New file |
| | |
| | | # 默认忽略的文件 |
| | | /shelf/ |
| | | /workspace.xml |
| | | # 基于编辑器的 HTTP 客户端请求 |
| | | /httpRequests/ |
| | | # Datasource local storage ignored files |
| | | /dataSources/ |
| | | /dataSources.local.xml |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project version="4"> |
| | | <component name="CompilerConfiguration"> |
| | | <annotationProcessing> |
| | | <profile name="Maven default annotation processors profile" enabled="true"> |
| | | <sourceOutputDir name="target/generated-sources/annotations" /> |
| | | <sourceTestOutputDir name="target/generated-test-sources/test-annotations" /> |
| | | <outputRelativeToContentRoot value="true" /> |
| | | <module name="guns-rest" /> |
| | | <module name="guns-generator" /> |
| | | <module name="guns-admin" /> |
| | | <module name="guns-core" /> |
| | | </profile> |
| | | </annotationProcessing> |
| | | </component> |
| | | <component name="JavacSettings"> |
| | | <option name="ADDITIONAL_OPTIONS_OVERRIDE"> |
| | | <module name="guns-admin" options="-parameters" /> |
| | | <module name="guns-core" options="-parameters" /> |
| | | <module name="guns-generator" options="-parameters" /> |
| | | <module name="guns-rest" options="-parameters" /> |
| | | </option> |
| | | </component> |
| | | </project> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project version="4"> |
| | | <component name="Encoding"> |
| | | <file url="file://$PROJECT_DIR$/guns-admin/src/main/java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/guns-core/src/main/java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/guns-generator/src/main/java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/guns-rest/src/main/java" charset="UTF-8" /> |
| | | <file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" /> |
| | | </component> |
| | | </project> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project version="4"> |
| | | <component name="GitToolBoxProjectSettings"> |
| | | <option name="commitMessageIssueKeyValidationOverride"> |
| | | <BoolValueOverride> |
| | | <option name="enabled" value="true" /> |
| | | </BoolValueOverride> |
| | | </option> |
| | | <option name="commitMessageValidationEnabledOverride"> |
| | | <BoolValueOverride> |
| | | <option name="enabled" value="true" /> |
| | | </BoolValueOverride> |
| | | </option> |
| | | </component> |
| | | </project> |
New file |
| | |
| | | <component name="InspectionProjectProfileManager"> |
| | | <profile version="1.0"> |
| | | <option name="myName" value="Project Default" /> |
| | | <inspection_tool class="AliAccessStaticViaInstance" enabled="true" level="WARNING" enabled_by_default="true" /> |
| | | <inspection_tool class="AliArrayNamingShouldHaveBracket" enabled="true" level="WARNING" enabled_by_default="true" /> |
| | | <inspection_tool class="AliControlFlowStatementWithoutBraces" enabled="true" level="WARNING" enabled_by_default="true" /> |
| | | <inspection_tool class="AliDeprecation" enabled="true" level="WARNING" enabled_by_default="true" /> |
| | | <inspection_tool class="AliEqualsAvoidNull" enabled="true" level="WARNING" enabled_by_default="true" /> |
| | | <inspection_tool class="AliLongLiteralsEndingWithLowercaseL" enabled="true" level="WARNING" enabled_by_default="true" /> |
| | | <inspection_tool class="AliMissingOverrideAnnotation" enabled="true" level="WARNING" enabled_by_default="true" /> |
| | | <inspection_tool class="AliWrapperTypeEquality" enabled="true" level="WARNING" enabled_by_default="true" /> |
| | | <inspection_tool class="HtmlUnknownAttribute" enabled="true" level="WARNING" enabled_by_default="true"> |
| | | <option name="myValues"> |
| | | <value> |
| | | <list size="1"> |
| | | <item index="0" class="java.lang.String" itemvalue="取消规则:" /> |
| | | </list> |
| | | </value> |
| | | </option> |
| | | <option name="myCustomValuesEnabled" value="true" /> |
| | | </inspection_tool> |
| | | <inspection_tool class="MapOrSetKeyShouldOverrideHashCodeEquals" enabled="true" level="WARNING" enabled_by_default="true" /> |
| | | </profile> |
| | | </component> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project version="4"> |
| | | <component name="RemoteRepositoriesConfiguration"> |
| | | <remote-repository> |
| | | <option name="id" value="central" /> |
| | | <option name="name" value="Central Repository" /> |
| | | <option name="url" value="https://repo.maven.apache.org/maven2" /> |
| | | </remote-repository> |
| | | <remote-repository> |
| | | <option name="id" value="central" /> |
| | | <option name="name" value="Maven Central repository" /> |
| | | <option name="url" value="https://repo1.maven.org/maven2" /> |
| | | </remote-repository> |
| | | <remote-repository> |
| | | <option name="id" value="jboss.community" /> |
| | | <option name="name" value="JBoss Community repository" /> |
| | | <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" /> |
| | | </remote-repository> |
| | | </component> |
| | | </project> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project version="4"> |
| | | <component name="ExternalStorageConfigurationManager" enabled="true" /> |
| | | <component name="MavenProjectsManager"> |
| | | <option name="originalFiles"> |
| | | <list> |
| | | <option value="$PROJECT_DIR$/pom.xml" /> |
| | | </list> |
| | | </option> |
| | | </component> |
| | | <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8 (2)" project-jdk-type="JavaSDK" /> |
| | | </project> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project version="4"> |
| | | <component name="VcsDirectoryMappings"> |
| | | <mapping directory="$PROJECT_DIR$/.." vcs="Git" /> |
| | | </component> |
| | | </project> |
New file |
| | |
| | | # Guns V4.1 |
| | | |
| | | ## 介绍 |
| | | Guns基于SpringBoot,致力于做更简洁的后台管理系统,完美整合springmvc + shiro + mybatis-plus + beetl!Guns项目代码简洁,注释丰富,上手容易,同时Guns包含许多基础模块(用户管理,角色管理,部门管理,字典管理等10个模块),可以直接作为一个后台管理系统的脚手架! 2018目标 `更简洁`,`更规范`! |
| | | |
| | | Guns v3.0新增rest api服务,提供对接服务端接口的支持,并利用jwt token鉴权机制给予客户端的访问权限,传输数据进行md5签名保证传输过程数据的安全性! |
| | | |
| | | ### Guns v4.1更新内容 |
| | | |
| | | > * guns-admin提供rest api服务,并以jwt方式鉴权,所有以`/gunsApi`开头的接口走这种鉴权方式,其他接口仍为shiro鉴权 |
| | | |
| | | ### Guns v4.0更新内容 |
| | | |
| | | > * spring boot升级到2.0版本! |
| | | > * 简化前端所有的html,js,css等资源文件,由11.8MB缩减为4.8MB! |
| | | > * 新增手动增加标签页的方法,Feng.newCrontab(href,menuName); |
| | | > * laydate时间插件和layer弹出层插件更新为官网最新,可以看着layui官网的文档直接开发啦! |
| | | > * 去掉animate动画效果,加快页面响应速度! |
| | | > * 修复登陆后重启应用造成404的bug! |
| | | > * 增强core模块的功能,拿来即用开发新的模块的后端管理系统! |
| | | > * 升级各个依赖包的版本! |
| | | > * 简化applicatioin.yml的配置,一些固定不变的配置写在core模块的default-config.properties! |
| | | > * 简化多数据源配置,简化mybatis-plus的配置! |
| | | > * 优化日志记录格式和策略,详情见logback-spring.xml! |
| | | |
| | | 此外,**更新Guns文档到《Guns技术文档 v2.0》** |
| | | |
| | | ## 最新Guns技术文档 |
| | | Guns框架有作者在业余时间整理的技术文档,详情点击[查看详情](https://gitee.com/naan1993/guns/wikis/pages?title=Guns%E6%8A%80%E6%9C%AF%E6%96%87%E6%A1%A3&parent=) |
| | | |
| | | ## 最新Guns视频教程 |
| | | Guns框架有作者在业余时间录制的视频教程,详情点击[教程介绍](https://gitee.com/naan1993/guns/wikis/pages?title=Guns%E8%A7%86%E9%A2%91%E6%95%99%E7%A8%8B&parent=) |
| | | |
| | | ## 技术讨论 & [wiki地址](https://gitee.com/naan1993/guns/wikis/Home) |
| | | 如果对项目有任何疑问或者建议,欢迎加入Guns技术交流1群:254550081,Guns技术交流2群:684163663,Guns技术交流3群:207434260(加之前先看下文档guns-admin/doc/Guns技术文档 v1.0.pdf) |
| | | |
| | | ## 管理系统功能 |
| | | 1.用户管理 2.角色管理 3.部门管理 4.菜单管理 5.字典管理 6.业务日志 7.登录日志 8.监控管理 9.通知管理 10.代码生成 |
| | | |
| | | ## 项目特点 |
| | | 1. 基于SpringBoot,简化了大量项目配置和maven依赖,让您更专注于业务开发,独特的分包方式,代码多而不乱。 |
| | | 2. 完善的日志记录体系,可记录登录日志,业务操作日志(可记录操作前和操作后的数据),异常日志到数据库,通过@BussinessLog注解和LogObjectHolder.me().set()方法,业务操作日志可具体记录哪个用户,执行了哪些业务,修改了哪些数据,并且日志记录为异步执行,详情请见@BussinessLog注解和LogObjectHolder,LogManager,LogAop类。 |
| | | 3. 利用beetl模板引擎对前台页面进行封装和拆分,使臃肿的html代码变得简洁,更加易维护。 |
| | | 4. 对常用js插件进行二次封装,使js代码变得简洁,更加易维护,具体请见webapp/static/js/common文件夹内js代码。 |
| | | 5. 利用ehcache框架对经常调用的查询进行缓存,提升运行速度,具体请见ConstantFactory类中@Cacheable标记的方法。 |
| | | 6. controller层采用map + warpper方式的返回结果,返回给前端更为灵活的数据,具体参见com.stylefeng.guns.modular.system.warpper包中具体类。 |
| | | 7. 防止XSS攻击,通过XssFilter类对所有的输入的非法字符串进行过滤以及替换。 |
| | | 8. 简单可用的代码生成体系,通过SimpleTemplateEngine可生成带有主页跳转和增删改查的通用控制器、html页面以及相关的js,还可以生成Service和Dao,并且这些生成项都为可选的,通过ContextConfig下的一些列xxxSwitch开关,可灵活控制生成模板代码,让您把时间放在真正的业务上。 |
| | | 9. 控制器层统一的异常拦截机制,利用@ControllerAdvice统一对异常拦截,具体见com.stylefeng.guns.core.aop.GlobalExceptionHandler类。 |
| | | 10. 页面统一的js key-value单例模式写法,每个页面生成一个唯一的全局变量,提高js的利用效率,并且有效防止多个人员开发引起的函数名/类名冲突,并且可以更好地去维护代码。 |
| | | |
| | | ## 基于javabean方式的spring配置 |
| | | Guns以简洁为核心,抛弃了传统的易错,臃肿xml配置,采用javabean的方式配置spring,简化了项目的配置,如下示例为配置mybatis-plus和数据源: |
| | | ``` |
| | | @Configuration |
| | | @MapperScan(basePackages = {"com.stylefeng.guns.modular.*.dao", "com.stylefeng.guns.common.persistence.dao"}) |
| | | public class MybatisPlusConfig { |
| | | |
| | | @Autowired |
| | | DruidProperties druidProperties; |
| | | |
| | | /** |
| | | * mybatis-plus分页插件 |
| | | */ |
| | | @Bean |
| | | public PaginationInterceptor paginationInterceptor() { |
| | | PaginationInterceptor paginationInterceptor = new PaginationInterceptor(); |
| | | paginationInterceptor.setDialectType(DBType.MYSQL.getDb()); |
| | | return paginationInterceptor; |
| | | } |
| | | } |
| | | ``` |
| | | |
| | | ## 业务日志记录 |
| | | 日志记录采用aop(LogAop类)方式对所有包含@BussinessLog注解的方法进行aop切入,会记录下当前用户执行了哪些操作(即@BussinessLog value属性的内容),如果涉及到数据修改,会取当前http请求的所有requestParameters与LogObjectHolder类中缓存的Object对象的所有字段作比较(所以在编辑之前的获取详情接口中需要缓存被修改对象之前的字段信息),日志内容会异步存入数据库中(通过ScheduledThreadPoolExecutor类)。 |
| | | |
| | | ## beetl对前台页面的拆分与包装 |
| | | 例如,把主页拆分成三部分,每个部分单独一个页面,更加便于维护 |
| | | ``` |
| | | <!--左侧导航开始--> |
| | | @include("/common/_tab.html"){} |
| | | <!--左侧导航结束--> |
| | | |
| | | <!--右侧部分开始--> |
| | | @include("/common/_right.html"){} |
| | | <!--右侧部分结束--> |
| | | |
| | | <!--右侧边栏开始--> |
| | | @include("/common/_theme.html"){} |
| | | <!--右侧边栏结束--> |
| | | ``` |
| | | 以及对重复的html进行包装,使前端页面更加专注于业务实现,例如,把所有页面引用包进行提取 |
| | | ``` |
| | | <!DOCTYPE html> |
| | | <html> |
| | | <head> |
| | | <meta charset="utf-8"> |
| | | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| | | <meta name="renderer" content="webkit" /><!-- 让360浏览器默认选择webkit内核 --> |
| | | |
| | | <!-- 全局css --> |
| | | <link rel="shortcut icon" href="${ctxPath}/static/favicon.ico"> |
| | | <!-- 全局js --> |
| | | <script src="${ctxPath}/static/js/jquery.min.js?v=2.1.4"></script> |
| | | <body class="gray-bg"> |
| | | <div class="wrapper wrapper-content"> |
| | | ${layoutContent} |
| | | </div> |
| | | <script src="${ctxPath}/static/js/content.js?v=1.0.0"></script> |
| | | </body> |
| | | </html> |
| | | ``` |
| | | 开发页面时,只需编写如下代码即可 |
| | | ``` |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>部门管理</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | //自定义内容 |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/dept/dept.js"></script> |
| | | @} |
| | | ``` |
| | | 以上beetl的用法请参考beetl说明文档。 |
| | | |
| | | ## 对js常用代码的封装 |
| | | 在webapp/static/js/common目录中,有对常用js代码的封装,例如Feng.js,其中Feng.info(),Feng.success(),Feng.error()三个方法,分别封装了普通提示,成功提示,错误提示的代码,简化了layer提示层插件的使用。 |
| | | |
| | | ## 极简的图片上传方法 |
| | | guns对web-upload进行二次封装,让图片的上传功能呢只用2行代码即可实现,如下 |
| | | ``` |
| | | var avatarUp = new $WebUpload("avatar"); |
| | | avatarUp.init(); |
| | | ``` |
| | | 具体实现请参考static/js/common/web-upload-object.js |
| | | |
| | | ## 独创controller层,map+warpper返回方式 |
| | | map+warpper方式即为把controller层的返回结果使用BeanKit工具类把原有bean转化为Map的的形式(或者原有bean直接是map的形式),再用单独写的一个包装类再包装一次这个map,使里面的参数更加具体,更加有含义,下面举一个例子,例如,在返回给前台一个性别时,数据库查出来1是男2是女,假如直接返回给前台,那么前台显示的时候还需要增加一次判断,并且前后端分离开发时又增加了一次交流和文档的成本,但是采用warpper包装的形式,可以直接把返回结果包装一下,例如动态增加一个字段sexName直接返回给前台性别的中文名称即可。 |
| | | |
| | | ## 独创mybatis数据范围拦截器,实现对数据权限的过滤 |
| | | Guns的数据范围控制是指,对拥有相同角色的用户,根据部门的不同进行相应的数据筛选,如果部门不相同,那么有可能展示出的具体数据是不一致的.所以说Guns对数据范围控制是以部门id为单位来标识的,如何增加数据范围拦截呢?只需在相关的mapper接口的参数中增加一个DataScope对象即可,DataScope中有两个字段,scopeName用来标识sql语句中部门id的字段名称,例如deptiid或者id,另一个字段deptIds就是具体需要过滤的部门id的集合.拦截器原理如下:拦截mapper中包含DataScope对象的方法,获取其原始sql,并做一个包装限制部门id在deptIds范围内的数据进行展示. |
| | | |
| | | ## swagger api管理使用说明 |
| | | swagger会管理所有包含@ApiOperation注解的控制器方法,同时,可利用@ApiImplicitParams注解标记接口中的参数,具体用法请参考CodeController类中的用法。 |
| | | ``` |
| | | @ApiOperation("生成代码") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "moduleName", value = "模块名称", required = true, dataType = "String"), |
| | | @ApiImplicitParam(name = "bizChName", value = "业务名称", required = true, dataType = "String"), |
| | | @ApiImplicitParam(name = "bizEnName", value = "业务英文名称", required = true, dataType = "String"), |
| | | @ApiImplicitParam(name = "path", value = "项目生成类路径", required = true, dataType = "String") |
| | | }) |
| | | @RequestMapping(value = "/generate", method = RequestMethod.POST) |
| | | ``` |
| | | |
| | | ## jwt token鉴权机制 |
| | | jwt token鉴权机制是指若需要请求服务器接口,必须通过AuthController获取一个请求令牌(jwt token),持有jwt token的用户才可以访问服务器的其他资源,如果没有此令牌,则访问接口会直接忽略,请求获取jwt token时,需要携带credenceName和credenceCode(可以是账号密码,可以是手机号验证码等等),校验credenceName和credenceCode成功后,会颁发给客户端一个jwt token还有一个随机字符串,用于传输过程中对数据进行签名用,签名机制请见下面介绍.基于token的鉴权机制类似于http协议也是无状态的,它不需要在服务端去保留用户的认证信息或者会话信息.这就意味着基于token认证机制的应用不需要去考虑用户在哪一台服务器登录了,这就为应用的扩展提供了便利. |
| | | |
| | | ## 签名机制 |
| | | 签名机制是指客户端向服务端传输数据中,对传输数据进行md5加密,并且加密过程中利用Auth接口返回的随机字符串进行混淆加密,并把md5值同时附带给服务端,服务端通获取数据之后对数据再进行一次md5加密,若加密结果和客户端传来的数据一致,则认定客户端请求的数据是没有被篡改的,若不一致,则认为被加密的数据是被篡改的 |
| | | |
| | | ## 效果图 |
| | |  |
| | |  |
| | |  |
| | |  |
| | |  |
| | |  |
| | |  |
| | |  |
| | |  |
| | |  |
| | |  |
| | |  |
| | |  |
| | |  |
| | | |
| | | ## 曾获荣誉 |
| | |  |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | |
| | | <artifactId>guns-admin</artifactId> |
| | | <name>guns-admin</name> |
| | | <description>guns 的spring boot版本</description> |
| | | <parent> |
| | | <groupId>com.stylefeng</groupId> |
| | | <artifactId>guns-parent</artifactId> |
| | | <version>1.0.0</version> |
| | | <relativePath>../pom.xml</relativePath> |
| | | </parent> |
| | | <packaging>jar</packaging> |
| | | |
| | | <dependencies> |
| | | <!--<dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.cloud</groupId> |
| | | <artifactId>spring-cloud-starter-netflix-hystrix</artifactId> |
| | | </dependency>--> |
| | | |
| | | |
| | | <dependency> |
| | | <groupId>org.springframework</groupId> |
| | | <artifactId>spring-test</artifactId> |
| | | <version>5.3.9</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.stylefeng</groupId> |
| | | <artifactId>guns-core</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.stylefeng</groupId> |
| | | <artifactId>guns-generator</artifactId> |
| | | </dependency> |
| | | |
| | | <!--spring boot依赖--> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-aop</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-web</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-cache</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-validation</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-test</artifactId> |
| | | <scope>test</scope> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-devtools</artifactId> |
| | | <optional>true</optional> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>redis.clients</groupId> |
| | | <artifactId>jedis</artifactId> |
| | | <version>2.9.0</version> |
| | | </dependency> |
| | | |
| | | <!-- 导入Excel数据依赖 start --> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi</artifactId> |
| | | <version>5.0.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.poi</groupId> |
| | | <artifactId>poi-ooxml</artifactId> |
| | | <version>5.0.0</version> |
| | | </dependency> |
| | | |
| | | <!--shiro依赖--> |
| | | <dependency> |
| | | <groupId>org.apache.shiro</groupId> |
| | | <artifactId>shiro-core</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | | <artifactId>slf4j-api</artifactId> |
| | | <groupId>org.slf4j</groupId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.shiro</groupId> |
| | | <artifactId>shiro-spring</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.shiro</groupId> |
| | | <artifactId>shiro-ehcache</artifactId> |
| | | <exclusions> |
| | | <exclusion> |
| | | <artifactId>slf4j-api</artifactId> |
| | | <groupId>org.slf4j</groupId> |
| | | </exclusion> |
| | | </exclusions> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.ehcache</groupId> |
| | | <artifactId>ehcache</artifactId> |
| | | </dependency> |
| | | |
| | | <!--极光推送--> |
| | | <dependency> |
| | | <groupId>cn.jpush.api</groupId> |
| | | <artifactId>jpush-client</artifactId> |
| | | <version>3.2.17</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.jpush.api</groupId> |
| | | <artifactId>jiguang-common</artifactId> |
| | | <version>1.1.1</version> |
| | | </dependency> |
| | | |
| | | <!--需要分布式session的话需要放开注释--> |
| | | <!--<dependency>--> |
| | | <!--<groupId>org.springframework.session</groupId>--> |
| | | <!--<artifactId>spring-session-data-redis</artifactId>--> |
| | | <!--</dependency>--> |
| | | <!--<dependency>--> |
| | | <!--<groupId>org.springframework.boot</groupId>--> |
| | | <!--<artifactId>spring-boot-starter-data-redis</artifactId>--> |
| | | <!--</dependency>--> |
| | | |
| | | <dependency> |
| | | <groupId>com.github.penggle</groupId> |
| | | <artifactId>kaptcha</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.google.zxing</groupId> |
| | | <artifactId>core</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.ibeetl</groupId> |
| | | <artifactId>beetl</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>io.springfox</groupId> |
| | | <artifactId>springfox-swagger2</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>io.springfox</groupId> |
| | | <artifactId>springfox-swagger-ui</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>io.jsonwebtoken</groupId> |
| | | <artifactId>jjwt</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>commons-io</groupId> |
| | | <artifactId>commons-io</artifactId> |
| | | <version>2.6</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.aliyun.oss</groupId> |
| | | <artifactId>aliyun-sdk-oss</artifactId> |
| | | <version>2.5.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.google.code.gson</groupId> |
| | | <artifactId>gson</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.quartz-scheduler</groupId> |
| | | <artifactId>quartz</artifactId> |
| | | <version>2.2.1</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>cn.rongcloud.im</groupId> |
| | | <artifactId>server-sdk-java</artifactId> |
| | | <version>3.0.4</version> |
| | | </dependency> |
| | | |
| | | |
| | | <dependency> |
| | | <groupId>org.apache.httpcomponents</groupId> |
| | | <artifactId>httpclient</artifactId> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>commons-httpclient</groupId> |
| | | <artifactId>commons-httpclient</artifactId> |
| | | <version>3.1</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.alipay.sdk</groupId> |
| | | <artifactId>alipay-sdk-java</artifactId> |
| | | <version>4.8.10.ALL</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>dom4j</groupId> |
| | | <artifactId>dom4j</artifactId> |
| | | <version>1.6.1</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.projectlombok</groupId> |
| | | <artifactId>lombok</artifactId> |
| | | <scope>provided</scope> |
| | | </dependency> |
| | | </dependencies> |
| | | |
| | | |
| | | |
| | | |
| | | <build> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-maven-plugin</artifactId> |
| | | <configuration> |
| | | <fork>true</fork><!-- 如果没有该项配置,肯呢个devtools不会起作用,即应用不会restart --> |
| | | </configuration> |
| | | </plugin> |
| | | <plugin> |
| | | <groupId>org.apache.maven.plugins</groupId> |
| | | <artifactId>maven-surefire-plugin</artifactId> |
| | | <configuration> |
| | | <skip>true</skip> |
| | | </configuration> |
| | | </plugin> |
| | | </plugins> |
| | | |
| | | <!--打包war包引入本地jar的打包方式--> |
| | | <!-- <plugins>--> |
| | | <!-- <plugin>--> |
| | | <!-- <groupId>org.apache.maven.plugins</groupId>--> |
| | | <!-- <artifactId>maven-war-plugin</artifactId>--> |
| | | <!-- <configuration>--> |
| | | <!-- <!– 设置成false,否则检查web.xml是否存在。因为springboot是没有web.xml的 –>--> |
| | | <!-- <failOnMissingWebXml>false</failOnMissingWebXml>--> |
| | | <!-- <!–打包后的项目名–>--> |
| | | <!-- <!–<warName>example</warName>–>--> |
| | | <!-- <!–<webResources>–>--> |
| | | <!-- <!–<resource>–>--> |
| | | <!-- <!–<!–把本地lib里面的jar复制到lib–>–>--> |
| | | <!-- <!–<directory>${project.basedir}/lib</directory>–>--> |
| | | <!-- <!–<targetPath>WEB-INF/lib/</targetPath>–>--> |
| | | <!-- <!–<includes>–>--> |
| | | <!-- <!–<include>**/*.jar</include>–>--> |
| | | <!-- <!–</includes>–>--> |
| | | <!-- <!–</resource>–>--> |
| | | <!-- <!–</webResources>–>--> |
| | | <!-- </configuration>--> |
| | | <!-- </plugin>--> |
| | | <!-- </plugins>--> |
| | | |
| | | <resources> |
| | | <resource> |
| | | <directory>lib</directory> |
| | | <targetPath>/BOOT-INF/lib/</targetPath> |
| | | <includes> |
| | | <include>**/*.jar</include> |
| | | </includes> |
| | | </resource> |
| | | <resource> |
| | | <directory>src/main/webapp</directory> |
| | | </resource> |
| | | <resource> |
| | | <directory>src/main/resources</directory> |
| | | <filtering>true</filtering> |
| | | </resource> |
| | | <resource> |
| | | <directory>src/main/java</directory> |
| | | <includes> |
| | | <include>**/*.xml</include> |
| | | </includes> |
| | | </resource> |
| | | </resources> |
| | | </build> |
| | | |
| | | </project> |
New file |
| | |
| | | package com.stylefeng.guns; |
| | | |
| | | import org.apache.http.client.HttpClient; |
| | | import org.apache.http.config.SocketConfig; |
| | | import org.apache.http.impl.client.HttpClientBuilder; |
| | | import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.context.ConfigurableApplicationContext; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.core.env.Environment; |
| | | import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; |
| | | import org.springframework.http.converter.StringHttpMessageConverter; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.net.InetAddress; |
| | | import java.net.UnknownHostException; |
| | | import java.nio.charset.StandardCharsets; |
| | | |
| | | /** |
| | | * SpringBoot方式启动类 |
| | | * |
| | | * @author stylefeng |
| | | * @Date 2017/5/21 12:06 |
| | | */ |
| | | @EnableScheduling//开启定时任务 |
| | | @SpringBootApplication |
| | | public class GunsApplication { |
| | | |
| | | private final static Logger logger = LoggerFactory.getLogger(GunsApplication.class); |
| | | |
| | | public static void main(String[] args) throws UnknownHostException { |
| | | ConfigurableApplicationContext applicationContext = SpringApplication.run(GunsApplication.class, args); |
| | | Environment env = applicationContext.getEnvironment(); |
| | | System.out.println("GunsApplication is success!"); |
| | | // logger.info("\n----------------------------------------------------------\n\t" + |
| | | // "应用 '{}' 运行成功! 访问连接:\n\t" + |
| | | // "Swagger文档: \t\thttp://{}:{}\n" + |
| | | // "----------------------------------------------------------", |
| | | // env.getProperty("spring.application.name", "后台管理"), |
| | | // InetAddress.getLocalHost().getHostAddress(), |
| | | // env.getProperty("server.port", "8010")); |
| | | } |
| | | |
| | | @Bean //通过ip地址调用 |
| | | public RestTemplate restTemplate() { |
| | | PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(); |
| | | connectionManager.setDefaultSocketConfig(SocketConfig.custom().setTcpNoDelay(true).build()); |
| | | connectionManager.setDefaultMaxPerRoute(100);//最大并发连接 |
| | | connectionManager.setMaxTotal(200); // 总的最大连接数 |
| | | HttpClient httpClient = HttpClientBuilder.create().setConnectionManager(connectionManager).build(); |
| | | HttpComponentsClientHttpRequestFactory httpRequestFactory = new HttpComponentsClientHttpRequestFactory(httpClient); |
| | | httpRequestFactory.setConnectionRequestTimeout(30 * 1000); |
| | | httpRequestFactory.setConnectTimeout(30 * 3000); |
| | | httpRequestFactory.setReadTimeout(30 * 3000); |
| | | RestTemplate restTemplate = new RestTemplate(httpRequestFactory); |
| | | restTemplate.getMessageConverters().set(1, new StringHttpMessageConverter(StandardCharsets.UTF_8)); |
| | | return restTemplate; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns; |
| | | |
| | | import org.springframework.boot.builder.SpringApplicationBuilder; |
| | | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; |
| | | |
| | | /** |
| | | * Guns Web程序启动类 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-05-21 9:43 |
| | | */ |
| | | public class GunsServletInitializer extends SpringBootServletInitializer { |
| | | |
| | | @Override |
| | | protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { |
| | | return builder.sources(GunsApplication.class); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.config; |
| | | |
| | | import net.sf.ehcache.CacheManager; |
| | | import org.springframework.cache.annotation.EnableCaching; |
| | | import org.springframework.cache.ehcache.EhCacheCacheManager; |
| | | import org.springframework.cache.ehcache.EhCacheManagerFactoryBean; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.core.io.ClassPathResource; |
| | | |
| | | /** |
| | | * ehcache配置 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-05-20 23:11 |
| | | */ |
| | | @Configuration |
| | | @EnableCaching |
| | | public class EhCacheConfig { |
| | | |
| | | /** |
| | | * EhCache的配置 |
| | | */ |
| | | @Bean |
| | | public EhCacheCacheManager cacheManager(CacheManager cacheManager) { |
| | | return new EhCacheCacheManager(cacheManager); |
| | | } |
| | | |
| | | /** |
| | | * EhCache的配置 |
| | | */ |
| | | @Bean |
| | | public EhCacheManagerFactoryBean ehcache() { |
| | | EhCacheManagerFactoryBean ehCacheManagerFactoryBean = new EhCacheManagerFactoryBean(); |
| | | ehCacheManagerFactoryBean.setConfigLocation(new ClassPathResource("ehcache.xml")); |
| | | return ehCacheManagerFactoryBean; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.config; |
| | | |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | |
| | | /** |
| | | * spring session配置 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-07-13 21:05 |
| | | */ |
| | | //@EnableRedisHttpSession(maxInactiveIntervalInSeconds = 1800) //session过期时间 如果部署多机环境,需要打开注释 |
| | | @ConditionalOnProperty(prefix = "guns", name = "spring-session-open", havingValue = "true") |
| | | public class SpringSessionConfig { |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.config; |
| | | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import springfox.documentation.builders.ApiInfoBuilder; |
| | | import springfox.documentation.builders.PathSelectors; |
| | | import springfox.documentation.builders.RequestHandlerSelectors; |
| | | import springfox.documentation.service.ApiInfo; |
| | | import springfox.documentation.spi.DocumentationType; |
| | | import springfox.documentation.spring.web.plugins.Docket; |
| | | import springfox.documentation.swagger2.annotations.EnableSwagger2; |
| | | |
| | | /** |
| | | * swagger配置类 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017年6月1日19:42:59 |
| | | */ |
| | | @Configuration |
| | | @EnableSwagger2 |
| | | @ConditionalOnProperty(prefix = "guns", name = "swagger-open", havingValue = "true") |
| | | public class SwaggerConfig{ |
| | | |
| | | @Bean |
| | | public Docket createRestApi() { |
| | | return new Docket(DocumentationType.SWAGGER_2) |
| | | .apiInfo(apiInfo()) |
| | | .select() |
| | | .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class)) //这里采用包含注解的方式来确定要显示的接口 |
| | | //.apis(RequestHandlerSelectors.basePackage("com.stylefeng.guns.controller.system.controller")) //这里采用包扫描的方式来确定要显示的接口 |
| | | .paths(PathSelectors.any()) |
| | | .build(); |
| | | } |
| | | |
| | | private ApiInfo apiInfo() { |
| | | return new ApiInfoBuilder() |
| | | .title("Guns Doc") |
| | | .description("Guns Api文档") |
| | | .termsOfServiceUrl("http://git.oschina.net/naan1993/guns") |
| | | .contact("stylefeng") |
| | | .version("2.0") |
| | | .build(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.config.datasource; |
| | | |
| | | import com.alibaba.druid.pool.DruidDataSource; |
| | | import com.baomidou.mybatisplus.plugins.OptimisticLockerInterceptor; |
| | | import com.baomidou.mybatisplus.plugins.PaginationInterceptor; |
| | | import com.stylefeng.guns.core.config.properties.DruidProperties; |
| | | import com.stylefeng.guns.core.config.properties.MutiDataSourceProperties; |
| | | import com.stylefeng.guns.core.datascope.DataScopeInterceptor; |
| | | import com.stylefeng.guns.core.mutidatasource.DynamicDataSource; |
| | | import com.stylefeng.guns.core.mutidatasource.aop.MultiSourceExAop; |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.jdbc.datasource.DataSourceTransactionManager; |
| | | import org.springframework.transaction.annotation.EnableTransactionManagement; |
| | | |
| | | import java.sql.SQLException; |
| | | import java.util.HashMap; |
| | | |
| | | /** |
| | | * 多数据源配置<br/> |
| | | * <p> |
| | | * 注:由于引入多数据源,所以让spring事务的aop要在多数据源切换aop的后面 |
| | | * |
| | | * @author stylefeng |
| | | * @Date 2017/5/20 21:58 |
| | | */ |
| | | @Configuration |
| | | @ConditionalOnProperty(prefix = "guns.muti-datasource", name = "open", havingValue = "true") |
| | | @EnableTransactionManagement(order = 2) |
| | | @MapperScan(basePackages = {"com.stylefeng.guns.modular.system.dao"}) |
| | | public class MultiDataSourceConfig { |
| | | |
| | | @Bean |
| | | @ConfigurationProperties(prefix = "guns.muti-datasource") |
| | | public MutiDataSourceProperties mutiDataSourceProperties() { |
| | | return new MutiDataSourceProperties(); |
| | | } |
| | | |
| | | @Bean |
| | | public MultiSourceExAop multiSourceExAop() { |
| | | return new MultiSourceExAop(); |
| | | } |
| | | |
| | | /** |
| | | * guns的数据源 |
| | | */ |
| | | private DruidDataSource dataSource(DruidProperties druidProperties) { |
| | | DruidDataSource dataSource = new DruidDataSource(); |
| | | druidProperties.config(dataSource); |
| | | return dataSource; |
| | | } |
| | | |
| | | /** |
| | | * 多数据源,第二个数据源 |
| | | */ |
| | | private DruidDataSource bizDataSource(DruidProperties druidProperties, MutiDataSourceProperties mutiDataSourceProperties) { |
| | | DruidDataSource dataSource = new DruidDataSource(); |
| | | druidProperties.config(dataSource); |
| | | mutiDataSourceProperties.config(dataSource); |
| | | return dataSource; |
| | | } |
| | | |
| | | /** |
| | | * 多数据源连接池配置 |
| | | */ |
| | | @Bean |
| | | public DynamicDataSource mutiDataSource(DruidProperties druidProperties, MutiDataSourceProperties mutiDataSourceProperties) { |
| | | |
| | | DruidDataSource dataSourceGuns = dataSource(druidProperties); |
| | | DruidDataSource bizDataSource = bizDataSource(druidProperties, mutiDataSourceProperties); |
| | | |
| | | try { |
| | | dataSourceGuns.init(); |
| | | bizDataSource.init(); |
| | | } catch (SQLException sql) { |
| | | sql.printStackTrace(); |
| | | } |
| | | |
| | | DynamicDataSource dynamicDataSource = new DynamicDataSource(); |
| | | HashMap<Object, Object> hashMap = new HashMap<>(); |
| | | hashMap.put(mutiDataSourceProperties.getDataSourceNames()[0], dataSourceGuns); |
| | | hashMap.put(mutiDataSourceProperties.getDataSourceNames()[1], bizDataSource); |
| | | dynamicDataSource.setTargetDataSources(hashMap); |
| | | dynamicDataSource.setDefaultTargetDataSource(dataSourceGuns); |
| | | return dynamicDataSource; |
| | | } |
| | | |
| | | /** |
| | | * mybatis-plus分页插件 |
| | | */ |
| | | @Bean |
| | | public PaginationInterceptor paginationInterceptor() { |
| | | return new PaginationInterceptor(); |
| | | } |
| | | |
| | | /** |
| | | * 数据范围mybatis插件 |
| | | */ |
| | | @Bean |
| | | public DataScopeInterceptor dataScopeInterceptor() { |
| | | return new DataScopeInterceptor(); |
| | | } |
| | | |
| | | /** |
| | | * 乐观锁mybatis插件 |
| | | */ |
| | | @Bean |
| | | public OptimisticLockerInterceptor optimisticLockerInterceptor() { |
| | | return new OptimisticLockerInterceptor(); |
| | | } |
| | | |
| | | /** |
| | | * 事务配置 |
| | | * |
| | | * @author stylefeng |
| | | * @Date 2018/6/27 23:11 |
| | | */ |
| | | @Bean |
| | | public DataSourceTransactionManager dataSourceTransactionManager(DynamicDataSource mutiDataSource) { |
| | | return new DataSourceTransactionManager(mutiDataSource); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.config.datasource; |
| | | |
| | | import com.alibaba.druid.pool.DruidDataSource; |
| | | import com.baomidou.mybatisplus.plugins.OptimisticLockerInterceptor; |
| | | import com.baomidou.mybatisplus.plugins.PaginationInterceptor; |
| | | import com.stylefeng.guns.core.config.properties.DruidProperties; |
| | | import com.stylefeng.guns.core.datascope.DataScopeInterceptor; |
| | | import org.mybatis.spring.annotation.MapperScan; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.transaction.annotation.EnableTransactionManagement; |
| | | |
| | | /** |
| | | * 多数据源配置 |
| | | * |
| | | * @author stylefeng |
| | | * @Date 2017/5/20 21:58 |
| | | */ |
| | | @Configuration |
| | | @ConditionalOnProperty(prefix = "guns.muti-datasource", name = "open", havingValue = "false", matchIfMissing = true) |
| | | @EnableTransactionManagement |
| | | @MapperScan(basePackages = {"com.stylefeng.guns.modular.system.dao"}) |
| | | public class SingleDataSourceConfig { |
| | | |
| | | /** |
| | | * 单数据源连接池配置 |
| | | */ |
| | | @Bean |
| | | public DruidDataSource dataSource(DruidProperties druidProperties) { |
| | | DruidDataSource dataSource = new DruidDataSource(); |
| | | druidProperties.config(dataSource); |
| | | return dataSource; |
| | | } |
| | | |
| | | /** |
| | | * mybatis-plus分页插件 |
| | | */ |
| | | @Bean |
| | | public PaginationInterceptor paginationInterceptor() { |
| | | return new PaginationInterceptor(); |
| | | } |
| | | |
| | | /** |
| | | * 数据范围mybatis插件 |
| | | */ |
| | | @Bean |
| | | public DataScopeInterceptor dataScopeInterceptor() { |
| | | return new DataScopeInterceptor(); |
| | | } |
| | | |
| | | /** |
| | | * 乐观锁mybatis插件 |
| | | */ |
| | | @Bean |
| | | public OptimisticLockerInterceptor optimisticLockerInterceptor() { |
| | | return new OptimisticLockerInterceptor(); |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.stylefeng.guns.config.properties; |
| | | |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | import java.util.Properties; |
| | | |
| | | /** |
| | | * beetl配置(如果需要配置别的配置可参照这个形式自己添加) |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-05-24 20:37 |
| | | */ |
| | | @Configuration |
| | | @ConfigurationProperties(prefix = BeetlProperties.BEETLCONF_PREFIX) |
| | | public class BeetlProperties { |
| | | |
| | | public static final String BEETLCONF_PREFIX = "beetl"; |
| | | |
| | | private String delimiterStatementStart; |
| | | |
| | | private String delimiterStatementEnd; |
| | | |
| | | private String resourceTagroot; |
| | | |
| | | private String resourceTagsuffix; |
| | | |
| | | private String resourceAutoCheck; |
| | | |
| | | @Value("${spring.mvc.view.prefix}") |
| | | private String prefix; |
| | | |
| | | public Properties getProperties(){ |
| | | Properties properties = new Properties(); |
| | | if(ToolUtil.isNotEmpty(delimiterStatementStart)){ |
| | | if(delimiterStatementStart.startsWith("\\")){ |
| | | delimiterStatementStart = delimiterStatementStart.substring(1); |
| | | } |
| | | properties.setProperty("DELIMITER_STATEMENT_START",delimiterStatementStart); |
| | | } |
| | | if(ToolUtil.isNotEmpty(delimiterStatementEnd)){ |
| | | properties.setProperty("DELIMITER_STATEMENT_END",delimiterStatementEnd); |
| | | }else{ |
| | | properties.setProperty("DELIMITER_STATEMENT_END","null"); |
| | | } |
| | | if(ToolUtil.isNotEmpty(resourceTagroot)){ |
| | | properties.setProperty("RESOURCE.tagRoot",resourceTagroot); |
| | | } |
| | | if(ToolUtil.isNotEmpty(resourceTagsuffix)){ |
| | | properties.setProperty("RESOURCE.tagSuffix",resourceTagsuffix); |
| | | } |
| | | if(ToolUtil.isNotEmpty(resourceAutoCheck)){ |
| | | properties.setProperty("RESOURCE.autoCheck",resourceAutoCheck); |
| | | } |
| | | return properties; |
| | | } |
| | | |
| | | public String getPrefix() { |
| | | return prefix; |
| | | } |
| | | |
| | | public String getDelimiterStatementStart() { |
| | | return delimiterStatementStart; |
| | | } |
| | | |
| | | public void setDelimiterStatementStart(String delimiterStatementStart) { |
| | | this.delimiterStatementStart = delimiterStatementStart; |
| | | } |
| | | |
| | | public String getDelimiterStatementEnd() { |
| | | return delimiterStatementEnd; |
| | | } |
| | | |
| | | public void setDelimiterStatementEnd(String delimiterStatementEnd) { |
| | | this.delimiterStatementEnd = delimiterStatementEnd; |
| | | } |
| | | |
| | | public String getResourceTagroot() { |
| | | return resourceTagroot; |
| | | } |
| | | |
| | | public void setResourceTagroot(String resourceTagroot) { |
| | | this.resourceTagroot = resourceTagroot; |
| | | } |
| | | |
| | | public String getResourceTagsuffix() { |
| | | return resourceTagsuffix; |
| | | } |
| | | |
| | | public void setResourceTagsuffix(String resourceTagsuffix) { |
| | | this.resourceTagsuffix = resourceTagsuffix; |
| | | } |
| | | |
| | | public String getResourceAutoCheck() { |
| | | return resourceAutoCheck; |
| | | } |
| | | |
| | | public void setResourceAutoCheck(String resourceAutoCheck) { |
| | | this.resourceAutoCheck = resourceAutoCheck; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.config.properties; |
| | | |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.File; |
| | | |
| | | import static com.stylefeng.guns.core.util.ToolUtil.getTempPath; |
| | | import static com.stylefeng.guns.core.util.ToolUtil.isEmpty; |
| | | |
| | | /** |
| | | * guns项目配置 |
| | | * |
| | | * @author stylefeng |
| | | * @Date 2017/5/23 22:31 |
| | | */ |
| | | @Component |
| | | @ConfigurationProperties(prefix = GunsProperties.PREFIX) |
| | | public class GunsProperties { |
| | | |
| | | public static final String PREFIX = "guns"; |
| | | |
| | | private Boolean kaptchaOpen = false; |
| | | |
| | | private Boolean swaggerOpen = false; |
| | | |
| | | // 文件上传位置配置 |
| | | private String fileUploadPath; |
| | | |
| | | // 文件服务器访问地址 |
| | | private String pictureServerAddress; |
| | | |
| | | private Boolean haveCreatePath = false; |
| | | |
| | | private Boolean springSessionOpen = false; |
| | | |
| | | /** |
| | | * session 失效时间(默认为30分钟 单位:秒) |
| | | */ |
| | | private Integer sessionInvalidateTime = 30 * 60; |
| | | |
| | | /** |
| | | * session 验证失效时间(默认为15分钟 单位:秒) |
| | | */ |
| | | private Integer sessionValidationInterval = 15 * 60; |
| | | /** |
| | | *前端接口调用基础路径 |
| | | */ |
| | | private String restUrl; |
| | | |
| | | public String getFileUploadPath() { |
| | | //如果没有写文件上传路径,保存到临时目录 |
| | | if (isEmpty(fileUploadPath)) { |
| | | return getTempPath(); |
| | | } else { |
| | | //判断有没有结尾符,没有得加上 |
| | | if (!fileUploadPath.endsWith(File.separator)) { |
| | | fileUploadPath = fileUploadPath + File.separator; |
| | | } |
| | | //判断目录存不存在,不存在得加上 |
| | | if (!haveCreatePath) { |
| | | File file = new File(fileUploadPath); |
| | | file.mkdirs(); |
| | | haveCreatePath = true; |
| | | } |
| | | return fileUploadPath; |
| | | } |
| | | } |
| | | |
| | | public void setFileUploadPath(String fileUploadPath) { |
| | | this.fileUploadPath = fileUploadPath; |
| | | } |
| | | |
| | | public String getPictureServerAddress() { |
| | | return pictureServerAddress; |
| | | } |
| | | |
| | | public void setPictureServerAddress(String pictureServerAddress) { |
| | | this.pictureServerAddress = pictureServerAddress; |
| | | } |
| | | |
| | | public Boolean getKaptchaOpen() { |
| | | return kaptchaOpen; |
| | | } |
| | | |
| | | public void setKaptchaOpen(Boolean kaptchaOpen) { |
| | | this.kaptchaOpen = kaptchaOpen; |
| | | } |
| | | |
| | | public Boolean getSwaggerOpen() { |
| | | return swaggerOpen; |
| | | } |
| | | |
| | | public void setSwaggerOpen(Boolean swaggerOpen) { |
| | | this.swaggerOpen = swaggerOpen; |
| | | } |
| | | |
| | | public Boolean getSpringSessionOpen() { |
| | | return springSessionOpen; |
| | | } |
| | | |
| | | public void setSpringSessionOpen(Boolean springSessionOpen) { |
| | | this.springSessionOpen = springSessionOpen; |
| | | } |
| | | |
| | | public Integer getSessionInvalidateTime() { |
| | | return sessionInvalidateTime; |
| | | } |
| | | |
| | | public void setSessionInvalidateTime(Integer sessionInvalidateTime) { |
| | | this.sessionInvalidateTime = sessionInvalidateTime; |
| | | } |
| | | |
| | | public Integer getSessionValidationInterval() { |
| | | return sessionValidationInterval; |
| | | } |
| | | |
| | | public void setSessionValidationInterval(Integer sessionValidationInterval) { |
| | | this.sessionValidationInterval = sessionValidationInterval; |
| | | } |
| | | |
| | | public String getRestUrl() { |
| | | return restUrl; |
| | | } |
| | | |
| | | public void setRestUrl(String restUrl) { |
| | | this.restUrl = restUrl; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.config.web; |
| | | |
| | | import com.stylefeng.guns.config.properties.BeetlProperties; |
| | | import com.stylefeng.guns.core.beetl.BeetlConfiguration; |
| | | import org.beetl.core.resource.ClasspathResourceLoader; |
| | | import org.beetl.ext.spring.BeetlSpringViewResolver; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | /** |
| | | * web 配置类 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2016年11月12日 下午5:03:32 |
| | | */ |
| | | @Configuration |
| | | public class BeetlConfig { |
| | | |
| | | @Autowired |
| | | BeetlProperties beetlProperties; |
| | | |
| | | /** |
| | | * beetl的配置 |
| | | */ |
| | | @Bean(initMethod = "init") |
| | | public BeetlConfiguration beetlConfiguration() { |
| | | BeetlConfiguration beetlConfiguration = new BeetlConfiguration(); |
| | | beetlConfiguration.setResourceLoader(new ClasspathResourceLoader(BeetlConfig.class.getClassLoader(), beetlProperties.getPrefix())); |
| | | beetlConfiguration.setConfigProperties(beetlProperties.getProperties()); |
| | | return beetlConfiguration; |
| | | } |
| | | |
| | | /** |
| | | * beetl的视图解析器 |
| | | */ |
| | | @Bean |
| | | public BeetlSpringViewResolver beetlViewResolver() { |
| | | BeetlSpringViewResolver beetlSpringViewResolver = new BeetlSpringViewResolver(); |
| | | beetlSpringViewResolver.setConfig(beetlConfiguration()); |
| | | beetlSpringViewResolver.setContentType("text/html;charset=UTF-8"); |
| | | beetlSpringViewResolver.setOrder(0); |
| | | return beetlSpringViewResolver; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.config.web; |
| | | |
| | | import com.stylefeng.guns.config.properties.GunsProperties; |
| | | import com.stylefeng.guns.core.intercept.GunsUserFilter; |
| | | import com.stylefeng.guns.core.shiro.ShiroDbRealm; |
| | | import org.apache.shiro.cache.CacheManager; |
| | | import org.apache.shiro.cache.ehcache.EhCacheManager; |
| | | import org.apache.shiro.codec.Base64; |
| | | import org.apache.shiro.session.mgt.SessionManager; |
| | | import org.apache.shiro.spring.LifecycleBeanPostProcessor; |
| | | import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor; |
| | | import org.apache.shiro.spring.web.ShiroFilterFactoryBean; |
| | | import org.apache.shiro.web.mgt.CookieRememberMeManager; |
| | | import org.apache.shiro.web.mgt.DefaultWebSecurityManager; |
| | | import org.apache.shiro.web.servlet.Cookie; |
| | | import org.apache.shiro.web.servlet.ShiroHttpSession; |
| | | import org.apache.shiro.web.servlet.SimpleCookie; |
| | | import org.apache.shiro.web.session.mgt.DefaultWebSessionManager; |
| | | import org.apache.shiro.web.session.mgt.ServletContainerSessionManager; |
| | | import org.springframework.beans.factory.config.MethodInvokingFactoryBean; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.cache.ehcache.EhCacheManagerFactoryBean; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | import javax.servlet.Filter; |
| | | import java.util.HashMap; |
| | | import java.util.LinkedHashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * shiro权限管理的配置 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2016年11月14日 下午3:03:44 |
| | | */ |
| | | @Configuration |
| | | public class ShiroConfig { |
| | | |
| | | /** |
| | | * 安全管理器 |
| | | */ |
| | | @Bean |
| | | public DefaultWebSecurityManager securityManager(CookieRememberMeManager rememberMeManager, CacheManager cacheShiroManager, SessionManager sessionManager) { |
| | | DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager(); |
| | | securityManager.setRealm(this.shiroDbRealm()); |
| | | securityManager.setCacheManager(cacheShiroManager); |
| | | securityManager.setRememberMeManager(rememberMeManager); |
| | | securityManager.setSessionManager(sessionManager); |
| | | return securityManager; |
| | | } |
| | | |
| | | /** |
| | | * spring session管理器(多机环境) |
| | | */ |
| | | @Bean |
| | | @ConditionalOnProperty(prefix = "guns", name = "spring-session-open", havingValue = "true") |
| | | public ServletContainerSessionManager servletContainerSessionManager() { |
| | | return new ServletContainerSessionManager(); |
| | | } |
| | | |
| | | /** |
| | | * session管理器(单机环境) |
| | | */ |
| | | @Bean |
| | | @ConditionalOnProperty(prefix = "guns", name = "spring-session-open", havingValue = "false") |
| | | public DefaultWebSessionManager defaultWebSessionManager(CacheManager cacheShiroManager, GunsProperties gunsProperties) { |
| | | DefaultWebSessionManager sessionManager = new DefaultWebSessionManager(); |
| | | sessionManager.setCacheManager(cacheShiroManager); |
| | | sessionManager.setSessionValidationInterval(gunsProperties.getSessionValidationInterval() * 1000); |
| | | sessionManager.setGlobalSessionTimeout(gunsProperties.getSessionInvalidateTime() * 1000); |
| | | sessionManager.setDeleteInvalidSessions(true); |
| | | sessionManager.setSessionValidationSchedulerEnabled(true); |
| | | Cookie cookie = new SimpleCookie(ShiroHttpSession.DEFAULT_SESSION_ID_NAME); |
| | | cookie.setName("shiroCookie"); |
| | | cookie.setHttpOnly(true); |
| | | sessionManager.setSessionIdCookie(cookie); |
| | | return sessionManager; |
| | | } |
| | | |
| | | /** |
| | | * 缓存管理器 使用Ehcache实现 |
| | | */ |
| | | @Bean |
| | | public CacheManager getCacheShiroManager(EhCacheManagerFactoryBean ehcache) { |
| | | EhCacheManager ehCacheManager = new EhCacheManager(); |
| | | ehCacheManager.setCacheManager(ehcache.getObject()); |
| | | return ehCacheManager; |
| | | } |
| | | |
| | | /** |
| | | * 项目自定义的Realm |
| | | */ |
| | | @Bean |
| | | public ShiroDbRealm shiroDbRealm() { |
| | | return new ShiroDbRealm(); |
| | | } |
| | | |
| | | /** |
| | | * rememberMe管理器, cipherKey生成见{@code Base64Test.java} |
| | | */ |
| | | @Bean |
| | | public CookieRememberMeManager rememberMeManager(SimpleCookie rememberMeCookie) { |
| | | CookieRememberMeManager manager = new CookieRememberMeManager(); |
| | | manager.setCipherKey(Base64.decode("Z3VucwAAAAAAAAAAAAAAAA==")); |
| | | manager.setCookie(rememberMeCookie); |
| | | return manager; |
| | | } |
| | | |
| | | /** |
| | | * 记住密码Cookie |
| | | */ |
| | | @Bean |
| | | public SimpleCookie rememberMeCookie() { |
| | | SimpleCookie simpleCookie = new SimpleCookie("rememberMe"); |
| | | simpleCookie.setHttpOnly(true); |
| | | simpleCookie.setMaxAge(7 * 24 * 60 * 60);//7天 |
| | | return simpleCookie; |
| | | } |
| | | |
| | | /** |
| | | * Shiro的过滤器链 |
| | | */ |
| | | @Bean |
| | | public ShiroFilterFactoryBean shiroFilter(DefaultWebSecurityManager securityManager) { |
| | | ShiroFilterFactoryBean shiroFilter = new ShiroFilterFactoryBean(); |
| | | shiroFilter.setSecurityManager(securityManager); |
| | | /** |
| | | * 默认的登陆访问url |
| | | */ |
| | | shiroFilter.setLoginUrl("/login"); |
| | | /** |
| | | * 登陆成功后跳转的url |
| | | */ |
| | | shiroFilter.setSuccessUrl("/"); |
| | | /** |
| | | * 没有权限跳转的url |
| | | */ |
| | | shiroFilter.setUnauthorizedUrl("/global/error"); |
| | | |
| | | /** |
| | | * 覆盖默认的user拦截器(默认拦截器解决不了ajax请求 session超时的问题,若有更好的办法请及时反馈作者) |
| | | */ |
| | | HashMap<String, Filter> myFilters = new HashMap<>(); |
| | | myFilters.put("user", new GunsUserFilter()); |
| | | shiroFilter.setFilters(myFilters); |
| | | |
| | | /** |
| | | * 配置shiro拦截器链 |
| | | * |
| | | * anon 不需要认证 |
| | | * authc 需要认证 |
| | | * user 验证通过或RememberMe登录的都可以 |
| | | * |
| | | * 当应用开启了rememberMe时,用户下次访问时可以是一个user,但不会是authc,因为authc是需要重新认证的 |
| | | * |
| | | * 顺序从上到下,优先级依次降低 |
| | | * |
| | | * api开头的接口,走rest api鉴权,不走shiro鉴权 |
| | | * |
| | | */ |
| | | Map<String, String> hashMap = new LinkedHashMap<>(); |
| | | hashMap.put("/static/**", "anon"); |
| | | hashMap.put("/gunsApi/**", "anon"); |
| | | hashMap.put("/login", "anon"); |
| | | hashMap.put("/global/sessionError", "anon"); |
| | | hashMap.put("/kaptcha", "anon"); |
| | | hashMap.put("/**", "user"); |
| | | shiroFilter.setFilterChainDefinitionMap(hashMap); |
| | | return shiroFilter; |
| | | } |
| | | |
| | | /** |
| | | * 在方法中 注入 securityManager,进行代理控制 |
| | | */ |
| | | @Bean |
| | | public MethodInvokingFactoryBean methodInvokingFactoryBean(DefaultWebSecurityManager securityManager) { |
| | | MethodInvokingFactoryBean bean = new MethodInvokingFactoryBean(); |
| | | bean.setStaticMethod("org.apache.shiro.SecurityUtils.setSecurityManager"); |
| | | bean.setArguments(new Object[]{securityManager}); |
| | | return bean; |
| | | } |
| | | |
| | | /** |
| | | * Shiro生命周期处理器: |
| | | * 用于在实现了Initializable接口的Shiro bean初始化时调用Initializable接口回调(例如:UserRealm) |
| | | * 在实现了Destroyable接口的Shiro bean销毁时调用 Destroyable接口回调(例如:DefaultSecurityManager) |
| | | */ |
| | | @Bean |
| | | public LifecycleBeanPostProcessor lifecycleBeanPostProcessor() { |
| | | return new LifecycleBeanPostProcessor(); |
| | | } |
| | | |
| | | /** |
| | | * 启用shrio授权注解拦截方式,AOP式方法级权限检查 |
| | | */ |
| | | @Bean |
| | | public AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor(DefaultWebSecurityManager securityManager) { |
| | | AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor = |
| | | new AuthorizationAttributeSourceAdvisor(); |
| | | authorizationAttributeSourceAdvisor.setSecurityManager(securityManager); |
| | | return authorizationAttributeSourceAdvisor; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.config.web; |
| | | |
| | | import com.alibaba.druid.pool.DruidDataSource; |
| | | import com.alibaba.druid.support.http.StatViewServlet; |
| | | import com.alibaba.druid.support.http.WebStatFilter; |
| | | import com.alibaba.druid.support.spring.stat.BeanTypeAutoProxyCreator; |
| | | import com.alibaba.druid.support.spring.stat.DruidStatInterceptor; |
| | | import com.google.code.kaptcha.impl.DefaultKaptcha; |
| | | import com.google.code.kaptcha.util.Config; |
| | | import com.stylefeng.guns.config.properties.GunsProperties; |
| | | import com.stylefeng.guns.core.intercept.RestApiInteceptor; |
| | | import com.stylefeng.guns.core.listener.ConfigListener; |
| | | import com.stylefeng.guns.core.xss.XssFilter; |
| | | import org.springframework.aop.Advisor; |
| | | import org.springframework.aop.support.DefaultPointcutAdvisor; |
| | | import org.springframework.aop.support.JdkRegexpMethodPointcut; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.web.servlet.FilterRegistrationBean; |
| | | import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; |
| | | import org.springframework.boot.web.servlet.ServletRegistrationBean; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.web.context.request.RequestContextListener; |
| | | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; |
| | | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; |
| | | import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Properties; |
| | | |
| | | /** |
| | | * web 配置类 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2016年11月12日 下午5:03:32 |
| | | */ |
| | | @Configuration |
| | | public class WebConfig extends WebMvcConfigurerAdapter { |
| | | |
| | | @Autowired |
| | | private GunsProperties gunsProperties; |
| | | |
| | | /** |
| | | * 增加swagger的支持 |
| | | */ |
| | | @Override |
| | | public void addResourceHandlers(ResourceHandlerRegistry registry) { |
| | | if (gunsProperties.getSwaggerOpen()) { |
| | | registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/"); |
| | | registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 增加对rest api鉴权的spring mvc拦截器 |
| | | */ |
| | | @Override |
| | | public void addInterceptors(InterceptorRegistry registry) { |
| | | registry.addInterceptor(new RestApiInteceptor()).addPathPatterns("/gunsApi/**"); |
| | | } |
| | | |
| | | /** |
| | | * druidServlet注册 |
| | | */ |
| | | @Bean |
| | | public ServletRegistrationBean druidServletRegistration() { |
| | | ServletRegistrationBean registration = new ServletRegistrationBean(new StatViewServlet()); |
| | | registration.addUrlMappings("/druid/*"); |
| | | return registration; |
| | | } |
| | | |
| | | /** |
| | | * druid监控 配置URI拦截策略 |
| | | */ |
| | | @Bean |
| | | public FilterRegistrationBean druidStatFilter() { |
| | | FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean(new WebStatFilter()); |
| | | //添加过滤规则. |
| | | filterRegistrationBean.addUrlPatterns("/*"); |
| | | //添加不需要忽略的格式信息. |
| | | filterRegistrationBean.addInitParameter( |
| | | "exclusions", "/static/*,*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid,/druid/*"); |
| | | //用于session监控页面的用户名显示 需要登录后主动将username注入到session里 |
| | | filterRegistrationBean.addInitParameter("principalSessionName", "username"); |
| | | return filterRegistrationBean; |
| | | } |
| | | |
| | | /** |
| | | * druid数据库连接池监控 |
| | | */ |
| | | @Bean |
| | | public DruidStatInterceptor druidStatInterceptor() { |
| | | return new DruidStatInterceptor(); |
| | | } |
| | | |
| | | @Bean |
| | | public JdkRegexpMethodPointcut druidStatPointcut() { |
| | | JdkRegexpMethodPointcut druidStatPointcut = new JdkRegexpMethodPointcut(); |
| | | String patterns = "com.stylefeng.guns.controller.*.service.*"; |
| | | //可以set多个 |
| | | druidStatPointcut.setPatterns(patterns); |
| | | return druidStatPointcut; |
| | | } |
| | | |
| | | /** |
| | | * druid数据库连接池监控 |
| | | */ |
| | | @Bean |
| | | public BeanTypeAutoProxyCreator beanTypeAutoProxyCreator() { |
| | | BeanTypeAutoProxyCreator beanTypeAutoProxyCreator = new BeanTypeAutoProxyCreator(); |
| | | beanTypeAutoProxyCreator.setTargetBeanType(DruidDataSource.class); |
| | | beanTypeAutoProxyCreator.setInterceptorNames("druidStatInterceptor"); |
| | | return beanTypeAutoProxyCreator; |
| | | } |
| | | |
| | | /** |
| | | * druid 为druidStatPointcut添加拦截 |
| | | * |
| | | * @return |
| | | */ |
| | | @Bean |
| | | public Advisor druidStatAdvisor() { |
| | | return new DefaultPointcutAdvisor(druidStatPointcut(), druidStatInterceptor()); |
| | | } |
| | | |
| | | /** |
| | | * xssFilter注册 |
| | | */ |
| | | @Bean |
| | | public FilterRegistrationBean xssFilterRegistration() { |
| | | XssFilter xssFilter = new XssFilter(); |
| | | xssFilter.setUrlExclusion(Arrays.asList("/tAgreement/updateAppParam","/tAdvertisement/add","/tAdvertisement/update","/tNotices/addSystem","/tNotices/updateSystem" |
| | | ,"/tIntegralGoods/add","/tIntegralGoods/update")); |
| | | FilterRegistrationBean registration = new FilterRegistrationBean(xssFilter); |
| | | registration.addUrlPatterns("/*"); |
| | | return registration; |
| | | } |
| | | |
| | | /** |
| | | * RequestContextListener注册 |
| | | */ |
| | | @Bean |
| | | public ServletListenerRegistrationBean<RequestContextListener> requestContextListenerRegistration() { |
| | | return new ServletListenerRegistrationBean<>(new RequestContextListener()); |
| | | } |
| | | |
| | | /** |
| | | * ConfigListener注册 |
| | | */ |
| | | @Bean |
| | | public ServletListenerRegistrationBean<ConfigListener> configListenerRegistration() { |
| | | return new ServletListenerRegistrationBean<>(new ConfigListener()); |
| | | } |
| | | |
| | | /** |
| | | * 验证码生成相关 |
| | | */ |
| | | @Bean |
| | | public DefaultKaptcha kaptcha() { |
| | | Properties properties = new Properties(); |
| | | properties.put("kaptcha.border", "no"); |
| | | properties.put("kaptcha.border.color", "105,179,90"); |
| | | properties.put("kaptcha.textproducer.font.color", "blue"); |
| | | properties.put("kaptcha.image.width", "125"); |
| | | properties.put("kaptcha.image.height", "45"); |
| | | properties.put("kaptcha.textproducer.font.size", "45"); |
| | | properties.put("kaptcha.session.key", "code"); |
| | | properties.put("kaptcha.textproducer.char.length", "4"); |
| | | properties.put("kaptcha.textproducer.font.names", "宋体,楷体,微软雅黑"); |
| | | Config config = new Config(properties); |
| | | DefaultKaptcha defaultKaptcha = new DefaultKaptcha(); |
| | | defaultKaptcha.setConfig(config); |
| | | return defaultKaptcha; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.aop; |
| | | |
| | | import com.stylefeng.guns.core.common.exception.BizExceptionEnum; |
| | | import com.stylefeng.guns.core.common.exception.InvalidKaptchaException; |
| | | import com.stylefeng.guns.core.base.tips.ErrorTip; |
| | | import com.stylefeng.guns.core.exception.GunsException; |
| | | import com.stylefeng.guns.core.log.LogManager; |
| | | import com.stylefeng.guns.core.log.factory.LogTaskFactory; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import org.apache.shiro.authc.AuthenticationException; |
| | | import org.apache.shiro.authc.CredentialsException; |
| | | import org.apache.shiro.authc.DisabledAccountException; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.core.annotation.Order; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.ControllerAdvice; |
| | | import org.springframework.web.bind.annotation.ExceptionHandler; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.ResponseStatus; |
| | | |
| | | import java.lang.reflect.UndeclaredThrowableException; |
| | | |
| | | import static com.stylefeng.guns.core.support.HttpKit.getIp; |
| | | import static com.stylefeng.guns.core.support.HttpKit.getRequest; |
| | | |
| | | /** |
| | | * 全局的的异常拦截器(拦截所有的控制器)(带有@RequestMapping注解的方法上都会拦截) |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2016年11月12日 下午3:19:56 |
| | | */ |
| | | @ControllerAdvice |
| | | @Order(-1) |
| | | public class GlobalExceptionHandler { |
| | | |
| | | private Logger log = LoggerFactory.getLogger(this.getClass()); |
| | | |
| | | /** |
| | | * 拦截业务异常 |
| | | */ |
| | | @ExceptionHandler(GunsException.class) |
| | | @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) |
| | | @ResponseBody |
| | | public ErrorTip notFount(GunsException e) { |
| | | LogManager.me().executeLog(LogTaskFactory.exceptionLog(ShiroKit.getUser().getId(), e)); |
| | | getRequest().setAttribute("tip", e.getMessage()); |
| | | log.error("业务异常:", e); |
| | | return new ErrorTip(e.getCode(), e.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 用户未登录异常 |
| | | */ |
| | | @ExceptionHandler(AuthenticationException.class) |
| | | @ResponseStatus(HttpStatus.UNAUTHORIZED) |
| | | public String unAuth(AuthenticationException e) { |
| | | log.error("用户未登陆:", e); |
| | | return "/login.html"; |
| | | } |
| | | |
| | | /** |
| | | * 账号被冻结异常 |
| | | */ |
| | | @ExceptionHandler(DisabledAccountException.class) |
| | | @ResponseStatus(HttpStatus.UNAUTHORIZED) |
| | | public String accountLocked(DisabledAccountException e, Model model) { |
| | | String username = getRequest().getParameter("username"); |
| | | LogManager.me().executeLog(LogTaskFactory.loginLog(username, "账号被冻结", getIp())); |
| | | model.addAttribute("tips", "账号被冻结"); |
| | | return "/login.html"; |
| | | } |
| | | |
| | | /** |
| | | * 账号密码错误异常 |
| | | */ |
| | | @ExceptionHandler(CredentialsException.class) |
| | | @ResponseStatus(HttpStatus.UNAUTHORIZED) |
| | | public String credentials(CredentialsException e, Model model) { |
| | | String username = getRequest().getParameter("username"); |
| | | LogManager.me().executeLog(LogTaskFactory.loginLog(username, "账号密码错误", getIp())); |
| | | model.addAttribute("tips", "账号密码错误"); |
| | | return "/login.html"; |
| | | } |
| | | |
| | | /** |
| | | * 验证码错误异常 |
| | | */ |
| | | @ExceptionHandler(InvalidKaptchaException.class) |
| | | @ResponseStatus(HttpStatus.BAD_REQUEST) |
| | | public String credentials(InvalidKaptchaException e, Model model) { |
| | | String username = getRequest().getParameter("username"); |
| | | LogManager.me().executeLog(LogTaskFactory.loginLog(username, "验证码错误", getIp())); |
| | | model.addAttribute("tips", "验证码错误"); |
| | | return "/login.html"; |
| | | } |
| | | |
| | | /** |
| | | * 无权访问该资源异常 |
| | | */ |
| | | @ExceptionHandler(UndeclaredThrowableException.class) |
| | | @ResponseStatus(HttpStatus.UNAUTHORIZED) |
| | | @ResponseBody |
| | | public ErrorTip credentials(UndeclaredThrowableException e) { |
| | | getRequest().setAttribute("tip", "权限异常"); |
| | | log.error("权限异常!", e); |
| | | return new ErrorTip(BizExceptionEnum.NO_PERMITION.getCode(), BizExceptionEnum.NO_PERMITION.getMessage()); |
| | | } |
| | | |
| | | /** |
| | | * 拦截未知的运行时异常 |
| | | */ |
| | | @ExceptionHandler(RuntimeException.class) |
| | | @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) |
| | | @ResponseBody |
| | | public ErrorTip notFount(RuntimeException e) { |
| | | LogManager.me().executeLog(LogTaskFactory.exceptionLog(ShiroKit.getUser().getId(), e)); |
| | | getRequest().setAttribute("tip", "服务器未知运行时异常"); |
| | | log.error("运行时异常:", e); |
| | | return new ErrorTip(BizExceptionEnum.SERVER_ERROR.getCode(), BizExceptionEnum.SERVER_ERROR.getMessage()); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.aop; |
| | | |
| | | import com.stylefeng.guns.core.common.annotion.BussinessLog; |
| | | import com.stylefeng.guns.core.common.constant.dictmap.base.AbstractDictMap; |
| | | import com.stylefeng.guns.core.log.LogManager; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import com.stylefeng.guns.core.log.factory.LogTaskFactory; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.shiro.ShiroUser; |
| | | import com.stylefeng.guns.core.support.HttpKit; |
| | | import com.stylefeng.guns.core.util.Contrast; |
| | | import org.aspectj.lang.ProceedingJoinPoint; |
| | | import org.aspectj.lang.Signature; |
| | | import org.aspectj.lang.annotation.Around; |
| | | import org.aspectj.lang.annotation.Aspect; |
| | | import org.aspectj.lang.annotation.Pointcut; |
| | | import org.aspectj.lang.reflect.MethodSignature; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.lang.reflect.Method; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 日志记录 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2016年12月6日 下午8:48:30 |
| | | */ |
| | | @Aspect |
| | | @Component |
| | | public class LogAop { |
| | | |
| | | private Logger log = LoggerFactory.getLogger(this.getClass()); |
| | | |
| | | @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(); |
| | | |
| | | try { |
| | | handle(point); |
| | | } catch (Exception e) { |
| | | log.error("日志记录出错!", e); |
| | | } |
| | | |
| | | return result; |
| | | } |
| | | |
| | | private void handle(ProceedingJoinPoint point) throws Exception { |
| | | |
| | | //获取拦截的方法名 |
| | | Signature sig = point.getSignature(); |
| | | MethodSignature msig = null; |
| | | if (!(sig instanceof MethodSignature)) { |
| | | throw new IllegalArgumentException("该注解只能用于方法"); |
| | | } |
| | | msig = (MethodSignature) sig; |
| | | Object target = point.getTarget(); |
| | | Method currentMethod = target.getClass().getMethod(msig.getName(), msig.getParameterTypes()); |
| | | String methodName = currentMethod.getName(); |
| | | |
| | | //如果当前用户未登录,不做日志 |
| | | ShiroUser user = ShiroKit.getUser(); |
| | | if (null == user) { |
| | | return; |
| | | } |
| | | |
| | | //获取拦截方法的参数 |
| | | String className = point.getTarget().getClass().getName(); |
| | | Object[] params = point.getArgs(); |
| | | |
| | | //获取操作名称 |
| | | BussinessLog annotation = currentMethod.getAnnotation(BussinessLog.class); |
| | | String bussinessName = annotation.value(); |
| | | String key = annotation.key(); |
| | | Class dictClass = annotation.dict(); |
| | | |
| | | StringBuilder sb = new StringBuilder(); |
| | | for (Object param : params) { |
| | | sb.append(param); |
| | | sb.append(" & "); |
| | | } |
| | | |
| | | //如果涉及到修改,比对变化 |
| | | String msg; |
| | | if (bussinessName.indexOf("修改") != -1 || bussinessName.indexOf("编辑") != -1) { |
| | | Object obj1 = LogObjectHolder.me().get(); |
| | | Map<String, String> obj2 = HttpKit.getRequestParameters(); |
| | | msg = Contrast.contrastObj(dictClass, key, obj1, obj2); |
| | | } else { |
| | | Map<String, String> parameters = HttpKit.getRequestParameters(); |
| | | AbstractDictMap dictMap = (AbstractDictMap) dictClass.newInstance(); |
| | | msg = Contrast.parseMutiKey(dictMap,key,parameters); |
| | | } |
| | | |
| | | LogManager.me().executeLog(LogTaskFactory.bussinessLog(user.getId(), bussinessName, className, methodName, msg)); |
| | | } |
| | | } |
New file |
| | |
| | | /** |
| | | * Copyright (c) 2015-2017, Chill Zhuang 庄骞 (smallchill@163.com). |
| | | * <p> |
| | | * Licensed under the Apache License, Version 2.0 (the "License"); |
| | | * you may not use this file except in compliance with the License. |
| | | * You may obtain a copy of the License at |
| | | * <p> |
| | | * http://www.apache.org/licenses/LICENSE-2.0 |
| | | * <p> |
| | | * Unless required by applicable law or agreed to in writing, software |
| | | * distributed under the License is distributed on an "AS IS" BASIS, |
| | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| | | * See the License for the specific language governing permissions and |
| | | * limitations under the License. |
| | | */ |
| | | package com.stylefeng.guns.core.aop; |
| | | |
| | | import com.stylefeng.guns.core.common.annotion.Permission; |
| | | import com.stylefeng.guns.core.shiro.check.PermissionCheckManager; |
| | | import org.aspectj.lang.ProceedingJoinPoint; |
| | | import org.aspectj.lang.annotation.Around; |
| | | import org.aspectj.lang.annotation.Aspect; |
| | | import org.aspectj.lang.annotation.Pointcut; |
| | | import org.aspectj.lang.reflect.MethodSignature; |
| | | import org.springframework.core.annotation.Order; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.naming.NoPermissionException; |
| | | import java.lang.reflect.Method; |
| | | |
| | | /** |
| | | * AOP 权限自定义检查 |
| | | */ |
| | | @Aspect |
| | | @Component |
| | | @Order(200) |
| | | public class PermissionAop { |
| | | |
| | | @Pointcut(value = "@annotation(com.stylefeng.guns.core.common.annotion.Permission)") |
| | | private void cutPermission() { |
| | | |
| | | } |
| | | |
| | | @Around("cutPermission()") |
| | | public Object doPermission(ProceedingJoinPoint point) throws Throwable { |
| | | MethodSignature ms = (MethodSignature) point.getSignature(); |
| | | Method method = ms.getMethod(); |
| | | Permission permission = method.getAnnotation(Permission.class); |
| | | Object[] permissions = permission.value(); |
| | | if (permissions == null || permissions.length == 0) { |
| | | //检查全体角色 |
| | | boolean result = PermissionCheckManager.checkAll(); |
| | | if (result) { |
| | | return point.proceed(); |
| | | } else { |
| | | throw new NoPermissionException(); |
| | | } |
| | | } else { |
| | | //检查指定角色 |
| | | boolean result = PermissionCheckManager.check(permissions); |
| | | if (result) { |
| | | return point.proceed(); |
| | | } else { |
| | | throw new NoPermissionException(); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.beetl; |
| | | |
| | | import com.stylefeng.guns.core.tag.DictSelectorTag; |
| | | import com.stylefeng.guns.core.util.KaptchaUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import org.beetl.core.Context; |
| | | import org.beetl.core.Function; |
| | | import org.beetl.core.Tag; |
| | | import org.beetl.core.TagFactory; |
| | | import org.beetl.ext.spring.BeetlGroupUtilConfiguration; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.core.env.Environment; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | |
| | | /** |
| | | * beetl拓展配置,绑定一些工具类,方便在模板中直接调用 |
| | | * |
| | | * @author stylefeng |
| | | * @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 ShiroExt()); |
| | | groupTemplate.registerFunctionPackage("tool", new ToolUtil()); |
| | | groupTemplate.registerFunctionPackage("kaptcha", new KaptchaUtil()); |
| | | groupTemplate.registerTagFactory("dictSelector", new TagFactory() { |
| | | @Override |
| | | public Tag createTag() { |
| | | return dictSelectorTag; |
| | | } |
| | | }); |
| | | |
| | | groupTemplate.registerFunction("env", new Function() { |
| | | @Override |
| | | public String call(Object[] paras, Context ctx) { |
| | | String key = (String)paras[0]; |
| | | String value = env.getProperty(key); |
| | | if(value!=null) { |
| | | return getStr(value); |
| | | } |
| | | if(paras.length==2) { |
| | | return (String)paras[1]; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | protected String getStr(String str) { |
| | | try { |
| | | return new String(str.getBytes("iso8859-1"),"UTF-8"); |
| | | } catch (UnsupportedEncodingException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | } |
New file |
| | |
| | | /** |
| | | * Copyright (c) 2015-2017, Chill Zhuang 庄骞 (smallchill@163.com). |
| | | * <p> |
| | | * Licensed under the Apache License, Version 2.0 (the "License"); |
| | | * you may not use this file except in compliance with the License. |
| | | * You may obtain a copy of the License at |
| | | * <p> |
| | | * http://www.apache.org/licenses/LICENSE-2.0 |
| | | * <p> |
| | | * Unless required by applicable law or agreed to in writing, software |
| | | * distributed under the License is distributed on an "AS IS" BASIS, |
| | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| | | * See the License for the specific language governing permissions and |
| | | * limitations under the License. |
| | | */ |
| | | package com.stylefeng.guns.core.beetl; |
| | | |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.apache.shiro.subject.Subject; |
| | | import org.beetl.core.GroupTemplate; |
| | | |
| | | import com.stylefeng.guns.core.shiro.ShiroUser; |
| | | |
| | | public class ShiroExt { |
| | | private static final String NAMES_DELIMETER = ","; |
| | | |
| | | /** |
| | | * 获取当前 Subject |
| | | * |
| | | * @return Subject |
| | | */ |
| | | protected static Subject getSubject() { |
| | | return SecurityUtils.getSubject(); |
| | | } |
| | | |
| | | /** |
| | | * 获取封装的 ShiroUser |
| | | * |
| | | * @return ShiroUser |
| | | */ |
| | | public ShiroUser getUser() { |
| | | if (isGuest()) { |
| | | return null; |
| | | } else { |
| | | return (ShiroUser) getSubject().getPrincipals().getPrimaryPrincipal(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 验证当前用户是否属于该角色?,使用时与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); |
| | | } |
| | | |
| | | /** |
| | | * 验证当前用户是否属于以下任意一个角色。 |
| | | * |
| | | * @param roleNames 角色列表 |
| | | * @return 属于:true,否则false |
| | | */ |
| | | public boolean hasAnyRoles(String roleNames) { |
| | | boolean hasAnyRole = false; |
| | | Subject subject = getSubject(); |
| | | if (subject != null && roleNames != null && roleNames.length() > 0) { |
| | | for (String role : roleNames.split(NAMES_DELIMETER)) { |
| | | if (subject.hasRole(role.trim())) { |
| | | hasAnyRole = true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | return hasAnyRole; |
| | | } |
| | | |
| | | /** |
| | | * 验证当前用户是否属于以下所有角色。 |
| | | * |
| | | * @param roleNames 角色列表 |
| | | * @return 属于:true,否则false |
| | | */ |
| | | public boolean hasAllRoles(String roleNames) { |
| | | boolean hasAllRole = true; |
| | | Subject subject = getSubject(); |
| | | if (subject != null && roleNames != null && roleNames.length() > 0) { |
| | | for (String role : roleNames.split(NAMES_DELIMETER)) { |
| | | if (!subject.hasRole(role.trim())) { |
| | | hasAllRole = false; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | return hasAllRole; |
| | | } |
| | | |
| | | /** |
| | | * 验证当前用户是否拥有指定权限,使用时与lacksPermission 搭配使用 |
| | | * |
| | | * @param permission 权限名 |
| | | * @return 拥有权限:true,否则false |
| | | */ |
| | | public boolean hasPermission(String permission) { |
| | | return getSubject() != null && permission != null |
| | | && permission.length() > 0 |
| | | && getSubject().isPermitted(permission); |
| | | } |
| | | |
| | | /** |
| | | * 与hasPermission标签逻辑相反,当前用户没有制定权限时,验证通过。 |
| | | * |
| | | * @param permission 权限名 |
| | | * @return 拥有权限:true,否则false |
| | | */ |
| | | public boolean lacksPermission(String permission) { |
| | | return !hasPermission(permission); |
| | | } |
| | | |
| | | /** |
| | | * 已认证通过的用户。不包含已记住的用户,这是与user标签的区别所在。与notAuthenticated搭配使用 |
| | | * |
| | | * @return 通过身份验证:true,否则false |
| | | */ |
| | | public boolean authenticated() { |
| | | return getSubject() != null && getSubject().isAuthenticated(); |
| | | } |
| | | |
| | | /** |
| | | * 未认证通过用户,与authenticated标签相对应。与guest标签的区别是,该标签包含已记住用户。。 |
| | | * |
| | | * @return 没有通过身份验证:true,否则false |
| | | */ |
| | | public boolean notAuthenticated() { |
| | | return !authenticated(); |
| | | } |
| | | |
| | | /** |
| | | * 认证通过或已记住的用户。与guset搭配使用。 |
| | | * |
| | | * @return 用户:true,否则 false |
| | | */ |
| | | public boolean isUser() { |
| | | return getSubject() != null && getSubject().getPrincipal() != null; |
| | | } |
| | | |
| | | /** |
| | | * 验证当前用户是否为“访客”,即未认证(包含未记住)的用户。用user搭配使用 |
| | | * |
| | | * @return 访客:true,否则false |
| | | */ |
| | | public boolean isGuest() { |
| | | return !isUser(); |
| | | } |
| | | |
| | | /** |
| | | * 输出当前用户信息,通常为登录帐号信息。 |
| | | * |
| | | * @return 当前用户信息 |
| | | */ |
| | | public String principal() { |
| | | if (getSubject() != null) { |
| | | Object principal = getSubject().getPrincipal(); |
| | | return principal.toString(); |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | GroupTemplate gt = new GroupTemplate(); |
| | | gt.registerFunctionPackage("shiro", new ShiroExt()); |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.annotion; |
| | | |
| | | import com.stylefeng.guns.core.common.constant.dictmap.base.AbstractDictMap; |
| | | import com.stylefeng.guns.core.common.constant.dictmap.base.SystemDict; |
| | | |
| | | import java.lang.annotation.*; |
| | | |
| | | /** |
| | | * 标记需要做业务日志的方法 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-03-31 12:46 |
| | | */ |
| | | @Inherited |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Target({ElementType.METHOD}) |
| | | public @interface BussinessLog { |
| | | |
| | | /** |
| | | * 业务的名称,例如:"修改菜单" |
| | | */ |
| | | String value() default ""; |
| | | |
| | | /** |
| | | * 被修改的实体的唯一标识,例如:菜单实体的唯一标识为"id" |
| | | */ |
| | | String key() default "id"; |
| | | |
| | | /** |
| | | * 字典(用于查找key的中文名称和字段的中文名称) |
| | | */ |
| | | Class<? extends AbstractDictMap> dict() default SystemDict.class; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.annotion; |
| | | |
| | | import java.lang.annotation.*; |
| | | |
| | | /** |
| | | * 权限注解 用于检查权限 规定访问权限 |
| | | * |
| | | * @example @Permission({role1,role2}) |
| | | * @example @Permission |
| | | */ |
| | | @Inherited |
| | | @Retention(RetentionPolicy.RUNTIME) |
| | | @Target({ElementType.METHOD}) |
| | | public @interface Permission { |
| | | |
| | | /** |
| | | * <p>角色英文名称</p> |
| | | * <p>使用注解时加上这个值表示限制只有某个角色的才可以访问对应的资源</p> |
| | | * <p>常用在某些资源限制只有超级管理员角色才可访问</p> |
| | | */ |
| | | String[] value() default {}; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant; |
| | | |
| | | /** |
| | | * 系统常量 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017年2月12日 下午9:42:53 |
| | | */ |
| | | public interface Const { |
| | | |
| | | /** |
| | | * 系统默认的管理员密码 |
| | | */ |
| | | String DEFAULT_PWD = "111111"; |
| | | |
| | | /** |
| | | * 管理员角色的名字 |
| | | */ |
| | | String ADMIN_NAME = "administrator"; |
| | | |
| | | /** |
| | | * 管理员id |
| | | */ |
| | | Integer ADMIN_ID = 1; |
| | | |
| | | /** |
| | | * 超级管理员角色id |
| | | */ |
| | | Integer ADMIN_ROLE_ID = 1; |
| | | |
| | | /** |
| | | * 接口文档的菜单名 |
| | | */ |
| | | String API_MENU_NAME = "接口文档"; |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant; |
| | | |
| | | /** |
| | | * |
| | | * 多数据源的枚举 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017年3月5日 上午10:15:02 |
| | | */ |
| | | public interface DatasourceEnum { |
| | | |
| | | String DATA_SOURCE_GUNS = "dataSourceGuns"; //guns数据源 |
| | | |
| | | String DATA_SOURCE_BIZ = "dataSourceBiz"; //其他业务的数据源 |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant; |
| | | |
| | | /** |
| | | * jwt相关配置 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-08-23 9:23 |
| | | */ |
| | | public interface JwtConstants { |
| | | |
| | | String AUTH_HEADER = "Authorization"; |
| | | |
| | | String SECRET = "defaultSecret"; |
| | | |
| | | Long EXPIRATION = 604800L; |
| | | |
| | | String AUTH_PATH = "/gunsApi/auth"; |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.cache; |
| | | |
| | | /** |
| | | * 所有缓存名称的集合 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-04-24 21:56 |
| | | */ |
| | | public interface Cache { |
| | | |
| | | /** |
| | | * 常量缓存 |
| | | */ |
| | | String CONSTANT = "CONSTANT"; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.cache; |
| | | |
| | | /** |
| | | * 缓存标识前缀集合,常用在ConstantFactory类中 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-04-25 9:37 |
| | | */ |
| | | public interface CacheKey { |
| | | |
| | | /** |
| | | * 角色名称(多个) |
| | | */ |
| | | String ROLES_NAME = "roles_name_"; |
| | | |
| | | /** |
| | | * 角色名称(单个) |
| | | */ |
| | | String SINGLE_ROLE_NAME = "single_role_name_"; |
| | | |
| | | /** |
| | | * 角色英文名称 |
| | | */ |
| | | String SINGLE_ROLE_TIP = "single_role_tip_"; |
| | | |
| | | /** |
| | | * 部门名称 |
| | | */ |
| | | String DEPT_NAME = "dept_name_"; |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.dictmap; |
| | | |
| | | import com.stylefeng.guns.core.common.constant.dictmap.base.AbstractDictMap; |
| | | |
| | | /** |
| | | * 用于删除业务的字典 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-05-06 15:01 |
| | | */ |
| | | public class DeleteDict extends AbstractDictMap { |
| | | |
| | | @Override |
| | | public void init() { |
| | | put("roleId","角色名称"); |
| | | put("deptId", "部门名称"); |
| | | put("menuId", "菜单名称"); |
| | | put("dictId", "字典名称"); |
| | | put("noticeId", "标题"); |
| | | } |
| | | |
| | | @Override |
| | | protected void initBeWrapped() { |
| | | putFieldWrapperMethodName("roleId","getCacheObject"); |
| | | putFieldWrapperMethodName("deptId","getCacheObject"); |
| | | putFieldWrapperMethodName("menuId","getCacheObject"); |
| | | putFieldWrapperMethodName("dictId","getCacheObject"); |
| | | putFieldWrapperMethodName("noticeId","getCacheObject"); |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.dictmap; |
| | | |
| | | import com.stylefeng.guns.core.common.constant.dictmap.base.AbstractDictMap; |
| | | |
| | | /** |
| | | * 部门的映射 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-05-06 15:01 |
| | | */ |
| | | public class DeptDict extends AbstractDictMap { |
| | | |
| | | @Override |
| | | public void init() { |
| | | put("deptId", "部门名称"); |
| | | put("num", "部门排序"); |
| | | put("pid", "上级名称"); |
| | | put("simplename", "部门简称"); |
| | | put("fullname", "部门全称"); |
| | | put("tips", "备注"); |
| | | } |
| | | |
| | | @Override |
| | | protected void initBeWrapped() { |
| | | putFieldWrapperMethodName("deptId", "getDeptName"); |
| | | putFieldWrapperMethodName("pid", "getDeptName"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.dictmap.Dict; |
| | | |
| | | import com.stylefeng.guns.core.common.constant.dictmap.base.AbstractDictMap; |
| | | |
| | | /** |
| | | * 车牌品牌日志记录 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-05-06 15:01 |
| | | */ |
| | | public class BrandDict extends AbstractDictMap { |
| | | |
| | | @Override |
| | | public void init() { |
| | | put("id","车辆品牌id"); |
| | | put("addTime","添加时间"); |
| | | put("name","品牌名称"); |
| | | put("brandImg","品牌图片(多个用逗号隔开)"); |
| | | put("state","状态(1正常,2停用)"); |
| | | put("specialMode","专车计费"); |
| | | put("charteredMode","包车计费"); |
| | | put("seatNum","座位数"); |
| | | } |
| | | |
| | | @Override |
| | | protected void initBeWrapped() { |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.dictmap.Dict; |
| | | |
| | | import com.stylefeng.guns.core.common.constant.dictmap.base.AbstractDictMap; |
| | | |
| | | /** |
| | | * 车辆日志记录 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-05-06 15:01 |
| | | */ |
| | | public class CarDict extends AbstractDictMap { |
| | | |
| | | @Override |
| | | public void init() { |
| | | put("id","车辆id"); |
| | | put("addTime","添加时间"); |
| | | put("carImg","车辆图片"); |
| | | put("plateNumber","车牌号"); |
| | | put("licenseNumber","行驶证编号"); |
| | | put("licenseImg","行驶证照片"); |
| | | put("brandId","关联品牌id"); |
| | | put("color","车辆颜色"); |
| | | put("serviceMode","服务模式(1专车,2包车)"); |
| | | put("state","状态(1正常,2停用)"); |
| | | put("insuranceNumber","保险编号"); |
| | | put("insuranceImg","保险图片"); |
| | | put("insuranceDate","保险到期时间"); |
| | | } |
| | | |
| | | @Override |
| | | protected void initBeWrapped() { |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.dictmap.Dict; |
| | | |
| | | import com.stylefeng.guns.core.common.constant.dictmap.base.AbstractDictMap; |
| | | |
| | | /** |
| | | * 司机日志记录 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-05-06 15:01 |
| | | */ |
| | | public class DriverDict extends AbstractDictMap { |
| | | |
| | | @Override |
| | | public void init() { |
| | | put("id","司机id"); |
| | | put("addTime","添加时间"); |
| | | put("name","司机姓名"); |
| | | put("headImg","头像"); |
| | | put("phone","电话"); |
| | | put("sex","性别"); |
| | | put("password","登录密码"); |
| | | put("state","状态(1正常,2停用)"); |
| | | put("serviceMode","服务模式(1专车,2包车)"); |
| | | put("driveNumber","驾驶证编号"); |
| | | put("driveImg","驾驶证照片"); |
| | | put("carId","车辆id"); |
| | | put("driverId","司机id"); |
| | | } |
| | | |
| | | @Override |
| | | protected void initBeWrapped() { |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.dictmap.Dict; |
| | | |
| | | import com.stylefeng.guns.core.common.constant.dictmap.base.AbstractDictMap; |
| | | |
| | | /** |
| | | * 评价标签日志记录 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-05-06 15:01 |
| | | */ |
| | | public class LabelDict extends AbstractDictMap { |
| | | |
| | | @Override |
| | | public void init() { |
| | | put("id","标签id"); |
| | | put("appLabelId","标签id"); |
| | | put("addTime","添加时间"); |
| | | put("name","标签名称"); |
| | | } |
| | | |
| | | @Override |
| | | protected void initBeWrapped() { |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.dictmap.Dict; |
| | | |
| | | import com.stylefeng.guns.core.common.constant.dictmap.base.AbstractDictMap; |
| | | |
| | | /** |
| | | * 系统通知日志记录 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-05-06 15:01 |
| | | */ |
| | | public class NoticeDict extends AbstractDictMap { |
| | | |
| | | @Override |
| | | public void init() { |
| | | put("id","通知id"); |
| | | put("addTime","添加时间"); |
| | | put("title","标题"); |
| | | put("issue","是否发布(1未发布,2已发布)"); |
| | | put("content","内容"); |
| | | put("sendType","发送对象(1用户,2司机 ,3用户和司机)"); |
| | | put("sendTime","发送时间"); |
| | | } |
| | | |
| | | @Override |
| | | protected void initBeWrapped() { |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.dictmap.Dict; |
| | | |
| | | import com.stylefeng.guns.core.common.constant.dictmap.base.AbstractDictMap; |
| | | |
| | | /** |
| | | * 日志记录 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-05-06 15:01 |
| | | */ |
| | | public class ObjectDict extends AbstractDictMap { |
| | | |
| | | @Override |
| | | public void init() { |
| | | put("appOrderTopupId","充值订单id"); |
| | | put("id","提现记录id"); |
| | | put("appInvoiceId","发票记录id"); |
| | | put("appOrderEvaluateId","订单评价id"); |
| | | put("appComplaintId","投诉id"); |
| | | put("appFeedbackId","意见反馈id"); |
| | | put("appDriverRecruitId","司机招募id"); |
| | | } |
| | | |
| | | @Override |
| | | protected void initBeWrapped() { |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.dictmap.Dict; |
| | | |
| | | import com.stylefeng.guns.core.common.constant.dictmap.base.AbstractDictMap; |
| | | |
| | | /** |
| | | * 订单日志记录 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-05-06 15:01 |
| | | */ |
| | | public class OrderDict extends AbstractDictMap { |
| | | |
| | | @Override |
| | | public void init() { |
| | | put("id","订单id"); |
| | | put("appOrderId","订单id"); |
| | | put("addTime","添加时间"); |
| | | put("orderNum","订单编号"); |
| | | put("userName","乘车人名称"); |
| | | put("userPhone","乘车人手机"); |
| | | put("number","乘车人数"); |
| | | put("chargeMode","计费方式(1时间,2里程)"); |
| | | put("rideTime","乘车时间"); |
| | | put("startName","起点名称"); |
| | | put("endName","终点名称"); |
| | | put("driverId","接单司机id"); |
| | | } |
| | | |
| | | @Override |
| | | protected void initBeWrapped() { |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.dictmap.Dict; |
| | | |
| | | import com.stylefeng.guns.core.common.constant.dictmap.base.AbstractDictMap; |
| | | |
| | | /** |
| | | * 用户日志记录 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-05-06 15:01 |
| | | */ |
| | | public class UserAuthenticationDict extends AbstractDictMap { |
| | | |
| | | @Override |
| | | public void init() { |
| | | put("id","实名认证id"); |
| | | put("state","审核状态(1待审核,2审核成功,3审核失败)"); |
| | | put("isDelete","是否删除(1正常,2删除)"); |
| | | } |
| | | |
| | | @Override |
| | | protected void initBeWrapped() { |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.dictmap.Dict; |
| | | |
| | | import com.stylefeng.guns.core.common.constant.dictmap.base.AbstractDictMap; |
| | | |
| | | /** |
| | | * 用户日志记录 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-05-06 15:01 |
| | | */ |
| | | public class UserDict extends AbstractDictMap { |
| | | |
| | | @Override |
| | | public void init() { |
| | | put("id","用户id"); |
| | | put("state","用户状态(1正常,2冻结)"); |
| | | put("gold","用户金币数"); |
| | | put("balance","用户余额数"); |
| | | put("nickName","用户昵称"); |
| | | put("phone","用户手机号"); |
| | | put("level","等级(1普通用户,2白银会员,3黄金会员,4白金会员)"); |
| | | put("sex","性别"); |
| | | put("birthday","生日"); |
| | | put("industry","行业"); |
| | | put("job","职业"); |
| | | put("company","公司"); |
| | | put("education","学历"); |
| | | put("signature","个性签名"); |
| | | put("addTime","添加时间"); |
| | | } |
| | | |
| | | @Override |
| | | protected void initBeWrapped() { |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.dictmap.Dict; |
| | | |
| | | import com.stylefeng.guns.core.common.constant.dictmap.base.AbstractDictMap; |
| | | |
| | | /** |
| | | * 版本控制日志记录 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-05-06 15:01 |
| | | */ |
| | | public class VersionDict extends AbstractDictMap { |
| | | |
| | | @Override |
| | | public void init() { |
| | | put("id","版本id"); |
| | | put("createDate","添加时间"); |
| | | put("type","类型(1用户端,2司机端)"); |
| | | put("versions","版本号"); |
| | | put("mark","版本描述"); |
| | | put("state","是否强制更新 1否,2 是"); |
| | | put("url","版本链接"); |
| | | } |
| | | |
| | | @Override |
| | | protected void initBeWrapped() { |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.dictmap; |
| | | |
| | | import com.stylefeng.guns.core.common.constant.dictmap.base.AbstractDictMap; |
| | | |
| | | /** |
| | | * 字典map |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-05-06 15:43 |
| | | */ |
| | | public class DictMap extends AbstractDictMap { |
| | | |
| | | @Override |
| | | public void init() { |
| | | put("dictId","字典名称"); |
| | | put("dictName","字典名称"); |
| | | put("dictValues","字典内容"); |
| | | } |
| | | |
| | | @Override |
| | | protected void initBeWrapped() { |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.dictmap; |
| | | |
| | | import com.stylefeng.guns.core.common.constant.dictmap.base.AbstractDictMap; |
| | | |
| | | /** |
| | | * 日志的字典 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-05-06 15:01 |
| | | */ |
| | | public class LogDict extends AbstractDictMap { |
| | | |
| | | @Override |
| | | public void init() { |
| | | put("tips","备注"); |
| | | } |
| | | |
| | | @Override |
| | | protected void initBeWrapped() { |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.dictmap; |
| | | |
| | | import com.stylefeng.guns.core.common.constant.dictmap.base.AbstractDictMap; |
| | | |
| | | /** |
| | | * 菜单的字典 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-05-06 15:01 |
| | | */ |
| | | public class MenuDict extends AbstractDictMap { |
| | | |
| | | @Override |
| | | public void init() { |
| | | put("menuId","菜单id"); |
| | | put("id","菜单id"); |
| | | put("code","菜单编号"); |
| | | put("pcode","菜单父编号"); |
| | | put("name","菜单名称"); |
| | | put("icon","菜单图标"); |
| | | put("url","url地址"); |
| | | put("num","菜单排序号"); |
| | | put("levels","菜单层级"); |
| | | put("tips","备注"); |
| | | put("status","菜单状态"); |
| | | put("isopen","是否打开"); |
| | | put("",""); |
| | | } |
| | | |
| | | @Override |
| | | protected void initBeWrapped() { |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.dictmap; |
| | | |
| | | import com.stylefeng.guns.core.common.constant.dictmap.base.AbstractDictMap; |
| | | |
| | | /** |
| | | * 通知的映射 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-05-06 15:01 |
| | | */ |
| | | public class NoticeMap extends AbstractDictMap { |
| | | |
| | | @Override |
| | | public void init() { |
| | | put("title", "标题"); |
| | | put("content", "内容"); |
| | | } |
| | | |
| | | @Override |
| | | protected void initBeWrapped() { |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.dictmap; |
| | | |
| | | import com.stylefeng.guns.core.common.constant.dictmap.base.AbstractDictMap; |
| | | |
| | | /** |
| | | * 角色的字典 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-05-06 15:01 |
| | | */ |
| | | public class RoleDict extends AbstractDictMap { |
| | | |
| | | @Override |
| | | public void init() { |
| | | put("roleId","角色名称"); |
| | | put("num","角色排序"); |
| | | put("pid","角色的父级"); |
| | | put("name","角色名称"); |
| | | put("deptid","部门名称"); |
| | | put("tips","备注"); |
| | | put("ids","资源名称"); |
| | | } |
| | | |
| | | @Override |
| | | protected void initBeWrapped() { |
| | | putFieldWrapperMethodName("pid","getSingleRoleName"); |
| | | putFieldWrapperMethodName("deptid","getDeptName"); |
| | | putFieldWrapperMethodName("roleId","getSingleRoleName"); |
| | | putFieldWrapperMethodName("ids","getMenuNames"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.dictmap; |
| | | |
| | | import com.stylefeng.guns.core.common.constant.dictmap.base.AbstractDictMap; |
| | | |
| | | /** |
| | | * 用户的字典 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-05-06 15:01 |
| | | */ |
| | | public class UserDict extends AbstractDictMap { |
| | | |
| | | @Override |
| | | public void init() { |
| | | put("userId","账号"); |
| | | put("avatar","头像"); |
| | | put("account","账号"); |
| | | put("name","名字"); |
| | | put("birthday","生日"); |
| | | put("sex","性别"); |
| | | put("email","电子邮件"); |
| | | put("phone","电话"); |
| | | put("roleid","角色名称"); |
| | | put("deptid","部门名称"); |
| | | put("roleIds","角色名称集合"); |
| | | } |
| | | |
| | | @Override |
| | | protected void initBeWrapped() { |
| | | putFieldWrapperMethodName("sex","getSexName"); |
| | | putFieldWrapperMethodName("deptid","getDeptName"); |
| | | putFieldWrapperMethodName("roleid","getSingleRoleName"); |
| | | putFieldWrapperMethodName("userId","getUserAccountById"); |
| | | putFieldWrapperMethodName("roleIds","getRoleName"); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.dictmap.base; |
| | | |
| | | import java.util.HashMap; |
| | | |
| | | /** |
| | | * 字典映射抽象类 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-05-06 14:58 |
| | | */ |
| | | public abstract class AbstractDictMap { |
| | | |
| | | protected HashMap<String, String> dictory = new HashMap<>(); |
| | | protected HashMap<String, String> fieldWarpperDictory = new HashMap<>(); |
| | | |
| | | public AbstractDictMap(){ |
| | | put("id","主键id"); |
| | | init(); |
| | | initBeWrapped(); |
| | | } |
| | | |
| | | /** |
| | | * 初始化字段英文名称和中文名称对应的字典 |
| | | * |
| | | * @author stylefeng |
| | | * @Date 2017/5/9 19:39 |
| | | */ |
| | | public abstract void init(); |
| | | |
| | | /** |
| | | * 初始化需要被包装的字段(例如:性别为1:男,2:女,需要被包装为汉字) |
| | | * |
| | | * @author stylefeng |
| | | * @Date 2017/5/9 19:35 |
| | | */ |
| | | protected abstract void initBeWrapped(); |
| | | |
| | | public String get(String key) { |
| | | return this.dictory.get(key); |
| | | } |
| | | |
| | | public void put(String key, String value) { |
| | | this.dictory.put(key, value); |
| | | } |
| | | |
| | | public String getFieldWarpperMethodName(String key){ |
| | | return this.fieldWarpperDictory.get(key); |
| | | } |
| | | |
| | | public void putFieldWrapperMethodName(String key,String methodName){ |
| | | this.fieldWarpperDictory.put(key,methodName); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.dictmap.base; |
| | | |
| | | /** |
| | | * 系统相关的字典 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-05-06 15:48 |
| | | */ |
| | | public class SystemDict extends AbstractDictMap { |
| | | |
| | | @Override |
| | | public void init() { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void initBeWrapped() { |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.dictmap.factory; |
| | | |
| | | import com.stylefeng.guns.core.common.constant.factory.ConstantFactory; |
| | | import com.stylefeng.guns.core.common.constant.factory.IConstantFactory; |
| | | import com.stylefeng.guns.core.common.exception.BizExceptionEnum; |
| | | import com.stylefeng.guns.core.exception.GunsException; |
| | | |
| | | import java.lang.reflect.Method; |
| | | |
| | | /** |
| | | * 字典字段的包装器(从ConstantFactory中获取包装值) |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-05-06 15:12 |
| | | */ |
| | | public class DictFieldWarpperFactory { |
| | | |
| | | public static Object createFieldWarpper(Object parameter, String methodName) { |
| | | IConstantFactory constantFactory = ConstantFactory.me(); |
| | | try { |
| | | Method method = IConstantFactory.class.getMethod(methodName, parameter.getClass()); |
| | | return method.invoke(constantFactory, parameter); |
| | | } catch (Exception e) { |
| | | try { |
| | | Method method = IConstantFactory.class.getMethod(methodName, Integer.class); |
| | | return method.invoke(constantFactory, Integer.parseInt(parameter.toString())); |
| | | } catch (Exception e1) { |
| | | throw new GunsException(BizExceptionEnum.ERROR_WRAPPER_FIELD); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.factory; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import org.springframework.cache.annotation.Cacheable; |
| | | import org.springframework.context.annotation.DependsOn; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.stylefeng.guns.core.common.constant.cache.Cache; |
| | | import com.stylefeng.guns.core.common.constant.cache.CacheKey; |
| | | import com.stylefeng.guns.core.common.constant.state.ManagerStatus; |
| | | import com.stylefeng.guns.core.common.constant.state.MenuStatus; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import com.stylefeng.guns.core.support.StrKit; |
| | | import com.stylefeng.guns.core.util.Convert; |
| | | import com.stylefeng.guns.core.util.SpringContextHolder; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.dao.DeptMapper; |
| | | import com.stylefeng.guns.modular.system.dao.DictMapper; |
| | | import com.stylefeng.guns.modular.system.dao.MenuMapper; |
| | | import com.stylefeng.guns.modular.system.dao.NoticeMapper; |
| | | import com.stylefeng.guns.modular.system.dao.RoleMapper; |
| | | import com.stylefeng.guns.modular.system.dao.UserMapper; |
| | | import com.stylefeng.guns.modular.system.model.Dept; |
| | | import com.stylefeng.guns.modular.system.model.Dict; |
| | | import com.stylefeng.guns.modular.system.model.Menu; |
| | | import com.stylefeng.guns.modular.system.model.Notice; |
| | | import com.stylefeng.guns.modular.system.model.Role; |
| | | import com.stylefeng.guns.modular.system.model.User; |
| | | |
| | | /** |
| | | * 常量的生产工厂 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017年2月13日 下午10:55:21 |
| | | */ |
| | | @Component |
| | | @DependsOn("springContextHolder") |
| | | public class ConstantFactory implements IConstantFactory { |
| | | |
| | | private RoleMapper roleMapper = SpringContextHolder.getBean(RoleMapper.class); |
| | | private DeptMapper deptMapper = SpringContextHolder.getBean(DeptMapper.class); |
| | | private DictMapper dictMapper = SpringContextHolder.getBean(DictMapper.class); |
| | | private UserMapper userMapper = SpringContextHolder.getBean(UserMapper.class); |
| | | private MenuMapper menuMapper = SpringContextHolder.getBean(MenuMapper.class); |
| | | private NoticeMapper noticeMapper = SpringContextHolder.getBean(NoticeMapper.class); |
| | | |
| | | public static IConstantFactory me() { |
| | | return SpringContextHolder.getBean("constantFactory"); |
| | | } |
| | | |
| | | /** |
| | | * 根据用户id获取用户名称 |
| | | * |
| | | * @author stylefeng |
| | | * @Date 2017/5/9 23:41 |
| | | */ |
| | | @Override |
| | | public String getUserNameById(Integer userId) { |
| | | User user = userMapper.selectById(userId); |
| | | if (user != null) { |
| | | return user.getName(); |
| | | } else { |
| | | return "--"; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据用户id获取用户账号 |
| | | * |
| | | * @author stylefeng |
| | | * @date 2017年5月16日21:55:371 |
| | | */ |
| | | @Override |
| | | public String getUserAccountById(Integer userId) { |
| | | User user = userMapper.selectById(userId); |
| | | if (user != null) { |
| | | return user.getAccount(); |
| | | } else { |
| | | return "--"; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 通过角色ids获取角色名称 |
| | | */ |
| | | @Override |
| | | @Cacheable(value = Cache.CONSTANT, key = "'" + CacheKey.ROLES_NAME + "'+#roleIds") |
| | | public String getRoleName(String roleIds) { |
| | | Integer[] roles = Convert.toIntArray(roleIds); |
| | | StringBuilder sb = new StringBuilder(); |
| | | for (int role : roles) { |
| | | Role roleObj = roleMapper.selectById(role); |
| | | if (ToolUtil.isNotEmpty(roleObj) && ToolUtil.isNotEmpty(roleObj.getName())) { |
| | | sb.append(roleObj.getName()).append(","); |
| | | } |
| | | } |
| | | return StrKit.removeSuffix(sb.toString(), ","); |
| | | } |
| | | |
| | | /** |
| | | * 通过角色id获取角色名称 |
| | | */ |
| | | @Override |
| | | @Cacheable(value = Cache.CONSTANT, key = "'" + CacheKey.SINGLE_ROLE_NAME + "'+#roleId") |
| | | public String getSingleRoleName(Integer roleId) { |
| | | if (0 == roleId) { |
| | | return "--"; |
| | | } |
| | | Role roleObj = roleMapper.selectById(roleId); |
| | | if (ToolUtil.isNotEmpty(roleObj) && ToolUtil.isNotEmpty(roleObj.getName())) { |
| | | return roleObj.getName(); |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | /** |
| | | * 通过角色id获取角色英文名称 |
| | | */ |
| | | @Override |
| | | @Cacheable(value = Cache.CONSTANT, key = "'" + CacheKey.SINGLE_ROLE_TIP + "'+#roleId") |
| | | public String getSingleRoleTip(Integer roleId) { |
| | | if (0 == roleId) { |
| | | return "--"; |
| | | } |
| | | Role roleObj = roleMapper.selectById(roleId); |
| | | if (ToolUtil.isNotEmpty(roleObj) && ToolUtil.isNotEmpty(roleObj.getName())) { |
| | | return roleObj.getTips(); |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | /** |
| | | * 获取部门名称 |
| | | */ |
| | | @Override |
| | | @Cacheable(value = Cache.CONSTANT, key = "'" + CacheKey.DEPT_NAME + "'+#deptId") |
| | | public String getDeptName(Integer deptId) { |
| | | Dept dept = deptMapper.selectById(deptId); |
| | | if (ToolUtil.isNotEmpty(dept) && ToolUtil.isNotEmpty(dept.getFullname())) { |
| | | return dept.getFullname(); |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | /** |
| | | * 获取菜单的名称们(多个) |
| | | */ |
| | | @Override |
| | | public String getMenuNames(String menuIds) { |
| | | Integer[] menus = Convert.toIntArray(menuIds); |
| | | StringBuilder sb = new StringBuilder(); |
| | | for (int menu : menus) { |
| | | Menu menuObj = menuMapper.selectById(menu); |
| | | if (ToolUtil.isNotEmpty(menuObj) && ToolUtil.isNotEmpty(menuObj.getName())) { |
| | | sb.append(menuObj.getName()).append(","); |
| | | } |
| | | } |
| | | return StrKit.removeSuffix(sb.toString(), ","); |
| | | } |
| | | |
| | | /** |
| | | * 获取菜单名称 |
| | | */ |
| | | @Override |
| | | public String getMenuName(Long menuId) { |
| | | if (ToolUtil.isEmpty(menuId)) { |
| | | return ""; |
| | | } else { |
| | | Menu menu = menuMapper.selectById(menuId); |
| | | if (menu == null) { |
| | | return ""; |
| | | } else { |
| | | return menu.getName(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取菜单名称通过编号 |
| | | */ |
| | | @Override |
| | | public String getMenuNameByCode(String code) { |
| | | if (ToolUtil.isEmpty(code)) { |
| | | return ""; |
| | | } else { |
| | | Menu param = new Menu(); |
| | | param.setCode(code); |
| | | Menu menu = menuMapper.selectOne(param); |
| | | if (menu == null) { |
| | | return ""; |
| | | } else { |
| | | return menu.getName(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取字典名称 |
| | | */ |
| | | @Override |
| | | public String getDictName(Integer dictId) { |
| | | if (ToolUtil.isEmpty(dictId)) { |
| | | return ""; |
| | | } else { |
| | | Dict dict = dictMapper.selectById(dictId); |
| | | if (dict == null) { |
| | | return ""; |
| | | } else { |
| | | return dict.getName(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取通知标题 |
| | | */ |
| | | @Override |
| | | public String getNoticeTitle(Integer dictId) { |
| | | if (ToolUtil.isEmpty(dictId)) { |
| | | return ""; |
| | | } else { |
| | | Notice notice = noticeMapper.selectById(dictId); |
| | | if (notice == null) { |
| | | return ""; |
| | | } else { |
| | | return notice.getTitle(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 根据字典名称和字典中的值获取对应的名称 |
| | | */ |
| | | @Override |
| | | public String getDictsByName(String name, Integer val) { |
| | | Dict temp = new Dict(); |
| | | temp.setName(name); |
| | | Dict dict = dictMapper.selectOne(temp); |
| | | if (dict == null) { |
| | | return ""; |
| | | } else { |
| | | Wrapper<Dict> wrapper = new EntityWrapper<>(); |
| | | wrapper = wrapper.eq("pid", dict.getId()); |
| | | List<Dict> dicts = dictMapper.selectList(wrapper); |
| | | for (Dict item : dicts) { |
| | | if (item.getNum() != null && item.getNum().equals(val)) { |
| | | return item.getName(); |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取性别名称 |
| | | */ |
| | | @Override |
| | | public String getSexName(Integer sex) { |
| | | return getDictsByName("性别", sex); |
| | | } |
| | | |
| | | /** |
| | | * 获取用户登录状态 |
| | | */ |
| | | @Override |
| | | public String getStatusName(Integer status) { |
| | | return ManagerStatus.valueOf(status); |
| | | } |
| | | |
| | | /** |
| | | * 获取菜单状态 |
| | | */ |
| | | @Override |
| | | public String getMenuStatusName(Integer status) { |
| | | return MenuStatus.valueOf(status); |
| | | } |
| | | |
| | | /** |
| | | * 查询字典 |
| | | */ |
| | | @Override |
| | | public List<Dict> findInDict(Integer id) { |
| | | if (ToolUtil.isEmpty(id)) { |
| | | return null; |
| | | } else { |
| | | EntityWrapper<Dict> wrapper = new EntityWrapper<>(); |
| | | List<Dict> dicts = dictMapper.selectList(wrapper.eq("pid", id)); |
| | | if (dicts == null || dicts.size() == 0) { |
| | | return null; |
| | | } else { |
| | | return dicts; |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取被缓存的对象(用户删除业务) |
| | | */ |
| | | @Override |
| | | public String getCacheObject(String para) { |
| | | return LogObjectHolder.me().get().toString(); |
| | | } |
| | | |
| | | /** |
| | | * 获取子部门id |
| | | */ |
| | | @Override |
| | | public List<Integer> getSubDeptId(Integer deptid) { |
| | | Wrapper<Dept> wrapper = new EntityWrapper<>(); |
| | | wrapper = wrapper.like("pids", "%[" + deptid + "]%"); |
| | | List<Dept> depts = this.deptMapper.selectList(wrapper); |
| | | |
| | | ArrayList<Integer> deptids = new ArrayList<>(); |
| | | |
| | | if(depts != null && depts.size() > 0){ |
| | | for (Dept dept : depts) { |
| | | deptids.add(dept.getId()); |
| | | } |
| | | } |
| | | |
| | | return deptids; |
| | | } |
| | | |
| | | /** |
| | | * 获取所有父部门id |
| | | */ |
| | | @Override |
| | | public List<Integer> getParentDeptIds(Integer deptid) { |
| | | Dept dept = deptMapper.selectById(deptid); |
| | | String pids = dept.getPids(); |
| | | String[] split = pids.split(","); |
| | | ArrayList<Integer> parentDeptIds = new ArrayList<>(); |
| | | for (String s : split) { |
| | | parentDeptIds.add(Integer.valueOf(StrKit.removeSuffix(StrKit.removePrefix(s, "["), "]"))); |
| | | } |
| | | return parentDeptIds; |
| | | } |
| | | |
| | | /** |
| | | * 根据用户Id获取用户昵称 |
| | | */ |
| | | @Override |
| | | public String getTUserNickNameById(Integer userId) { |
| | | /* TUser user = tUserMapper.selectById(userId); |
| | | if (user != null) { |
| | | return user.getNickName(); |
| | | } else { |
| | | return "--"; |
| | | }*/ |
| | | return "--"; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.factory; |
| | | |
| | | import com.stylefeng.guns.modular.system.model.Dict; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 常量生产工厂的接口 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-06-14 21:12 |
| | | */ |
| | | public interface IConstantFactory { |
| | | |
| | | /** |
| | | * 根据用户id获取用户名称 |
| | | * |
| | | * @author stylefeng |
| | | * @Date 2017/5/9 23:41 |
| | | */ |
| | | String getUserNameById(Integer userId); |
| | | |
| | | /** |
| | | * 根据用户id获取用户账号 |
| | | * |
| | | * @author stylefeng |
| | | * @date 2017年5月16日21:55:371 |
| | | */ |
| | | String getUserAccountById(Integer userId); |
| | | |
| | | /** |
| | | * 通过角色ids获取角色名称 |
| | | */ |
| | | String getRoleName(String roleIds); |
| | | |
| | | /** |
| | | * 通过角色id获取角色名称 |
| | | */ |
| | | String getSingleRoleName(Integer roleId); |
| | | |
| | | /** |
| | | * 通过角色id获取角色英文名称 |
| | | */ |
| | | String getSingleRoleTip(Integer roleId); |
| | | |
| | | /** |
| | | * 获取部门名称 |
| | | */ |
| | | String getDeptName(Integer deptId); |
| | | |
| | | /** |
| | | * 获取菜单的名称们(多个) |
| | | */ |
| | | String getMenuNames(String menuIds); |
| | | |
| | | /** |
| | | * 获取菜单名称 |
| | | */ |
| | | String getMenuName(Long menuId); |
| | | |
| | | /** |
| | | * 获取菜单名称通过编号 |
| | | */ |
| | | String getMenuNameByCode(String code); |
| | | |
| | | /** |
| | | * 获取字典名称 |
| | | */ |
| | | String getDictName(Integer dictId); |
| | | |
| | | /** |
| | | * 获取通知标题 |
| | | */ |
| | | String getNoticeTitle(Integer dictId); |
| | | |
| | | /** |
| | | * 根据字典名称和字典中的值获取对应的名称 |
| | | */ |
| | | String getDictsByName(String name, Integer val); |
| | | |
| | | /** |
| | | * 获取性别名称 |
| | | */ |
| | | String getSexName(Integer sex); |
| | | |
| | | /** |
| | | * 获取用户登录状态 |
| | | */ |
| | | String getStatusName(Integer status); |
| | | |
| | | /** |
| | | * 获取菜单状态 |
| | | */ |
| | | String getMenuStatusName(Integer status); |
| | | |
| | | /** |
| | | * 查询字典 |
| | | */ |
| | | List<Dict> findInDict(Integer id); |
| | | |
| | | /** |
| | | * 获取被缓存的对象(用户删除业务) |
| | | */ |
| | | String getCacheObject(String para); |
| | | |
| | | /** |
| | | * 获取子部门id |
| | | */ |
| | | List<Integer> getSubDeptId(Integer deptid); |
| | | |
| | | /** |
| | | * 获取所有父部门id |
| | | */ |
| | | List<Integer> getParentDeptIds(Integer deptid); |
| | | |
| | | /** |
| | | * 根据用户Id获取用户昵称 |
| | | */ |
| | | String getTUserNickNameById(Integer userId); |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.factory; |
| | | |
| | | import com.stylefeng.guns.core.support.StrKit; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 组合字符串生产者 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-04-27 16:42 |
| | | */ |
| | | public class MutiStrFactory { |
| | | |
| | | /** |
| | | * 每个条目之间的分隔符 |
| | | */ |
| | | public static final String ITEM_SPLIT = ";"; |
| | | |
| | | /** |
| | | * 属性之间的分隔符 |
| | | */ |
| | | public static final String ATTR_SPLIT = ":"; |
| | | |
| | | /** |
| | | * 拼接字符串的id |
| | | */ |
| | | public static final String MUTI_STR_ID = "ID"; |
| | | |
| | | /** |
| | | * 拼接字符串的CODE |
| | | */ |
| | | public static final String MUTI_STR_CODE = "CODE"; |
| | | |
| | | /** |
| | | * 拼接字符串的NAME |
| | | */ |
| | | public static final String MUTI_STR_NAME = "NAME"; |
| | | |
| | | /** |
| | | * 拼接字符串的NUM |
| | | */ |
| | | public static final String MUTI_STR_NUM = "NUM"; |
| | | |
| | | /** |
| | | * 解析一个组合字符串(例如: "1:启用;2:禁用;3:冻结" 这样的字符串) |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2017/4/27 16:44 |
| | | */ |
| | | public static List<Map<String,String>> parseKeyValue(String mutiString){ |
| | | if(ToolUtil.isEmpty(mutiString)){ |
| | | return new ArrayList<>(); |
| | | }else{ |
| | | ArrayList<Map<String,String>> results = new ArrayList<>(); |
| | | String[] items = StrKit.split(StrKit.removeSuffix(mutiString, ITEM_SPLIT), ITEM_SPLIT); |
| | | for (String item : items) { |
| | | String[] attrs = item.split(ATTR_SPLIT); |
| | | HashMap<String, String> itemMap = new HashMap<>(); |
| | | itemMap.put(MUTI_STR_CODE,attrs[0]); |
| | | itemMap.put(MUTI_STR_NAME,attrs[1]); |
| | | itemMap.put(MUTI_STR_NUM,attrs[2]); |
| | | results.add(itemMap); |
| | | } |
| | | return results; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 解析id:key:value这样类型的字符串 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2017/4/28 11:06 |
| | | */ |
| | | public static List<Map<String,String>> parseIdKeyValue(String mutiString){ |
| | | if(ToolUtil.isEmpty(mutiString)){ |
| | | return new ArrayList<>(); |
| | | }else{ |
| | | ArrayList<Map<String,String>> results = new ArrayList<>(); |
| | | String[] items = StrKit.split(StrKit.removeSuffix(mutiString, ITEM_SPLIT), ITEM_SPLIT); |
| | | for (String item : items) { |
| | | String[] attrs = item.split(ATTR_SPLIT); |
| | | HashMap<String, String> itemMap = new HashMap<>(); |
| | | itemMap.put(MUTI_STR_CODE,attrs[0]); |
| | | itemMap.put(MUTI_STR_NAME,attrs[1]); |
| | | itemMap.put(MUTI_STR_NUM,attrs[2]); |
| | | results.add(itemMap); |
| | | } |
| | | return results; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.factory; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.common.constant.state.Order; |
| | | import com.stylefeng.guns.core.support.HttpKit; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | | * BootStrap Table默认的分页参数创建 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-04-05 22:25 |
| | | */ |
| | | public class PageFactory<T> { |
| | | |
| | | public Page<T> defaultPage() { |
| | | HttpServletRequest request = HttpKit.getRequest(); |
| | | int limit = Integer.valueOf(request.getParameter("limit")); //每页多少条数据 |
| | | int offset = Integer.valueOf(request.getParameter("offset")); //每页的偏移量(本页当前有多少条) |
| | | String sort = request.getParameter("sort"); //排序字段名称 |
| | | String order = request.getParameter("order"); //asc或desc(升序或降序) |
| | | if (ToolUtil.isEmpty(sort)) { |
| | | Page<T> page = new Page<>((offset / limit + 1), limit); |
| | | page.setOpenSort(false); |
| | | return page; |
| | | } else { |
| | | Page<T> page = new Page<>((offset / limit + 1), limit, sort); |
| | | if (Order.ASC.getDes().equals(order)) { |
| | | page.setAsc(true); |
| | | } else { |
| | | page.setAsc(false); |
| | | } |
| | | return page; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.state; |
| | | |
| | | /** |
| | | * 业务日志类型 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2017年1月22日 下午12:14:59 |
| | | */ |
| | | public enum BizLogType { |
| | | |
| | | ALL(0, null),//全部日志 |
| | | BUSSINESS(1, "业务日志"), |
| | | EXCEPTION(2, "异常日志"); |
| | | |
| | | Integer val; |
| | | String message; |
| | | |
| | | BizLogType(Integer val, String message) { |
| | | this.val = val; |
| | | this.message = message; |
| | | } |
| | | |
| | | public String getMessage() { |
| | | return message; |
| | | } |
| | | |
| | | public void setMessage(String message) { |
| | | this.message = message; |
| | | } |
| | | |
| | | public Integer getVal() { |
| | | return val; |
| | | } |
| | | |
| | | public void setVal(Integer val) { |
| | | this.val = val; |
| | | } |
| | | |
| | | public static String valueOf(Integer value) { |
| | | if (value == null) { |
| | | return null; |
| | | } else { |
| | | for (BizLogType bizLogType : BizLogType.values()) { |
| | | if (bizLogType.getVal().equals(value)) { |
| | | return bizLogType.getMessage(); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.state; |
| | | |
| | | /** |
| | | * 是否是菜单的枚举 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017年6月1日22:50:11 |
| | | */ |
| | | public enum ExpenseState { |
| | | |
| | | SUBMITING(1, "待提交"), |
| | | CHECKING(2, "待审核"), |
| | | PASS(3, "审核通过"), |
| | | UN_PASS(4, "未通过"); |
| | | |
| | | int code; |
| | | String message; |
| | | |
| | | ExpenseState(int code, String message) { |
| | | this.code = code; |
| | | this.message = message; |
| | | } |
| | | |
| | | public int getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(int code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getMessage() { |
| | | return message; |
| | | } |
| | | |
| | | public void setMessage(String message) { |
| | | this.message = message; |
| | | } |
| | | |
| | | public static String valueOf(Integer status) { |
| | | if (status == null) { |
| | | return ""; |
| | | } else { |
| | | for (ExpenseState s : ExpenseState.values()) { |
| | | if (s.getCode() == status) { |
| | | return s.getMessage(); |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.state; |
| | | |
| | | /** |
| | | * 业务是否成功的日志记录 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2017年1月22日 下午12:14:59 |
| | | */ |
| | | public enum LogSucceed { |
| | | |
| | | SUCCESS("成功"), |
| | | FAIL("失败"); |
| | | |
| | | String message; |
| | | |
| | | LogSucceed(String message) { |
| | | this.message = message; |
| | | } |
| | | |
| | | public String getMessage() { |
| | | return message; |
| | | } |
| | | |
| | | public void setMessage(String message) { |
| | | this.message = message; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.state; |
| | | |
| | | /** |
| | | * 日志类型 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2017年1月22日 下午12:14:59 |
| | | */ |
| | | public enum LogType { |
| | | |
| | | LOGIN("登录日志"), |
| | | LOGIN_FAIL("登录失败日志"), |
| | | EXIT("退出日志"), |
| | | EXCEPTION("异常日志"), |
| | | BUSSINESS("业务日志"); |
| | | |
| | | String message; |
| | | |
| | | LogType(String message) { |
| | | this.message = message; |
| | | } |
| | | |
| | | public String getMessage() { |
| | | return message; |
| | | } |
| | | |
| | | public void setMessage(String message) { |
| | | this.message = message; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.state; |
| | | |
| | | /** |
| | | * 管理员的状态 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2017年1月10日 下午9:54:13 |
| | | */ |
| | | public enum ManagerStatus { |
| | | |
| | | OK(1, "启用"), FREEZED(2, "冻结"), DELETED(3, "被删除"); |
| | | |
| | | int code; |
| | | String message; |
| | | |
| | | ManagerStatus(int code, String message) { |
| | | this.code = code; |
| | | this.message = message; |
| | | } |
| | | |
| | | public int getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(int code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getMessage() { |
| | | return message; |
| | | } |
| | | |
| | | public void setMessage(String message) { |
| | | this.message = message; |
| | | } |
| | | |
| | | public static String valueOf(Integer value) { |
| | | if (value == null) { |
| | | return ""; |
| | | } else { |
| | | for (ManagerStatus ms : ManagerStatus.values()) { |
| | | if (ms.getCode() == value) { |
| | | return ms.getMessage(); |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.state; |
| | | |
| | | /** |
| | | * 菜单是否打开的状态 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2017年4月8日10:12:15 |
| | | */ |
| | | public enum MenuOpenStatus { |
| | | |
| | | OPEN(1, "打开"), |
| | | CLOSE(0, "关闭"); |
| | | |
| | | int code; |
| | | String message; |
| | | |
| | | MenuOpenStatus(int code, String message) { |
| | | this.code = code; |
| | | this.message = message; |
| | | } |
| | | |
| | | public int getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(int code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getMessage() { |
| | | return message; |
| | | } |
| | | |
| | | public void setMessage(String message) { |
| | | this.message = message; |
| | | } |
| | | |
| | | public static String valueOf(Integer status) { |
| | | if (status == null) { |
| | | return ""; |
| | | } else { |
| | | for (MenuOpenStatus s : MenuOpenStatus.values()) { |
| | | if (s.getCode() == status) { |
| | | return s.getMessage(); |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.state; |
| | | |
| | | /** |
| | | * 菜单的状态 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2017年1月22日 下午12:14:59 |
| | | */ |
| | | public enum MenuStatus { |
| | | |
| | | ENABLE(1, "启用"), |
| | | DISABLE(0, "禁用"); |
| | | |
| | | int code; |
| | | String message; |
| | | |
| | | MenuStatus(int code, String message) { |
| | | this.code = code; |
| | | this.message = message; |
| | | } |
| | | |
| | | public int getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(int code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getMessage() { |
| | | return message; |
| | | } |
| | | |
| | | public void setMessage(String message) { |
| | | this.message = message; |
| | | } |
| | | |
| | | public static String valueOf(Integer status) { |
| | | if (status == null) { |
| | | return ""; |
| | | } else { |
| | | for (MenuStatus s : MenuStatus.values()) { |
| | | if (s.getCode() == status) { |
| | | return s.getMessage(); |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.constant.state; |
| | | |
| | | /** |
| | | * 数据库排序 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2017年5月31日20:48:41 |
| | | */ |
| | | public enum Order { |
| | | |
| | | ASC("asc"), DESC("desc"); |
| | | |
| | | private String des; |
| | | |
| | | Order(String des) { |
| | | this.des = des; |
| | | } |
| | | |
| | | public String getDes() { |
| | | return des; |
| | | } |
| | | |
| | | public void setDes(String des) { |
| | | this.des = des; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.exception; |
| | | |
| | | import com.stylefeng.guns.core.exception.ServiceExceptionEnum; |
| | | |
| | | /** |
| | | * @author fengshuonan |
| | | * @Description 所有业务异常的枚举 |
| | | * @date 2016年11月12日 下午5:04:51 |
| | | */ |
| | | public enum BizExceptionEnum implements ServiceExceptionEnum { |
| | | |
| | | /** |
| | | * 字典 |
| | | */ |
| | | DICT_EXISTED(400, "字典已经存在"), |
| | | ERROR_CREATE_DICT(500, "创建字典失败"), |
| | | ERROR_WRAPPER_FIELD(500, "包装字典属性失败"), |
| | | ERROR_CODE_EMPTY(500, "字典类型不能为空"), |
| | | |
| | | /** |
| | | * 文件上传 |
| | | */ |
| | | FILE_READING_ERROR(400, "FILE_READING_ERROR!"), |
| | | FILE_NOT_FOUND(400, "FILE_NOT_FOUND!"), |
| | | UPLOAD_ERROR(500, "上传图片出错"), |
| | | |
| | | /** |
| | | * 权限和数据问题 |
| | | */ |
| | | DB_RESOURCE_NULL(400, "数据库中没有该资源"), |
| | | NO_PERMITION(405, "权限异常"), |
| | | REQUEST_INVALIDATE(400, "请求数据格式不正确"), |
| | | INVALID_KAPTCHA(400, "验证码不正确"), |
| | | CANT_DELETE_ADMIN(600, "不能删除超级管理员"), |
| | | CANT_FREEZE_ADMIN(600, "不能冻结超级管理员"), |
| | | CANT_CHANGE_ADMIN(600, "不能修改超级管理员角色"), |
| | | |
| | | /** |
| | | * 账户问题 |
| | | */ |
| | | USER_ALREADY_REG(401, "该用户已经注册"), |
| | | NO_THIS_USER(400, "没有此用户"), |
| | | USER_NOT_EXISTED(400, "没有此用户"), |
| | | ACCOUNT_FREEZED(401, "账号被冻结"), |
| | | OLD_PWD_NOT_RIGHT(402, "原密码不正确"), |
| | | TWO_PWD_NOT_MATCH(405, "两次输入密码不一致"), |
| | | |
| | | /** |
| | | * 错误的请求 |
| | | */ |
| | | MENU_PCODE_COINCIDENCE(400, "菜单编号和副编号不能一致"), |
| | | EXISTED_THE_MENU(400, "菜单编号重复,不能添加"), |
| | | DICT_MUST_BE_NUMBER(400, "字典的值必须为数字"), |
| | | REQUEST_NULL(400, "请求有错误"), |
| | | SESSION_TIMEOUT(400, "会话超时"), |
| | | SERVER_ERROR(500, "服务器异常"), |
| | | |
| | | /** |
| | | * token异常 |
| | | */ |
| | | TOKEN_EXPIRED(700, "token过期"), |
| | | TOKEN_ERROR(700, "token验证失败"), |
| | | |
| | | /** |
| | | * 签名异常 |
| | | */ |
| | | SIGN_ERROR(700, "签名验证失败"), |
| | | |
| | | /** |
| | | * 其他 |
| | | */ |
| | | AUTH_REQUEST_ERROR(400, "账号密码错误"); |
| | | |
| | | BizExceptionEnum(int code, String message) { |
| | | this.code = code; |
| | | this.message = message; |
| | | } |
| | | |
| | | private Integer code; |
| | | |
| | | private String message; |
| | | |
| | | @Override |
| | | public Integer getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(Integer code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | @Override |
| | | public String getMessage() { |
| | | return message; |
| | | } |
| | | |
| | | public void setMessage(String message) { |
| | | this.message = message; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.common.exception; |
| | | |
| | | /** |
| | | * 验证码错误异常 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-05-05 23:52 |
| | | */ |
| | | public class InvalidKaptchaException extends RuntimeException { |
| | | } |
New file |
| | |
| | | /* |
| | | * Licensed to the Apache Software Foundation (ASF) under one |
| | | * or more contributor license agreements. See the NOTICE file |
| | | * distributed with this work for additional information |
| | | * regarding copyright ownership. The ASF licenses this file |
| | | * to you under the Apache License, Version 2.0 (the |
| | | * "License"); you may not use this file except in compliance |
| | | * with the License. You may obtain a copy of the License at |
| | | * |
| | | * http://www.apache.org/licenses/LICENSE-2.0 |
| | | * |
| | | * Unless required by applicable law or agreed to in writing, |
| | | * software distributed under the License is distributed on an |
| | | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| | | * KIND, either express or implied. See the License for the |
| | | * specific language governing permissions and limitations |
| | | * under the License. |
| | | */ |
| | | package com.stylefeng.guns.core.intercept; |
| | | |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import org.apache.shiro.subject.Subject; |
| | | import org.apache.shiro.web.filter.AccessControlFilter; |
| | | import org.apache.shiro.web.util.WebUtils; |
| | | |
| | | import javax.servlet.ServletRequest; |
| | | import javax.servlet.ServletResponse; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * Filter that allows access to resources if the accessor is a known user, which is defined as |
| | | * having a known principal. This means that any user who is authenticated or remembered via a |
| | | * 'remember me' feature will be allowed access from this filter. |
| | | * <p/> |
| | | * If the accessor is not a known user, then they will be redirected to the {@link #setLoginUrl(String) loginUrl}</p> |
| | | * |
| | | * @since 0.9 |
| | | */ |
| | | public class GunsUserFilter extends AccessControlFilter { |
| | | |
| | | /** |
| | | * Returns <code>true</code> if the request is a |
| | | * {@link #isLoginRequest(javax.servlet.ServletRequest, javax.servlet.ServletResponse) loginRequest} or |
| | | * if the current {@link #getSubject(javax.servlet.ServletRequest, javax.servlet.ServletResponse) subject} |
| | | * is not <code>null</code>, <code>false</code> otherwise. |
| | | * |
| | | * @return <code>true</code> if the request is a |
| | | * {@link #isLoginRequest(javax.servlet.ServletRequest, javax.servlet.ServletResponse) loginRequest} or |
| | | * if the current {@link #getSubject(javax.servlet.ServletRequest, javax.servlet.ServletResponse) subject} |
| | | * is not <code>null</code>, <code>false</code> otherwise. |
| | | */ |
| | | protected boolean isAccessAllowed(ServletRequest request, ServletResponse response, Object mappedValue) { |
| | | if (isLoginRequest(request, response)) { |
| | | return true; |
| | | } else { |
| | | Subject subject = getSubject(request, response); |
| | | // If principal is not null, then the user is known and should be allowed access. |
| | | return subject.getPrincipal() != null; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * This default implementation simply calls |
| | | * {@link #saveRequestAndRedirectToLogin(javax.servlet.ServletRequest, javax.servlet.ServletResponse) saveRequestAndRedirectToLogin} |
| | | * and then immediately returns <code>false</code>, thereby preventing the chain from continuing so the redirect may |
| | | * execute. |
| | | */ |
| | | protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception { |
| | | HttpServletRequest httpServletRequest = WebUtils.toHttp(request); |
| | | HttpServletResponse httpServletResponse = WebUtils.toHttp(response); |
| | | |
| | | /** |
| | | * 如果是ajax请求则不进行跳转 |
| | | */ |
| | | if (httpServletRequest.getHeader("x-requested-with") != null |
| | | && httpServletRequest.getHeader("x-requested-with").equalsIgnoreCase("XMLHttpRequest")) { |
| | | httpServletResponse.setHeader("sessionstatus", "timeout"); |
| | | return false; |
| | | } else { |
| | | |
| | | /** |
| | | * 第一次点击页面 |
| | | */ |
| | | String referer = httpServletRequest.getHeader("Referer"); |
| | | if (referer == null) { |
| | | saveRequestAndRedirectToLogin(request, response); |
| | | return false; |
| | | } else { |
| | | |
| | | /** |
| | | * 从别的页面跳转过来的 |
| | | */ |
| | | if (ShiroKit.getSession().getAttribute("sessionFlag") == null) { |
| | | httpServletRequest.setAttribute("tips", "请重新登录"); |
| | | httpServletRequest.getRequestDispatcher("/login").forward(request, response); |
| | | return false; |
| | | } else { |
| | | saveRequestAndRedirectToLogin(request, response); |
| | | return false; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.intercept; |
| | | |
| | | import com.stylefeng.guns.core.base.tips.ErrorTip; |
| | | import com.stylefeng.guns.core.common.constant.JwtConstants; |
| | | import com.stylefeng.guns.core.common.exception.BizExceptionEnum; |
| | | import com.stylefeng.guns.core.util.JwtTokenUtil; |
| | | import com.stylefeng.guns.core.util.RenderUtil; |
| | | import io.jsonwebtoken.JwtException; |
| | | import org.springframework.web.method.HandlerMethod; |
| | | import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | |
| | | /** |
| | | * Rest Api接口鉴权 |
| | | * |
| | | * @author stylefeng |
| | | * @Date 2018/7/20 23:11 |
| | | */ |
| | | public class RestApiInteceptor extends HandlerInterceptorAdapter { |
| | | |
| | | @Override |
| | | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { |
| | | if (handler instanceof org.springframework.web.servlet.resource.ResourceHttpRequestHandler) { |
| | | return true; |
| | | } |
| | | HandlerMethod handlerMethod = (HandlerMethod) handler; |
| | | return check(request, response, handlerMethod); |
| | | } |
| | | |
| | | private boolean check(HttpServletRequest request, HttpServletResponse response, HandlerMethod handlerMethod) { |
| | | if (request.getServletPath().equals(JwtConstants.AUTH_PATH)) { |
| | | return true; |
| | | } |
| | | final String requestHeader = request.getHeader(JwtConstants.AUTH_HEADER); |
| | | String authToken; |
| | | if (requestHeader != null && requestHeader.startsWith("Bearer ")) { |
| | | authToken = requestHeader.substring(7); |
| | | |
| | | //验证token是否过期,包含了验证jwt是否正确 |
| | | try { |
| | | boolean flag = JwtTokenUtil.isTokenExpired(authToken); |
| | | if (flag) { |
| | | RenderUtil.renderJson(response, new ErrorTip(BizExceptionEnum.TOKEN_EXPIRED.getCode(), BizExceptionEnum.TOKEN_EXPIRED.getMessage())); |
| | | return false; |
| | | } |
| | | } catch (JwtException e) { |
| | | //有异常就是token解析失败 |
| | | RenderUtil.renderJson(response, new ErrorTip(BizExceptionEnum.TOKEN_ERROR.getCode(), BizExceptionEnum.TOKEN_ERROR.getMessage())); |
| | | return false; |
| | | } |
| | | } else { |
| | | //header没有带Bearer字段 |
| | | RenderUtil.renderJson(response, new ErrorTip(BizExceptionEnum.TOKEN_ERROR.getCode(), BizExceptionEnum.TOKEN_ERROR.getMessage())); |
| | | return false; |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.intercept; |
| | | |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.util.HttpSessionHolder; |
| | | import org.aspectj.lang.ProceedingJoinPoint; |
| | | import org.aspectj.lang.annotation.Around; |
| | | import org.aspectj.lang.annotation.Aspect; |
| | | import org.aspectj.lang.annotation.Pointcut; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 静态调用session的拦截器 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2016年11月13日 下午10:15:42 |
| | | */ |
| | | @Aspect |
| | | @Component |
| | | public class SessionHolderInterceptor extends BaseController { |
| | | |
| | | @Pointcut("execution(* com.stylefeng.guns.*..controller.*.*(..))") |
| | | public void cutService() { |
| | | } |
| | | |
| | | @Around("cutService()") |
| | | public Object sessionKit(ProceedingJoinPoint point) throws Throwable { |
| | | HttpSessionHolder.put(super.getHttpServletRequest().getSession()); |
| | | try { |
| | | return point.proceed(); |
| | | } finally { |
| | | HttpSessionHolder.remove(); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | /** |
| | | * Copyright (c) 2015-2017, Chill Zhuang 庄骞 (smallchill@163.com). |
| | | * <p> |
| | | * Licensed under the Apache License, Version 2.0 (the "License"); |
| | | * you may not use this file except in compliance with the License. |
| | | * You may obtain a copy of the License at |
| | | * <p> |
| | | * http://www.apache.org/licenses/LICENSE-2.0 |
| | | * <p> |
| | | * Unless required by applicable law or agreed to in writing, software |
| | | * distributed under the License is distributed on an "AS IS" BASIS, |
| | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| | | * See the License for the specific language governing permissions and |
| | | * limitations under the License. |
| | | */ |
| | | package com.stylefeng.guns.core.listener; |
| | | |
| | | import javax.servlet.ServletContext; |
| | | import javax.servlet.ServletContextEvent; |
| | | import javax.servlet.ServletContextListener; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * ServletContext监听器 |
| | | * |
| | | * @author stylefeng |
| | | * @Date 2018/2/22 21:07 |
| | | */ |
| | | public class ConfigListener implements ServletContextListener { |
| | | |
| | | private static Map<String, String> conf = new HashMap<>(); |
| | | |
| | | public static Map<String, String> getConf() { |
| | | return conf; |
| | | } |
| | | |
| | | @Override |
| | | public void contextDestroyed(ServletContextEvent arg0) { |
| | | conf.clear(); |
| | | } |
| | | |
| | | @Override |
| | | public void contextInitialized(ServletContextEvent evt) { |
| | | ServletContext sc = evt.getServletContext(); |
| | | |
| | | //项目发布,当前运行环境的绝对路径 |
| | | conf.put("realPath", sc.getRealPath("/").replaceFirst("/", "")); |
| | | |
| | | //servletContextPath,默认"" |
| | | conf.put("contextPath", sc.getContextPath()); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.log; |
| | | |
| | | import java.util.TimerTask; |
| | | import java.util.concurrent.ScheduledThreadPoolExecutor; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * 日志管理器 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-03-30 16:29 |
| | | */ |
| | | public class LogManager { |
| | | |
| | | //日志记录操作延时 |
| | | private final int OPERATE_DELAY_TIME = 10; |
| | | |
| | | //异步操作记录日志的线程池 |
| | | private ScheduledThreadPoolExecutor executor = new ScheduledThreadPoolExecutor(10); |
| | | |
| | | private LogManager() { |
| | | } |
| | | |
| | | public static LogManager logManager = new LogManager(); |
| | | |
| | | public static LogManager me() { |
| | | return logManager; |
| | | } |
| | | |
| | | public void executeLog(TimerTask task) { |
| | | executor.schedule(task, OPERATE_DELAY_TIME, TimeUnit.MILLISECONDS); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.log; |
| | | |
| | | import com.stylefeng.guns.core.util.SpringContextHolder; |
| | | import org.springframework.context.annotation.Scope; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.context.WebApplicationContext; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 被修改的bean临时存放的地方 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-03-31 11:19 |
| | | */ |
| | | @Component |
| | | @Scope(scopeName = WebApplicationContext.SCOPE_SESSION) |
| | | public class LogObjectHolder implements Serializable{ |
| | | |
| | | private Object object = null; |
| | | |
| | | public void set(Object obj) { |
| | | this.object = obj; |
| | | } |
| | | |
| | | public Object get() { |
| | | return object; |
| | | } |
| | | |
| | | public static LogObjectHolder me(){ |
| | | LogObjectHolder bean = SpringContextHolder.getBean(LogObjectHolder.class); |
| | | return bean; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.log.factory; |
| | | |
| | | import com.stylefeng.guns.core.common.constant.state.LogSucceed; |
| | | import com.stylefeng.guns.core.common.constant.state.LogType; |
| | | import com.stylefeng.guns.modular.system.model.LoginLog; |
| | | import com.stylefeng.guns.modular.system.model.OperationLog; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 日志对象创建工厂 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2016年12月6日 下午9:18:27 |
| | | */ |
| | | public class LogFactory { |
| | | |
| | | /** |
| | | * 创建操作日志 |
| | | */ |
| | | public static OperationLog createOperationLog(LogType logType, Integer userId, String bussinessName, String clazzName, String methodName, String msg, LogSucceed succeed) { |
| | | OperationLog operationLog = new OperationLog(); |
| | | operationLog.setLogtype(logType.getMessage()); |
| | | operationLog.setLogname(bussinessName); |
| | | operationLog.setUserid(userId); |
| | | operationLog.setClassname(clazzName); |
| | | operationLog.setMethod(methodName); |
| | | operationLog.setCreatetime(new Date()); |
| | | operationLog.setSucceed(succeed.getMessage()); |
| | | operationLog.setMessage(msg); |
| | | return operationLog; |
| | | } |
| | | |
| | | /** |
| | | * 创建登录日志 |
| | | */ |
| | | public static LoginLog createLoginLog(LogType logType, Integer userId, String msg, String ip) { |
| | | LoginLog loginLog = new LoginLog(); |
| | | loginLog.setLogname(logType.getMessage()); |
| | | loginLog.setUserid(userId); |
| | | loginLog.setCreatetime(new Date()); |
| | | loginLog.setSucceed(LogSucceed.SUCCESS.getMessage()); |
| | | loginLog.setIp(ip); |
| | | loginLog.setMessage(msg); |
| | | return loginLog; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.log.factory; |
| | | |
| | | import com.stylefeng.guns.core.common.constant.state.LogSucceed; |
| | | import com.stylefeng.guns.core.common.constant.state.LogType; |
| | | import com.stylefeng.guns.modular.system.dao.LoginLogMapper; |
| | | import com.stylefeng.guns.modular.system.dao.OperationLogMapper; |
| | | import com.stylefeng.guns.modular.system.model.LoginLog; |
| | | import com.stylefeng.guns.modular.system.model.OperationLog; |
| | | import com.stylefeng.guns.core.db.Db; |
| | | import com.stylefeng.guns.core.log.LogManager; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import java.util.TimerTask; |
| | | |
| | | /** |
| | | * 日志操作任务创建工厂 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2016年12月6日 下午9:18:27 |
| | | */ |
| | | public class LogTaskFactory { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(LogManager.class); |
| | | private static LoginLogMapper loginLogMapper = Db.getMapper(LoginLogMapper.class); |
| | | private static OperationLogMapper operationLogMapper = Db.getMapper(OperationLogMapper.class); |
| | | |
| | | public static TimerTask loginLog(final Integer userId, final String ip) { |
| | | return new TimerTask() { |
| | | @Override |
| | | public void run() { |
| | | try { |
| | | LoginLog loginLog = LogFactory.createLoginLog(LogType.LOGIN, userId, null, ip); |
| | | loginLogMapper.insert(loginLog); |
| | | } catch (Exception e) { |
| | | logger.error("创建登录日志异常!", e); |
| | | } |
| | | } |
| | | }; |
| | | } |
| | | |
| | | public static TimerTask loginLog(final String username, final String msg, final String ip) { |
| | | return new TimerTask() { |
| | | @Override |
| | | public void run() { |
| | | LoginLog loginLog = LogFactory.createLoginLog( |
| | | LogType.LOGIN_FAIL, null, "账号:" + username + "," + msg, ip); |
| | | try { |
| | | loginLogMapper.insert(loginLog); |
| | | } catch (Exception e) { |
| | | logger.error("创建登录失败异常!", e); |
| | | } |
| | | } |
| | | }; |
| | | } |
| | | |
| | | public static TimerTask exitLog(final Integer userId, final String ip) { |
| | | return new TimerTask() { |
| | | @Override |
| | | public void run() { |
| | | LoginLog loginLog = LogFactory.createLoginLog(LogType.EXIT, userId, null,ip); |
| | | try { |
| | | loginLogMapper.insert(loginLog); |
| | | } catch (Exception e) { |
| | | logger.error("创建退出日志异常!", e); |
| | | } |
| | | } |
| | | }; |
| | | } |
| | | |
| | | public static TimerTask bussinessLog(final Integer userId, final String bussinessName, final String clazzName, final String methodName, final String msg) { |
| | | return new TimerTask() { |
| | | @Override |
| | | public void run() { |
| | | OperationLog operationLog = LogFactory.createOperationLog( |
| | | LogType.BUSSINESS, userId, bussinessName, clazzName, methodName, msg, LogSucceed.SUCCESS); |
| | | try { |
| | | operationLogMapper.insert(operationLog); |
| | | } catch (Exception e) { |
| | | logger.error("创建业务日志异常!", e); |
| | | } |
| | | } |
| | | }; |
| | | } |
| | | |
| | | public static TimerTask exceptionLog(final Integer userId, final Exception exception) { |
| | | return new TimerTask() { |
| | | @Override |
| | | public void run() { |
| | | String msg = ToolUtil.getExceptionMsg(exception); |
| | | OperationLog operationLog = LogFactory.createOperationLog( |
| | | LogType.EXCEPTION, userId, "", null, null, msg, LogSucceed.FAIL); |
| | | try { |
| | | operationLogMapper.insert(operationLog); |
| | | } catch (Exception e) { |
| | | logger.error("创建异常日志异常!", e); |
| | | } |
| | | } |
| | | }; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.shiro; |
| | | |
| | | import com.stylefeng.guns.core.shiro.factory.IShiro; |
| | | import com.stylefeng.guns.core.shiro.factory.ShiroFactroy; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.model.User; |
| | | import org.apache.shiro.authc.AuthenticationException; |
| | | import org.apache.shiro.authc.AuthenticationInfo; |
| | | import org.apache.shiro.authc.AuthenticationToken; |
| | | import org.apache.shiro.authc.UsernamePasswordToken; |
| | | import org.apache.shiro.authc.credential.CredentialsMatcher; |
| | | import org.apache.shiro.authc.credential.HashedCredentialsMatcher; |
| | | import org.apache.shiro.authz.AuthorizationInfo; |
| | | import org.apache.shiro.authz.SimpleAuthorizationInfo; |
| | | import org.apache.shiro.realm.AuthorizingRealm; |
| | | import org.apache.shiro.subject.PrincipalCollection; |
| | | |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | public class ShiroDbRealm extends AuthorizingRealm { |
| | | |
| | | /** |
| | | * 登录认证 |
| | | */ |
| | | @Override |
| | | protected AuthenticationInfo doGetAuthenticationInfo(AuthenticationToken authcToken) |
| | | throws AuthenticationException { |
| | | IShiro shiroFactory = ShiroFactroy.me(); |
| | | UsernamePasswordToken token = (UsernamePasswordToken) authcToken; |
| | | User user = shiroFactory.user(token.getUsername()); |
| | | ShiroUser shiroUser = shiroFactory.shiroUser(user); |
| | | return shiroFactory.info(shiroUser, user, super.getName()); |
| | | } |
| | | |
| | | /** |
| | | * 权限认证 |
| | | */ |
| | | @Override |
| | | protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) { |
| | | IShiro shiroFactory = ShiroFactroy.me(); |
| | | ShiroUser shiroUser = (ShiroUser) principals.getPrimaryPrincipal(); |
| | | List<Integer> roleList = shiroUser.getRoleList(); |
| | | |
| | | Set<String> permissionSet = new HashSet<>(); |
| | | Set<String> roleNameSet = new HashSet<>(); |
| | | |
| | | for (Integer roleId : roleList) { |
| | | List<String> permissions = shiroFactory.findPermissionsByRoleId(roleId); |
| | | if (permissions != null) { |
| | | for (String permission : permissions) { |
| | | if (ToolUtil.isNotEmpty(permission)) { |
| | | permissionSet.add(permission); |
| | | } |
| | | } |
| | | } |
| | | String roleName = shiroFactory.findRoleNameByRoleId(roleId); |
| | | roleNameSet.add(roleName); |
| | | } |
| | | |
| | | SimpleAuthorizationInfo info = new SimpleAuthorizationInfo(); |
| | | info.addStringPermissions(permissionSet); |
| | | info.addRoles(roleNameSet); |
| | | return info; |
| | | } |
| | | |
| | | /** |
| | | * 设置认证加密方式 |
| | | */ |
| | | @Override |
| | | public void setCredentialsMatcher(CredentialsMatcher credentialsMatcher) { |
| | | HashedCredentialsMatcher md5CredentialsMatcher = new HashedCredentialsMatcher(); |
| | | md5CredentialsMatcher.setHashAlgorithmName(ShiroKit.hashAlgorithmName); |
| | | md5CredentialsMatcher.setHashIterations(ShiroKit.hashIterations); |
| | | super.setCredentialsMatcher(md5CredentialsMatcher); |
| | | } |
| | | } |
New file |
| | |
| | | /** |
| | | * Copyright (c) 2015-2017, Chill Zhuang 庄骞 (smallchill@163.com). |
| | | * <p> |
| | | * Licensed under the Apache License, Version 2.0 (the "License"); |
| | | * you may not use this file except in compliance with the License. |
| | | * You may obtain a copy of the License at |
| | | * <p> |
| | | * http://www.apache.org/licenses/LICENSE-2.0 |
| | | * <p> |
| | | * Unless required by applicable law or agreed to in writing, software |
| | | * distributed under the License is distributed on an "AS IS" BASIS, |
| | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| | | * See the License for the specific language governing permissions and |
| | | * limitations under the License. |
| | | */ |
| | | package com.stylefeng.guns.core.shiro; |
| | | |
| | | import com.stylefeng.guns.core.common.constant.Const; |
| | | import com.stylefeng.guns.core.common.constant.factory.ConstantFactory; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.apache.shiro.crypto.hash.Md5Hash; |
| | | import org.apache.shiro.crypto.hash.SimpleHash; |
| | | import org.apache.shiro.session.Session; |
| | | import org.apache.shiro.subject.Subject; |
| | | import org.apache.shiro.util.ByteSource; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * shiro工具类 |
| | | * |
| | | * @author dafei, Chill Zhuang |
| | | */ |
| | | public class ShiroKit { |
| | | |
| | | private static final String NAMES_DELIMETER = ","; |
| | | |
| | | /** |
| | | * 加盐参数 |
| | | */ |
| | | public final static String hashAlgorithmName = "MD5"; |
| | | |
| | | /** |
| | | * 循环次数 |
| | | */ |
| | | public final static int hashIterations = 1024; |
| | | |
| | | /** |
| | | * shiro密码加密工具类 |
| | | * |
| | | * @param credentials 密码 |
| | | * @param saltSource 密码盐 |
| | | * @return |
| | | */ |
| | | public static String md5(String credentials, String saltSource) { |
| | | ByteSource salt = new Md5Hash(saltSource); |
| | | return new SimpleHash(hashAlgorithmName, credentials, salt, hashIterations).toString(); |
| | | } |
| | | |
| | | /** |
| | | * 获取随机盐值 |
| | | * @param length |
| | | * @return |
| | | */ |
| | | public static String getRandomSalt(int length) { |
| | | return ToolUtil.getRandomString(length); |
| | | } |
| | | |
| | | /** |
| | | * 获取当前 Subject |
| | | * |
| | | * @return Subject |
| | | */ |
| | | public static Subject getSubject() { |
| | | return SecurityUtils.getSubject(); |
| | | } |
| | | |
| | | /** |
| | | * 获取封装的 ShiroUser |
| | | * |
| | | * @return ShiroUser |
| | | */ |
| | | public static ShiroUser getUser() { |
| | | if (isGuest()) { |
| | | return null; |
| | | } else { |
| | | return (ShiroUser) getSubject().getPrincipals().getPrimaryPrincipal(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 从shiro获取session |
| | | * |
| | | */ |
| | | public static Session getSession() { |
| | | return getSubject().getSession(); |
| | | } |
| | | |
| | | /** |
| | | * 获取shiro指定的sessionKey |
| | | * |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | public static <T> T getSessionAttr(String key) { |
| | | Session session = getSession(); |
| | | return session != null ? (T) session.getAttribute(key) : null; |
| | | } |
| | | |
| | | /** |
| | | * 设置shiro指定的sessionKey |
| | | * |
| | | */ |
| | | public static void setSessionAttr(String key, Object value) { |
| | | Session session = getSession(); |
| | | session.setAttribute(key, value); |
| | | } |
| | | |
| | | /** |
| | | * 移除shiro指定的sessionKey |
| | | */ |
| | | public static void removeSessionAttr(String key) { |
| | | Session session = getSession(); |
| | | if (session != null) |
| | | session.removeAttribute(key); |
| | | } |
| | | |
| | | /** |
| | | * 验证当前用户是否属于该角色?,使用时与lacksRole 搭配使用 |
| | | * |
| | | * @param roleName |
| | | * 角色名 |
| | | * @return 属于该角色:true,否则false |
| | | */ |
| | | public static boolean hasRole(String roleName) { |
| | | return getSubject() != null && roleName != null |
| | | && roleName.length() > 0 && getSubject().hasRole(roleName); |
| | | } |
| | | |
| | | /** |
| | | * 与hasRole标签逻辑相反,当用户不属于该角色时验证通过。 |
| | | * |
| | | * @param roleName |
| | | * 角色名 |
| | | * @return 不属于该角色:true,否则false |
| | | */ |
| | | public static boolean lacksRole(String roleName) { |
| | | return !hasRole(roleName); |
| | | } |
| | | |
| | | /** |
| | | * 验证当前用户是否属于以下任意一个角色。 |
| | | * |
| | | * @param roleNames |
| | | * 角色列表 |
| | | * @return 属于:true,否则false |
| | | */ |
| | | public static boolean hasAnyRoles(String roleNames) { |
| | | boolean hasAnyRole = false; |
| | | Subject subject = getSubject(); |
| | | if (subject != null && roleNames != null && roleNames.length() > 0) { |
| | | for (String role : roleNames.split(NAMES_DELIMETER)) { |
| | | if (subject.hasRole(role.trim())) { |
| | | hasAnyRole = true; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | return hasAnyRole; |
| | | } |
| | | |
| | | /** |
| | | * 验证当前用户是否属于以下所有角色。 |
| | | * |
| | | * @param roleNames |
| | | * 角色列表 |
| | | * @return 属于:true,否则false |
| | | */ |
| | | public static boolean hasAllRoles(String roleNames) { |
| | | boolean hasAllRole = true; |
| | | Subject subject = getSubject(); |
| | | if (subject != null && roleNames != null && roleNames.length() > 0) { |
| | | for (String role : roleNames.split(NAMES_DELIMETER)) { |
| | | if (!subject.hasRole(role.trim())) { |
| | | hasAllRole = false; |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | return hasAllRole; |
| | | } |
| | | |
| | | /** |
| | | * 验证当前用户是否拥有指定权限,使用时与lacksPermission 搭配使用 |
| | | * |
| | | * @param permission |
| | | * 权限名 |
| | | * @return 拥有权限:true,否则false |
| | | */ |
| | | public static boolean hasPermission(String permission) { |
| | | return getSubject() != null && permission != null |
| | | && permission.length() > 0 |
| | | && getSubject().isPermitted(permission); |
| | | } |
| | | |
| | | /** |
| | | * 与hasPermission标签逻辑相反,当前用户没有制定权限时,验证通过。 |
| | | * |
| | | * @param permission |
| | | * 权限名 |
| | | * @return 拥有权限:true,否则false |
| | | */ |
| | | public static boolean lacksPermission(String permission) { |
| | | return !hasPermission(permission); |
| | | } |
| | | |
| | | /** |
| | | * 已认证通过的用户。不包含已记住的用户,这是与user标签的区别所在。与notAuthenticated搭配使用 |
| | | * |
| | | * @return 通过身份验证:true,否则false |
| | | */ |
| | | public static boolean isAuthenticated() { |
| | | return getSubject() != null && getSubject().isAuthenticated(); |
| | | } |
| | | |
| | | /** |
| | | * 未认证通过用户,与authenticated标签相对应。与guest标签的区别是,该标签包含已记住用户。。 |
| | | * |
| | | * @return 没有通过身份验证:true,否则false |
| | | */ |
| | | public static boolean notAuthenticated() { |
| | | return !isAuthenticated(); |
| | | } |
| | | |
| | | /** |
| | | * 认证通过或已记住的用户。与guset搭配使用。 |
| | | * |
| | | * @return 用户:true,否则 false |
| | | */ |
| | | public static boolean isUser() { |
| | | return getSubject() != null && getSubject().getPrincipal() != null; |
| | | } |
| | | |
| | | /** |
| | | * 验证当前用户是否为“访客”,即未认证(包含未记住)的用户。用user搭配使用 |
| | | * |
| | | * @return 访客:true,否则false |
| | | */ |
| | | public static boolean isGuest() { |
| | | return !isUser(); |
| | | } |
| | | |
| | | /** |
| | | * 输出当前用户信息,通常为登录帐号信息。 |
| | | * |
| | | * @return 当前用户信息 |
| | | */ |
| | | public static String principal() { |
| | | if (getSubject() != null) { |
| | | Object principal = getSubject().getPrincipal(); |
| | | return principal.toString(); |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | /** |
| | | * 获取当前用户的部门数据范围的集合 |
| | | */ |
| | | public static List<Integer> getDeptDataScope() { |
| | | Integer deptId = getUser().getDeptId(); |
| | | List<Integer> subDeptIds = ConstantFactory.me().getSubDeptId(deptId); |
| | | subDeptIds.add(deptId); |
| | | return subDeptIds; |
| | | } |
| | | |
| | | /** |
| | | * 判断当前用户是否是超级管理员 |
| | | */ |
| | | public static boolean isAdmin() { |
| | | List<Integer> roleList = ShiroKit.getUser().getRoleList(); |
| | | for (Integer integer : roleList) { |
| | | String singleRoleTip = ConstantFactory.me().getSingleRoleTip(integer); |
| | | if (singleRoleTip.equals(Const.ADMIN_NAME)) { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.shiro; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 自定义Authentication对象,使得Subject除了携带用户的登录名外还可以携带更多信息 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2016年12月5日 上午10:26:43 |
| | | */ |
| | | public class ShiroUser implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public Integer id; // 主键ID |
| | | public String account; // 账号 |
| | | public String name; // 姓名 |
| | | public Integer deptId; // 部门id |
| | | public List<Integer> roleList; // 角色集 |
| | | public String deptName; // 部门名称 |
| | | public List<String> roleNames; // 角色名称集 |
| | | public Integer roleType; // 角色类型 1=平台 2=分公司 3=加盟商 |
| | | public Integer objectId; // 对象ID |
| | | |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getAccount() { |
| | | return account; |
| | | } |
| | | |
| | | public void setAccount(String account) { |
| | | this.account = account; |
| | | } |
| | | |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public Integer getDeptId() { |
| | | return deptId; |
| | | } |
| | | |
| | | public void setDeptId(Integer deptId) { |
| | | this.deptId = deptId; |
| | | } |
| | | |
| | | public List<Integer> getRoleList() { |
| | | return roleList; |
| | | } |
| | | |
| | | public void setRoleList(List<Integer> roleList) { |
| | | this.roleList = roleList; |
| | | } |
| | | |
| | | public String getDeptName() { |
| | | return deptName; |
| | | } |
| | | |
| | | public void setDeptName(String deptName) { |
| | | this.deptName = deptName; |
| | | } |
| | | |
| | | public List<String> getRoleNames() { |
| | | return roleNames; |
| | | } |
| | | |
| | | public void setRoleNames(List<String> roleNames) { |
| | | this.roleNames = roleNames; |
| | | } |
| | | |
| | | public Integer getRoleType() { |
| | | return roleType; |
| | | } |
| | | |
| | | public void setRoleType(Integer roleType) { |
| | | this.roleType = roleType; |
| | | } |
| | | |
| | | public Integer getObjectId() { |
| | | return objectId; |
| | | } |
| | | |
| | | public void setObjectId(Integer objectId) { |
| | | this.objectId = objectId; |
| | | } |
| | | } |
New file |
| | |
| | | /** |
| | | * Copyright (c) 2015-2017, Chill Zhuang 庄骞 (smallchill@163.com). |
| | | * <p> |
| | | * Licensed under the Apache License, Version 2.0 (the "License"); |
| | | * you may not use this file except in compliance with the License. |
| | | * You may obtain a copy of the License at |
| | | * <p> |
| | | * http://www.apache.org/licenses/LICENSE-2.0 |
| | | * <p> |
| | | * Unless required by applicable law or agreed to in writing, software |
| | | * distributed under the License is distributed on an "AS IS" BASIS, |
| | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| | | * See the License for the specific language governing permissions and |
| | | * limitations under the License. |
| | | */ |
| | | package com.stylefeng.guns.core.shiro.check; |
| | | |
| | | /** |
| | | * 检查用接口 |
| | | */ |
| | | public interface ICheck { |
| | | |
| | | /** |
| | | * 检查当前登录用户是否拥有指定的角色访问当 |
| | | */ |
| | | boolean check(Object[] permissions); |
| | | |
| | | /** |
| | | * 检查当前登录用户是否拥有当前请求的servlet的权限 |
| | | */ |
| | | boolean checkAll(); |
| | | } |
New file |
| | |
| | | /** |
| | | * Copyright (c) 2015-2017, Chill Zhuang 庄骞 (smallchill@163.com). |
| | | * <p> |
| | | * Licensed under the Apache License, Version 2.0 (the "License"); |
| | | * you may not use this file except in compliance with the License. |
| | | * You may obtain a copy of the License at |
| | | * <p> |
| | | * http://www.apache.org/licenses/LICENSE-2.0 |
| | | * <p> |
| | | * Unless required by applicable law or agreed to in writing, software |
| | | * distributed under the License is distributed on an "AS IS" BASIS, |
| | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| | | * See the License for the specific language governing permissions and |
| | | * limitations under the License. |
| | | */ |
| | | package com.stylefeng.guns.core.shiro.check; |
| | | |
| | | import com.stylefeng.guns.core.listener.ConfigListener; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.shiro.ShiroUser; |
| | | import com.stylefeng.guns.core.support.CollectionKit; |
| | | import com.stylefeng.guns.core.support.HttpKit; |
| | | import com.stylefeng.guns.core.util.SpringContextHolder; |
| | | import org.springframework.context.annotation.DependsOn; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | | * 权限自定义检查 |
| | | */ |
| | | @Service |
| | | @DependsOn("springContextHolder") |
| | | @Transactional(readOnly = true) |
| | | public class PermissionCheckFactory implements ICheck { |
| | | |
| | | public static ICheck me() { |
| | | return SpringContextHolder.getBean(ICheck.class); |
| | | } |
| | | |
| | | @Override |
| | | public boolean check(Object[] permissions) { |
| | | ShiroUser user = ShiroKit.getUser(); |
| | | if (null == user) { |
| | | return false; |
| | | } |
| | | String join = CollectionKit.join(permissions, ","); |
| | | if (ShiroKit.hasAnyRoles(join)) { |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | @Override |
| | | public boolean checkAll() { |
| | | HttpServletRequest request = HttpKit.getRequest(); |
| | | ShiroUser user = ShiroKit.getUser(); |
| | | if (null == user) { |
| | | return false; |
| | | } |
| | | String requestURI = request.getRequestURI().replaceFirst(ConfigListener.getConf().get("contextPath"), ""); |
| | | String[] str = requestURI.split("/"); |
| | | if (str.length > 3) { |
| | | requestURI = "/" + str[1] + "/" + str[2]; |
| | | } |
| | | if (ShiroKit.hasPermission(requestURI)) { |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | /** |
| | | * Copyright (c) 2015-2017, Chill Zhuang 庄骞 (smallchill@163.com). |
| | | * <p> |
| | | * Licensed under the Apache License, Version 2.0 (the "License"); |
| | | * you may not use this file except in compliance with the License. |
| | | * You may obtain a copy of the License at |
| | | * <p> |
| | | * http://www.apache.org/licenses/LICENSE-2.0 |
| | | * <p> |
| | | * Unless required by applicable law or agreed to in writing, software |
| | | * distributed under the License is distributed on an "AS IS" BASIS, |
| | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| | | * See the License for the specific language governing permissions and |
| | | * limitations under the License. |
| | | */ |
| | | package com.stylefeng.guns.core.shiro.check; |
| | | |
| | | import com.stylefeng.guns.core.util.SpringContextHolder; |
| | | |
| | | /** |
| | | * 权限检查管理器(入口) |
| | | */ |
| | | public class PermissionCheckManager { |
| | | private final static PermissionCheckManager me = new PermissionCheckManager(); |
| | | |
| | | private ICheck defaultCheckFactory = SpringContextHolder.getBean(ICheck.class); |
| | | |
| | | public static PermissionCheckManager me() { |
| | | return me; |
| | | } |
| | | |
| | | private PermissionCheckManager() { |
| | | } |
| | | |
| | | public PermissionCheckManager(ICheck checkFactory) { |
| | | this.defaultCheckFactory = checkFactory; |
| | | } |
| | | |
| | | public void setDefaultCheckFactory(ICheck defaultCheckFactory) { |
| | | this.defaultCheckFactory = defaultCheckFactory; |
| | | } |
| | | |
| | | public static boolean check(Object[] permissions) { |
| | | return me.defaultCheckFactory.check(permissions); |
| | | } |
| | | |
| | | public static boolean checkAll() { |
| | | return me.defaultCheckFactory.checkAll(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.shiro.factory; |
| | | |
| | | import com.stylefeng.guns.core.shiro.ShiroUser; |
| | | import com.stylefeng.guns.modular.system.model.User; |
| | | import org.apache.shiro.authc.SimpleAuthenticationInfo; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 定义shirorealm所需数据的接口 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2016年12月5日 上午10:23:34 |
| | | */ |
| | | public interface IShiro { |
| | | |
| | | /** |
| | | * 根据账号获取登录用户 |
| | | * |
| | | * @param account 账号 |
| | | */ |
| | | User user(String account); |
| | | |
| | | /** |
| | | * 根据系统用户获取Shiro的用户 |
| | | * |
| | | * @param user 系统用户 |
| | | */ |
| | | ShiroUser shiroUser(User user); |
| | | |
| | | /** |
| | | * 获取权限列表通过角色id |
| | | * |
| | | * @param roleId 角色id |
| | | */ |
| | | List<String> findPermissionsByRoleId(Integer roleId); |
| | | |
| | | /** |
| | | * 根据角色id获取角色名称 |
| | | * |
| | | * @param roleId 角色id |
| | | */ |
| | | String findRoleNameByRoleId(Integer roleId); |
| | | |
| | | /** |
| | | * 获取shiro的认证信息 |
| | | */ |
| | | SimpleAuthenticationInfo info(ShiroUser shiroUser, User user, String realmName); |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.shiro.factory; |
| | | |
| | | import com.stylefeng.guns.core.common.constant.factory.ConstantFactory; |
| | | import com.stylefeng.guns.core.common.constant.state.ManagerStatus; |
| | | import com.stylefeng.guns.core.shiro.ShiroUser; |
| | | import com.stylefeng.guns.core.util.Convert; |
| | | import com.stylefeng.guns.core.util.SpringContextHolder; |
| | | import com.stylefeng.guns.modular.system.dao.MenuMapper; |
| | | import com.stylefeng.guns.modular.system.dao.UserMapper; |
| | | import com.stylefeng.guns.modular.system.model.User; |
| | | import org.apache.shiro.authc.CredentialsException; |
| | | import org.apache.shiro.authc.LockedAccountException; |
| | | import org.apache.shiro.authc.SimpleAuthenticationInfo; |
| | | import org.apache.shiro.crypto.hash.Md5Hash; |
| | | import org.apache.shiro.util.ByteSource; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.DependsOn; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | @DependsOn("springContextHolder") |
| | | @Transactional(readOnly = true) |
| | | public class ShiroFactroy implements IShiro { |
| | | |
| | | @Autowired |
| | | private UserMapper userMapper; |
| | | |
| | | @Autowired |
| | | private MenuMapper menuMapper; |
| | | |
| | | public static IShiro me() { |
| | | return SpringContextHolder.getBean(IShiro.class); |
| | | } |
| | | |
| | | @Override |
| | | public User user(String account) { |
| | | |
| | | User user = userMapper.getByAccount(account); |
| | | |
| | | // 账号不存在 |
| | | if (null == user) { |
| | | throw new CredentialsException(); |
| | | } |
| | | // 账号被冻结 |
| | | if (user.getStatus() != ManagerStatus.OK.getCode()) { |
| | | throw new LockedAccountException(); |
| | | } |
| | | return user; |
| | | } |
| | | |
| | | @Override |
| | | public ShiroUser shiroUser(User user) { |
| | | ShiroUser shiroUser = new ShiroUser(); |
| | | |
| | | shiroUser.setId(user.getId()); |
| | | shiroUser.setAccount(user.getAccount()); |
| | | shiroUser.setDeptId(user.getDeptid()); |
| | | shiroUser.setDeptName(ConstantFactory.me().getDeptName(user.getDeptid())); |
| | | shiroUser.setName(user.getName()); |
| | | |
| | | Integer[] roleArray = Convert.toIntArray(user.getRoleid()); |
| | | List<Integer> roleList = new ArrayList<Integer>(); |
| | | List<String> roleNameList = new ArrayList<String>(); |
| | | for (int roleId : roleArray) { |
| | | roleList.add(roleId); |
| | | roleNameList.add(ConstantFactory.me().getSingleRoleName(roleId)); |
| | | } |
| | | shiroUser.setRoleList(roleList); |
| | | shiroUser.setRoleNames(roleNameList); |
| | | |
| | | return shiroUser; |
| | | } |
| | | |
| | | @Override |
| | | public List<String> findPermissionsByRoleId(Integer roleId) { |
| | | return menuMapper.getResUrlsByRoleId(roleId); |
| | | } |
| | | |
| | | @Override |
| | | public String findRoleNameByRoleId(Integer roleId) { |
| | | return ConstantFactory.me().getSingleRoleTip(roleId); |
| | | } |
| | | |
| | | @Override |
| | | public SimpleAuthenticationInfo info(ShiroUser shiroUser, User user, String realmName) { |
| | | String credentials = user.getPassword(); |
| | | |
| | | // 密码加盐处理 |
| | | String source = user.getSalt(); |
| | | ByteSource credentialsSalt = new Md5Hash(source); |
| | | return new SimpleAuthenticationInfo(shiroUser, credentials, credentialsSalt, realmName); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.tag; |
| | | |
| | | import com.stylefeng.guns.core.common.exception.BizExceptionEnum; |
| | | import com.stylefeng.guns.core.exception.GunsException; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.model.Dict; |
| | | import com.stylefeng.guns.modular.system.service.IDictService; |
| | | import org.beetl.core.Tag; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Scope; |
| | | import org.springframework.stereotype.Component; |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 字典标签渲染 |
| | | * |
| | | * @author zhangjiajia |
| | | * @Date 2018年6月4日17:33:32 |
| | | */ |
| | | @Component |
| | | @Scope("prototype") |
| | | public class DictSelectorTag extends Tag { |
| | | |
| | | @Autowired |
| | | IDictService iDictService; |
| | | |
| | | @Override |
| | | public void render(){ |
| | | //String tagName = (String) this.args[0]; |
| | | Map attrs = (Map) args[1]; |
| | | if(ToolUtil.isEmpty(attrs.get("code"))){ |
| | | throw new GunsException(BizExceptionEnum.ERROR_CODE_EMPTY); |
| | | } |
| | | |
| | | //字典类型编码 |
| | | String code = attrs.get("code").toString(); |
| | | //控件显示类型select 选择框,radio 单选按钮,checkbox 多选按钮 |
| | | String type = ToolUtil.isNotEmpty(attrs.get("type"))?attrs.get("type").toString():"select"; |
| | | //开启多选 |
| | | String multiple = ToolUtil.isNotEmpty(attrs.get("multiple"))?attrs.get("multiple").toString():""; |
| | | //字典名称 |
| | | String label = ToolUtil.isNotEmpty(attrs.get("label"))?attrs.get("label").toString():""; |
| | | //提示 |
| | | String placeholder = (ToolUtil.isNotEmpty(attrs.get("placeholder"))?attrs.get("placeholder").toString():""); |
| | | //宽度 |
| | | String width = ToolUtil.isNotEmpty(attrs.get("width"))?attrs.get("width").toString():"248"; |
| | | //默认值 |
| | | String value = ToolUtil.isNotEmpty(attrs.get("value"))?attrs.get("value").toString():""; |
| | | //id |
| | | String id = ToolUtil.isNotEmpty(attrs.get("id"))?attrs.get("id").toString():""; |
| | | //name |
| | | String name = ToolUtil.isNotEmpty(attrs.get("name"))?attrs.get("name").toString():""; |
| | | //分割线 |
| | | String underline = ToolUtil.isNotEmpty(attrs.get("underline"))?attrs.get("underline").toString():""; |
| | | //onchange事件 |
| | | String onchange = ToolUtil.isNotEmpty(attrs.get("onchange"))?attrs.get("onchange").toString():""; |
| | | //readonly属性 |
| | | String readonly = ToolUtil.isNotEmpty(attrs.get("readonly"))?attrs.get("readonly").toString():""; |
| | | //disabled属性 |
| | | String disabled = ToolUtil.isNotEmpty(attrs.get("disabled"))?attrs.get("disabled").toString():""; |
| | | //searchnum 下拉选项数量达到多少启用搜索,默认10 |
| | | int searchnum = ToolUtil.isNum(attrs.get("searchnum"))?Integer.parseInt(attrs.get("searchnum").toString()):10; |
| | | //根据code查询字典数据 |
| | | List<Dict> list = iDictService.selectByParentCode(code); |
| | | |
| | | StringBuffer html = new StringBuffer(); |
| | | html.append("<div class=\"form-group\">\r\n"); |
| | | html.append("<label class=\"col-sm-3 control-label\">"+label+"</label>\r\n"); |
| | | html.append("<div class=\"col-sm-9\">\r\n"); |
| | | |
| | | //单选按钮 |
| | | if("radio".equals(type)) { |
| | | |
| | | list.forEach(obj->{ |
| | | html.append("<label class=\"radio-inline i-checks\">\r\n<input type=\"radio\" "); |
| | | //判断控件是否禁用 |
| | | if("true".equals(disabled)||"disabled".equals(disabled)) { |
| | | html.append("disabled "); |
| | | }else{ |
| | | if(ToolUtil.isNotEmpty(name)){ |
| | | html.append("name=\""+name+"\" "); |
| | | } |
| | | } |
| | | if("true".equals(readonly)||"disabled".equals(readonly)) { |
| | | html.append("disabled "); |
| | | } |
| | | if(ToolUtil.isNotEmpty(value)&&value.equals(obj.getCode())){ |
| | | html.append("checked "); |
| | | } |
| | | |
| | | html.append("value=\""+obj.getCode()+"\" >"+obj.getName()+"</label>\r\n"); |
| | | }); |
| | | |
| | | //多选按钮 |
| | | }else if("checkbox".equals(type)){ |
| | | list.forEach(obj->{ |
| | | html.append("<label class=\"checkbox-inline i-checks\">\r\n<input type=\"checkbox\" "); |
| | | //判断控件是否禁用 |
| | | if("true".equals(disabled)||"disabled".equals(disabled)) { |
| | | html.append("disabled "); |
| | | }else{ |
| | | if(ToolUtil.isNotEmpty(name)){ |
| | | html.append("name=\""+name+"\" "); |
| | | } |
| | | } |
| | | if("true".equals(readonly)||"disabled".equals(readonly)) { |
| | | html.append("disabled "); |
| | | } |
| | | if(ToolUtil.isNotEmpty(value)&&value.equals(obj.getCode())){ |
| | | html.append("checked "); |
| | | } |
| | | |
| | | html.append("value=\""+obj.getCode()+"\" >"+obj.getName()+"</label>\r\n"); |
| | | }); |
| | | |
| | | //默认select |
| | | }else{ |
| | | //开启多选 |
| | | if("true".equals(multiple)){ |
| | | if(list.size()>=searchnum) { |
| | | html.append("<select multiple "); |
| | | }else{ |
| | | html.append("<select multiple=\"multiple\" size=\"10\" "); |
| | | } |
| | | }else{ |
| | | html.append("<select "); |
| | | } |
| | | |
| | | //判断控件是否启用提示 |
| | | if(ToolUtil.isNotEmpty(placeholder)){ |
| | | html.append(" data-placeholder=\""+placeholder+"\" "); |
| | | } |
| | | |
| | | //判断控件是否禁用 |
| | | if("true".equals(disabled)||"disabled".equals(disabled)) { |
| | | html.append("disabled=\"disabled\" "); |
| | | }else{ |
| | | //启用 |
| | | if(ToolUtil.isNotEmpty(id)){ |
| | | html.append("id=\""+id+"\" "); |
| | | } |
| | | |
| | | if(ToolUtil.isNotEmpty(name)){ |
| | | html.append("name=\""+name+"\" "); |
| | | } |
| | | } |
| | | |
| | | //判断是否启用搜索框 |
| | | //判断下拉数据,如果查询出来的条数达到启用搜索的数量就启用 |
| | | |
| | | |
| | | if(list.size()>=searchnum){ |
| | | html.append("class=\"form-control chosen-select\" style=\"width:"+width+"px\" tabindex=\"1\" \r\n"); |
| | | } else{ |
| | | html.append("class=\"form-control\" style=\"width:"+width+"px\" \r\n"); |
| | | } |
| | | |
| | | //判断控件是否只读 |
| | | if("true".equals(readonly)||"readonly".equals(readonly)) { |
| | | if(list.size()>=searchnum) { |
| | | html.append("disabled=\"disabled\" "); |
| | | }else{ |
| | | html.append("onfocus=\"this.defaultIndex=this.selectedIndex;\" onchange=\"this.selectedIndex=this.defaultIndex;\" "); |
| | | } |
| | | } |
| | | |
| | | //判断是否绑定onchange事件 |
| | | if(ToolUtil.isNotEmpty(onchange)){ |
| | | html.append("onchange=\""+onchange+"($(this).children('option:selected').val())\" "); |
| | | } |
| | | |
| | | html.append(">"); |
| | | if(ToolUtil.isNotEmpty(placeholder)){ |
| | | html.append("<option value=\"\">"+placeholder+"</option>\r\n"); |
| | | } |
| | | //将查询出来的数据添加到select中 |
| | | list.forEach(obj->{ |
| | | if(ToolUtil.isNotEmpty(value)&&value.equals(obj.getCode())){ |
| | | html.append("<option selected value=\""+obj.getCode()+"\">"+obj.getName()+"</option>\r\n"); |
| | | }else{ |
| | | html.append("<option value=\""+obj.getCode()+"\">"+obj.getName()+"</option>\r\n"); |
| | | } |
| | | }); |
| | | html.append("</select>\r\n"); |
| | | } |
| | | |
| | | html.append("</div>\r\n</div>\r\n"); |
| | | //判断是否添加分割线 |
| | | if(ToolUtil.isNotEmpty(underline) && "true".equals(underline)) { |
| | | html.append("<div class=\"hr-line-dashed\" ></div >\r\n"); |
| | | } |
| | | |
| | | try{ |
| | | this.ctx.byteWriter.writeString(html.toString()); |
| | | }catch (IOException e){ |
| | | throw new RuntimeException("输出字典标签错误"); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.util; |
| | | |
| | | import com.stylefeng.guns.core.common.constant.Const; |
| | | import com.stylefeng.guns.config.properties.GunsProperties; |
| | | import com.stylefeng.guns.core.node.MenuNode; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * api接口文档显示过滤 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-08-17 16:55 |
| | | */ |
| | | public class ApiMenuFilter extends MenuNode { |
| | | |
| | | public static List<MenuNode> build(List<MenuNode> nodes) { |
| | | |
| | | //如果关闭了接口文档,则不显示接口文档菜单 |
| | | GunsProperties gunsProperties = SpringContextHolder.getBean(GunsProperties.class); |
| | | if (!gunsProperties.getSwaggerOpen()) { |
| | | List<MenuNode> menuNodesCopy = new ArrayList<>(); |
| | | for (MenuNode menuNode : nodes) { |
| | | if (Const.API_MENU_NAME.equals(menuNode.getName())) { |
| | | continue; |
| | | } else { |
| | | menuNodesCopy.add(menuNode); |
| | | } |
| | | } |
| | | nodes = menuNodesCopy; |
| | | } |
| | | |
| | | return nodes; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.util; |
| | | |
| | | import com.stylefeng.guns.core.common.constant.dictmap.base.AbstractDictMap; |
| | | import com.stylefeng.guns.core.common.constant.dictmap.factory.DictFieldWarpperFactory; |
| | | import com.stylefeng.guns.core.support.StrKit; |
| | | |
| | | import java.beans.PropertyDescriptor; |
| | | import java.lang.reflect.Field; |
| | | import java.lang.reflect.Method; |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 对比两个对象的变化的工具类 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2017/3/31 10:36 |
| | | */ |
| | | public class Contrast { |
| | | |
| | | //记录每个修改字段的分隔符 |
| | | public static final String separator = ";;;"; |
| | | |
| | | /** |
| | | * 比较两个对象,并返回不一致的信息 |
| | | * |
| | | * @author stylefeng |
| | | * @Date 2017/5/9 19:34 |
| | | */ |
| | | public static String contrastObj(Object pojo1, Object pojo2) { |
| | | String str = ""; |
| | | try { |
| | | Class clazz = pojo1.getClass(); |
| | | Field[] fields = pojo1.getClass().getDeclaredFields(); |
| | | int i = 1; |
| | | for (Field field : fields) { |
| | | if ("serialVersionUID".equals(field.getName())) { |
| | | continue; |
| | | } |
| | | PropertyDescriptor pd = new PropertyDescriptor(field.getName(), clazz); |
| | | Method getMethod = pd.getReadMethod(); |
| | | Object o1 = getMethod.invoke(pojo1); |
| | | Object o2 = getMethod.invoke(pojo2); |
| | | if (o1 == null || o2 == null) { |
| | | continue; |
| | | } |
| | | if (o1 instanceof Date) { |
| | | o1 = DateUtil.getDay((Date) o1); |
| | | } |
| | | if (!o1.toString().equals(o2.toString())) { |
| | | if (i != 1) { |
| | | str += separator; |
| | | } |
| | | str += "字段名称" + field.getName() + ",旧值:" + o1 + ",新值:" + o2; |
| | | i++; |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return str; |
| | | } |
| | | |
| | | /** |
| | | * 比较两个对象pojo1和pojo2,并输出不一致信息 |
| | | * |
| | | * @author stylefeng |
| | | * @Date 2017/5/9 19:34 |
| | | */ |
| | | public static String contrastObj(Class dictClass, String key, Object pojo1, Map<String, String> pojo2) throws IllegalAccessException, InstantiationException { |
| | | AbstractDictMap dictMap = (AbstractDictMap) dictClass.newInstance(); |
| | | String str = parseMutiKey(dictMap, key, pojo2) + separator; |
| | | try { |
| | | Class clazz = pojo1.getClass(); |
| | | Field[] fields = pojo1.getClass().getDeclaredFields(); |
| | | int i = 1; |
| | | for (Field field : fields) { |
| | | if ("serialVersionUID".equals(field.getName())) { |
| | | continue; |
| | | } |
| | | PropertyDescriptor pd = new PropertyDescriptor(field.getName(), clazz); |
| | | Method getMethod = pd.getReadMethod(); |
| | | Object o1 = getMethod.invoke(pojo1); |
| | | Object o2 = pojo2.get(StrKit.firstCharToLowerCase(getMethod.getName().substring(3))); |
| | | if (o1 == null || o2 == null) { |
| | | continue; |
| | | } |
| | | if (o1 instanceof Date) { |
| | | o1 = DateUtil.getDay((Date) o1); |
| | | } else if (o1 instanceof Integer) { |
| | | o2 = Integer.parseInt(o2.toString()); |
| | | } |
| | | if (!o1.toString().equals(o2.toString())) { |
| | | if (i != 1) { |
| | | str += separator; |
| | | } |
| | | String fieldName = dictMap.get(field.getName()); |
| | | String fieldWarpperMethodName = dictMap.getFieldWarpperMethodName(field.getName()); |
| | | if (fieldWarpperMethodName != null) { |
| | | Object o1Warpper = DictFieldWarpperFactory.createFieldWarpper(o1, fieldWarpperMethodName); |
| | | Object o2Warpper = DictFieldWarpperFactory.createFieldWarpper(o2, fieldWarpperMethodName); |
| | | str += "字段名称:" + fieldName + ",旧值:" + o1Warpper + ",新值:" + o2Warpper; |
| | | } else { |
| | | str += "字段名称:" + fieldName + ",旧值:" + o1 + ",新值:" + o2; |
| | | } |
| | | i++; |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return str; |
| | | } |
| | | |
| | | /** |
| | | * 比较两个对象pojo1和pojo2,并输出不一致信息 |
| | | * |
| | | * @author stylefeng |
| | | * @Date 2017/5/9 19:34 |
| | | */ |
| | | public static String contrastObjByName(Class dictClass, String key, Object pojo1, Map<String, String> pojo2) throws IllegalAccessException, InstantiationException { |
| | | AbstractDictMap dictMap = (AbstractDictMap) dictClass.newInstance(); |
| | | String str = parseMutiKey(dictMap, key, pojo2) + separator; |
| | | try { |
| | | Class clazz = pojo1.getClass(); |
| | | Field[] fields = pojo1.getClass().getDeclaredFields(); |
| | | int i = 1; |
| | | for (Field field : fields) { |
| | | if ("serialVersionUID".equals(field.getName())) { |
| | | continue; |
| | | } |
| | | String prefix = "get"; |
| | | int prefixLength = 3; |
| | | if (field.getType().getName().equals("java.lang.Boolean")) { |
| | | prefix = "is"; |
| | | prefixLength = 2; |
| | | } |
| | | Method getMethod = null; |
| | | try { |
| | | getMethod = clazz.getDeclaredMethod(prefix + StrKit.firstCharToUpperCase(field.getName())); |
| | | } catch (java.lang.NoSuchMethodException e) { |
| | | System.err.println("this className:" + clazz.getName() + " is not methodName: " + e.getMessage()); |
| | | continue; |
| | | } |
| | | Object o1 = getMethod.invoke(pojo1); |
| | | Object o2 = pojo2.get(StrKit.firstCharToLowerCase(getMethod.getName().substring(prefixLength))); |
| | | if (o1 == null || o2 == null) { |
| | | continue; |
| | | } |
| | | if (o1 instanceof Date) { |
| | | o1 = DateUtil.getDay((Date) o1); |
| | | } else if (o1 instanceof Integer) { |
| | | o2 = Integer.parseInt(o2.toString()); |
| | | } |
| | | if (!o1.toString().equals(o2.toString())) { |
| | | if (i != 1) { |
| | | str += separator; |
| | | } |
| | | String fieldName = dictMap.get(field.getName()); |
| | | String fieldWarpperMethodName = dictMap.getFieldWarpperMethodName(field.getName()); |
| | | if (fieldWarpperMethodName != null) { |
| | | Object o1Warpper = DictFieldWarpperFactory.createFieldWarpper(o1, fieldWarpperMethodName); |
| | | Object o2Warpper = DictFieldWarpperFactory.createFieldWarpper(o2, fieldWarpperMethodName); |
| | | str += "字段名称:" + fieldName + ",旧值:" + o1Warpper + ",新值:" + o2Warpper; |
| | | } else { |
| | | str += "字段名称:" + fieldName + ",旧值:" + o1 + ",新值:" + o2; |
| | | } |
| | | i++; |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return str; |
| | | } |
| | | |
| | | /** |
| | | * 解析多个key(逗号隔开的) |
| | | * |
| | | * @author stylefeng |
| | | * @Date 2017/5/16 22:19 |
| | | */ |
| | | public static String parseMutiKey(AbstractDictMap dictMap, String key, Map<String, String> requests) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | if (key.indexOf(",") != -1) { |
| | | String[] keys = key.split(","); |
| | | for (String item : keys) { |
| | | String fieldWarpperMethodName = dictMap.getFieldWarpperMethodName(item); |
| | | String value = requests.get(item); |
| | | if (fieldWarpperMethodName != null) { |
| | | Object valueWarpper = DictFieldWarpperFactory.createFieldWarpper(value, fieldWarpperMethodName); |
| | | sb.append(dictMap.get(item) + "=" + valueWarpper + ","); |
| | | } else { |
| | | if(item.equals("addTime") || item.equals("createDate")){ |
| | | value= com.stylefeng.guns.modular.system.util.DateUtil.todayStr("yyyy-MM-dd HH:mm"); |
| | | } |
| | | sb.append(dictMap.get(item) + "=" + value + ","); |
| | | } |
| | | } |
| | | return StrKit.removeSuffix(sb.toString(), ","); |
| | | } else { |
| | | String fieldWarpperMethodName = dictMap.getFieldWarpperMethodName(key); |
| | | String value = requests.get(key); |
| | | if (fieldWarpperMethodName != null) { |
| | | Object valueWarpper = DictFieldWarpperFactory.createFieldWarpper(value, fieldWarpperMethodName); |
| | | sb.append(dictMap.get(key) + "=" + valueWarpper); |
| | | } else { |
| | | sb.append(dictMap.get(key) + "=" + value); |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.util; |
| | | |
| | | import com.stylefeng.guns.core.common.constant.JwtConstants; |
| | | import io.jsonwebtoken.*; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p>jwt token工具类</p> |
| | | * <pre> |
| | | * jwt的claim里一般包含以下几种数据: |
| | | * 1. iss -- token的发行者 |
| | | * 2. sub -- 该JWT所面向的用户 |
| | | * 3. aud -- 接收该JWT的一方 |
| | | * 4. exp -- token的失效时间 |
| | | * 5. nbf -- 在此时间段之前,不会被处理 |
| | | * 6. iat -- jwt发布时间 |
| | | * 7. jti -- jwt唯一标识,防止重复使用 |
| | | * </pre> |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2017/8/25 10:59 |
| | | */ |
| | | @Component |
| | | public class JwtTokenUtil { |
| | | |
| | | /** |
| | | * 获取用户名从token中 |
| | | */ |
| | | public static String getUsernameFromToken(String token) { |
| | | return getClaimFromToken(token).getSubject(); |
| | | } |
| | | |
| | | /** |
| | | * 获取jwt发布时间 |
| | | */ |
| | | public static Date getIssuedAtDateFromToken(String token) { |
| | | return getClaimFromToken(token).getIssuedAt(); |
| | | } |
| | | |
| | | /** |
| | | * 获取jwt失效时间 |
| | | */ |
| | | public static Date getExpirationDateFromToken(String token) { |
| | | return getClaimFromToken(token).getExpiration(); |
| | | } |
| | | |
| | | /** |
| | | * 获取jwt接收者 |
| | | */ |
| | | public static String getAudienceFromToken(String token) { |
| | | return getClaimFromToken(token).getAudience(); |
| | | } |
| | | |
| | | /** |
| | | * 获取私有的jwt claim |
| | | */ |
| | | public static String getPrivateClaimFromToken(String token, String key) { |
| | | return getClaimFromToken(token).get(key).toString(); |
| | | } |
| | | |
| | | /** |
| | | * 获取jwt的payload部分 |
| | | */ |
| | | public static Claims getClaimFromToken(String token) { |
| | | return Jwts.parser() |
| | | .setSigningKey(JwtConstants.SECRET) |
| | | .parseClaimsJws(token) |
| | | .getBody(); |
| | | } |
| | | |
| | | /** |
| | | * 解析token是否正确,不正确会报异常<br> |
| | | */ |
| | | public static void parseToken(String token) throws JwtException { |
| | | Jwts.parser().setSigningKey(JwtConstants.SECRET).parseClaimsJws(token).getBody(); |
| | | } |
| | | |
| | | /** |
| | | * <pre> |
| | | * 验证token是否失效 |
| | | * true:过期 false:没过期 |
| | | * </pre> |
| | | */ |
| | | public static Boolean isTokenExpired(String token) { |
| | | try { |
| | | final Date expiration = getExpirationDateFromToken(token); |
| | | return expiration.before(new Date()); |
| | | } catch (ExpiredJwtException expiredJwtException) { |
| | | return true; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 生成token(通过用户名和签名时候用的随机数) |
| | | */ |
| | | public static String generateToken(String userId) { |
| | | Map<String, Object> claims = new HashMap<>(); |
| | | return doGenerateToken(claims, userId); |
| | | } |
| | | |
| | | /** |
| | | * 生成token |
| | | */ |
| | | private static String doGenerateToken(Map<String, Object> claims, String subject) { |
| | | final Date createdDate = new Date(); |
| | | final Date expirationDate = new Date(createdDate.getTime() + JwtConstants.EXPIRATION * 1000); |
| | | |
| | | return Jwts.builder() |
| | | .setClaims(claims) |
| | | .setSubject(subject) |
| | | .setIssuedAt(createdDate) |
| | | .setExpiration(expirationDate) |
| | | .signWith(SignatureAlgorithm.HS512, JwtConstants.SECRET) |
| | | .compact(); |
| | | } |
| | | |
| | | /** |
| | | * 获取混淆MD5签名用的随机字符串 |
| | | */ |
| | | public static String getRandomKey() { |
| | | return ToolUtil.getRandomString(6); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.util; |
| | | |
| | | import com.stylefeng.guns.config.properties.GunsProperties; |
| | | |
| | | /** |
| | | * 验证码工具类 |
| | | */ |
| | | public class KaptchaUtil { |
| | | |
| | | /** |
| | | * 获取验证码开关 |
| | | */ |
| | | public static Boolean getKaptchaOnOff() { |
| | | return SpringContextHolder.getBean(GunsProperties.class).getKaptchaOpen(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.util; |
| | | |
| | | import com.obs.services.ObsClient; |
| | | import com.obs.services.model.ObjectMetadata; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.UUID; |
| | | |
| | | public class ObsUploadUtil { |
| | | //OBS图片访问域名 |
| | | public static String endPoint = "obs.cn-southwest-2.myhuaweicloud.com"; |
| | | public static String accessKeyId = "OQZYM4VGF42OBXL5DLSI"; |
| | | public static String accessKeySecret = "gSFrPUZ59go8gunBxeL9Stnh9AqZ2EiQzQADRowr"; |
| | | public static String bucketName = "huanqiucx"; |
| | | public static String oss_domain = "https://huanqiucx.obs.cn-southwest-2.myhuaweicloud.com/"; |
| | | |
| | | |
| | | // 创建ObsClient实例 |
| | | public static ObsClient obsClient = new ObsClient(accessKeyId, accessKeySecret, endPoint); |
| | | |
| | | public static String obsUpload(HttpServletRequest request, MultipartFile file) throws IOException{ |
| | | //CommonsMultipartFile file = (CommonsMultipartFile)multipartFile; |
| | | String fileName = ""; |
| | | if(file!=null && !"".equals(file.getOriginalFilename()) && file.getOriginalFilename()!=null){ |
| | | InputStream content = file.getInputStream();//获得指定文件的输入流 |
| | | ObjectMetadata meta = new ObjectMetadata();// 创建上传Object的Metadata |
| | | meta.setContentLength(file.getSize()); // 必须设置ContentLength |
| | | String originalFilename = file.getOriginalFilename(); |
| | | fileName = UUID.randomUUID().toString().replaceAll("-","") + originalFilename.subSequence(originalFilename.lastIndexOf("."), originalFilename.length()); |
| | | obsClient.putObject(bucketName,"admin/"+fileName,content,meta);// 上传Object. |
| | | if(fileName != null && !"".equals(fileName)){ |
| | | System.out.println(fileName); |
| | | fileName = oss_domain+"admin/"+fileName; |
| | | } |
| | | } |
| | | return fileName; |
| | | } |
| | | |
| | | /** |
| | | * 删除某个Object |
| | | * |
| | | * @param bucketUrl |
| | | * @return |
| | | */ |
| | | public static boolean deleteObject(String bucketUrl) { |
| | | try { |
| | | bucketUrl=bucketUrl.replace(oss_domain+"web",""); |
| | | // 删除Object. |
| | | obsClient.deleteObject(bucketName, bucketUrl); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return false; |
| | | } finally { |
| | | //ossClient.shutdown(); |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | // public static void createBucket(String bucketName) |
| | | // { |
| | | // //初始化 OSSClient |
| | | //// ossClient = new OssClient(endPoint, accessKeyId, accessKeySecret); |
| | | // |
| | | // // 新建一个Bucket |
| | | // Bucket bucket = ossClient.createBucket(bucketName); |
| | | // System.out.println(bucket.getName()); |
| | | // System.out.println(bucket.getCreationDate()); |
| | | // } |
| | | // |
| | | // public static void main(String[] args) { |
| | | // OssUploadUtil.createBucket("ssfdfsd"); |
| | | // } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.util; |
| | | |
| | | import com.obs.services.ObsClient; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.UUID; |
| | | |
| | | public class OssUploadUtil { |
| | | public static String endPoint = "obs.cn-south-1.myhuaweicloud.com"; |
| | | public static String accessKeyId = "MLJEFPYY0LJKAVA5C4YI"; |
| | | public static String accessKeySecret = "C8PmdLHAW7OOKR1fbEGYrqIiTh4yaLrRzA0uVZ89"; |
| | | public static String bucketName = "qinqinzhuanche"; |
| | | public static String oss_domain = "https://qinqinzhuanche.obs.cn-south-1.myhuaweicloud.com/"; |
| | | // 创建ObsClient实例 |
| | | public static ObsClient obsClient = new ObsClient(accessKeyId, accessKeySecret, endPoint); |
| | | |
| | | public static String ossUpload(HttpServletRequest request,MultipartFile file) throws IOException{ |
| | | //CommonsMultipartFile file = (CommonsMultipartFile)multipartFile; |
| | | String fileName = ""; |
| | | if(file!=null && !"".equals(file.getOriginalFilename()) && file.getOriginalFilename()!=null){ |
| | | InputStream content = file.getInputStream();//获得指定文件的输入流 |
| | | com.obs.services.model.ObjectMetadata meta = new com.obs.services.model.ObjectMetadata();// 创建上传Object的Metadata |
| | | meta.setContentLength(file.getSize()); // 必须设置ContentLength |
| | | String originalFilename = file.getOriginalFilename(); |
| | | fileName = UUID.randomUUID().toString().replaceAll("-","") + originalFilename.subSequence(originalFilename.lastIndexOf("."), originalFilename.length()); |
| | | obsClient.putObject(bucketName,fileName,content,meta);// 上传Object. |
| | | if(fileName != null && !"".equals(fileName)){ |
| | | System.out.println(fileName); |
| | | fileName = oss_domain+fileName; |
| | | } |
| | | } |
| | | return fileName; |
| | | } |
| | | |
| | | /** |
| | | * 删除某个Object |
| | | * |
| | | * @param bucketUrl |
| | | * @return |
| | | */ |
| | | public static boolean deleteObject(String bucketUrl) { |
| | | try { |
| | | bucketUrl=bucketUrl.replace(oss_domain+"web",""); |
| | | // 删除Object. |
| | | obsClient.deleteObject(bucketName, bucketUrl); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return false; |
| | | } finally { |
| | | //ossClient.shutdown(); |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.util; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLDecoder; |
| | | import java.net.URLEncoder; |
| | | import java.text.DecimalFormat; |
| | | import java.text.NumberFormat; |
| | | import java.text.ParseException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.UUID; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | |
| | | |
| | | /** |
| | | * 基本数据处理工具类 |
| | | */ |
| | | public class SinataUtil { |
| | | |
| | | |
| | | /** |
| | | * List集合分页<br/> |
| | | * 创建人:Mryang<br/> |
| | | * 时间:2016年7月28日-下午2:58:14 <br/> |
| | | * @param <T> |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param list |
| | | * @throws Exception List<UserOrderList> <br/> |
| | | */ |
| | | public static <T> List<T> listpage(int pageNo, int pageSize, List<T> list) throws Exception { |
| | | List<T> result = new ArrayList<T>(); |
| | | if (list != null && list.size() > 0) { |
| | | int allCount = list.size(); |
| | | if(pageNo > 1 && allCount < pageSize) { |
| | | return new ArrayList<>(); |
| | | } |
| | | int pageCount = (allCount + pageSize - 1) / pageSize; |
| | | if (pageNo >= pageCount) { |
| | | pageNo = pageCount; |
| | | } |
| | | int start = (pageNo - 1) * pageSize; |
| | | int end = pageNo * pageSize; |
| | | if (end >= allCount) { |
| | | end = allCount; |
| | | } |
| | | for (int i = start; i < end; i++) { |
| | | result.add(list.get(i)); |
| | | } |
| | | } |
| | | return (result != null && result.size() > 0) ? result : new ArrayList<T>(); |
| | | } |
| | | |
| | | /** |
| | | * Double类型取整 |
| | | * @param num |
| | | * @return |
| | | */ |
| | | public static String doubleTrans(double num) { |
| | | return String.valueOf((long) num); |
| | | } |
| | | |
| | | /** |
| | | * Double类型保留1位小数 |
| | | * |
| | | * @param num |
| | | * @return |
| | | */ |
| | | public static String doubleRetainOne(double num) { |
| | | DecimalFormat dfs = new DecimalFormat("0.0"); |
| | | return dfs.format(num); |
| | | } |
| | | |
| | | /** |
| | | * 5位随机数 |
| | | * @return |
| | | */ |
| | | public static synchronized String getFive() { |
| | | int i=(int)((Math.random()*9+1)*10000); |
| | | return i+""; |
| | | } |
| | | /** |
| | | * Double类型保留2位小数 |
| | | * |
| | | * @param num |
| | | * @return |
| | | */ |
| | | public static String doubleRetainTwo(double num) { |
| | | DecimalFormat dfs = new DecimalFormat("0.00"); |
| | | String.format("%.2f", num); |
| | | return dfs.format(num); |
| | | } |
| | | |
| | | /** |
| | | * Double类型保留1位小数(四舍五入) |
| | | * |
| | | * @param num |
| | | * @return |
| | | */ |
| | | public static String doubleForwardOne(double num) { |
| | | return String.format("%.1f", num); |
| | | } |
| | | |
| | | /** |
| | | * Double类型保留2位小数(四舍五入) |
| | | * |
| | | * @param num |
| | | * @return |
| | | */ |
| | | public static String doubleForwardTwo(double num) { |
| | | return String.format("%.2f", num); |
| | | } |
| | | |
| | | /** |
| | | * 字符串转换成Ascii |
| | | * |
| | | * @param value |
| | | * @return |
| | | */ |
| | | public static String stringToAscii(String value) { |
| | | StringBuffer sbu = new StringBuffer(); |
| | | char[] chars = value.toCharArray(); |
| | | for (int i = 0; i < chars.length; i++) { |
| | | if (i != chars.length - 1) { |
| | | sbu.append((int) chars[i]); |
| | | } else { |
| | | sbu.append((int) chars[i]); |
| | | } |
| | | } |
| | | return sbu.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 小数转换为百分比 |
| | | * |
| | | * @param decimal |
| | | * @return |
| | | * @author TaoNingBo |
| | | */ |
| | | public static String decTurnPercent(double decimal) { |
| | | NumberFormat num = NumberFormat.getPercentInstance(); |
| | | num.setMaximumIntegerDigits(3); |
| | | num.setMaximumFractionDigits(2); |
| | | return num.format(decimal); |
| | | } |
| | | |
| | | /** |
| | | * Ascii转换成字符串 |
| | | * |
| | | * @param value |
| | | * @return |
| | | */ |
| | | public static String asciiToString(String value) { |
| | | String[] chars = value.split(","); |
| | | StringBuffer sbu = new StringBuffer(); |
| | | for (int i = 0; i < chars.length; i++) { |
| | | sbu.append((char) Integer.parseInt(chars[i])); |
| | | } |
| | | return sbu.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 字符串转换unicode |
| | | * |
| | | * @param string |
| | | * @return |
| | | * @author TaoNingBo |
| | | */ |
| | | public static String string2Unicode(String string) { |
| | | StringBuffer unicode = new StringBuffer(); |
| | | for (int i = 0; i < string.length(); i++) { |
| | | // 取出每一个字符 |
| | | char c = string.charAt(i); |
| | | // 转换为unicode |
| | | unicode.append("\\u" + Integer.toHexString(c)); |
| | | } |
| | | return unicode.toString(); |
| | | } |
| | | |
| | | /** |
| | | * unicode 转字符串 |
| | | * |
| | | * @param unicode |
| | | * @return |
| | | * @author TaoNingBo |
| | | */ |
| | | public static String unicode2String(String unicode) { |
| | | StringBuffer string = new StringBuffer(); |
| | | String[] hex = unicode.split("\\\\u"); |
| | | for (int i = 1; i < hex.length; i++) { |
| | | // 转换出每一个代码点 |
| | | int data = Integer.parseInt(hex[i], 16); |
| | | // 追加成string |
| | | string.append((char) data); |
| | | } |
| | | return string.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 字符串编码转换的实现方法 |
| | | * |
| | | * @param str |
| | | * 待转换编码的字符串 |
| | | * @param newCharset |
| | | * 目标编码 |
| | | * @return |
| | | * @throws UnsupportedEncodingException |
| | | */ |
| | | public static String changeCharset(String str, String newCharset) throws UnsupportedEncodingException { |
| | | if (str != null) { |
| | | // 用默认字符编码解码字符串。 |
| | | byte[] bs = str.getBytes(); |
| | | // 用新的字符编码生成字符串 |
| | | return new String(bs, newCharset); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 注: \n 回车( ) \t 水平制表符( ) \s 空格(\u0008) \r 换行( ) |
| | | * |
| | | * @param str |
| | | * @return |
| | | */ |
| | | public static String replaceBlank(String str) { |
| | | String dest = ""; |
| | | if (str != null) { |
| | | Pattern p = Pattern.compile("\\s*|\t|\r|\n"); |
| | | Matcher m = p.matcher(str); |
| | | dest = m.replaceAll(""); |
| | | } |
| | | return dest; |
| | | } |
| | | |
| | | /** |
| | | * 判断该字符串不能为空 |
| | | * |
| | | * @param str |
| | | * @return |
| | | * @author TaoNingBo |
| | | */ |
| | | public static boolean isNotEmpty(Object str) { |
| | | return !isEmpty(str); |
| | | } |
| | | |
| | | |
| | | public static boolean isNotEmptyUndefined(Object str) { |
| | | return !isEmpty(str) && !str.toString().equals("undefined"); |
| | | } |
| | | |
| | | /** |
| | | * 字符串编码转换的实现方法 |
| | | * |
| | | * @param str |
| | | * 待转换编码的字符串 |
| | | * @param oldCharset |
| | | * 原编码 |
| | | * @param newCharset |
| | | * 目标编码 |
| | | * @return |
| | | * @throws UnsupportedEncodingException |
| | | */ |
| | | public static String changeCharset(String str, String oldCharset, String newCharset) throws UnsupportedEncodingException { |
| | | if (str != null) { |
| | | // 用旧的字符编码解码字符串。解码可能会出现异常。 |
| | | byte[] bs = str.getBytes(oldCharset); |
| | | // 用新的字符编码生成字符串 |
| | | return new String(bs, newCharset); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 给手机号码加分割符 |
| | | * |
| | | * @param phone |
| | | * @return |
| | | * @author TaoNingBo |
| | | */ |
| | | public static String splitPhone(String phone) { |
| | | if (isNotEmpty(phone)) { |
| | | String strone = phone.substring(0, 3); |
| | | String strtwo = phone.substring(strone.length(), 7); |
| | | String strthree = phone.substring(strtwo.length() + strone.length(), phone.length()); |
| | | return strone + "-" + strtwo + "-" + strthree; |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | /** |
| | | * 非空判断 |
| | | * |
| | | * @param str |
| | | * @return |
| | | * @author TaoNingBo |
| | | */ |
| | | public static boolean isEmpty(Object str) { |
| | | return str == null || str.toString().length() == 0 || str.equals("") || str.toString().matches("\\s*"); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 将List<{@link Object}>转换成List<{@link T}> |
| | | * |
| | | * @param list |
| | | * 将要转换的对象 |
| | | * @param clazs |
| | | * 需要转换的泛型对象 |
| | | * @return |
| | | * @author TaoNingBo |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | public static <T> List<T> fromToObject(List<?> list, Class<T> clazs) { |
| | | List<T> t = new ArrayList<T>(); |
| | | for (Object object : list) { |
| | | t.add((T) object); |
| | | } |
| | | return t; |
| | | } |
| | | |
| | | /** |
| | | * 生成 uuid, 即用来标识一笔单,也用做 nonce_str |
| | | * @return |
| | | */ |
| | | public static String generateUUID() { |
| | | return UUID.randomUUID().toString().replaceAll("-", "").substring(0, 32); |
| | | } |
| | | |
| | | /** |
| | | * 将List<{@link Object}>转换成List<{@link Map<String, Object>}> |
| | | * |
| | | * @param list |
| | | * @return |
| | | * @author TaoNingBo |
| | | */ |
| | | @SuppressWarnings("unchecked") |
| | | public static List<Map<String, Object>> fromToObject_M(List<?> list) { |
| | | List<Map<String, Object>> t = new ArrayList<Map<String, Object>>(); |
| | | for (Object object : list) { |
| | | t.add((Map<String, Object>) object); |
| | | } |
| | | return t; |
| | | } |
| | | |
| | | /** |
| | | * URL编码 |
| | | * |
| | | * @param url |
| | | * @return |
| | | */ |
| | | @SuppressWarnings("deprecation") |
| | | public static String URLEncode(String url) { |
| | | try { |
| | | return URLEncoder.encode(url, "UTF-8"); |
| | | } catch (UnsupportedEncodingException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return URLEncoder.encode(url); |
| | | } |
| | | |
| | | /** |
| | | * URL解码 |
| | | * |
| | | * @param url |
| | | * @return |
| | | */ |
| | | @SuppressWarnings("deprecation") |
| | | public static String URLDecode(String url) { |
| | | try { |
| | | return URLDecoder.decode(url, "UTF-8"); |
| | | } catch (UnsupportedEncodingException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return URLDecoder.decode(url); |
| | | } |
| | | public static void main(String[] args) throws ParseException { |
| | | |
| | | System.out.println(doubleRetainTwo(0.0)); |
| | | |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.core.util; |
| | | |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.apache.poi.xssf.usermodel.XSSFWorkbook; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | |
| | | public class WoUtil { |
| | | public static Workbook ImportFile(MultipartFile importFile) { |
| | | Workbook book = null; |
| | | if(importFile == null) |
| | | { |
| | | //throw new WoException(SysConstant.ERR_EXCEL_NULL); |
| | | } |
| | | String fileName = importFile.getOriginalFilename(); |
| | | try { |
| | | if(fileName.endsWith(".xlsx")) //当表格的后缀是".xlsx时" |
| | | { |
| | | book = new XSSFWorkbook(importFile.getInputStream()); |
| | | }else |
| | | { |
| | | book = new HSSFWorkbook(importFile.getInputStream()); |
| | | } |
| | | } catch (IOException e) { |
| | | //throw new WoException(e,SysConstant.ERR_EXCEL_NO); |
| | | } |
| | | return book; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.api; |
| | | |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.base.tips.ErrorTip; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.shiro.ShiroUser; |
| | | import com.stylefeng.guns.core.util.JwtTokenUtil; |
| | | import com.stylefeng.guns.modular.system.dao.UserMapper; |
| | | import com.stylefeng.guns.modular.system.model.User; |
| | | import org.apache.shiro.authc.SimpleAuthenticationInfo; |
| | | import org.apache.shiro.authc.UsernamePasswordToken; |
| | | import org.apache.shiro.authc.credential.HashedCredentialsMatcher; |
| | | import org.apache.shiro.crypto.hash.Md5Hash; |
| | | import org.apache.shiro.util.ByteSource; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.HashMap; |
| | | |
| | | /** |
| | | * 接口控制器提供 |
| | | * |
| | | * @author stylefeng |
| | | * @Date 2018/7/20 23:39 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/gunsApi") |
| | | public class ApiController extends BaseController { |
| | | |
| | | @Autowired |
| | | private UserMapper userMapper; |
| | | |
| | | /** |
| | | * api登录接口,通过账号密码获取token |
| | | */ |
| | | @RequestMapping("/auth") |
| | | public Object auth(@RequestParam("username") String username, |
| | | @RequestParam("password") String password) { |
| | | |
| | | //封装请求账号密码为shiro可验证的token |
| | | UsernamePasswordToken usernamePasswordToken = new UsernamePasswordToken(username, password.toCharArray()); |
| | | |
| | | //获取数据库中的账号密码,准备比对 |
| | | User user = userMapper.getByAccount(username); |
| | | |
| | | String credentials = user.getPassword(); |
| | | String salt = user.getSalt(); |
| | | ByteSource credentialsSalt = new Md5Hash(salt); |
| | | SimpleAuthenticationInfo simpleAuthenticationInfo = new SimpleAuthenticationInfo( |
| | | new ShiroUser(), credentials, credentialsSalt, ""); |
| | | |
| | | //校验用户账号密码 |
| | | HashedCredentialsMatcher md5CredentialsMatcher = new HashedCredentialsMatcher(); |
| | | md5CredentialsMatcher.setHashAlgorithmName(ShiroKit.hashAlgorithmName); |
| | | md5CredentialsMatcher.setHashIterations(ShiroKit.hashIterations); |
| | | boolean passwordTrueFlag = md5CredentialsMatcher.doCredentialsMatch( |
| | | usernamePasswordToken, simpleAuthenticationInfo); |
| | | |
| | | if (passwordTrueFlag) { |
| | | HashMap<String, Object> result = new HashMap<>(); |
| | | result.put("token", JwtTokenUtil.generateToken(String.valueOf(user.getId()))); |
| | | return result; |
| | | } else { |
| | | return new ErrorTip(500, "账号密码错误!"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 测试接口是否走鉴权 |
| | | */ |
| | | @RequestMapping(value = "/test", method = RequestMethod.POST) |
| | | public Object test() { |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.stylefeng.guns.modular.code.controller; |
| | | |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.config.properties.DruidProperties; |
| | | import com.stylefeng.guns.generator.action.config.WebGeneratorConfig; |
| | | import com.stylefeng.guns.generator.action.model.GenQo; |
| | | import com.stylefeng.guns.modular.code.factory.DefaultTemplateFactory; |
| | | import com.stylefeng.guns.modular.code.service.TableService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | 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.RequestMethod; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | /** |
| | | * 代码生成控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2017年11月30日16:39:19 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/code") |
| | | public class CodeController extends BaseController { |
| | | |
| | | private static String PREFIX = "/code"; |
| | | |
| | | @Autowired |
| | | private TableService tableService; |
| | | |
| | | @Autowired |
| | | private DruidProperties druidProperties; |
| | | |
| | | /** |
| | | * 跳转到代码生成主页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String blackboard(Model model) { |
| | | model.addAttribute("tables", tableService.getAllTables()); |
| | | model.addAttribute("params", DefaultTemplateFactory.getDefaultParams()); |
| | | model.addAttribute("templates", DefaultTemplateFactory.getDefaultTemplates()); |
| | | return PREFIX + "/code.html"; |
| | | } |
| | | |
| | | /** |
| | | * 生成代码 |
| | | */ |
| | | @ApiOperation("生成代码") |
| | | @RequestMapping(value = "/generate", method = RequestMethod.POST) |
| | | @ResponseBody |
| | | public Object generate(GenQo genQo) { |
| | | genQo.setUrl(druidProperties.getUrl()); |
| | | genQo.setUserName(druidProperties.getUsername()); |
| | | genQo.setPassword(druidProperties.getPassword()); |
| | | WebGeneratorConfig webGeneratorConfig = new WebGeneratorConfig(genQo); |
| | | webGeneratorConfig.doMpGeneration(); |
| | | webGeneratorConfig.doGunsGeneration(); |
| | | return SUCCESS_TIP; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.code.factory; |
| | | |
| | | |
| | | import com.stylefeng.guns.GunsApplication; |
| | | import com.stylefeng.guns.core.CoreFlag; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.generator.action.model.GenQo; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 模板种类构建器 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-12-04-下午2:59 |
| | | */ |
| | | public class DefaultTemplateFactory { |
| | | |
| | | /** |
| | | * 获取所有的模板种类 |
| | | */ |
| | | public static List<Map<String,Object>> getDefaultTemplates(){ |
| | | ArrayList<Map<String, Object>> templates = new ArrayList<>(); |
| | | templates.add(create("controllerSwitch","controller-控制器模板")); |
| | | templates.add(create("entitySwitch","entity-实体模板")); |
| | | templates.add(create("serviceSwitch","service-service模板")); |
| | | templates.add(create("daoSwitch","dao-dao模板")); |
| | | templates.add(create("indexPageSwitch","indexPage-首页模板")); |
| | | templates.add(create("addPageSwitch","addPage-添加页面模板")); |
| | | templates.add(create("editPageSwitch","editPage-编辑页面模板")); |
| | | templates.add(create("jsSwitch","indexJs-主页js模板")); |
| | | templates.add(create("infoJsSwitch","infoJs-详情页js模板")); |
| | | templates.add(create("sqlSwitch","sql-sql语句模板")); |
| | | return templates; |
| | | } |
| | | |
| | | /** |
| | | * 获取默认的参数 |
| | | */ |
| | | public static GenQo getDefaultParams(){ |
| | | GenQo genQo = new GenQo(); |
| | | genQo.setProjectPath(ToolUtil.getWebRootPath(null)); |
| | | genQo.setAuthor("stylefeng"); |
| | | genQo.setProjectPackage(GunsApplication.class.getPackage().getName()); |
| | | genQo.setCorePackage(CoreFlag.class.getPackage().getName()); |
| | | genQo.setIgnoreTabelPrefix("sys_"); |
| | | genQo.setModuleName("system"); |
| | | genQo.setParentMenuName("系统管理"); |
| | | return genQo; |
| | | } |
| | | |
| | | private static Map<String,Object> create(String key,String desc){ |
| | | HashMap<String, Object> template = new HashMap<>(); |
| | | template.put("key",key); |
| | | template.put("desc",desc); |
| | | return template; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.code.service; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.SqlRunner; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 获取数据库所有的表 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-12-04-下午1:37 |
| | | */ |
| | | @Service |
| | | public class TableService { |
| | | |
| | | @Value("${spring.datasource.db-name}") |
| | | private String dbName; |
| | | |
| | | /** |
| | | * 获取当前数据库所有的表信息 |
| | | */ |
| | | public List<Map<String, Object>> getAllTables() { |
| | | String sql = "select TABLE_NAME as tableName,TABLE_COMMENT as tableComment from information_schema.`TABLES` where TABLE_SCHEMA = '" + dbName + "'"; |
| | | return SqlRunner.db().selectList(sql); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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.DateUtil; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | 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 java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-17 20:51:18 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/driverActivity") |
| | | public class DriverActivityController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/driverActivity/"; |
| | | |
| | | @Autowired |
| | | private IDriverActivityService driverActivityService; |
| | | |
| | | @Autowired |
| | | private IDriverActivityOnlineService driverActivityOnlineService; |
| | | |
| | | @Autowired |
| | | private IDriverActivityOrderService driverActivityOrderService; |
| | | |
| | | @Autowired |
| | | private IDriverActivityRegisteredService driverActivityRegisteredService; |
| | | |
| | | @Autowired |
| | | private IDriverActivityHistoryService driverActivityHistoryService; |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "driverActivity.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加 |
| | | */ |
| | | @RequestMapping("/driverActivity_add") |
| | | public String driverActivityAdd() { |
| | | return PREFIX + "driverActivity_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转领取统计 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/receiveRecord") |
| | | public String receiveRecord(Model model,Integer activityId){ |
| | | model.addAttribute("activityId",activityId); |
| | | DriverActivity driverActivity = driverActivityService.selectById(activityId); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | model.addAttribute("startTime", sdf.format(driverActivity.getStartTime())); |
| | | model.addAttribute("endTime", sdf.format(driverActivity.getEndTime())); |
| | | DriverActivityRegistered driverActivityRegistered = driverActivityRegisteredService.selectOne(new EntityWrapper<DriverActivityRegistered>().eq("driverActivityId",activityId).eq("type",1)); |
| | | model.addAttribute("id1",driverActivityRegistered.getId()); |
| | | driverActivityRegistered = driverActivityRegisteredService.selectOne(new EntityWrapper<DriverActivityRegistered>().eq("driverActivityId",activityId).eq("type",2)); |
| | | model.addAttribute("id2",driverActivityRegistered.getId()); |
| | | DriverActivityOnline driverActivityOnline = driverActivityOnlineService.selectOne(new EntityWrapper<DriverActivityOnline>().eq("driverActivityId",activityId).eq("type",1)); |
| | | model.addAttribute("id3",driverActivityOnline.getId()); |
| | | //统计专车在线 |
| | | // driverActivityOnline = driverActivityOnlineService.selectOne(new EntityWrapper<DriverActivityOnline>().eq("driverActivityId",activityId).eq("type",2)); |
| | | // model.addAttribute("id4",driverActivityOnline.getId()); |
| | | driverActivityOnline = driverActivityOnlineService.selectOne(new EntityWrapper<DriverActivityOnline>().eq("driverActivityId",activityId).eq("type",3)); |
| | | model.addAttribute("id5",driverActivityOnline.getId()); |
| | | DriverActivityOrder driverActivityOrder = driverActivityOrderService.selectOne(new EntityWrapper<DriverActivityOrder>().eq("driverActivityId",activityId)); |
| | | model.addAttribute("id6",driverActivityOrder.getId()); |
| | | return PREFIX + "receiveRecord.html"; |
| | | } |
| | | |
| | | @RequestMapping(value = "/receiveRecordDetail") |
| | | @ResponseBody |
| | | public Object receiveRecordDetail(String createTime,Integer activityId) { |
| | | 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"); |
| | | }else{ |
| | | DriverActivity driverActivity = driverActivityService.selectById(activityId); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | startTimes=driverActivity.getStartTime(); |
| | | endTimes=driverActivity.getEndTime(); |
| | | } |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | Map<String,Object> map = new HashMap<>(); |
| | | DriverActivityRegistered driverActivityRegistered = driverActivityRegisteredService.selectOne(new EntityWrapper<DriverActivityRegistered>().eq("driverActivityId",activityId) |
| | | .eq("type",1).where("startTime >= '" + sdf.format(startTimes) + "' and endTime < '" + sdf.format(endTimes) + "'").orderBy("insertTime desc limit 0, 1")); |
| | | //统计邀请司机注册 |
| | | List<DriverActivityHistory> historyList = driverActivityHistoryService.selectList(new EntityWrapper<DriverActivityHistory>() |
| | | .between("insertTime",startTimes,endTimes).eq("type",1).eq("activityId",driverActivityRegistered.getId()).eq("carryOut",2)); |
| | | Double totalMOney=0d; |
| | | Double money=0d; |
| | | Integer number=0; |
| | | for(DriverActivityHistory history:historyList){ |
| | | totalMOney+=history.getMoney(); |
| | | money+=history.getMoney(); |
| | | number+=1; |
| | | } |
| | | map.put("money1",money); |
| | | map.put("number1",number); |
| | | driverActivityRegistered = driverActivityRegisteredService.selectOne(new EntityWrapper<DriverActivityRegistered>().eq("driverActivityId",activityId) |
| | | .eq("type",2).where("startTime >= '" + sdf.format(startTimes) + "' and endTime < '" + sdf.format(endTimes) + "'").orderBy("insertTime desc limit 0, 1")); |
| | | //统计邀请用户注册 |
| | | historyList = driverActivityHistoryService.selectList(new EntityWrapper<DriverActivityHistory>().between("insertTime",startTimes,endTimes).eq("type",2).eq("activityId",driverActivityRegistered.getId()).eq("carryOut",2)); |
| | | money=0d; |
| | | number=0; |
| | | for(DriverActivityHistory history:historyList){ |
| | | totalMOney+=history.getMoney(); |
| | | money+=history.getMoney(); |
| | | number+=1; |
| | | } |
| | | map.put("money2",money); |
| | | map.put("number2",number); |
| | | DriverActivityOnline driverActivityOnline = driverActivityOnlineService.selectOne(new EntityWrapper<DriverActivityOnline>().eq("driverActivityId",activityId) |
| | | .eq("type",1).where("startTime >= '" + sdf.format(startTimes) + "' and endTime < '" + sdf.format(endTimes) + "'").orderBy("insertTime desc limit 0, 1")); |
| | | //统计专车在线 |
| | | historyList = driverActivityHistoryService.selectList(new EntityWrapper<DriverActivityHistory>().between("insertTime",startTimes,endTimes).eq("type",3).eq("activityId",driverActivityOnline.getId()).eq("carryOut",2)); |
| | | money=0d; |
| | | number=0; |
| | | for(DriverActivityHistory history:historyList){ |
| | | totalMOney+=history.getMoney(); |
| | | money+=history.getMoney(); |
| | | number+=1; |
| | | } |
| | | map.put("money3",money); |
| | | map.put("number3",number); |
| | | driverActivityOnline = driverActivityOnlineService.selectOne(new EntityWrapper<DriverActivityOnline>().eq("driverActivityId",activityId) |
| | | .eq("type",2).where("startTime >= '" + sdf.format(startTimes) + "' and endTime < '" + sdf.format(endTimes) + "'").orderBy("insertTime desc limit 0, 1")); |
| | | // //统计出租车在线 |
| | | // historyList = driverActivityHistoryService.selectList(new EntityWrapper<DriverActivityHistory>().between("insertTime",startTimes,endTimes).eq("type",3).eq("activityId",driverActivityOnline.getId()).eq("carryOut",2)); |
| | | // money=0d; |
| | | // number=0; |
| | | // for(DriverActivityHistory history:historyList){ |
| | | // totalMOney+=history.getMoney(); |
| | | // money+=history.getMoney(); |
| | | // number+=1; |
| | | // } |
| | | // map.put("money4",money); |
| | | // map.put("number4",number); |
| | | // driverActivityOnline = driverActivityOnlineService.selectOne(new EntityWrapper<DriverActivityOnline>().eq("driverActivityId",activityId) |
| | | // .eq("type",3).where("startTime >= '" + sdf.format(startTimes) + "' and endTime < '" + sdf.format(endTimes) + "'").orderBy("insertTime desc limit 0, 1")); |
| | | //统计城际在线 |
| | | // historyList = driverActivityHistoryService.selectList(new EntityWrapper<DriverActivityHistory>().between("insertTime",startTimes,endTimes).eq("type",3).eq("activityId",driverActivityOnline.getId()).eq("carryOut",2)); |
| | | // money=0d; |
| | | // number=0; |
| | | // for(DriverActivityHistory history:historyList){ |
| | | // totalMOney+=history.getMoney(); |
| | | // money+=history.getMoney(); |
| | | // number+=1; |
| | | // } |
| | | // map.put("money5",money); |
| | | // map.put("number5",number); |
| | | // DriverActivityOrder driverActivityOrder = driverActivityOrderService.selectOne(new EntityWrapper<DriverActivityOrder>() |
| | | // .eq("driverActivityId",activityId).where("startTime >= '" + sdf.format(startTimes) + "' and endTime < '" + sdf.format(endTimes) + "'").orderBy("insertTime desc limit 0, 1")); |
| | | //统计订单数 |
| | | // historyList = driverActivityHistoryService.selectList(new EntityWrapper<DriverActivityHistory>().between("insertTime",startTimes,endTimes).eq("type",4).eq("activityId",driverActivityOrder.getId()).eq("carryOut",2)); |
| | | // money=0d; |
| | | // number=0; |
| | | // for(DriverActivityHistory history:historyList){ |
| | | // totalMOney+=history.getMoney(); |
| | | // money+=history.getMoney(); |
| | | // number+=1; |
| | | // } |
| | | // map.put("money6",money); |
| | | // map.put("number6",number); |
| | | map.put("totalMOney",totalMOney); |
| | | return map; |
| | | } |
| | | /** |
| | | * 跳转到修改 |
| | | */ |
| | | @RequestMapping("/driverActivity_update/{driverActivityId}") |
| | | public String driverActivityUpdate(@PathVariable Integer driverActivityId, Model model) { |
| | | DriverActivity driverActivity = driverActivityService.selectById(driverActivityId); |
| | | model.addAttribute("item",driverActivity); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | model.addAttribute("startTime", sdf.format(driverActivity.getStartTime())); |
| | | model.addAttribute("endTime", sdf.format(driverActivity.getEndTime())); |
| | | model.addAttribute("online1",driverActivityOnlineService.selectOne(new EntityWrapper<DriverActivityOnline>().eq("driverActivityId",driverActivityId).eq("type",1))); |
| | | model.addAttribute("online2",driverActivityOnlineService.selectOne(new EntityWrapper<DriverActivityOnline>().eq("driverActivityId",driverActivityId).eq("type",2))); |
| | | model.addAttribute("online3",driverActivityOnlineService.selectOne(new EntityWrapper<DriverActivityOnline>().eq("driverActivityId",driverActivityId).eq("type",3))); |
| | | DriverActivityOrder driverActivityOrder = driverActivityOrderService.selectOne(new EntityWrapper<DriverActivityOrder>().eq("driverActivityId",driverActivityId)); |
| | | if(driverActivityOrder!=null){ |
| | | model.addAttribute("startTime1", driverActivityOrder.getStart()+" - "+driverActivityOrder.getEnd()); |
| | | }else{ |
| | | model.addAttribute("startTime1", ""); |
| | | } |
| | | model.addAttribute("order",driverActivityOrder); |
| | | model.addAttribute("regist1",driverActivityRegisteredService.selectOne(new EntityWrapper<DriverActivityRegistered>().eq("driverActivityId",driverActivityId).eq("type",1))); |
| | | model.addAttribute("regist2",driverActivityRegisteredService.selectOne(new EntityWrapper<DriverActivityRegistered>().eq("driverActivityId",driverActivityId).eq("type",2))); |
| | | |
| | | LogObjectHolder.me().set(driverActivity); |
| | | return PREFIX + "driverActivity_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String createTime,String name) { |
| | | ShiroUser user = ShiroKit.getUser(); |
| | | 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(); |
| | | page.setRecords(driverActivityService.getList(page,beginTime,endTime,name,user.getRoleType(),user.getObjectId())); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(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) { |
| | | |
| | | driverActivityService.insertOrUpdate(null,staTime,startTime, num1, num2 |
| | | , num3 |
| | | , num4 |
| | | , num5 |
| | | , num6 |
| | | , num7 |
| | | , num8 |
| | | , num9 |
| | | , num10 |
| | | , num11); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer driverActivityId) { |
| | | driverActivityService.deleteById(driverActivityId); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(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) { |
| | | driverActivityService.insertOrUpdate(id,staTime,startTime, num1, num2 |
| | | , num3 |
| | | , num4 |
| | | , num5 |
| | | , num6 |
| | | , num7 |
| | | , num8 |
| | | , num9 |
| | | , num10 |
| | | , num11); |
| | | return SUCCESS_TIP; |
| | | } |
| | | @RequestMapping(value = "/updateStatus") |
| | | @ResponseBody |
| | | public Object updateStatus(DriverActivity driverActivity) { |
| | | driverActivityService.updateById(driverActivity); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | @RequestMapping("/driverActivity_detail/{driverActivityId}") |
| | | public String driverActivityDetail(@PathVariable Integer driverActivityId, Model model) { |
| | | DriverActivity driverActivity = driverActivityService.selectById(driverActivityId); |
| | | model.addAttribute("item",driverActivity); |
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | model.addAttribute("startTime", sdf.format(driverActivity.getStartTime())); |
| | | model.addAttribute("endTime", sdf.format(driverActivity.getEndTime())); |
| | | |
| | | model.addAttribute("online1",driverActivityOnlineService.selectOne(new EntityWrapper<DriverActivityOnline>().eq("driverActivityId",driverActivityId).eq("type",1))); |
| | | model.addAttribute("online2",driverActivityOnlineService.selectOne(new EntityWrapper<DriverActivityOnline>().eq("driverActivityId",driverActivityId).eq("type",2))); |
| | | model.addAttribute("online3",driverActivityOnlineService.selectOne(new EntityWrapper<DriverActivityOnline>().eq("driverActivityId",driverActivityId).eq("type",3))); |
| | | model.addAttribute("order",driverActivityOrderService.selectOne(new EntityWrapper<DriverActivityOrder>().eq("driverActivityId",driverActivityId))); |
| | | model.addAttribute("regist1",driverActivityRegisteredService.selectOne(new EntityWrapper<DriverActivityRegistered>().eq("driverActivityId",driverActivityId).eq("type",1))); |
| | | model.addAttribute("regist2",driverActivityRegisteredService.selectOne(new EntityWrapper<DriverActivityRegistered>().eq("driverActivityId",driverActivityId).eq("type",2))); |
| | | LogObjectHolder.me().set(driverActivity); |
| | | return PREFIX + "driverActivity_detail.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到立即处理页面 |
| | | */ |
| | | @RequestMapping("/driverActivity_immediately/{id}") |
| | | public String driverActivityImmediately(@PathVariable Integer id, Model model) { |
| | | model.addAttribute("id",id); |
| | | return PREFIX + "driverActivity_immediately.html"; |
| | | } |
| | | /** |
| | | * 立即处理操作 |
| | | */ |
| | | @RequestMapping(value = "/immediately") |
| | | @ResponseBody |
| | | public Object immediately(@RequestParam Integer id,@RequestParam Integer state,@RequestParam String remark) { |
| | | DriverActivity driverActivity = driverActivityService.selectById(id); |
| | | if (SinataUtil.isNotEmpty(driverActivity)){ |
| | | driverActivity.setStatus(state); |
| | | driverActivity.setRemark(remark); |
| | | driverActivityService.updateById(driverActivity); |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | 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.DriverActivityHistory; |
| | | import com.stylefeng.guns.modular.system.service.IDriverActivityHistoryService; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-17 20:51:26 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/driverActivityHistory") |
| | | public class DriverActivityHistoryController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/driverActivityHistory/"; |
| | | |
| | | @Autowired |
| | | private IDriverActivityHistoryService driverActivityHistoryService; |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index(Model model,Integer type,Integer activityId) { |
| | | model.addAttribute("type",type); |
| | | model.addAttribute("activityId",activityId); |
| | | return PREFIX + "driverActivityHistory.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加 |
| | | */ |
| | | @RequestMapping("/driverActivityHistory_add") |
| | | public String driverActivityHistoryAdd() { |
| | | return PREFIX + "driverActivityHistory_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改 |
| | | */ |
| | | @RequestMapping("/driverActivityHistory_update/{driverActivityHistoryId}") |
| | | public String driverActivityHistoryUpdate(@PathVariable Integer driverActivityHistoryId, Model model) { |
| | | DriverActivityHistory driverActivityHistory = driverActivityHistoryService.selectById(driverActivityHistoryId); |
| | | model.addAttribute("item",driverActivityHistory); |
| | | LogObjectHolder.me().set(driverActivityHistory); |
| | | return PREFIX + "driverActivityHistory_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(Integer type,Integer activityId) { |
| | | |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | page.setRecords(driverActivityHistoryService.getList(page,activityId,type)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(DriverActivityHistory driverActivityHistory) { |
| | | driverActivityHistoryService.insert(driverActivityHistory); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer driverActivityHistoryId) { |
| | | driverActivityHistoryService.deleteById(driverActivityHistoryId); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(DriverActivityHistory driverActivityHistory) { |
| | | driverActivityHistoryService.updateById(driverActivityHistory); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @RequestMapping(value = "/detail/{driverActivityHistoryId}") |
| | | @ResponseBody |
| | | public Object detail(@PathVariable("driverActivityHistoryId") Integer driverActivityHistoryId) { |
| | | return driverActivityHistoryService.selectById(driverActivityHistoryId); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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.DriverActivityOnline; |
| | | import com.stylefeng.guns.modular.system.service.IDriverActivityOnlineService; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-17 20:51:31 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/driverActivityOnline") |
| | | public class DriverActivityOnlineController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/driverActivityOnline/"; |
| | | |
| | | @Autowired |
| | | private IDriverActivityOnlineService driverActivityOnlineService; |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "driverActivityOnline.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加 |
| | | */ |
| | | @RequestMapping("/driverActivityOnline_add") |
| | | public String driverActivityOnlineAdd() { |
| | | return PREFIX + "driverActivityOnline_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改 |
| | | */ |
| | | @RequestMapping("/driverActivityOnline_update/{driverActivityOnlineId}") |
| | | public String driverActivityOnlineUpdate(@PathVariable Integer driverActivityOnlineId, Model model) { |
| | | DriverActivityOnline driverActivityOnline = driverActivityOnlineService.selectById(driverActivityOnlineId); |
| | | model.addAttribute("item",driverActivityOnline); |
| | | LogObjectHolder.me().set(driverActivityOnline); |
| | | return PREFIX + "driverActivityOnline_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String condition) { |
| | | return driverActivityOnlineService.selectList(null); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(DriverActivityOnline driverActivityOnline) { |
| | | driverActivityOnlineService.insert(driverActivityOnline); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer driverActivityOnlineId) { |
| | | driverActivityOnlineService.deleteById(driverActivityOnlineId); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(DriverActivityOnline driverActivityOnline) { |
| | | driverActivityOnlineService.updateById(driverActivityOnline); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @RequestMapping(value = "/detail/{driverActivityOnlineId}") |
| | | @ResponseBody |
| | | public Object detail(@PathVariable("driverActivityOnlineId") Integer driverActivityOnlineId) { |
| | | return driverActivityOnlineService.selectById(driverActivityOnlineId); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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.DriverActivityOrder; |
| | | import com.stylefeng.guns.modular.system.service.IDriverActivityOrderService; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-17 20:51:36 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/driverActivityOrder") |
| | | public class DriverActivityOrderController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/driverActivityOrder/"; |
| | | |
| | | @Autowired |
| | | private IDriverActivityOrderService driverActivityOrderService; |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "driverActivityOrder.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加 |
| | | */ |
| | | @RequestMapping("/driverActivityOrder_add") |
| | | public String driverActivityOrderAdd() { |
| | | return PREFIX + "driverActivityOrder_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改 |
| | | */ |
| | | @RequestMapping("/driverActivityOrder_update/{driverActivityOrderId}") |
| | | public String driverActivityOrderUpdate(@PathVariable Integer driverActivityOrderId, Model model) { |
| | | DriverActivityOrder driverActivityOrder = driverActivityOrderService.selectById(driverActivityOrderId); |
| | | model.addAttribute("item",driverActivityOrder); |
| | | LogObjectHolder.me().set(driverActivityOrder); |
| | | return PREFIX + "driverActivityOrder_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String condition) { |
| | | return driverActivityOrderService.selectList(null); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(DriverActivityOrder driverActivityOrder) { |
| | | driverActivityOrderService.insert(driverActivityOrder); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer driverActivityOrderId) { |
| | | driverActivityOrderService.deleteById(driverActivityOrderId); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(DriverActivityOrder driverActivityOrder) { |
| | | driverActivityOrderService.updateById(driverActivityOrder); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @RequestMapping(value = "/detail/{driverActivityOrderId}") |
| | | @ResponseBody |
| | | public Object detail(@PathVariable("driverActivityOrderId") Integer driverActivityOrderId) { |
| | | return driverActivityOrderService.selectById(driverActivityOrderId); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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.DriverActivityRegistered; |
| | | import com.stylefeng.guns.modular.system.service.IDriverActivityRegisteredService; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-17 20:51:43 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/driverActivityRegistered") |
| | | public class DriverActivityRegisteredController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/driverActivityRegistered/"; |
| | | |
| | | @Autowired |
| | | private IDriverActivityRegisteredService driverActivityRegisteredService; |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "driverActivityRegistered.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加 |
| | | */ |
| | | @RequestMapping("/driverActivityRegistered_add") |
| | | public String driverActivityRegisteredAdd() { |
| | | return PREFIX + "driverActivityRegistered_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改 |
| | | */ |
| | | @RequestMapping("/driverActivityRegistered_update/{driverActivityRegisteredId}") |
| | | public String driverActivityRegisteredUpdate(@PathVariable Integer driverActivityRegisteredId, Model model) { |
| | | DriverActivityRegistered driverActivityRegistered = driverActivityRegisteredService.selectById(driverActivityRegisteredId); |
| | | model.addAttribute("item",driverActivityRegistered); |
| | | LogObjectHolder.me().set(driverActivityRegistered); |
| | | return PREFIX + "driverActivityRegistered_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String condition) { |
| | | return driverActivityRegisteredService.selectList(null); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(DriverActivityRegistered driverActivityRegistered) { |
| | | driverActivityRegisteredService.insert(driverActivityRegistered); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer driverActivityRegisteredId) { |
| | | driverActivityRegisteredService.deleteById(driverActivityRegisteredId); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(DriverActivityRegistered driverActivityRegistered) { |
| | | driverActivityRegisteredService.updateById(driverActivityRegistered); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @RequestMapping(value = "/detail/{driverActivityRegisteredId}") |
| | | @ResponseBody |
| | | public Object detail(@PathVariable("driverActivityRegisteredId") Integer driverActivityRegisteredId) { |
| | | return driverActivityRegisteredService.selectById(driverActivityRegisteredId); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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.SinataUtil; |
| | | import com.stylefeng.guns.modular.system.controller.util.MyQrCodeUtil; |
| | | import com.stylefeng.guns.modular.system.controller.util.QRCodeUtil; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.ISysCouponRecordService; |
| | | import com.stylefeng.guns.modular.system.service.ITActivityGeneralizationService; |
| | | import com.stylefeng.guns.modular.system.service.IUserCouponRecordService; |
| | | import com.stylefeng.guns.modular.system.util.GaoDeMapUtil; |
| | | import com.stylefeng.guns.modular.system.util.OssUploadUtil; |
| | | import com.stylefeng.guns.modular.system.util.UUIDUtil; |
| | | import org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.core.io.ByteArrayResource; |
| | | import org.springframework.mock.web.MockMultipartFile; |
| | | 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 org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.imageio.ImageIO; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.*; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | |
| | | /** |
| | | * todo 新增推广活动设置控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-17 20:51:18 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/generalization") |
| | | public class GeneralizationActivityController extends BaseController { |
| | | @Autowired |
| | | private ITActivityGeneralizationService activityGeneralizationService; |
| | | @Autowired |
| | | private ISysCouponRecordService sysCouponRecordService; |
| | | private String PREFIX = "/system/generalization/"; |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | | */ |
| | | @RequestMapping("/activity") |
| | | public String index() { |
| | | return PREFIX + "generalization.html"; |
| | | } |
| | | /** |
| | | * 跳转到选择优惠券页面 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/sysCouponRecord") |
| | | public String sysCouponRecord() { |
| | | return PREFIX + "sysCouponRecord.html"; |
| | | } |
| | | @RequestMapping("/addHtml") |
| | | public String addHtml() { |
| | | return PREFIX + "addHtml.html"; |
| | | } |
| | | @RequestMapping("/editHtml/{id}") |
| | | public String editHtml(Model model,@PathVariable("id") Integer id) { |
| | | TActivityGeneralization data = activityGeneralizationService.selectById(id); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | model.addAttribute("startTime", sdf.format(data.getStartTime())); |
| | | model.addAttribute("endTime", sdf.format(data.getEndTime())); |
| | | SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | |
| | | model.addAttribute("insertTime", sdf1.format(data.getInsertTime())); |
| | | model.addAttribute("item",data); |
| | | List<SysCouponRecord> siteList = sysCouponRecordService.selectList(new EntityWrapper<SysCouponRecord>() |
| | | .eq("id",data.getCouponId())); |
| | | |
| | | List<UserCouponRecord> userCouponRecords = userCouponRecordService.selectList(new EntityWrapper<UserCouponRecord>().eq("couponId", siteList.get(0).getId()).groupBy("userId")); |
| | | siteList.get(0).setReceive(userCouponRecords==null?0:userCouponRecords.size()); |
| | | |
| | | |
| | | model.addAttribute("siteList",siteList); |
| | | return PREFIX + "editHtml.html"; |
| | | } |
| | | |
| | | @Autowired |
| | | private IUserCouponRecordService userCouponRecordService; |
| | | @RequestMapping("/generalization_detail/{id}") |
| | | public String generalization_detail(Model model,@PathVariable("id") Integer id) { |
| | | TActivityGeneralization data = activityGeneralizationService.selectById(id); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | model.addAttribute("startTime", sdf.format(data.getStartTime())); |
| | | model.addAttribute("endTime", sdf.format(data.getEndTime())); |
| | | model.addAttribute("item",data); |
| | | List<SysCouponRecord> siteList = sysCouponRecordService.selectList(new EntityWrapper<SysCouponRecord>() |
| | | .eq("id",data.getCouponId())); |
| | | List<UserCouponRecord> userCouponRecords = userCouponRecordService.selectList(new EntityWrapper<UserCouponRecord>().eq("couponId", siteList.get(0).getId()).groupBy("userId")); |
| | | siteList.get(0).setReceive(userCouponRecords==null?0:userCouponRecords.size()); |
| | | model.addAttribute("siteList",siteList); |
| | | |
| | | SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | |
| | | model.addAttribute("insertTime", sdf1.format(data.getInsertTime())); |
| | | return PREFIX + "generalization_detail.html"; |
| | | } |
| | | |
| | | @RequestMapping("/qrCodeHtml/{id}") |
| | | public String qrCodeHtml(Model model,@PathVariable("id") Integer id) { |
| | | TActivityGeneralization data = activityGeneralizationService.selectById(id); |
| | | model.addAttribute("qrCode",data.getQrCode()); |
| | | return PREFIX + "qrCodeHtml.html"; |
| | | } |
| | | |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String createTime,String activityName,Integer state) { |
| | | 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(); |
| | | List<Map<String, Object>> list = activityGeneralizationService.getList(page, beginTime, endTime, activityName, state); |
| | | |
| | | // DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); |
| | | // LocalDate currentDate = LocalDate.now(); |
| | | // for (Map<String, Object> item : list) { |
| | | // String timeRangeStr = (String) item.get("time"); |
| | | // if (timeRangeStr != null && !timeRangeStr.isEmpty()) { |
| | | // String[] range = timeRangeStr.split(" — "); |
| | | // LocalDate startDate = LocalDate.parse(range[0], formatter); |
| | | // LocalDate endDate = LocalDate.parse(range[1], formatter); |
| | | // |
| | | // // 判断当前日期是否在范围内 |
| | | // int newState; |
| | | // if (currentDate.isBefore(startDate)) { |
| | | // newState = 2; |
| | | // } else if (currentDate.isAfter(endDate)) { |
| | | // newState = 3; |
| | | // } else { |
| | | // newState = 1; |
| | | // } |
| | | // |
| | | // // 更新状态 |
| | | // item.put("state", newState); |
| | | // } |
| | | // } |
| | | page.setRecords(list); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 新增推广活动 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(TActivityGeneralization tActivityGeneralization) throws Exception { |
| | | |
| | | // 判断状态 |
| | | if(new Date().after(tActivityGeneralization.getStartTime()) && new Date().before(tActivityGeneralization.getEndTime())){ |
| | | tActivityGeneralization.setState(1); |
| | | } |
| | | if(new Date().after(tActivityGeneralization.getEndTime())){ |
| | | tActivityGeneralization.setState(3); |
| | | } |
| | | if(new Date().before(tActivityGeneralization.getStartTime())){ |
| | | tActivityGeneralization.setState(2); |
| | | } |
| | | tActivityGeneralization.setInsertTime(new Date()); |
| | | activityGeneralizationService.insert(tActivityGeneralization); |
| | | |
| | | // 生成二维码,上传到服务器 |
| | | MyQrCodeUtil.createCodeToFile("https://weilaigo.cn/qrCodeShare?id=" + tActivityGeneralization.getId()); |
| | | BufferedImage qrCodeImage = QRCodeUtil.createImage("https://weilaigo.cn/qrCodeShare?id=" + tActivityGeneralization.getId()); |
| | | MultipartFile qrCodeFile = convert(qrCodeImage, new Date().getTime()+ UUIDUtil.getRandomCode(3)+".PNG"); |
| | | String picture = OssUploadUtil.ossUpload1(qrCodeFile); |
| | | System.err.println("二维码:"+ picture); |
| | | tActivityGeneralization.setQrCode(picture); |
| | | activityGeneralizationService.updateById(tActivityGeneralization); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 编辑推广活动 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TActivityGeneralization tActivityGeneralization) { |
| | | |
| | | // 判断状态 |
| | | if(new Date().after(tActivityGeneralization.getStartTime()) && new Date().before(tActivityGeneralization.getEndTime())){ |
| | | tActivityGeneralization.setState(1); |
| | | } |
| | | if(new Date().after(tActivityGeneralization.getEndTime())){ |
| | | tActivityGeneralization.setState(3); |
| | | } |
| | | if(new Date().before(tActivityGeneralization.getStartTime())){ |
| | | tActivityGeneralization.setState(2); |
| | | } |
| | | activityGeneralizationService.updateById(tActivityGeneralization); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除推广活动 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(Integer tActivityGeneralizationId) { |
| | | TActivityGeneralization activityGeneralization = activityGeneralizationService.selectById(tActivityGeneralizationId); |
| | | activityGeneralization.setIsDelete(2); |
| | | activityGeneralizationService.updateById(activityGeneralization); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 启动/暂停 |
| | | */ |
| | | @RequestMapping(value = "/updateStatus") |
| | | @ResponseBody |
| | | public Object updateStatus(Integer id, Integer status) { |
| | | TActivityGeneralization tActivityGeneralization = activityGeneralizationService.selectById(id); |
| | | if(status == 1){ |
| | | if(new Date().after(tActivityGeneralization.getStartTime()) && new Date().before(tActivityGeneralization.getEndTime())){ |
| | | tActivityGeneralization.setState(1); |
| | | } |
| | | if(new Date().after(tActivityGeneralization.getEndTime())){ |
| | | tActivityGeneralization.setState(3); |
| | | } |
| | | if(new Date().before(tActivityGeneralization.getStartTime())){ |
| | | tActivityGeneralization.setState(2); |
| | | } |
| | | }else { |
| | | tActivityGeneralization.setState(status); |
| | | } |
| | | activityGeneralizationService.updateById(tActivityGeneralization); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 启动/暂停 |
| | | */ |
| | | @RequestMapping(value = "/downQrcode") |
| | | @ResponseBody |
| | | public Object downQrcode(HttpServletResponse response, String imgURL) throws Exception { |
| | | File localFile = new File("D://qrCode"); |
| | | File file = new File(imgURL); |
| | | |
| | | |
| | | // 创建File对象 |
| | | File downloadedFile = new File(localFile.getAbsolutePath()); |
| | | |
| | | System.out.println("文件已下载到: " + downloadedFile.getAbsolutePath()); |
| | | |
| | | // 设置响应头 |
| | | response.reset(); |
| | | response.setContentType("image/png"); // 根据图片类型调整 |
| | | response.setHeader("Content-Disposition", "attachment; filename=二维码.png"); |
| | | |
| | | // 输出文件内容到响应输出流 |
| | | FileInputStream fis = new FileInputStream(file); |
| | | OutputStream os = response.getOutputStream(); |
| | | |
| | | byte[] buffer = new byte[1024]; |
| | | int bytesRead; |
| | | while ((bytesRead = fis.read(buffer)) != -1) { |
| | | os.write(buffer, 0, bytesRead); |
| | | } |
| | | // 关闭流 |
| | | os.flush(); |
| | | os.close(); |
| | | fis.close(); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | public static MultipartFile convert(BufferedImage bufferedImage, String fileName) throws IOException { |
| | | // 将 BufferedImage 转换为字节数组 |
| | | ByteArrayOutputStream baos = new ByteArrayOutputStream(); |
| | | ImageIO.write(bufferedImage, "png", baos); |
| | | byte[] bytes = baos.toByteArray(); |
| | | |
| | | // 创建 ByteArrayResource |
| | | ByteArrayResource resource = new ByteArrayResource(bytes); |
| | | |
| | | // 创建 MockMultipartFile |
| | | MockMultipartFile multipartFile = new MockMultipartFile( |
| | | "file", |
| | | fileName, |
| | | "image/png", |
| | | resource.getInputStream() |
| | | ); |
| | | |
| | | return multipartFile; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | 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.service.*; |
| | | import com.stylefeng.guns.modular.system.util.DateUtil; |
| | | import com.stylefeng.guns.modular.system.util.RedisUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 首页统计 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/home") |
| | | public class HomeController { |
| | | |
| | | @Autowired |
| | | private ITUserService tUserService; |
| | | |
| | | @Autowired |
| | | private ITDriverService tDriverService; |
| | | |
| | | @Autowired |
| | | private ITOrderTaxiService tOrderTaxiService; |
| | | |
| | | @Autowired |
| | | private ITCarService tCarService; |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | |
| | | @Autowired |
| | | private IUserService userService; |
| | | |
| | | @Autowired |
| | | private ITCompanyService tCompanyService; |
| | | |
| | | @Autowired |
| | | private ITCarBrandService carBrandService; |
| | | |
| | | @Autowired |
| | | private ITCarModelService carModelService; |
| | | |
| | | private List<TCompany> companys = null; |
| | | |
| | | |
| | | @Autowired |
| | | private ITOrderPrivateCarService itOrderPrivateCarService; |
| | | |
| | | @Autowired |
| | | private ITOrderCrossCityService itOrderCrossCityService; |
| | | |
| | | @Autowired |
| | | private ITOrderLogisticsService itOrderLogisticsService; |
| | | |
| | | @Autowired |
| | | private IDriverOnlineService driverOnlineService; |
| | | |
| | | |
| | | @RequestMapping("/openNetCarInfo") |
| | | public Object openNetCarInfo(Integer id, Model model){ |
| | | model.addAttribute("id", id); |
| | | return "/netCarInfo.html"; |
| | | } |
| | | |
| | | @RequestMapping("/showDriverOnline") |
| | | public String showDriverOnline(){ |
| | | return "/driverOnline.html"; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/getSumData") |
| | | public Object getSumData(Integer companyId, Date addDate, Date start, Date end){ |
| | | Integer id = ShiroKit.getUser().getId(); |
| | | User user = userService.selectById(id); |
| | | if(companyId == null && user.getRoleType() != 1){ |
| | | companyId = user.getObjectId(); |
| | | } |
| | | Map<String, Object> map = new HashMap<>(); |
| | | Date date = new Date(); |
| | | Calendar calendar1 = Calendar.getInstance(); |
| | | Calendar calendar2 = Calendar.getInstance(); |
| | | Calendar calendar3 = Calendar.getInstance(); |
| | | Calendar calendar4 = Calendar.getInstance(); |
| | | if(addDate == null){ |
| | | calendar1.setTime(date); |
| | | calendar2.setTime(date); |
| | | }else{ |
| | | calendar1.setTime(addDate); |
| | | calendar2.setTime(addDate); |
| | | } |
| | | if(start == null || end == null){ |
| | | calendar3.setTime(date); |
| | | calendar4.setTime(date); |
| | | }else{ |
| | | calendar3.setTime(start); |
| | | calendar4.setTime(end); |
| | | } |
| | | calendar1.set(Calendar.HOUR_OF_DAY, 00); |
| | | calendar1.set(Calendar.MINUTE, 00); |
| | | calendar1.set(Calendar.SECOND, 00); |
| | | calendar2.set(Calendar.HOUR_OF_DAY, 23); |
| | | calendar2.set(Calendar.MINUTE, 59); |
| | | calendar2.set(Calendar.SECOND, 59); |
| | | calendar3.set(Calendar.HOUR_OF_DAY, 00); |
| | | calendar3.set(Calendar.MINUTE, 00); |
| | | calendar3.set(Calendar.SECOND, 00); |
| | | 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){ |
| | | 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){ |
| | | ne1.eq("companyId", companyId).or().eq("franchiseeId", companyId); |
| | | } |
| | | List<TDriver> tDrivers = tDriverService.selectList(ne1); |
| | | String keys = ""; |
| | | for(TDriver driver : tDrivers){ |
| | | keys += "DRIVER" + driver.getId() + ","; |
| | | } |
| | | String value = redisUtil.getValues(keys.substring(0, keys.length() - 1)); |
| | | JSONArray jsonArray = JSON.parseArray(value); |
| | | int size = driverOnlineService.queryOnlineDriverCount(null, null); |
| | | map1.put("netcardriver", size); //在线司机 |
| | | |
| | | Wrapper<TOrderTaxi> travelTime1 = new EntityWrapper<TOrderTaxi>().between("travelTime", calendar1.getTime(), calendar2.getTime()); |
| | | if(companyId != null){ |
| | | travelTime1.eq("companyId", companyId); |
| | | } |
| | | int i1 = tOrderTaxiService.selectCount(travelTime1); |
| | | map1.put("orderDetail2", i1); //出租车订单 |
| | | |
| | | Wrapper<TOrderPrivateCar> zcTodayTme = new EntityWrapper<TOrderPrivateCar>().between("travelTime", calendar1.getTime(), calendar2.getTime()); |
| | | if(companyId != null){ |
| | | zcTodayTme.eq("companyId", companyId); |
| | | } |
| | | int zcTodayNum = itOrderPrivateCarService.selectCount(zcTodayTme); |
| | | map1.put("orderDetail1", zcTodayNum); //专车订单 |
| | | |
| | | Wrapper<TOrderCrossCity> kcTodayTme = new EntityWrapper<TOrderCrossCity>().between("travelTime", calendar1.getTime(), calendar2.getTime()); |
| | | if(companyId != null){ |
| | | kcTodayTme.eq("companyId", companyId); |
| | | } |
| | | int kcTodayNum = itOrderCrossCityService.selectCount(kcTodayTme); |
| | | map1.put("orderDetail3", kcTodayNum); //跨城订单 |
| | | |
| | | Wrapper<TOrderLogistics> tcxTodayTme = new EntityWrapper<TOrderLogistics>().between("travelTime", calendar1.getTime(), calendar2.getTime()); |
| | | if(companyId != null){ |
| | | tcxTodayTme.eq("companyId", companyId); |
| | | } |
| | | tcxTodayTme.eq("type",4); |
| | | int tcxTodayNum = itOrderLogisticsService.selectCount(tcxTodayTme); |
| | | map1.put("orderDetail4", tcxTodayNum); //同城物流订单 |
| | | |
| | | Wrapper<TOrderLogistics> kcxTodayTme = new EntityWrapper<TOrderLogistics>().between("travelTime", calendar1.getTime(), calendar2.getTime()); |
| | | if(companyId != null){ |
| | | kcxTodayTme.eq("companyId", companyId); |
| | | } |
| | | tcxTodayTme.eq("type",5); |
| | | int kcxTodayNum = itOrderLogisticsService.selectCount(kcxTodayTme); |
| | | map1.put("orderDetail5", kcxTodayNum); //跨城物流订单 |
| | | |
| | | map.put("operationStatus", map1); |
| | | |
| | | //【全部运营总数据】 |
| | | map1 = new HashMap<>(); |
| | | Wrapper<TUser> flag1 = new EntityWrapper<TUser>().ne("flag", 3); |
| | | if(companyId != null){ |
| | | flag1.eq("companyId", companyId); |
| | | } |
| | | int flag = tUserService.selectCount(flag1); |
| | | map1.put("passengerInfoSum", flag); //总用户 |
| | | |
| | | Wrapper<TDriver> ne4 = new EntityWrapper<TDriver>().eq("authState", 2).ne("flag", 3); |
| | | if(companyId != null){ |
| | | ne4.eq("companyId", companyId).or().eq("franchiseeId", companyId); |
| | | } |
| | | int i2 = tDriverService.selectCount(ne4); |
| | | map1.put("netcarDriverSum", i2); //总司机 |
| | | |
| | | Wrapper<TCar> state3 = new EntityWrapper<TCar>().eq("state", 1); |
| | | if(companyId != null){ |
| | | state3.eq("companyId", companyId).or().eq("franchiseeId", companyId); |
| | | } |
| | | int state1 = tCarService.selectCount(state3); |
| | | map1.put("netCarSum", state1); //总车辆 |
| | | |
| | | Integer i3 = tOrderTaxiService.getAllOrderNum(companyId,null,null); |
| | | map1.put("orderDetailSum", i3); //总订单 |
| | | |
| | | Double allTradeMoney = tOrderTaxiService.getAllTradeMoney(companyId, null, null); |
| | | Double allIncomeMoney = tOrderTaxiService.getAllIncomeMoney(companyId, null, null); |
| | | map1.put("paiceSum", allTradeMoney); //交易总金额 |
| | | map1.put("paySum", allIncomeMoney); //总收益 |
| | | map.put("operationSum", map1); |
| | | |
| | | //【运营数据增长查询】 |
| | | map1 = new HashMap<>(); |
| | | Wrapper<TUser> ne2 = new EntityWrapper<TUser>().between("insertTime", calendar3.getTime(), calendar4.getTime()).ne("flag", 3); |
| | | if(companyId != null){ |
| | | ne2.eq("companyId", companyId); |
| | | } |
| | | int i4 = tUserService.selectCount(ne2); |
| | | map1.put("passengerInfoSum", i4); |
| | | |
| | | Wrapper<TDriver> ne3 = new EntityWrapper<TDriver>().between("insertTime", calendar3.getTime(), calendar4.getTime()).eq("authState", 2).ne("flag", 3); |
| | | if(companyId != null){ |
| | | ne3.eq("companyId", companyId).or().eq("franchiseeId", companyId); |
| | | } |
| | | int i5 = tDriverService.selectCount(ne3); |
| | | map1.put("netcarDriverSum", i5); |
| | | |
| | | Wrapper<TOrderPrivateCar> zcTodayTmeByConditions = new EntityWrapper<TOrderPrivateCar>().between("travelTime", calendar3.getTime(), calendar4.getTime()); |
| | | if(companyId != null){ |
| | | zcTodayTmeByConditions.eq("companyId", companyId); |
| | | } |
| | | int zcTodayNum1 = itOrderPrivateCarService.selectCount(zcTodayTmeByConditions); |
| | | map1.put("orderDetail1", zcTodayNum1); //专车订单 |
| | | |
| | | Wrapper<TOrderTaxi> travelTime2 = new EntityWrapper<TOrderTaxi>().between("travelTime", calendar3.getTime(), calendar4.getTime()); |
| | | if(companyId != null){ |
| | | travelTime2.eq("companyId", companyId); |
| | | } |
| | | int travelTime = tOrderTaxiService.selectCount(travelTime2); |
| | | map1.put("orderDetail2", travelTime); //出租车订单 |
| | | |
| | | Wrapper<TOrderCrossCity> kcTodayTmeByConditions = new EntityWrapper<TOrderCrossCity>().between("travelTime", calendar3.getTime(), calendar4.getTime()); |
| | | if(companyId != null){ |
| | | kcTodayTmeByConditions.eq("companyId", companyId); |
| | | } |
| | | int kcTodayNum1 = itOrderCrossCityService.selectCount(kcTodayTmeByConditions); |
| | | map1.put("orderDetail3", kcTodayNum1); //跨城订单 |
| | | |
| | | Wrapper<TOrderLogistics> tcxTodayTmeByConditions = new EntityWrapper<TOrderLogistics>().between("travelTime", calendar3.getTime(), calendar4.getTime()); |
| | | if(companyId != null){ |
| | | tcxTodayTmeByConditions.eq("companyId", companyId); |
| | | } |
| | | tcxTodayTmeByConditions.eq("type",4); |
| | | int tcxTodayNum1 = itOrderLogisticsService.selectCount(tcxTodayTmeByConditions); |
| | | map1.put("orderDetail4", tcxTodayNum1); //同城物流订单 |
| | | |
| | | Wrapper<TOrderLogistics> kcxTodayTmeByConditions = new EntityWrapper<TOrderLogistics>().between("travelTime", calendar3.getTime(), calendar4.getTime()); |
| | | if(companyId != null){ |
| | | kcxTodayTmeByConditions.eq("companyId", companyId); |
| | | } |
| | | kcxTodayTmeByConditions.eq("type",5); |
| | | int kcxTodayNum1 = itOrderLogisticsService.selectCount(kcxTodayTmeByConditions); |
| | | map1.put("orderDetail5", kcxTodayNum1); //跨城物流订单 |
| | | |
| | | String startTime = null; |
| | | if (SinataUtil.isNotEmpty(start)){ |
| | | startTime = DateUtil.format(start, "yyyy-MM-dd"); |
| | | } |
| | | String endTime = null; |
| | | if (SinataUtil.isNotEmpty(end)){ |
| | | endTime = DateUtil.format(end, "yyyy-MM-dd"); |
| | | } |
| | | Double allTradeMoneyByTime = tOrderTaxiService.getAllTradeMoney(companyId, startTime, endTime); |
| | | Double allIncomeMoneyByTime = tOrderTaxiService.getAllIncomeMoney(companyId, startTime, endTime); |
| | | map1.put("paiceSum", allTradeMoneyByTime); //交易总金额 |
| | | map1.put("paySum", allIncomeMoneyByTime); //总收益 |
| | | map.put("operationGrow", map1); |
| | | |
| | | |
| | | //【运营总趋势】 |
| | | Integer[] states = new Integer[]{8, 9}; |
| | | map1 = new HashMap<>(); |
| | | List<Integer> m1 = new ArrayList<>(); |
| | | List<Integer> m2 = new ArrayList<>(); |
| | | List<Integer> m3 = new ArrayList<>(); |
| | | List<Integer> m4 = new ArrayList<>(); |
| | | List<Integer> m5 = new ArrayList<>(); |
| | | List<Integer> m6 = new ArrayList<>(); |
| | | List<Integer> m7 = new ArrayList<>(); |
| | | for(int j = 30; j > 0; j--){ |
| | | Calendar s1 = Calendar.getInstance(); |
| | | s1.setTime(date); |
| | | s1.set(s1.get(Calendar.YEAR), s1.get(Calendar.MONTH), s1.get(Calendar.DAY_OF_MONTH) - j, 0, 0, 1); |
| | | Calendar e1 = Calendar.getInstance(); |
| | | e1.setTime(date); |
| | | e1.set(e1.get(Calendar.YEAR), e1.get(Calendar.MONTH), e1.get(Calendar.DAY_OF_MONTH) - j, 23, 59, 59); |
| | | |
| | | //出租车订单趋势图 |
| | | Wrapper<TOrderTaxi> in = new EntityWrapper<TOrderTaxi>().between("travelTime", s1.getTime(), e1.getTime()).in("state", states); |
| | | if(companyId != null){ |
| | | in.eq("companyId", companyId); |
| | | } |
| | | int i6 = tOrderTaxiService.selectCount(in); |
| | | m1.add(i6); |
| | | |
| | | //用户注册趋势图 |
| | | Wrapper<TUser> ne5 = new EntityWrapper<TUser>().between("insertTime", s1.getTime(), e1.getTime()).ne("flag", 3); |
| | | if(companyId != null){ |
| | | ne5.eq("companyId", companyId); |
| | | } |
| | | int i7 = tUserService.selectCount(ne5); |
| | | m2.add(i7); |
| | | |
| | | //订单数趋势图 |
| | | String startTime1 = DateUtil.format(s1.getTime(), "yyyy-MM-dd"); |
| | | String endTime1 = DateUtil.format(e1.getTime(), "yyyy-MM-dd"); |
| | | Integer allOrderNum = tOrderTaxiService.getAllOrderNum(companyId, startTime1, endTime1); |
| | | m3.add(allOrderNum); |
| | | |
| | | //专车订单趋势图 |
| | | Wrapper<TOrderPrivateCar> inZC = new EntityWrapper<TOrderPrivateCar>().between("travelTime", s1.getTime(), e1.getTime()).in("state", states); |
| | | if(companyId != null){ |
| | | inZC.eq("companyId", companyId); |
| | | } |
| | | int zc = itOrderPrivateCarService.selectCount(inZC); |
| | | m4.add(zc); |
| | | |
| | | //跨城订单趋势图 |
| | | Wrapper<TOrderCrossCity> inKC = new EntityWrapper<TOrderCrossCity>().between("travelTime", s1.getTime(), e1.getTime()).in("state", states); |
| | | if(companyId != null){ |
| | | inKC.eq("companyId", companyId); |
| | | } |
| | | int kc = itOrderCrossCityService.selectCount(inKC); |
| | | m5.add(kc); |
| | | |
| | | //同城物流订单趋势图 |
| | | Wrapper<TOrderLogistics> inTCX = new EntityWrapper<TOrderLogistics>().between("travelTime", s1.getTime(), e1.getTime()).in("state", states); |
| | | if(companyId != null){ |
| | | inTCX.eq("companyId", companyId); |
| | | } |
| | | inTCX.eq("type",4); |
| | | int tcx = itOrderLogisticsService.selectCount(inTCX); |
| | | m6.add(tcx); |
| | | |
| | | //跨城物流订单趋势图 |
| | | Wrapper<TOrderLogistics> inKCX = new EntityWrapper<TOrderLogistics>().between("travelTime", s1.getTime(), e1.getTime()).in("state", states); |
| | | if(companyId != null){ |
| | | inKCX.eq("companyId", companyId); |
| | | } |
| | | inKCX.eq("type",5); |
| | | int kcx = itOrderLogisticsService.selectCount(inKCX); |
| | | m7.add(kcx); |
| | | |
| | | } |
| | | map1.put("orderDetail5", m7); //跨城物流订单数趋势图 |
| | | map1.put("orderDetail4", m6); //同城物流订单数趋势图 |
| | | map1.put("orderDetail3", m5); //跨城订单数趋势图 |
| | | map1.put("orderDetail1", m4); //专车订单数趋势图 |
| | | map1.put("orderDetailSum", m3); //全部订单数趋势图 |
| | | map1.put("passengerInfoSum", m2); //用户注册趋势图 |
| | | map1.put("orderDetail2", m1); //出租车订单趋势图 |
| | | map.put("operationTrend", map1); |
| | | |
| | | return map; |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/getDriverPosition") |
| | | public Object getDriverPosition(Integer companyId){ |
| | | Integer id = ShiroKit.getUser().getId(); |
| | | User user = userService.selectById(id); |
| | | if(companyId == null && user.getRoleType() != 1){ |
| | | companyId = user.getObjectId(); |
| | | } |
| | | Wrapper<TDriver> ne = new EntityWrapper<TDriver>().eq("authState", 2).eq("state", 2).ne("flag", 3); |
| | | if(companyId != null){ |
| | | ne.eq("companyId", companyId).or().eq("franchiseeId", companyId); |
| | | } |
| | | List<TDriver> tDrivers = tDriverService.selectList(ne); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | List<Object> list = new ArrayList<>(); |
| | | for(TDriver tDriver : tDrivers){ |
| | | Map<String, Object> d = new HashMap<>(); |
| | | String value = redisUtil.getValue("DRIVER" + tDriver.getId()); |
| | | if(ToolUtil.isEmpty(value)){ |
| | | continue; |
| | | } |
| | | d.put("driver", tDriver); |
| | | d.put("lon", value.split(",")[0]); |
| | | d.put("lat", value.split(",")[1]); |
| | | list.add(d); |
| | | } |
| | | map.put("driver", list); |
| | | |
| | | Map<String, Object> map2 = new HashMap<>(); |
| | | Wrapper<TOrderTaxi> eq = new EntityWrapper<TOrderTaxi>().eq("state", 1).eq("isDelete", 1); |
| | | if(companyId != null){ |
| | | eq.eq("companyId", companyId); |
| | | } |
| | | List<TOrderTaxi> tOrderTaxis = tOrderTaxiService.selectList(eq); |
| | | list = new ArrayList<>(); |
| | | for(TOrderTaxi t : tOrderTaxis){ |
| | | Map<String, Object> map1 = new HashMap<>(); |
| | | map1.put("start", t.getStartAddress()); |
| | | map1.put("end", t.getEndAddress()); |
| | | map1.put("travelTime", t.getTravelTime()); |
| | | map1.put("carModel", ""); |
| | | map1.put("num", 1); |
| | | list.add(map1); |
| | | } |
| | | map2.put("chuzu", list); |
| | | map.put("order", map2); |
| | | |
| | | return map; |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/getAllOrder") |
| | | public Object getAllOrder(){ |
| | | List<TOrderTaxi> tOrderTaxis = tOrderTaxiService.selectList(new EntityWrapper<TOrderTaxi>().eq("isDelete", 1)); |
| | | List list = new ArrayList<>(); |
| | | for(TOrderTaxi t : tOrderTaxis){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("lon", t.getStartLon()); |
| | | map.put("lat", t.getStartLat()); |
| | | list.add(map); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/getCompanyInfoByUserId") |
| | | public Object getCompanyInfoByUserId(){ |
| | | Integer id = ShiroKit.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){ |
| | | tCompany = tCompanyService.selectById(1); |
| | | }else{ |
| | | tCompany = tCompanyService.selectById(user.getObjectId()); |
| | | } |
| | | ids.add(tCompany); |
| | | companys.addAll(ids); |
| | | this.getCompanyIds(ids); |
| | | return companys; |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/getDriverInfo", method = RequestMethod.POST) |
| | | public Object getDriverInfo(Integer driverId){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | TDriver tDriver = tDriverService.selectById(driverId); |
| | | TCar tCar = tCarService.selectById(tDriver.getCarId()); |
| | | TCarBrand tCarBrand = null; |
| | | TCarModel tCarModel = null; |
| | | if(null != tCar){ |
| | | tCarBrand = carBrandService.selectById(tCar.getCarBrandId()); |
| | | tCarModel = carModelService.selectById(tCar.getCarModelId()); |
| | | } |
| | | Integer[] states = new Integer[]{2, 3, 4, 5, 6, 11}; |
| | | Wrapper<TOrderTaxi> state4 = new EntityWrapper<TOrderTaxi>().in("state", states).eq("driverId", driverId).eq("isDelete", 1); |
| | | List<TOrderTaxi> tOrderTaxis = tOrderTaxiService.selectList(state4); |
| | | map.put("netcarDriver", tDriver); |
| | | map.put("netcar", tCar); |
| | | map.put("carBrand", null != tCarBrand ? tCarBrand.getName() : ""); |
| | | map.put("carModel", null != tCarModel ? tCarModel.getName() : ""); |
| | | map.put("order", tOrderTaxis); |
| | | return map; |
| | | } |
| | | |
| | | |
| | | |
| | | public void getCompanyIds(List<TCompany> ids){ |
| | | List<TCompany> ids_ = new ArrayList<>(); |
| | | for(TCompany id : ids){ |
| | | if(id.getId() == 1){ |
| | | List<TCompany> tCompanies = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("superiorId", id.getId()).or().isNull("superiorId").eq("state", 0).ne("flag", 3).ne("type", 1)); |
| | | ids_.addAll(tCompanies); |
| | | companys.addAll(tCompanies); |
| | | }else{ |
| | | List<TCompany> tCompanies = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("superiorId", id.getId()).eq("state", 0).ne("flag", 3)); |
| | | ids_.addAll(tCompanies); |
| | | companys.addAll(tCompanies); |
| | | } |
| | | } |
| | | if(ids_.size() == 0){ |
| | | return; |
| | | } |
| | | this.getCompanyIds(ids_); |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/queryOnlineDriver", method = RequestMethod.POST) |
| | | public Object queryOnlineDriver(String name, String phone, Integer offset, Integer limit){ |
| | | try { |
| | | return driverOnlineService.queryOnlineDriver(name, phone, offset, limit); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.model.TCompany; |
| | | import com.stylefeng.guns.modular.system.service.ITCompanyService; |
| | | import com.stylefeng.guns.modular.system.service.IUserActivityDiscount1Service; |
| | | import com.stylefeng.guns.modular.system.service.IUserCouponRecordService; |
| | | import com.stylefeng.guns.modular.system.service.IUserRedPacketRecordService; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | | 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.RequestMethod; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.servlet.ServletOutputStream; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.net.URLEncoder; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 报表控制器 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/report") |
| | | public class ReportController { |
| | | |
| | | private String PREFIX = "/system/report/"; |
| | | |
| | | @Autowired |
| | | private ITCompanyService companyService; |
| | | |
| | | @Autowired |
| | | private IUserCouponRecordService userCouponRecordService; |
| | | |
| | | @Autowired |
| | | private IUserRedPacketRecordService redPacketRecordService; |
| | | |
| | | @Autowired |
| | | private IUserActivityDiscount1Service userActivityDiscount1Service; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 跳转到日常运营数据汇总页 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/showOperationalData") |
| | | public String showOperationalData(Model model){ |
| | | List<TCompany> tCompanies = companyService.selectList(new EntityWrapper<TCompany>().eq("state", 0).ne("flag", 3)); |
| | | model.addAttribute("company", tCompanies); |
| | | return PREFIX + "operationalData.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到优惠券统计页 |
| | | * @param model |
| | | * @return |
| | | */ |
| | | @RequestMapping("/showCouponStatistics") |
| | | public String showCouponStatistics(Model model){ |
| | | List<TCompany> tCompanies = companyService.selectList(new EntityWrapper<TCompany>().eq("state", 0).ne("flag", 3)); |
| | | model.addAttribute("company", tCompanies); |
| | | return PREFIX + "couponStatistics.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到优惠券统计详情页 |
| | | * @param type |
| | | * @param model |
| | | * @return |
| | | */ |
| | | @RequestMapping("/showCouponStatisticsInfo") |
| | | public String showCouponStatisticsInfo(Integer type, Model model){ |
| | | List<TCompany> tCompanies = companyService.selectList(new EntityWrapper<TCompany>().eq("state", 0).ne("flag", 3)); |
| | | model.addAttribute("company", tCompanies); |
| | | model.addAttribute("type", type); |
| | | return PREFIX + "couponStatisticsInfo.html"; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取日常运营数据 |
| | | * @param type |
| | | * @param time |
| | | * @param companyId |
| | | * @param offset |
| | | * @param limit |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/queryOperationalData", method = RequestMethod.POST) |
| | | public Object queryOperationalData(Integer type, String time, Integer companyId, Integer offset, Integer limit){ |
| | | try { |
| | | String start = null; |
| | | String end = null; |
| | | if(ToolUtil.isNotEmpty(time)){ |
| | | start = time.split(" - ")[0]; |
| | | end = time.split(" - ")[1]; |
| | | } |
| | | return companyService.queryOperationalData(type, start, end, companyId, offset, limit); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 下载日常运营数据汇总表 |
| | | * @param type |
| | | * @param time |
| | | * @param companyId |
| | | * @param response |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/downloadOperationalData", method = RequestMethod.GET) |
| | | public void downloadOperationalData(Integer type, String time, Integer companyId, HttpServletResponse response){ |
| | | try { |
| | | String start = null; |
| | | String end = null; |
| | | if(ToolUtil.isNotEmpty(time)){ |
| | | start = time.split(" - ")[0]; |
| | | end = time.split(" - ")[1]; |
| | | } |
| | | HSSFWorkbook hssfWorkbook = companyService.downloadOperationalData(type, start, end, companyId); |
| | | response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode("日常运营数据汇总表.xls", "utf-8")); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | ServletOutputStream out = response.getOutputStream(); |
| | | hssfWorkbook.write(out); |
| | | out.flush(); |
| | | out.close(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取优惠券统计 |
| | | * @param type |
| | | * @param name |
| | | * @param time |
| | | * @param companyId |
| | | * @param offset |
| | | * @param limit |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/queryCouponRegister", method = RequestMethod.POST) |
| | | public Object queryCouponRegister(Integer type, String name, String time, Integer companyId, Integer offset, Integer limit){ |
| | | try { |
| | | return userCouponRecordService.queryCouponRegister(type, name, time, companyId, offset, limit); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 下载优惠券领取数据 |
| | | * @param type |
| | | * @param name |
| | | * @param time |
| | | * @param companyId |
| | | * @param response |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/downloadCouponRegister", method = RequestMethod.GET) |
| | | public void downloadCouponRegister(Integer type, String name, String time, Integer companyId, HttpServletResponse response){ |
| | | try { |
| | | String na = ""; |
| | | if(type == 2){ |
| | | na = "注册优惠券奖励"; |
| | | } |
| | | if(type == 3){ |
| | | na = "邀请优惠券奖励"; |
| | | } |
| | | if(type == 4){ |
| | | na = "充值优惠券奖励"; |
| | | } |
| | | HSSFWorkbook hssfWorkbook = userCouponRecordService.downloadCouponRegister(type, name, time, companyId); |
| | | response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode(na + ".xls", "utf-8")); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | ServletOutputStream out = response.getOutputStream(); |
| | | hssfWorkbook.write(out); |
| | | out.flush(); |
| | | out.close(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取红包统计数据 |
| | | * @param name |
| | | * @param time |
| | | * @param companyId |
| | | * @param offset |
| | | * @param limit |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/queryRedEnvelopes", method = RequestMethod.POST) |
| | | public Object queryRedEnvelopes(String name, String time, Integer companyId, Integer offset, Integer limit){ |
| | | try { |
| | | return redPacketRecordService.queryRedEnvelopes(name, time, companyId, offset, limit); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 下载红包奖励 |
| | | * @param name |
| | | * @param time |
| | | * @param companyId |
| | | * @param response |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/downloadRedEnvelopes", method = RequestMethod.GET) |
| | | public void downloadRedEnvelopes(String name, String time, Integer companyId, HttpServletResponse response){ |
| | | try { |
| | | HSSFWorkbook hssfWorkbook = redPacketRecordService.downloadRedEnvelopes(name, time, companyId); |
| | | response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode("红包奖励.xls", "utf-8")); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | ServletOutputStream out = response.getOutputStream(); |
| | | hssfWorkbook.write(out); |
| | | out.flush(); |
| | | out.close(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取折扣统计 |
| | | * @param name |
| | | * @param time |
| | | * @param companyId |
| | | * @param offset |
| | | * @param limit |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/queryDiscount1", method = RequestMethod.POST) |
| | | public Object queryDiscount1(String name, String time, Integer companyId, Integer offset, Integer limit){ |
| | | try { |
| | | return userActivityDiscount1Service.queryDiscount1(name, time, companyId, offset, limit); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 下载折扣优惠活动 |
| | | * @param name |
| | | * @param time |
| | | * @param companyId |
| | | * @param response |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/downloadDiscount1", method = RequestMethod.GET) |
| | | public void downloadDiscount1(String name, String time, Integer companyId, HttpServletResponse response){ |
| | | try { |
| | | HSSFWorkbook hssfWorkbook = userActivityDiscount1Service.downloadDiscount1(name, time, companyId); |
| | | response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode("折扣优惠活动.xls", "utf-8")); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | ServletOutputStream out = response.getOutputStream(); |
| | | hssfWorkbook.write(out); |
| | | out.flush(); |
| | | out.close(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取优惠券统计明细 |
| | | * @param type |
| | | * @param name |
| | | * @param time |
| | | * @param companyId |
| | | * @param offset |
| | | * @param limit |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/queryCouponRegisterInfo", method = RequestMethod.POST) |
| | | public Object queryCouponRegisterInfo(Integer type, String name, String time, Integer companyId, Integer offset, Integer limit){ |
| | | try { |
| | | type += 1; |
| | | return userCouponRecordService.queryCouponRegisterInfo(type, name, time, companyId, offset, limit); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取充值赠送优惠券明细 |
| | | * @param name |
| | | * @param time |
| | | * @param companyId |
| | | * @param offset |
| | | * @param limit |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/queryCouponRegisterInfo1", method = RequestMethod.POST) |
| | | public Object queryCouponRegisterInfo1(String name, String time, Integer companyId, Integer offset, Integer limit){ |
| | | try { |
| | | return userCouponRecordService.queryCouponRegisterInfo1( name, time, companyId, offset, limit); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取折扣优惠详情 |
| | | * @param time |
| | | * @param companyId |
| | | * @param offset |
| | | * @param limit |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/queryDiscountInfo", method = RequestMethod.POST) |
| | | public Object queryDiscountInfo(String name, String time, Integer companyId, Integer offset, Integer limit){ |
| | | try { |
| | | return userActivityDiscount1Service.queryDiscountInfo(name, time, companyId, offset, limit); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取红包领取详情 |
| | | * @param name |
| | | * @param time |
| | | * @param companyId |
| | | * @param offset |
| | | * @param limit |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/queryRedEnvelopesInfo", method = RequestMethod.POST) |
| | | public Object queryRedEnvelopesInfo(String name, String time, Integer companyId, Integer offset, Integer limit){ |
| | | try { |
| | | return redPacketRecordService.queryRedEnvelopesInfo(name, time, companyId, offset, limit); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 优惠明细下载 |
| | | * @param type |
| | | * @param name |
| | | * @param time |
| | | * @param companyId |
| | | * @param response |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/downloadCouponStatisticsInfo", method = RequestMethod.GET) |
| | | public void downloadCouponStatisticsInfo(Integer type, String name, String time, Integer companyId, HttpServletResponse response){ |
| | | try { |
| | | if(type == 1 || type == 2){ |
| | | type += 1; |
| | | HSSFWorkbook hssfWorkbook = userCouponRecordService.downloadCouponRegisterInfo(type, name, time, companyId); |
| | | response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode((type == 2 ? "注册奖励明细" : "邀请奖励明细") + ".xls", "utf-8")); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | ServletOutputStream out = response.getOutputStream(); |
| | | hssfWorkbook.write(out); |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | if(type == 3){ |
| | | HSSFWorkbook hssfWorkbook = userCouponRecordService.downloadCouponRegisterInfo1(name, time, companyId); |
| | | response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode("充值奖励明细.xls", "utf-8")); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | ServletOutputStream out = response.getOutputStream(); |
| | | hssfWorkbook.write(out); |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | if(type == 4){ |
| | | HSSFWorkbook hssfWorkbook = userActivityDiscount1Service.downloadDiscountInfo(name, time, companyId); |
| | | response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode("折扣优惠明细.xls", "utf-8")); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | ServletOutputStream out = response.getOutputStream(); |
| | | hssfWorkbook.write(out); |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | if(type == 5){ |
| | | HSSFWorkbook hssfWorkbook = redPacketRecordService.downloadRedEnvelopesInfo(name, time, companyId); |
| | | response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode("红包优惠明细.xls", "utf-8")); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | ServletOutputStream out = response.getOutputStream(); |
| | | hssfWorkbook.write(out); |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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.DateUtil; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.modular.system.model.SysCouponRecord; |
| | | import com.stylefeng.guns.modular.system.model.TUser; |
| | | import com.stylefeng.guns.modular.system.model.UserCouponRecord; |
| | | import com.stylefeng.guns.modular.system.service.ISysCouponRecordService; |
| | | import com.stylefeng.guns.modular.system.service.ITUserService; |
| | | 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.SysCouponActivity; |
| | | import com.stylefeng.guns.modular.system.service.ISysCouponActivityService; |
| | | |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-17 09:14:59 |
| | | */ |
| | | @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; |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "sysCouponActivity.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到选择优惠券页面 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/sysCouponRecord") |
| | | public String sysCouponRecord() { |
| | | return PREFIX + "sysCouponRecord.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到选择用户页面 |
| | | * @return |
| | | */ |
| | | @RequestMapping("user") |
| | | public String user() { |
| | | return PREFIX + "tUser.html"; |
| | | } |
| | | /** |
| | | * 跳转到添加 |
| | | */ |
| | | @RequestMapping("/sysCouponActivity_add") |
| | | public String sysCouponActivityAdd() { |
| | | return PREFIX + "sysCouponActivity_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改 |
| | | */ |
| | | @RequestMapping("/sysCouponActivity_update/{sysCouponActivityId}") |
| | | public String sysCouponActivityUpdate(@PathVariable Integer sysCouponActivityId, Model model) { |
| | | SysCouponActivity sysCouponActivity = sysCouponActivityService.selectById(sysCouponActivityId); |
| | | model.addAttribute("item",sysCouponActivity); |
| | | if(sysCouponActivity.getSendType()==2){ |
| | | model.addAttribute("sendUserInfoList",JSON.parseArray(sysCouponActivity.getSendUserId())); |
| | | }else{ |
| | | model.addAttribute("sendUserInfoList",new ArrayList<>()); |
| | | } |
| | | LogObjectHolder.me().set(sysCouponActivity); |
| | | return PREFIX + "sysCouponActivity_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String createTime,Integer couponUseType,Integer status) { |
| | | 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<SysCouponActivity> page = new PageFactory<SysCouponActivity>().defaultPage(); |
| | | Wrapper wrapper = new EntityWrapper<SysCouponActivity>(); |
| | | if(SinataUtil.isNotEmpty(createTime)){ |
| | | wrapper.between("insertTime",startTimes,endTimes); |
| | | } |
| | | if(SinataUtil.isNotEmpty(couponUseType)){wrapper.eq("couponUseType",couponUseType);} |
| | | if(SinataUtil.isNotEmpty(status)){wrapper.eq("status",status);} |
| | | ShiroUser user = ShiroKit.getUser(); |
| | | if(user.getRoleType()!=1){ |
| | | wrapper.eq("companyId",user.getObjectId()); |
| | | wrapper.eq("companyType",user.getRoleType()); |
| | | } |
| | | wrapper.ne("status",4); |
| | | wrapper.orderBy("id",false); |
| | | return super.packForBT(sysCouponActivityService.selectPage(page,wrapper)); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(SysCouponActivity sysCouponActivity,Integer activityId) { |
| | | SysCouponRecord sysCouponRecord = couponRecordService.selectById(activityId); |
| | | sysCouponActivity.setCouponType(sysCouponRecord.getCouponType()); |
| | | sysCouponActivity.setCouponUseType(sysCouponRecord.getCouponUseType()); |
| | | sysCouponActivity.setMoney(sysCouponRecord.getMoney()); |
| | | sysCouponActivity.setFullMoney(sysCouponRecord.getFullMoney()); |
| | | sysCouponActivity.setInsertTime(new Date()); |
| | | sysCouponActivity.setCouponId(activityId); |
| | | sysCouponActivity.setCompanyId(ShiroKit.getUser().getObjectId()); |
| | | sysCouponActivity.setCompanyType(ShiroKit.getUser().getRoleType()); |
| | | sysCouponActivity.setStatus(sysCouponActivity.getCompanyType()==1?3:1); |
| | | sysCouponActivityService.insert(sysCouponActivity); |
| | | if(sysCouponActivity.getCompanyType()==1){ |
| | | //定时发送优惠券 |
| | | Timer timer = new Timer(); |
| | | timer.schedule(new timerTaskTest(sysCouponActivity.getId()),30*1000);//timer.schedule(执行的方法,延迟多久执行(ms)) |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | /** |
| | | * 跳转到立即处理页面 |
| | | */ |
| | | @RequestMapping("/sysCouponActivity_immediately/{id}") |
| | | public String sysCouponActivityImmediately(@PathVariable Integer id, Model model) { |
| | | model.addAttribute("id",id); |
| | | return PREFIX + "sysCouponActivity_immediately.html"; |
| | | } |
| | | /** |
| | | * 立即处理操作 |
| | | */ |
| | | @RequestMapping(value = "/immediately") |
| | | @ResponseBody |
| | | public Object immediately(@RequestParam Integer id,@RequestParam Integer state,@RequestParam String remark) { |
| | | SysCouponActivity sysCouponActivity = sysCouponActivityService.selectById(id); |
| | | if (SinataUtil.isNotEmpty(sysCouponActivity)){ |
| | | sysCouponActivity.setStatus(state); |
| | | sysCouponActivity.setRemark(remark); |
| | | sysCouponActivityService.updateById(sysCouponActivity); |
| | | if(state==3){ |
| | | //定时发送优惠券 |
| | | Timer timer = new Timer(); |
| | | timer.schedule(new timerTaskTest(id),30*1000);//timer.schedule(执行的方法,延迟多久执行(ms)) |
| | | } |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | class timerTaskTest extends TimerTask { |
| | | private Integer id; |
| | | |
| | | public timerTaskTest(Integer id) { |
| | | this.id = id; |
| | | } |
| | | @Override |
| | | public void run() { |
| | | SysCouponActivity sysCouponActivity = sysCouponActivityService.selectById(id); |
| | | UserCouponRecord userCouponRecord = new UserCouponRecord(); |
| | | userCouponRecord.setMoney(sysCouponActivity.getMoney()); |
| | | userCouponRecord.setFullMoney(sysCouponActivity.getFullMoney()); |
| | | Date nowDay = new Date(); |
| | | userCouponRecord.setInsertTime(nowDay); |
| | | userCouponRecord.setExpirationTime(new Date(nowDay.getTime()+sysCouponActivity.getEffective()*24*3600*1000L)); |
| | | userCouponRecord.setCompanyId(sysCouponActivity.getCompanyId()); |
| | | userCouponRecord.setState(1); |
| | | userCouponRecord.setCouponType(sysCouponActivity.getCouponType()); |
| | | userCouponRecord.setCouponUseType(sysCouponActivity.getCouponUseType()); |
| | | userCouponRecord.setCouponActivityId(sysCouponActivity.getId()); |
| | | userCouponRecord.setActivityType(1); |
| | | //判断发送类型1=全部用户,2=选择用户 |
| | | if(sysCouponActivity.getSendType()==1){ |
| | | Wrapper wrapper = new EntityWrapper<TUser>(); |
| | | if(sysCouponActivity.getCompanyType()!=1){ |
| | | wrapper.eq("companyId",sysCouponActivity.getCompanyId()); |
| | | } |
| | | List<TUser> list = userService.selectList(wrapper); |
| | | for(TUser user:list){ |
| | | userCouponRecord.setUserId(user.getId()); |
| | | for (int i=0;i<sysCouponActivity.getNumber();i++){ |
| | | userCouponRecord.insert(); |
| | | } |
| | | } |
| | | sysCouponActivity.setSendUserNum(list.size()); |
| | | sysCouponActivity.updateById(); |
| | | }else{ |
| | | JSONArray userId = JSON.parseArray(sysCouponActivity.getSendUserId()); |
| | | for(int j=0;j<userId.size();j++){ |
| | | userCouponRecord.setUserId(userId.getJSONObject(j).getInteger("userId")); |
| | | for (int i=0;i<sysCouponActivity.getNumber();i++){ |
| | | userCouponRecord.insert(); |
| | | } |
| | | } |
| | | sysCouponActivity.setSendUserNum(userId.size()); |
| | | sysCouponActivity.updateById(); |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer sysCouponActivityId) { |
| | | SysCouponActivity sysCouponActivity = new SysCouponActivity(); |
| | | sysCouponActivity.setId(sysCouponActivityId); |
| | | sysCouponActivity.setStatus(4); |
| | | sysCouponActivityService.updateById(sysCouponActivity); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(SysCouponActivity sysCouponActivity,Integer activityId) { |
| | | SysCouponRecord sysCouponRecord = couponRecordService.selectById(activityId); |
| | | sysCouponActivity.setCouponType(sysCouponRecord.getCouponType()); |
| | | sysCouponActivity.setCouponUseType(sysCouponRecord.getCouponUseType()); |
| | | sysCouponActivity.setMoney(sysCouponRecord.getMoney()); |
| | | sysCouponActivity.setFullMoney(sysCouponRecord.getFullMoney()); |
| | | sysCouponActivity.setInsertTime(new Date()); |
| | | sysCouponActivity.setCouponId(activityId); |
| | | sysCouponActivity.setCompanyId(ShiroKit.getUser().getObjectId()); |
| | | sysCouponActivity.setCompanyType(ShiroKit.getUser().getRoleType()); |
| | | sysCouponActivity.setStatus(sysCouponActivity.getCompanyType()==1?3:1); |
| | | sysCouponActivityService.updateById(sysCouponActivity); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @RequestMapping(value = "/detail/{sysCouponActivityId}") |
| | | @ResponseBody |
| | | public Object detail(@PathVariable("sysCouponActivityId") Integer sysCouponActivityId) { |
| | | return sysCouponActivityService.selectById(sysCouponActivityId); |
| | | } |
| | | } |
New file |
| | |
| | | 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.common.constant.factory.PageFactory; |
| | | 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.modular.system.model.SysRedPacketRecord; |
| | | import com.stylefeng.guns.modular.system.model.UserCouponRecord; |
| | | import com.stylefeng.guns.modular.system.service.IUserCouponRecordService; |
| | | 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.SysCouponRecord; |
| | | import com.stylefeng.guns.modular.system.service.ISysCouponRecordService; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-15 17:42:16 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/sysCouponRecord") |
| | | public class SysCouponRecordController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/sysCouponRecord/"; |
| | | |
| | | @Autowired |
| | | private ISysCouponRecordService sysCouponRecordService; |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "sysCouponRecord.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加 |
| | | */ |
| | | @RequestMapping("/sysCouponRecord_add") |
| | | public String sysCouponRecordAdd() { |
| | | return PREFIX + "sysCouponRecord_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改 |
| | | */ |
| | | @RequestMapping("/sysCouponRecord_update/{sysCouponRecordId}") |
| | | public String sysCouponRecordUpdate(@PathVariable Integer sysCouponRecordId, Model model) { |
| | | SysCouponRecord sysCouponRecord = sysCouponRecordService.selectById(sysCouponRecordId); |
| | | model.addAttribute("item",sysCouponRecord); |
| | | LogObjectHolder.me().set(sysCouponRecord); |
| | | return PREFIX + "sysCouponRecord_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | | @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",ShiroKit.getUser().getObjectId()); |
| | | wrapper.eq("companyType",ShiroKit.getUser().getRoleType()); |
| | | wrapper.orderBy("id",false); |
| | | return super.packForBT(sysCouponRecordService.selectPage(page,wrapper)); |
| | | } |
| | | |
| | | @Autowired |
| | | private IUserCouponRecordService userCouponRecordService; |
| | | @RequestMapping(value = "/list1") |
| | | @ResponseBody |
| | | public Object list1(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",ShiroKit.getUser().getObjectId()); |
| | | wrapper.eq("companyType",ShiroKit.getUser().getRoleType()); |
| | | wrapper.orderBy("id",false); |
| | | Page page1 = sysCouponRecordService.selectPage(page, wrapper); |
| | | List<SysCouponRecord> records = page1.getRecords(); |
| | | for (SysCouponRecord record : records) { |
| | | int couponId = userCouponRecordService.selectCount(new EntityWrapper<UserCouponRecord>().eq("couponId", record.getId())); |
| | | record.setReceive(couponId); |
| | | } |
| | | return super.packForBT(page1); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(SysCouponRecord sysCouponRecord) { |
| | | sysCouponRecord.setInsertTime(new Date()); |
| | | sysCouponRecord.setCompanyId(ShiroKit.getUser().getObjectId()); |
| | | sysCouponRecord.setCompanyType(ShiroKit.getUser().getRoleType()); |
| | | sysCouponRecordService.insert(sysCouponRecord); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer sysCouponRecordId) { |
| | | sysCouponRecordService.deleteById(sysCouponRecordId); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(SysCouponRecord sysCouponRecord) { |
| | | sysCouponRecordService.updateById(sysCouponRecord); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @RequestMapping(value = "/detail/{sysCouponRecordId}") |
| | | @ResponseBody |
| | | public Object detail(@PathVariable("sysCouponRecordId") Integer sysCouponRecordId) { |
| | | return sysCouponRecordService.selectById(sysCouponRecordId); |
| | | } |
| | | } |
New file |
| | |
| | | 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.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | 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.SysRedPacketRecord; |
| | | import com.stylefeng.guns.modular.system.service.ISysRedPacketRecordService; |
| | | |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-13 10:50:42 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/sysRedPacketRecord") |
| | | public class SysRedPacketRecordController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/sysRedPacketRecord/"; |
| | | |
| | | @Autowired |
| | | private ISysRedPacketRecordService sysRedPacketRecordService; |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "sysRedPacketRecord.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加 |
| | | */ |
| | | @RequestMapping("/sysRedPacketRecord_add") |
| | | public String sysRedPacketRecordAdd() { |
| | | return PREFIX + "sysRedPacketRecord_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改 |
| | | */ |
| | | @RequestMapping("/sysRedPacketRecord_update/{sysRedPacketRecordId}") |
| | | public String sysRedPacketRecordUpdate(@PathVariable Integer sysRedPacketRecordId, Model model) { |
| | | SysRedPacketRecord sysRedPacketRecord = sysRedPacketRecordService.selectById(sysRedPacketRecordId); |
| | | model.addAttribute("item",sysRedPacketRecord); |
| | | LogObjectHolder.me().set(sysRedPacketRecord); |
| | | return PREFIX + "sysRedPacketRecord_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String createTime) { |
| | | 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<SysRedPacketRecord> page = new PageFactory<SysRedPacketRecord>().defaultPage(); |
| | | Wrapper wrapper = new EntityWrapper<SysRedPacketRecord>(); |
| | | if(SinataUtil.isNotEmpty(createTime)){ |
| | | wrapper.between("insertTime",startTimes,endTimes); |
| | | } |
| | | wrapper.eq("companyId",ShiroKit.getUser().getObjectId()); |
| | | wrapper.eq("companyType",ShiroKit.getUser().getRoleType()); |
| | | wrapper.orderBy("id",false); |
| | | return super.packForBT(sysRedPacketRecordService.selectPage(page,wrapper)); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(SysRedPacketRecord sysRedPacketRecord) { |
| | | sysRedPacketRecord.setInsertTime(new Date()); |
| | | sysRedPacketRecord.setCompanyId(ShiroKit.getUser().getObjectId()); |
| | | sysRedPacketRecord.setCompanyType(ShiroKit.getUser().getRoleType()); |
| | | sysRedPacketRecordService.insert(sysRedPacketRecord); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer sysRedPacketRecordId) { |
| | | sysRedPacketRecordService.deleteById(sysRedPacketRecordId); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(SysRedPacketRecord sysRedPacketRecord) { |
| | | sysRedPacketRecordService.updateById(sysRedPacketRecord); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @RequestMapping(value = "/detail/{sysRedPacketRecordId}") |
| | | @ResponseBody |
| | | public Object detail(@PathVariable("sysRedPacketRecordId") Integer sysRedPacketRecordId) { |
| | | return sysRedPacketRecordService.selectById(sysRedPacketRecordId); |
| | | } |
| | | } |
New file |
| | |
| | | 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.common.constant.factory.PageFactory; |
| | | 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.modular.system.model.TRegion; |
| | | import com.stylefeng.guns.modular.system.service.ITRegionService; |
| | | 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.TAdvertisement; |
| | | import com.stylefeng.guns.modular.system.service.ITAdvertisementService; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 广告设置控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-02 09:36:03 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tAdvertisement") |
| | | public class TAdvertisementController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tAdvertisement/"; |
| | | |
| | | @Autowired |
| | | private ITAdvertisementService tAdvertisementService; |
| | | |
| | | @Autowired |
| | | private ITRegionService tRegionService; |
| | | |
| | | /** |
| | | * 跳转到广告设置首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tAdvertisement.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加广告设置 |
| | | */ |
| | | @RequestMapping("/tAdvertisement_add") |
| | | public String tAdvertisementAdd(Model model) { |
| | | List<TRegion> list = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); |
| | | model.addAttribute("list",list); |
| | | return PREFIX + "tAdvertisement_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改广告设置 |
| | | */ |
| | | @RequestMapping("/tAdvertisement_update/{tAdvertisementId}") |
| | | public String tAdvertisementUpdate(@PathVariable Integer tAdvertisementId, Model model) { |
| | | TAdvertisement tAdvertisement = tAdvertisementService.selectById(tAdvertisementId); |
| | | model.addAttribute("item",tAdvertisement); |
| | | LogObjectHolder.me().set(tAdvertisement); |
| | | |
| | | List<TRegion> list = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); |
| | | model.addAttribute("list",list); |
| | | return PREFIX + "tAdvertisement_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取广告设置列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String insertTime, |
| | | String name, |
| | | Integer type) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | 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(tAdvertisementService.getAdvertisementList(page,beginTime,endTime,type,name)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 新增广告设置 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(TAdvertisement tAdvertisement) { |
| | | tAdvertisement.setInsertTime(new Date()); |
| | | tAdvertisement.setInsertUser(ShiroKit.getUser().getId()); |
| | | tAdvertisementService.insert(tAdvertisement); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除广告设置 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tAdvertisementId) { |
| | | tAdvertisementService.deleteById(tAdvertisementId); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 操作广告设置 |
| | | */ |
| | | @RequestMapping(value = "/opt") |
| | | @ResponseBody |
| | | public Object opt(@RequestParam Integer tAdvertisementId,@RequestParam Integer optType) { |
| | | TAdvertisement tAdvertisement = tAdvertisementService.selectById(tAdvertisementId); |
| | | if (SinataUtil.isNotEmpty(tAdvertisement)){ |
| | | if (1 == optType.intValue()){ //上线 |
| | | tAdvertisement.setState(1); |
| | | }else if (2 == optType.intValue()){ //下线 |
| | | tAdvertisement.setState(2); |
| | | } |
| | | tAdvertisement.setUpdateTime(new Date()); |
| | | tAdvertisement.setUpdateUser(ShiroKit.getUser().getId()); |
| | | tAdvertisementService.updateById(tAdvertisement); |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改广告设置 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TAdvertisement tAdvertisement) { |
| | | tAdvertisement.setUpdateTime(new Date()); |
| | | tAdvertisement.setUpdateUser(ShiroKit.getUser().getId()); |
| | | tAdvertisementService.updateById(tAdvertisement); |
| | | return SUCCESS_TIP; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.modular.system.util.AddAdminLogUtil; |
| | | 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 java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 用户端协议管理控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-01 17:42:20 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tAgreement") |
| | | public class TAgreementController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tAgreement/"; |
| | | |
| | | @Autowired |
| | | private ITAgreementService tAgreementService; |
| | | |
| | | /** |
| | | * 跳转到用户端协议管理首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index(Model model) { |
| | | //注册协议 |
| | | TAgreement one = tAgreementService.selectOne(new EntityWrapper<TAgreement>().eq("useType", 1).eq("type", 6)); |
| | | //用户协议 |
| | | TAgreement two = tAgreementService.selectOne(new EntityWrapper<TAgreement>().eq("useType", 1).eq("type", 2)); |
| | | //隐私协议 |
| | | TAgreement three = tAgreementService.selectOne(new EntityWrapper<TAgreement>().eq("useType", 1).eq("type", 1)); |
| | | model.addAttribute("one",one); |
| | | model.addAttribute("two",two); |
| | | model.addAttribute("three",three); |
| | | return PREFIX + "tAgreement.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到司机端协议管理首页 |
| | | */ |
| | | @RequestMapping("/driver") |
| | | public String driverIndex(Model model) { |
| | | //注册协议 |
| | | TAgreement one = tAgreementService.selectOne(new EntityWrapper<TAgreement>().eq("useType", 2).eq("type", 6)); |
| | | //用户协议 |
| | | TAgreement two = tAgreementService.selectOne(new EntityWrapper<TAgreement>().eq("useType", 2).eq("type", 2)); |
| | | //隐私协议 |
| | | TAgreement three = tAgreementService.selectOne(new EntityWrapper<TAgreement>().eq("useType", 2).eq("type", 1)); |
| | | model.addAttribute("one",one); |
| | | model.addAttribute("two",two); |
| | | model.addAttribute("three",three); |
| | | return PREFIX + "tAgreementDriver.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到取消订单说明协议管理首页 |
| | | */ |
| | | @RequestMapping("/order") |
| | | public String orderIndex(Model model) { |
| | | TAgreement one = tAgreementService.selectOne(new EntityWrapper<TAgreement>().eq("type", 7)); |
| | | model.addAttribute("one",one); |
| | | return PREFIX + "tAgreementOrder.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到用户指南设置协议管理首页 |
| | | */ |
| | | @RequestMapping("/user") |
| | | public String userIndex(Model model) { |
| | | TAgreement one = tAgreementService.selectOne(new EntityWrapper<TAgreement>().eq("type", 3)); |
| | | model.addAttribute("one",one); |
| | | return PREFIX + "tAgreementUser.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到法律法规设置协议管理首页 |
| | | */ |
| | | @RequestMapping("/law") |
| | | public String lawIndex(Model model) { |
| | | TAgreement one = tAgreementService.selectOne(new EntityWrapper<TAgreement>().eq("type", 4)); |
| | | model.addAttribute("one",one); |
| | | return PREFIX + "tAgreementLaw.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到关于我们设置协议管理首页 |
| | | */ |
| | | @RequestMapping("/me") |
| | | public String meIndex(Model model) { |
| | | TAgreement one = tAgreementService.selectOne(new EntityWrapper<TAgreement>().eq("type", 5)); |
| | | model.addAttribute("one",one); |
| | | return PREFIX + "tAgreementMe.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到充值领券规则设置协议管理首页 |
| | | */ |
| | | @RequestMapping("/recharge") |
| | | public String rechargeIndex(Model model) { |
| | | TAgreement one = tAgreementService.selectOne(new EntityWrapper<TAgreement>().eq("type", 8)); |
| | | model.addAttribute("one",one); |
| | | return PREFIX + "tAgreementRecharge.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到司机注册协议设置管理首页 |
| | | */ |
| | | @RequestMapping("/driverRegister") |
| | | public String driverRegister(Model model) { |
| | | TAgreement one = tAgreementService.selectOne(new EntityWrapper<TAgreement>().eq("type", 9)); |
| | | model.addAttribute("one",one); |
| | | return PREFIX + "driverRegister.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到改派说明设置管理首页 |
| | | */ |
| | | @RequestMapping("/instructions") |
| | | public String instructions(Model model) { |
| | | TAgreement one = tAgreementService.selectOne(new EntityWrapper<TAgreement>().eq("type", 10)); |
| | | model.addAttribute("one",one); |
| | | return PREFIX + "instructions.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到跨城出行乘车须知 |
| | | */ |
| | | @RequestMapping("/corssHtml") |
| | | public String corssHtml(Model model) { |
| | | TAgreement one = tAgreementService.selectOne(new EntityWrapper<TAgreement>().eq("type", 11)); |
| | | model.addAttribute("one",one); |
| | | return PREFIX + "corssHtml.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 跳转到常见问题 |
| | | * @param model |
| | | * @return |
| | | */ |
| | | @RequestMapping("/showCommonProblem") |
| | | public String showCommonProblem(Model model) { |
| | | TAgreement one = tAgreementService.selectOne(new EntityWrapper<TAgreement>().eq("type", 12)); |
| | | model.addAttribute("one",one); |
| | | return PREFIX + "commonProblem.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 跳转到计价规则 |
| | | * @param model |
| | | * @return |
| | | */ |
| | | @RequestMapping("/showPricingRules") |
| | | public String showPricingRules(Model model) { |
| | | TAgreement one = tAgreementService.selectOne(new EntityWrapper<TAgreement>().eq("type", 13)); |
| | | model.addAttribute("one",one); |
| | | return PREFIX + "pricingRules.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 跳转到包车协议 |
| | | * @param model |
| | | * @return |
| | | */ |
| | | @RequestMapping("/showCharterCar") |
| | | public String showCharterCar(Model model) { |
| | | TAgreement one = tAgreementService.selectOne(new EntityWrapper<TAgreement>().eq("type", 14)); |
| | | model.addAttribute("one",one); |
| | | return PREFIX + "tAgreementCharterCar.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 跳转到小件物流协议 |
| | | * @param model |
| | | * @return |
| | | */ |
| | | @RequestMapping("/showSmallPieceLogistics") |
| | | public String showSmallPieceLogistics(Model model) { |
| | | TAgreement one = tAgreementService.selectOne(new EntityWrapper<TAgreement>().eq("type", 15)); |
| | | model.addAttribute("one",one); |
| | | return PREFIX + "tAgreementSmallPieceLogistics.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改协议 |
| | | */ |
| | | @RequestMapping(value = "/updateAppParam") |
| | | @ResponseBody |
| | | public Object updateAppParam(@RequestParam Integer id,@RequestParam String context) { |
| | | TAgreement agreement = tAgreementService.selectById(id); |
| | | agreement.setContent(context); |
| | | agreement.setUpdateTime(new Date()); |
| | | agreement.setUpdateUser(ShiroKit.getUser().getId()); |
| | | tAgreementService.updateById(agreement); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加用户端协议管理 |
| | | */ |
| | | @RequestMapping("/tAgreement_add") |
| | | public String tAgreementAdd() { |
| | | return PREFIX + "tAgreement_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改用户端协议管理 |
| | | */ |
| | | @RequestMapping("/tAgreement_update/{tAgreementId}") |
| | | public String tAgreementUpdate(@PathVariable Integer tAgreementId, Model model) { |
| | | TAgreement tAgreement = tAgreementService.selectById(tAgreementId); |
| | | model.addAttribute("item",tAgreement); |
| | | LogObjectHolder.me().set(tAgreement); |
| | | return PREFIX + "tAgreement_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取用户端协议管理列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String condition) { |
| | | return tAgreementService.selectList(null); |
| | | } |
| | | |
| | | /** |
| | | * 新增用户端协议管理 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(TAgreement tAgreement) { |
| | | tAgreementService.insert(tAgreement); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除用户端协议管理 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tAgreementId) { |
| | | tAgreementService.deleteById(tAgreementId); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改用户端协议管理 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TAgreement tAgreement) { |
| | | tAgreementService.updateById(tAgreement); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 用户端协议管理详情 |
| | | */ |
| | | @RequestMapping(value = "/detail/{tAgreementId}") |
| | | @ResponseBody |
| | | public Object detail(@PathVariable("tAgreementId") Integer tAgreementId) { |
| | | return tAgreementService.selectById(tAgreementId); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | 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.TCarBrand; |
| | | import com.stylefeng.guns.modular.system.service.ITCarBrandService; |
| | | |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 车辆品牌管理控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-05 13:52:25 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tCarBrand") |
| | | public class TCarBrandController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tCarBrand/"; |
| | | |
| | | @Autowired |
| | | private ITCarBrandService tCarBrandService; |
| | | |
| | | /** |
| | | * 跳转到车辆品牌管理首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tCarBrand.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加车辆品牌管理 |
| | | */ |
| | | @RequestMapping("/tCarBrand_add") |
| | | public String tCarBrandAdd() { |
| | | return PREFIX + "tCarBrand_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改车辆品牌管理 |
| | | */ |
| | | @RequestMapping("/tCarBrand_update/{tCarBrandId}") |
| | | public String tCarBrandUpdate(@PathVariable Integer tCarBrandId, Model model) { |
| | | TCarBrand tCarBrand = tCarBrandService.selectById(tCarBrandId); |
| | | model.addAttribute("item",tCarBrand); |
| | | LogObjectHolder.me().set(tCarBrand); |
| | | return PREFIX + "tCarBrand_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取车辆品牌管理列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String createTime, |
| | | String name) { |
| | | 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(); |
| | | page.setRecords(tCarBrandService.getCarBrandList(page,beginTime,endTime,name)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 新增车辆品牌管理 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(TCarBrand tCarBrand) { |
| | | tCarBrand.setInsertTime(new Date()); |
| | | tCarBrand.setState(1); |
| | | tCarBrandService.insert(tCarBrand); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除车辆品牌管理 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tCarBrandId) { |
| | | TCarBrand tCarBrand = tCarBrandService.selectById(tCarBrandId); |
| | | tCarBrand.setState(2); |
| | | tCarBrandService.updateById(tCarBrand); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改车辆品牌管理 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TCarBrand tCarBrand) { |
| | | tCarBrandService.updateById(tCarBrand); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.base.tips.ErrorTip; |
| | | 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.ExcelExportUtil; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.core.util.WoUtil; |
| | | import com.stylefeng.guns.modular.system.dao.CarInsuranceMapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.PushMinistryOfTransportUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import org.apache.commons.lang.time.DateUtils; |
| | | import org.apache.poi.hdf.extractor.TC; |
| | | import org.apache.poi.ss.usermodel.Cell; |
| | | import org.apache.poi.ss.usermodel.Row; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | 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.text.DateFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 车辆管理控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-05 17:25:12 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tCar") |
| | | public class TCarController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tCar/"; |
| | | |
| | | @Autowired |
| | | private ITCarService tCarService; |
| | | |
| | | @Autowired |
| | | private ITCompanyService tCompanyService; |
| | | |
| | | @Autowired |
| | | private ITCarServiceService tCarServiceService; |
| | | |
| | | @Autowired |
| | | private ITDriverLineService tDriverLineService; |
| | | |
| | | @Autowired |
| | | private ITCarBrandService tCarBrandService; |
| | | |
| | | @Autowired |
| | | private ITCarModelService tCarModelService; |
| | | |
| | | @Autowired |
| | | private ITDriverService tDriverService; |
| | | |
| | | @Autowired |
| | | private ITCompanyService itCompanyService; |
| | | |
| | | @Autowired |
| | | private ITCarServiceService itCarServiceService; |
| | | |
| | | @Autowired |
| | | private ITServerCarmodelService itServerCarmodelService; |
| | | |
| | | @Autowired |
| | | private PushMinistryOfTransportUtil pushMinistryOfTransportUtil; |
| | | |
| | | @Resource |
| | | private CarInsuranceMapper carInsuranceMapper; |
| | | |
| | | @Value("${pushMinistryOfTransport}") |
| | | private boolean pushMinistryOfTransport; |
| | | |
| | | /** |
| | | * 跳转到车辆管理首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tCar.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加车辆管理 |
| | | */ |
| | | @RequestMapping("/tCar_add") |
| | | public String tCarAdd(Model model) { |
| | | List<TCompany> companyList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 2)); |
| | | model.addAttribute("companyList",companyList); |
| | | |
| | | Integer roleType = ShiroKit.getUser().getRoleType(); |
| | | model.addAttribute("roleType",roleType); |
| | | if (2 == roleType){ |
| | | List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3).eq("superiorId",ShiroKit.getUser().getObjectId())); |
| | | model.addAttribute("franchiseeList",franchiseeList); |
| | | }else{ |
| | | model.addAttribute("franchiseeList",null); |
| | | } |
| | | //查询当前用户所属分公司/加盟商 |
| | | model.addAttribute("objectName",tCompanyService.selectById(ShiroKit.getUser().getObjectId()).getName()); |
| | | |
| | | //车辆品牌 |
| | | List<TCarBrand> brandList = tCarBrandService.selectList(new EntityWrapper<TCarBrand>().eq("state", 1)); |
| | | model.addAttribute("brandList",brandList); |
| | | //车辆类型 |
| | | /*List<TCharteredService> modelList = tCarModelService.selectList(new EntityWrapper<TCharteredService>().eq("state", 1)); |
| | | model.addAttribute("modelList",modelList);*/ |
| | | |
| | | List<TServerCarmodel> zcModelList = itServerCarmodelService.selectList(new EntityWrapper<TServerCarmodel>().eq("type", 1).eq("state", 1)); |
| | | model.addAttribute("zcModelList",zcModelList); |
| | | List<TServerCarmodel> kcModelList = itServerCarmodelService.selectList(new EntityWrapper<TServerCarmodel>().eq("type", 2).eq("state", 1)); |
| | | model.addAttribute("kcModelList",kcModelList); |
| | | List<TServerCarmodel> jsjModelList = itServerCarmodelService.selectList(new EntityWrapper<TServerCarmodel>().eq("type", 7).eq("state", 1)); |
| | | model.addAttribute("jsjModelList",jsjModelList); |
| | | return PREFIX + "tCar_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 查询车辆类型 |
| | | * @param carBrandId |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/brandChange") |
| | | @ResponseBody |
| | | public Object brandChange(@RequestParam Integer carBrandId) { |
| | | List<TCarModel> list = new ArrayList<>(); |
| | | if (SinataUtil.isNotEmpty(carBrandId)){ |
| | | list = tCarModelService.selectList(new EntityWrapper<TCarModel>().eq("state",1).eq("brandId", carBrandId)); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改车辆管理 |
| | | */ |
| | | @RequestMapping("/tCar_update/{tCarId}") |
| | | public String tCarUpdate(@PathVariable Integer tCarId, Model model) { |
| | | TCar tCar = tCarService.selectById(tCarId); |
| | | model.addAttribute("item",tCar); |
| | | LogObjectHolder.me().set(tCar); |
| | | |
| | | Integer roleType = ShiroKit.getUser().getRoleType(); |
| | | model.addAttribute("roleType",roleType); |
| | | model.addAttribute("objectName",tCompanyService.selectById(ShiroKit.getUser().getObjectId()).getName()); |
| | | |
| | | if (1 == roleType){ |
| | | List<TCompany> companyList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 2)); |
| | | model.addAttribute("companyList",companyList); |
| | | List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3).eq("superiorId",tCar.getCompanyId())); |
| | | model.addAttribute("franchiseeList",franchiseeList); |
| | | }else if (2 == roleType){ |
| | | List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3).eq("superiorId",ShiroKit.getUser().getObjectId())); |
| | | model.addAttribute("franchiseeList",franchiseeList); |
| | | } |
| | | |
| | | //查询平台ID |
| | | TCompany company = tCompanyService.selectOne(new EntityWrapper<TCompany>().eq("type", 1)); |
| | | //判断是平台司机还是加盟司机 |
| | | if ((SinataUtil.isEmpty(tCar.getCompanyId()) || tCar.getCompanyId() == 0 || tCar.getCompanyId() == company.getId()) && (SinataUtil.isEmpty(tCar.getFranchiseeId()) || tCar.getFranchiseeId() == 0)){ |
| | | model.addAttribute("companyType",1); |
| | | }else{ |
| | | model.addAttribute("companyType",2); |
| | | } |
| | | |
| | | //获取经营业务 |
| | | List<TCarService> serviceList = tCarServiceService.selectList(new EntityWrapper<TCarService>().eq("carId", tCar.getId())); |
| | | Integer one = 1; |
| | | Integer two = 1; |
| | | Integer three = 1; |
| | | Integer four = 1; |
| | | Integer five = 1; |
| | | Integer six = 1; |
| | | Integer seven = 1; |
| | | Integer zcModel = 0; |
| | | Integer kcModel = 0; |
| | | Integer jsjModel = 0; |
| | | for (TCarService obj : serviceList){ |
| | | if (obj.getType() == 1){ |
| | | one = 2; |
| | | zcModel = obj.getServerCarModelId(); |
| | | } |
| | | if (obj.getType() == 2){ |
| | | two = 2; |
| | | } |
| | | if (obj.getType() == 3){ |
| | | three = 2; |
| | | kcModel = obj.getServerCarModelId(); |
| | | } |
| | | if (obj.getType() == 4){ |
| | | four = 2; |
| | | } |
| | | if (obj.getType() == 5){ |
| | | five = 2; |
| | | } |
| | | if (obj.getType() == 6){ |
| | | six = 2; |
| | | } |
| | | if (obj.getType() == 7){ |
| | | seven = 2; |
| | | jsjModel = obj.getServerCarModelId(); |
| | | } |
| | | } |
| | | model.addAttribute("one",one); |
| | | model.addAttribute("two",two); |
| | | model.addAttribute("three",three); |
| | | model.addAttribute("four",four); |
| | | model.addAttribute("five",five); |
| | | model.addAttribute("six",six); |
| | | model.addAttribute("seven",seven); |
| | | model.addAttribute("zcModel",zcModel); |
| | | model.addAttribute("kcModel",kcModel); |
| | | model.addAttribute("jsjModel",jsjModel); |
| | | |
| | | List<TServerCarmodel> zcModelList = itServerCarmodelService.selectList(new EntityWrapper<TServerCarmodel>().eq("type", 1).eq("state", 1)); |
| | | model.addAttribute("zcModelList",zcModelList); |
| | | List<TServerCarmodel> kcModelList = itServerCarmodelService.selectList(new EntityWrapper<TServerCarmodel>().eq("type", 2).eq("state", 1)); |
| | | model.addAttribute("kcModelList",kcModelList); |
| | | List<TServerCarmodel> jsjModelList = itServerCarmodelService.selectList(new EntityWrapper<TServerCarmodel>().eq("type", 7).eq("state", 1)); |
| | | model.addAttribute("jsjModelList",jsjModelList); |
| | | |
| | | //车辆品牌 |
| | | List<TCarBrand> brandList = tCarBrandService.selectList(new EntityWrapper<TCarBrand>().eq("state", 1)); |
| | | model.addAttribute("brandList",brandList); |
| | | //车辆类型 |
| | | List<TCarModel> modelList = tCarModelService.selectList(new EntityWrapper<TCarModel>().eq("brandId",tCar.getCarBrandId()).eq("state", 1)); |
| | | model.addAttribute("modelList",modelList); |
| | | return PREFIX + "tCar_edit.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 跳转到保险列表页 |
| | | * @param carId |
| | | * @param model |
| | | * @return |
| | | */ |
| | | @RequestMapping("/carInsurance") |
| | | public String carInsurance(Integer carId, Model model){ |
| | | model.addAttribute("carId", carId); |
| | | return PREFIX + "carInsurance.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加页面 |
| | | * @param carId |
| | | * @param model |
| | | * @return |
| | | */ |
| | | @RequestMapping("/showAddCarInsurance") |
| | | public String showAddCarInsurance(Integer carId, Model model){ |
| | | model.addAttribute("carId", carId); |
| | | model.addAttribute("id", ""); |
| | | return PREFIX + "carInsuranceInfo.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到编辑页 |
| | | * @param id |
| | | * @param carId |
| | | * @param model |
| | | * @return |
| | | */ |
| | | @RequestMapping("/showEditCarInsurance") |
| | | public String showEditCarInsurance(Integer id, Integer carId, Model model){ |
| | | model.addAttribute("carId", carId); |
| | | model.addAttribute("id", id); |
| | | return PREFIX + "carInsuranceInfo.html"; |
| | | } |
| | | |
| | | /** |
| | | * 添加保险数据 |
| | | * @param carInsurance |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/saveCarInsurance", method = RequestMethod.POST) |
| | | public ResultUtil saveCarInsurance(CarInsurance carInsurance){ |
| | | if(carInsurance.getId() == null){ |
| | | carInsuranceMapper.insert(carInsurance); |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.baseInfoVehicleInsurance(carInsurance.getId(), 1); |
| | | } |
| | | } |
| | | }).start(); |
| | | }else{ |
| | | carInsuranceMapper.updateById(carInsurance); |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.baseInfoVehicleInsurance(carInsurance.getId(), 2); |
| | | } |
| | | } |
| | | }).start(); |
| | | } |
| | | |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | /** |
| | | * 获取保险详情 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/queryCarInsurance", method = RequestMethod.POST) |
| | | public ResultUtil queryCarInsurance(Integer id){ |
| | | CarInsurance carInsurance = carInsuranceMapper.selectById(id); |
| | | return ResultUtil.success(carInsurance); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取保险列表 |
| | | * @param carId |
| | | * @param offset |
| | | * @param limit |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/queryInsuranceList", method = RequestMethod.POST) |
| | | public Object queryInsuranceList(Integer carId, Integer offset,Integer limit){ |
| | | try { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | List<Map<String, Object>> list = carInsuranceMapper.queryInsuranceList(carId, offset, limit); |
| | | int i = carInsuranceMapper.queryInsuranceListCount(carId); |
| | | map.put("rows", list); |
| | | map.put("total", i); |
| | | return map; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除保险 |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/delCarInsurance", method = RequestMethod.POST) |
| | | public ResultUtil delCarInsurance(Integer id){ |
| | | carInsuranceMapper.deleteById(id); |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.baseInfoVehicleInsurance(id, 3); |
| | | } |
| | | } |
| | | }).start(); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取车辆管理列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String createTime, |
| | | String id, |
| | | String brandName, |
| | | String modelName, |
| | | String carColor, |
| | | String serverStr, |
| | | String carLicensePlate, |
| | | String driverName, |
| | | String companyName, |
| | | String franchiseeName) { |
| | | 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(); |
| | | page.setRecords(tCarService.getCarList(page,ShiroKit.getUser().getRoleType(),ShiroKit.getUser().getObjectId(),beginTime,endTime,id,brandName,modelName,carColor,serverStr,carLicensePlate,driverName,companyName,franchiseeName)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 新增车辆管理 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(TCar tCar,@RequestParam String serverBox,Integer roleType,Integer companyType,Integer oneId,Integer twoId,Integer franchiseeId,String zcModel,String kcModel,String jsjModel) { |
| | | if (1 == roleType){ //平台 |
| | | if (2 == companyType.intValue()){ |
| | | if (SinataUtil.isNotEmpty(oneId)){ |
| | | tCar.setCompanyId(oneId); |
| | | } |
| | | if (SinataUtil.isNotEmpty(twoId)){ |
| | | tCar.setFranchiseeId(twoId); |
| | | } |
| | | }else if (1 == companyType.intValue()){ |
| | | TCompany company = tCompanyService.selectOne(new EntityWrapper<TCompany>().eq("type", 1)); |
| | | tCar.setCompanyId(company.getId()); |
| | | tCar.setFranchiseeId(0); |
| | | } |
| | | tCar.setAddType(2); |
| | | tCar.setIsPlatCar(1); |
| | | }else if (2 == roleType){ //分公司 |
| | | if (SinataUtil.isNotEmpty(ShiroKit.getUser().getObjectId())){ |
| | | tCar.setCompanyId(ShiroKit.getUser().getObjectId()); |
| | | } |
| | | if (SinataUtil.isNotEmpty(franchiseeId)){ |
| | | tCar.setFranchiseeId(franchiseeId); |
| | | } |
| | | tCar.setIsPlatCar(2); |
| | | tCar.setAddType(3); |
| | | tCar.setAddObjectId(ShiroKit.getUser().getObjectId()); |
| | | }else if (3 == roleType){ //加盟商 |
| | | TCompany tCompany = tCompanyService.selectById(ShiroKit.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(tCompany)){ |
| | | tCar.setCompanyId(tCompany.getSuperiorId()); |
| | | } |
| | | if (SinataUtil.isNotEmpty(ShiroKit.getUser().getObjectId())){ |
| | | tCar.setFranchiseeId(ShiroKit.getUser().getObjectId()); |
| | | } |
| | | tCar.setIsPlatCar(2); |
| | | tCar.setAddType(4); |
| | | tCar.setAddObjectId(ShiroKit.getUser().getObjectId()); |
| | | } |
| | | tCar.setInsertTime(new Date()); |
| | | tCar.setState(1); |
| | | tCarService.insert(tCar); |
| | | |
| | | //添加经营业务 |
| | | String[] serverArray = serverBox.split(","); |
| | | for (int i=0;i<serverArray.length;i++){ |
| | | TCarService service = new TCarService(); |
| | | service.setCarId(tCar.getId()); |
| | | service.setType(Integer.valueOf(serverArray[i])); |
| | | if (1 == service.getType()){ |
| | | service.setServerCarModelId(Integer.valueOf(zcModel)); |
| | | }else if (3 == service.getType()){ |
| | | service.setServerCarModelId(Integer.valueOf(kcModel)); |
| | | }else if (7 == service.getType()){ |
| | | service.setServerCarModelId(Integer.valueOf(jsjModel)); |
| | | } |
| | | tCarServiceService.insert(service); |
| | | } |
| | | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.baseInfoCompanyStat(); |
| | | pushMinistryOfTransportUtil.baseInfoVehicle(tCar.getId()); |
| | | } |
| | | } |
| | | }).start(); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除车辆管理 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tCarId) { |
| | | TCar tCar = tCarService.selectById(tCarId); |
| | | tCar.setState(2); |
| | | tCarService.updateById(tCar); |
| | | |
| | | //清除相对应的司机关联车辆ID |
| | | List<TDriver> list = tDriverService.selectList(new EntityWrapper<TDriver>().eq("carId", tCarId)); |
| | | for (TDriver obj : list){ |
| | | obj.setCarId(null); |
| | | tDriverService.updateById(obj); |
| | | } |
| | | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.baseInfoCompanyStat(); |
| | | pushMinistryOfTransportUtil.baseInfoVehicle(tCar.getId()); |
| | | } |
| | | } |
| | | }).start(); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改车辆管理 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TCar tCar,@RequestParam String serverBox,Integer roleType,Integer companyType,Integer oneId,Integer twoId,Integer franchiseeId,String zcModel,String kcModel,String jsjModel) { |
| | | if (1 == roleType){ //平台 |
| | | if (2 == companyType.intValue()){ |
| | | if (SinataUtil.isNotEmpty(oneId)){ |
| | | tCar.setCompanyId(oneId); |
| | | } |
| | | if (SinataUtil.isNotEmpty(twoId)){ |
| | | tCar.setFranchiseeId(twoId); |
| | | } |
| | | }else if (1 == companyType.intValue()){ |
| | | TCompany company = tCompanyService.selectOne(new EntityWrapper<TCompany>().eq("type", 1)); |
| | | tCar.setCompanyId(company.getId()); |
| | | tCar.setFranchiseeId(0); |
| | | } |
| | | }else if (2 == roleType){ //分公司 |
| | | if (SinataUtil.isNotEmpty(ShiroKit.getUser().getObjectId())){ |
| | | tCar.setCompanyId(ShiroKit.getUser().getObjectId()); |
| | | } |
| | | if (SinataUtil.isNotEmpty(franchiseeId)){ |
| | | tCar.setFranchiseeId(franchiseeId); |
| | | } |
| | | }else if (3 == roleType){ //加盟商 |
| | | TCompany tCompany = tCompanyService.selectById(ShiroKit.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(tCompany)){ |
| | | tCar.setCompanyId(tCompany.getSuperiorId()); |
| | | } |
| | | if (SinataUtil.isNotEmpty(ShiroKit.getUser().getObjectId())){ |
| | | tCar.setFranchiseeId(ShiroKit.getUser().getObjectId()); |
| | | } |
| | | } |
| | | |
| | | //删除业务 |
| | | tCarServiceService.delete(new EntityWrapper<TCarService>().eq("carId",tCar.getId())); |
| | | |
| | | //添加经营业务 |
| | | String[] serverArray = serverBox.split(","); |
| | | for (int i=0;i<serverArray.length;i++){ |
| | | TCarService service = new TCarService(); |
| | | service.setCarId(tCar.getId()); |
| | | service.setType(Integer.valueOf(serverArray[i])); |
| | | if (1 == service.getType()){ |
| | | service.setServerCarModelId(Integer.valueOf(zcModel)); |
| | | }else if (3 == service.getType()){ |
| | | service.setServerCarModelId(Integer.valueOf(kcModel)); |
| | | }else if (7 == service.getType()){ |
| | | service.setServerCarModelId(Integer.valueOf(jsjModel)); |
| | | } |
| | | tCarServiceService.insert(service); |
| | | } |
| | | |
| | | tCarService.updateById(tCar); |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){ |
| | | pushMinistryOfTransportUtil.baseInfoVehicle(tCar.getId()); |
| | | } |
| | | } |
| | | }).start(); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 车辆管理详情 |
| | | */ |
| | | @RequestMapping(value = "/detail/{tCarId}") |
| | | @ResponseBody |
| | | public Object detail(@PathVariable("tCarId") Integer tCarId) { |
| | | return tCarService.selectById(tCarId); |
| | | } |
| | | |
| | | /** |
| | | * 下载模板 |
| | | * @param request |
| | | * @param response |
| | | */ |
| | | @RequestMapping(value = "/uploadCarModel") |
| | | public void uploadCarModel(HttpServletRequest request, HttpServletResponse response) { |
| | | // 表格数据【封装】 |
| | | List<List<String>> dataList = new ArrayList<List<String>>(); |
| | | |
| | | // 首行【封装】 |
| | | List<String> shellList = new ArrayList<String>(); |
| | | shellList.add("所属机构[平台车辆/加盟车辆]"); |
| | | shellList.add("所属分公司[提示:加盟车辆选填]"); |
| | | shellList.add("所属加盟商[提示:加盟车辆选填]"); |
| | | shellList.add("服务模式:专车[是/否]"); |
| | | shellList.add("服务模式:出租车[是/否]"); |
| | | shellList.add("服务模式:跨城[是/否]"); |
| | | shellList.add("服务模式:小件同城物流[是/否]"); |
| | | shellList.add("服务模式:小件跨城物流[是/否]"); |
| | | shellList.add("服务模式:包车[是/否]"); |
| | | shellList.add("车辆品牌"); |
| | | shellList.add("车辆类型"); |
| | | shellList.add("车辆颜色[黑色/银色/白色/红色/黄色/橙色/蓝色/绿色/蓝白色]"); |
| | | shellList.add("车牌号"); |
| | | shellList.add("行驶证编号"); |
| | | shellList.add("年检到期时间[例如 2020-02-02]"); |
| | | shellList.add("商业保险到期时间[例如 2020-02-02]"); |
| | | dataList.add(shellList); |
| | | |
| | | try { |
| | | // 调用工具类进行导出 |
| | | ExcelExportUtil.easySheet("平台导入车辆模板"+DateUtil.formatDate(new Date(), "YYYYMMddHHmmss"), "平台导入车辆模板", dataList, request, response); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 导入操作 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping(value="/exportCar",method = RequestMethod.POST) |
| | | @ResponseBody |
| | | public Object exportCar(HttpServletRequest request){ |
| | | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
| | | MultipartFile file = (MultipartFile) multipartRequest.getFile("myfile"); |
| | | try { |
| | | //定时五秒后执行 |
| | | /*Map<String,Object> maps=new HashMap<>(); |
| | | Workbook book = WoUtil.ImportFile(file); |
| | | maps.put("book",book); |
| | | QuartzManager.addJob(AddContract.class, (AddContract.name+new Date().getTime()).toUpperCase(), TimeJobType.ADMIN,DateUtil.getDate_strYMdHms(new Date().getTime() + 1*1000) , maps);*/ |
| | | |
| | | Workbook book = WoUtil.ImportFile(file); |
| | | Sheet sh = book.getSheetAt(0); //获取到第一个表 |
| | | for (int i = 1; i <= sh.getLastRowNum(); i++) { |
| | | Row row = sh.getRow(i); |
| | | |
| | | Cell cell0 = row.getCell(0); //所属机构[平台车辆/加盟车辆] |
| | | String zero = null; |
| | | if (SinataUtil.isNotEmpty(cell0)){ |
| | | zero = String.valueOf(cell0.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell1 = row.getCell(1); //所属分公司[提示:加盟车辆选填] |
| | | String one = null; |
| | | if (SinataUtil.isNotEmpty(cell1)){ |
| | | one = String.valueOf(cell1.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell2 = row.getCell(2); //所属加盟商[提示:加盟车辆选填] |
| | | String two = null; |
| | | if (SinataUtil.isNotEmpty(cell2)){ |
| | | two = String.valueOf(cell2.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell3 = row.getCell(3); //服务模式:专车[是/否] |
| | | String three = null; |
| | | if (SinataUtil.isNotEmpty(cell3)){ |
| | | three = String.valueOf(cell3.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell4 = row.getCell(4); //服务模式:出租车[是/否] |
| | | String four = null; |
| | | if (SinataUtil.isNotEmpty(cell4)){ |
| | | four = String.valueOf(cell4.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell5 = row.getCell(5); //服务模式:跨城出行[是/否] |
| | | String five = null; |
| | | if (SinataUtil.isNotEmpty(cell5)){ |
| | | five = String.valueOf(cell5.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell6 = row.getCell(6); //服务模式:小件跨城物流[是/否] |
| | | String six = null; |
| | | if (SinataUtil.isNotEmpty(cell6)){ |
| | | six = String.valueOf(cell6.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell7 = row.getCell(7); //服务模式:小件跨城物流[是/否] |
| | | String seven = null; |
| | | if (SinataUtil.isNotEmpty(cell7)){ |
| | | seven = String.valueOf(cell7.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell8 = row.getCell(8); //服务模式:包车[是/否] |
| | | String eight = null; |
| | | if (SinataUtil.isNotEmpty(cell8)){ |
| | | eight = String.valueOf(cell8.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell9 = row.getCell(9); //车辆品牌 |
| | | String nine = null; |
| | | if (SinataUtil.isNotEmpty(cell9)){ |
| | | nine = String.valueOf(cell9.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell10 = row.getCell(10); //车辆类型 |
| | | String ten = null; |
| | | if (SinataUtil.isNotEmpty(cell10)){ |
| | | ten = String.valueOf(cell10.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell11 = row.getCell(11); //车辆颜色[黑色/银色/白色/红色/黄色/橙色/蓝色] |
| | | String eleven = null; |
| | | if (SinataUtil.isNotEmpty(cell11)){ |
| | | eleven = String.valueOf(cell11.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell12 = row.getCell(12); //车牌号 |
| | | String twelve = null; |
| | | if (SinataUtil.isNotEmpty(cell12)){ |
| | | twelve = String.valueOf(cell12.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell13 = row.getCell(13); //行驶证编号 |
| | | String thirteen = null; |
| | | if (SinataUtil.isNotEmpty(cell13)){ |
| | | thirteen = String.valueOf(cell13.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell14 = row.getCell(14); //年检到期时间 |
| | | String fourteen = null; |
| | | if (SinataUtil.isNotEmpty(cell14)){ |
| | | fourteen = String.valueOf(cell14.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell15 = row.getCell(15); //商业保险到期时间 |
| | | String fifteen = null; |
| | | if (SinataUtil.isNotEmpty(cell15)){ |
| | | fifteen = String.valueOf(cell15.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | if (SinataUtil.isEmpty(zero) || SinataUtil.isEmpty(three) || SinataUtil.isEmpty(four) |
| | | || SinataUtil.isEmpty(five) || SinataUtil.isEmpty(six) || SinataUtil.isEmpty(seven) |
| | | || SinataUtil.isEmpty(eight) || SinataUtil.isEmpty(nine) || SinataUtil.isEmpty(ten) |
| | | || SinataUtil.isEmpty(eleven) || SinataUtil.isEmpty(twelve) || SinataUtil.isEmpty(thirteen) |
| | | || SinataUtil.isEmpty(fourteen) || SinataUtil.isEmpty(fifteen)){ |
| | | return new ErrorTip(500, "单元格不能为空"); |
| | | }else{ |
| | | //判断所属机构 |
| | | if (!zero.equals("平台车辆") && !zero.equals("加盟车辆")){ |
| | | return new ErrorTip(500, "所属机构内容不正确"); |
| | | } |
| | | //判断服务模式【专车】 |
| | | if (!three.equals("是") && !three.equals("否")){ |
| | | return new ErrorTip(500, "服务模式【专车】内容不正确"); |
| | | } |
| | | //判断服务模式【出租车】 |
| | | if (!four.equals("是") && !four.equals("否")){ |
| | | return new ErrorTip(500, "服务模式【出租车】内容不正确"); |
| | | } |
| | | //判断服务模式【跨城出行】 |
| | | if (!five.equals("是") && !five.equals("否")){ |
| | | return new ErrorTip(500, "服务模式【跨城】内容不正确"); |
| | | } |
| | | //判断服务模式【小件同城物流】 |
| | | if (!six.equals("是") && !six.equals("否")){ |
| | | return new ErrorTip(500, "服务模式【小件同城物流】内容不正确"); |
| | | } |
| | | //判断服务模式【小件跨城物流】 |
| | | if (!seven.equals("是") && !seven.equals("否")){ |
| | | return new ErrorTip(500, "服务模式【小件跨城物流】内容不正确"); |
| | | } |
| | | //判断服务模式【包车】 |
| | | if (!eight.equals("是") && !eight.equals("否")){ |
| | | return new ErrorTip(500, "服务模式【包车】内容不正确"); |
| | | } |
| | | //判断车辆颜色 |
| | | if (!eleven.equals("黑色") && !eleven.equals("银色") && !eleven.equals("白色") && !eleven.equals("红色") && !eleven.equals("黄色") |
| | | && !eleven.equals("橙色") && !eleven.equals("蓝色") && !eleven.equals("绿色") && !eleven.equals("蓝白色")){ |
| | | return new ErrorTip(500, "车辆颜色内容不正确"); |
| | | } |
| | | //判断年检到期时间格式是否正确 |
| | | try { |
| | | if (!isValidDate(fourteen)) { |
| | | fourteen = importByExcelForDate(fourteen); |
| | | } |
| | | }catch (Exception e){ |
| | | return new ErrorTip(500, "年检到期时间格式不正确"); |
| | | } |
| | | //判断商业保险到期时间格式是否正确 |
| | | try { |
| | | if (!isValidDate(fifteen)) { |
| | | fifteen = importByExcelForDate(fifteen); |
| | | } |
| | | }catch (Exception e){ |
| | | return new ErrorTip(500, "商业保险到期时间格式不正确"); |
| | | } |
| | | |
| | | //查找平台公司 |
| | | TCompany platCompany = itCompanyService.selectOne(new EntityWrapper<TCompany>().eq("type", 1).notIn("flag", "3").last(" limit 1")); |
| | | Integer companyId = platCompany.getId(); |
| | | Integer franchiseeId = 0; |
| | | if ("加盟车辆".equals(zero)){ |
| | | //判断所属分公司是否存在 |
| | | if (SinataUtil.isNotEmpty(one)){ |
| | | TCompany company = itCompanyService.selectOne(new EntityWrapper<TCompany>().eq("name", one).eq("type", 2).notIn("flag", "3").last(" limit 1")); |
| | | if (SinataUtil.isNotEmpty(company)){ |
| | | companyId = company.getId(); |
| | | //判断加盟商是否存在 |
| | | if (SinataUtil.isNotEmpty(two)){ |
| | | TCompany franchisee = itCompanyService.selectOne(new EntityWrapper<TCompany>().eq("superiorId",company.getId()).eq("name", two).eq("type", 3).notIn("flag", "3").last(" limit 1")); |
| | | if (SinataUtil.isNotEmpty(franchisee)){ |
| | | franchiseeId = franchisee.getId(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | Integer carBrandId = null; |
| | | Integer carModelId = null; |
| | | //查找品牌 |
| | | if (SinataUtil.isNotEmpty(nine)){ |
| | | TCarBrand carBrand = tCarBrandService.selectOne(new EntityWrapper<TCarBrand>().eq("name", nine).eq("state", 1).last(" limit 1")); |
| | | if (SinataUtil.isNotEmpty(carBrand)){ |
| | | carBrandId = carBrand.getId(); |
| | | if (SinataUtil.isNotEmpty(ten)){ |
| | | //查找类型 |
| | | TCarModel carModel = tCarModelService.selectOne(new EntityWrapper<TCarModel>().eq("brandId", carBrand.getId()).eq("name", ten).eq("state", 1).last(" limit 1")); |
| | | if (SinataUtil.isNotEmpty(carModel)){ |
| | | carModelId = carModel.getId(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //添加车辆对象 |
| | | TCar car = new TCar(); |
| | | if ("平台车辆".equals(zero)){ |
| | | car.setIsPlatCar(1); |
| | | }else if ("加盟车辆".equals(zero)){ |
| | | car.setIsPlatCar(2); |
| | | } |
| | | car.setCompanyId(companyId); |
| | | car.setFranchiseeId(franchiseeId); |
| | | car.setCarColor(eleven); |
| | | car.setCarBrandId(carBrandId); |
| | | car.setCarModelId(carModelId); |
| | | car.setCarLicensePlate(twelve); |
| | | car.setDrivingLicenseNumber(thirteen); |
| | | car.setAnnualInspectionTime(DateUtil.parseDate(fourteen)); |
| | | car.setCommercialInsuranceTime(DateUtil.parseDate(fifteen)); |
| | | car.setInsertTime(new Date()); |
| | | car.setState(1); |
| | | if (ShiroKit.getUser().getRoleType() == 1){ |
| | | car.setAddType(2); |
| | | }else if (ShiroKit.getUser().getRoleType() == 2){ |
| | | car.setAddType(3); |
| | | car.setAddObjectId(ShiroKit.getUser().getObjectId()); |
| | | }else if (ShiroKit.getUser().getRoleType() == 3){ |
| | | car.setAddType(4); |
| | | car.setAddObjectId(ShiroKit.getUser().getObjectId()); |
| | | } |
| | | tCarService.insert(car); |
| | | |
| | | //添加专车服务模式 |
| | | if ("是".equals(three)){ |
| | | TCarService service = new TCarService(); |
| | | service.setCarId(car.getId()); |
| | | service.setType(1); |
| | | tCarServiceService.insert(service); |
| | | } |
| | | //添加出租车服务模式 |
| | | if ("是".equals(four)){ |
| | | TCarService service = new TCarService(); |
| | | service.setCarId(car.getId()); |
| | | service.setType(2); |
| | | tCarServiceService.insert(service); |
| | | } |
| | | //添加跨城出行服务模式 |
| | | if ("是".equals(five)){ |
| | | TCarService service = new TCarService(); |
| | | service.setCarId(car.getId()); |
| | | service.setType(3); |
| | | tCarServiceService.insert(service); |
| | | } |
| | | //添加小件同城物流服务模式 |
| | | if ("是".equals(six)){ |
| | | TCarService service = new TCarService(); |
| | | service.setCarId(car.getId()); |
| | | service.setType(4); |
| | | tCarServiceService.insert(service); |
| | | } |
| | | //添加小件跨城物流服务模式 |
| | | if ("是".equals(seven)){ |
| | | TCarService service = new TCarService(); |
| | | service.setCarId(car.getId()); |
| | | service.setType(5); |
| | | tCarServiceService.insert(service); |
| | | } |
| | | //添加包车服务模式 |
| | | if ("是".equals(eight)){ |
| | | TCarService service = new TCarService(); |
| | | service.setCarId(car.getId()); |
| | | service.setType(6); |
| | | tCarServiceService.insert(service); |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 判断日期是否满足yyyy-MM-dd格式 |
| | | * @param str |
| | | * @return |
| | | */ |
| | | public static boolean isValidDate(String str) { |
| | | boolean convertSuccess=true; |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | try { |
| | | format.setLenient(false); |
| | | format.parse(str); |
| | | } catch (Exception e) { |
| | | convertSuccess=false; |
| | | } |
| | | return convertSuccess; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 转换日期 |
| | | * @return |
| | | */ |
| | | public static String importByExcelForDate(String value) {//value就是它的天数 |
| | | String currentCellValue = ""; |
| | | if(value != null && !value.equals("")){ |
| | | Calendar calendar = new GregorianCalendar(1900,0,-1); |
| | | Date d = calendar.getTime(); |
| | | Date dd = DateUtils.addDays(d,Integer.valueOf(value)); |
| | | DateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); |
| | | currentCellValue = formater.format(dd); |
| | | } |
| | | return currentCellValue; |
| | | } |
| | | |
| | | /** |
| | | * 导出车辆信息 |
| | | */ |
| | | @RequestMapping(value = "/outCar") |
| | | public void outCar(HttpServletRequest request, HttpServletResponse response) { |
| | | List<Map<String,Object>> listMap = tCarService.getCarListNoPage(ShiroKit.getUser().getRoleType(),ShiroKit.getUser().getObjectId()); |
| | | |
| | | // 表格数据【封装】 |
| | | List<List<String>> dataList = new ArrayList<>(); |
| | | |
| | | //第一行显示【封装】 |
| | | List<String> twoList = new ArrayList<String>(); |
| | | twoList.add("总计:"); |
| | | twoList.add(String.valueOf(listMap.size())+"条"); |
| | | dataList.add(twoList); |
| | | |
| | | // 列【封装】 |
| | | List<String> shellList = new ArrayList<String>(); |
| | | shellList.add("添加时间"); |
| | | shellList.add("车辆ID"); |
| | | shellList.add("所属分公司"); |
| | | shellList.add("所属加盟商"); |
| | | shellList.add("车辆品牌"); |
| | | shellList.add("车辆类型"); |
| | | shellList.add("颜色"); |
| | | shellList.add("服务模式"); |
| | | shellList.add("车牌号"); |
| | | shellList.add("行驶证号码"); |
| | | shellList.add("座位数"); |
| | | shellList.add("关联司机"); |
| | | shellList.add("年检到期时间"); |
| | | shellList.add("商业保险到期时间"); |
| | | dataList.add(shellList); |
| | | |
| | | for (Map<String,Object> object : listMap){ |
| | | // 详细数据列【封装】 |
| | | shellList = new ArrayList<String>(); |
| | | if(SinataUtil.isNotEmpty(object.get("insertTime"))){ |
| | | shellList.add(DateUtil.formatDate(DateUtil.parse(object.get("insertTime").toString(),"YYYY-MM-dd HH:mm:ss.S"), "YYYY-MM-dd HH:mm:ss")); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | shellList.add(String.valueOf(object.get("id"))); |
| | | if(SinataUtil.isNotEmpty(object.get("companyName"))){ |
| | | shellList.add(object.get("companyName").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("franchiseeName"))){ |
| | | shellList.add(object.get("franchiseeName").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("brandName"))){ |
| | | shellList.add(object.get("brandName").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("modelName"))){ |
| | | shellList.add(object.get("modelName").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("carColor"))){ |
| | | shellList.add(object.get("carColor").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("serverStr"))){ |
| | | shellList.add(object.get("serverStr").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("carLicensePlate"))){ |
| | | shellList.add(object.get("carLicensePlate").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("drivingLicenseNumber"))){ |
| | | shellList.add(object.get("drivingLicenseNumber").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("seat"))){ |
| | | shellList.add(object.get("seat").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("driverName"))){ |
| | | shellList.add(object.get("driverName").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("annualInspectionTime"))){ |
| | | shellList.add(DateUtil.formatDate(DateUtil.parse(object.get("annualInspectionTime").toString(),"YYYY-MM-dd HH:mm:ss.S"), "YYYY-MM-dd HH:mm:ss")); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("commercialInsuranceTime"))){ |
| | | shellList.add(DateUtil.formatDate(DateUtil.parse(object.get("commercialInsuranceTime").toString(),"YYYY-MM-dd HH:mm:ss.S"), "YYYY-MM-dd HH:mm:ss")); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | dataList.add(shellList); |
| | | } |
| | | try { |
| | | // 调用工具类进行导出 |
| | | ExcelExportUtil.easySheet("车辆信息导出记录"+DateUtil.formatDate(new Date(), "YYYYMMddHHmmss"), "车辆信息导出记录", dataList,request, response); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.modular.system.model.TCarBrand; |
| | | import com.stylefeng.guns.modular.system.service.ITCarBrandService; |
| | | 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.TCarModel; |
| | | import com.stylefeng.guns.modular.system.service.ITCarModelService; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 车辆类型管理控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-05 14:31:28 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tCarModel") |
| | | public class TCarModelController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tCarModel/"; |
| | | |
| | | @Autowired |
| | | private ITCarModelService tCarModelService; |
| | | |
| | | @Autowired |
| | | private ITCarBrandService tCarBrandService; |
| | | |
| | | /** |
| | | * 跳转到车辆类型管理首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tCarModel.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加车辆类型管理 |
| | | */ |
| | | @RequestMapping("/tCarModel_add") |
| | | public String tCarModelAdd(Model model) { |
| | | List<TCarBrand> brandList = tCarBrandService.selectList(new EntityWrapper<TCarBrand>().eq("state", 1).orderBy("insertTime", false)); |
| | | model.addAttribute("brandList",brandList); |
| | | return PREFIX + "tCarModel_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改车辆类型管理 |
| | | */ |
| | | @RequestMapping("/tCarModel_update/{tCarModelId}") |
| | | public String tCarModelUpdate(@PathVariable Integer tCarModelId, Model model) { |
| | | TCarModel tCarModel = tCarModelService.selectById(tCarModelId); |
| | | model.addAttribute("item",tCarModel); |
| | | LogObjectHolder.me().set(tCarModel); |
| | | |
| | | List<TCarBrand> brandList = tCarBrandService.selectList(new EntityWrapper<TCarBrand>().eq("state", 1).orderBy("insertTime", false)); |
| | | model.addAttribute("brandList",brandList); |
| | | return PREFIX + "tCarModel_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取车辆类型管理列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String createTime, |
| | | String name) { |
| | | 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(); |
| | | page.setRecords(tCarModelService.getCarModelList(page,beginTime,endTime,name)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 新增车辆类型管理 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(TCarModel tCarModel) { |
| | | tCarModel.setInsertTime(new Date()); |
| | | tCarModel.setState(1); |
| | | tCarModelService.insert(tCarModel); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除车辆类型管理 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tCarModelId) { |
| | | TCarModel tCarModel = tCarModelService.selectById(tCarModelId); |
| | | tCarModel.setState(2); |
| | | tCarModelService.updateById(tCarModel); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改车辆类型管理 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TCarModel tCarModel) { |
| | | tCarModelService.updateById(tCarModel); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.modular.system.model.TCarBrand; |
| | | import com.stylefeng.guns.modular.system.model.TCarModel; |
| | | import com.stylefeng.guns.modular.system.model.TCharteredService; |
| | | import com.stylefeng.guns.modular.system.model.TServerCarmodel; |
| | | import com.stylefeng.guns.modular.system.service.ITCarBrandService; |
| | | import com.stylefeng.guns.modular.system.service.ITCarModelService; |
| | | import com.stylefeng.guns.modular.system.service.ITCharteredServiceService; |
| | | import com.stylefeng.guns.modular.system.service.ITServerCarmodelService; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.util.StringUtils; |
| | | 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 java.math.BigDecimal; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 包车管理管理控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-05 14:31:28 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tCharteredService") |
| | | public class TCharteredServiceController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tCharteredService/"; |
| | | |
| | | @Autowired |
| | | private ITCharteredServiceService charteredServiceService; |
| | | @Autowired |
| | | private ITServerCarmodelService serverCarmodelService; |
| | | |
| | | |
| | | /** |
| | | * 跳转到包车管理管理首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index(Model model) { |
| | | // 查询类型 |
| | | List<TServerCarmodel> tServerCarmodels = serverCarmodelService.selectList(new EntityWrapper<TServerCarmodel>().eq("type", 3).eq("state", 1)); |
| | | model.addAttribute("tServerCarmodels", tServerCarmodels); |
| | | return PREFIX + "tCharteredService.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加包车管理 |
| | | */ |
| | | @RequestMapping("/tCharteredService_add") |
| | | public String tCharteredServiceAdd(Model model) { |
| | | List<TServerCarmodel> tServerCarmodels = serverCarmodelService.selectList(new EntityWrapper<TServerCarmodel>().eq("type", 3).eq("state", 1)); |
| | | model.addAttribute("tServerCarmodels", tServerCarmodels); |
| | | return PREFIX + "tCharteredService_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改包车管理详情 |
| | | */ |
| | | @RequestMapping("/tCharteredService_detail/{tCharteredServiceId}") |
| | | public String tCharteredServiceDetail(@PathVariable Integer tCharteredServiceId, Model model) { |
| | | TCharteredService charteredService = charteredServiceService.selectById(tCharteredServiceId); |
| | | TServerCarmodel tServerCarmodel = serverCarmodelService.selectById(charteredService.getServerCarModelId()); |
| | | if(Objects.nonNull(tServerCarmodel)){ |
| | | charteredService.setServerCarModelName(tServerCarmodel.getName()); |
| | | } |
| | | model.addAttribute("item",charteredService); |
| | | //判断是手动挡和自动挡 |
| | | if (charteredService.getCarType() == 1){ |
| | | model.addAttribute("carType",1); |
| | | }else{ |
| | | model.addAttribute("carType",2); |
| | | } |
| | | //判断状态 |
| | | if (charteredService.getStatus() == 1){ |
| | | model.addAttribute("status",1); |
| | | }else{ |
| | | model.addAttribute("status",2); |
| | | } |
| | | LogObjectHolder.me().set(charteredService); |
| | | List<TServerCarmodel> tServerCarmodels = serverCarmodelService.selectList(new EntityWrapper<TServerCarmodel>().eq("type", 3).eq("state", 1)); |
| | | model.addAttribute("tServerCarmodels", tServerCarmodels); |
| | | return PREFIX + "tCharteredService_detail.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改包车管理 |
| | | */ |
| | | @RequestMapping("/tCharteredService_edit/{tCharteredServiceId}") |
| | | public String tCharteredServiceEdit(@PathVariable Integer tCharteredServiceId, Model model) { |
| | | TCharteredService charteredService = charteredServiceService.selectById(tCharteredServiceId); |
| | | TServerCarmodel tServerCarmodel = serverCarmodelService.selectById(charteredService.getServerCarModelId()); |
| | | if(Objects.nonNull(tServerCarmodel)){ |
| | | charteredService.setServerCarModelName(tServerCarmodel.getName()); |
| | | } |
| | | model.addAttribute("item",charteredService); |
| | | //判断是手动挡和自动挡 |
| | | if (charteredService.getCarType() == 1){ |
| | | model.addAttribute("carType",1); |
| | | }else{ |
| | | model.addAttribute("carType",2); |
| | | } |
| | | //判断状态 |
| | | if (charteredService.getStatus() == 1){ |
| | | model.addAttribute("status",1); |
| | | }else{ |
| | | model.addAttribute("status",2); |
| | | } |
| | | LogObjectHolder.me().set(charteredService); |
| | | List<TServerCarmodel> tServerCarmodels = serverCarmodelService.selectList(new EntityWrapper<TServerCarmodel>().eq("type", 3).eq("state", 1)); |
| | | model.addAttribute("tServerCarmodels", tServerCarmodels); |
| | | return PREFIX + "tCharteredService_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取包车管理管理列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String createTime, |
| | | String serviceName, |
| | | Integer serverCarModelId, |
| | | BigDecimal priceIntervalStart, |
| | | BigDecimal priceIntervalEnd, |
| | | Integer status) { |
| | | 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(); |
| | | page.setRecords(charteredServiceService.getCharteredServiceList(page,beginTime,endTime,serviceName,serverCarModelId,priceIntervalStart,priceIntervalEnd,status)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 新增包车管理管理 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(TCharteredService charteredService) { |
| | | String priceRule = charteredService.getPriceRule(); |
| | | priceRule = priceRule.replaceAll("& lt;", "<"); |
| | | priceRule = priceRule.replaceAll("& gt;", ">"); |
| | | priceRule = priceRule.replaceAll("& #40;", "("); |
| | | priceRule = priceRule.replaceAll("& #41;", ")"); |
| | | charteredService.setPriceRule(priceRule); |
| | | |
| | | String cancelRule = charteredService.getCancelRule(); |
| | | cancelRule = cancelRule.replaceAll("& lt;", "<"); |
| | | cancelRule = cancelRule.replaceAll("& gt;", ">"); |
| | | cancelRule = cancelRule.replaceAll("& #40;", "("); |
| | | cancelRule = cancelRule.replaceAll("& #41;", ")"); |
| | | charteredService.setCancelRule(cancelRule); |
| | | |
| | | |
| | | charteredService.setInsertTime(new Date()); |
| | | charteredService.setStatus(1); |
| | | charteredServiceService.insert(charteredService); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除包车管理管理 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(Integer charteredServiceId) { |
| | | TCharteredService charteredService = charteredServiceService.selectById(charteredServiceId); |
| | | charteredService.setIsDelete(2); |
| | | charteredServiceService.updateById(charteredService); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 批量删除包车管理管理 |
| | | */ |
| | | @RequestMapping(value = "/deleteBatch") |
| | | @ResponseBody |
| | | public Object deleteBatch(@RequestParam String charteredServiceIds) { |
| | | |
| | | if(!StringUtils.hasLength(charteredServiceIds)){ |
| | | return ResultUtil.error("请选择要删除的数据"); |
| | | } |
| | | |
| | | String[] split = charteredServiceIds.split(","); |
| | | List<Integer> charteredServiceId = new ArrayList<>(); |
| | | for (String s : split) { |
| | | charteredServiceId.add(Integer.valueOf(s)); |
| | | } |
| | | |
| | | List<TCharteredService> charteredService = charteredServiceService.selectList(new EntityWrapper<TCharteredService>() |
| | | .in("id", charteredServiceId)); |
| | | charteredService.forEach(tCharteredService -> { |
| | | tCharteredService.setIsDelete(2); |
| | | }); |
| | | charteredServiceService.updateBatchById(charteredService); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改包车管理管理 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TCharteredService charteredService) { |
| | | String priceRule = charteredService.getPriceRule(); |
| | | priceRule = priceRule.replaceAll("& lt;", "<"); |
| | | priceRule = priceRule.replaceAll("& gt;", ">"); |
| | | priceRule = priceRule.replaceAll("& #40;", "("); |
| | | priceRule = priceRule.replaceAll("& #41;", ")"); |
| | | charteredService.setPriceRule(priceRule); |
| | | |
| | | String cancelRule = charteredService.getCancelRule(); |
| | | cancelRule = cancelRule.replaceAll("& lt;", "<"); |
| | | cancelRule = cancelRule.replaceAll("& gt;", ">"); |
| | | cancelRule = cancelRule.replaceAll("& #40;", "("); |
| | | cancelRule = cancelRule.replaceAll("& #41;", ")"); |
| | | charteredService.setCancelRule(cancelRule); |
| | | |
| | | charteredServiceService.updateById(charteredService); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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.SinataUtil; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.ITCompanyCityService; |
| | | import com.stylefeng.guns.modular.system.service.ITRegionService; |
| | | import com.stylefeng.guns.modular.system.service.IUserService; |
| | | import com.stylefeng.guns.modular.system.util.PushMinistryOfTransportUtil; |
| | | 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.service.ITCompanyService; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 分公司管理控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-06 09:15:48 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tCompany") |
| | | public class TCompanyController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tCompany/"; |
| | | |
| | | @Autowired |
| | | private ITCompanyService tCompanyService; |
| | | |
| | | @Autowired |
| | | private ITRegionService tRegionService; |
| | | |
| | | @Autowired |
| | | private IUserService userService; |
| | | |
| | | @Autowired |
| | | private ITCompanyCityService tCompanyCityService; |
| | | |
| | | @Autowired |
| | | private PushMinistryOfTransportUtil pushMinistryOfTransportUtil; |
| | | |
| | | @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)); |
| | | model.addAttribute("item",tCompany); |
| | | LogObjectHolder.me().set(tCompany); |
| | | |
| | | //省 |
| | | List<TRegion> provinceList = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); |
| | | model.addAttribute("provinceList",provinceList); |
| | | |
| | | //系统用户对象 |
| | | User user = userService.selectOne(new EntityWrapper<User>().eq("roleType", 1).eq("objectId", tCompany.getId())); |
| | | model.addAttribute("user",user); |
| | | |
| | | //经营区域 |
| | | List<Map<String, Object>> scopeList = tCompanyService.getCompanyScopeById(tCompany.getId()); |
| | | model.addAttribute("scopeList",scopeList); |
| | | return PREFIX + "platformEdit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到分公司管理首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tCompany.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到加盟商管理首页 |
| | | */ |
| | | @RequestMapping("/franchisee") |
| | | public String franchisee() { |
| | | return PREFIX + "franchisee.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加分公司管理 |
| | | */ |
| | | @RequestMapping("/tCompany_add") |
| | | public String tCompanyAdd(Model model) { |
| | | List<TRegion> provinceList = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); |
| | | model.addAttribute("provinceList",provinceList); |
| | | return PREFIX + "tCompany_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加加盟商司管理 |
| | | */ |
| | | @RequestMapping("/tCompany_addFranchisee") |
| | | public String tCompany_addFranchisee(Model model) { |
| | | Integer roleType = ShiroKit.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(ShiroKit.getUser().getObjectId()); |
| | | model.addAttribute("company",tCompany); |
| | | } |
| | | model.addAttribute("roleType",roleType); |
| | | return PREFIX + "tCompany_addFranchisee.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到查看分公司详情 |
| | | */ |
| | | @RequestMapping("/tCompany_detail/{tCompanyId}") |
| | | public String tCompany_detail(@PathVariable Integer tCompanyId, Model model) { |
| | | TCompany tCompany = tCompanyService.selectById(tCompanyId); |
| | | model.addAttribute("item",tCompany); |
| | | LogObjectHolder.me().set(tCompany); |
| | | |
| | | //省 |
| | | List<TRegion> provinceList = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); |
| | | model.addAttribute("provinceList",provinceList); |
| | | |
| | | //系统用户对象 |
| | | User user = userService.selectOne(new EntityWrapper<User>().eq("roleType", 2).eq("objectId", tCompanyId)); |
| | | model.addAttribute("user",user); |
| | | |
| | | //经营区域 |
| | | List<Map<String, Object>> scopeList = tCompanyService.getCompanyScopeById(tCompanyId); |
| | | model.addAttribute("scopeList",scopeList); |
| | | |
| | | return PREFIX + "tCompany_detail.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改分公司管理 |
| | | */ |
| | | @RequestMapping("/tCompany_update/{tCompanyId}") |
| | | public String tCompanyUpdate(@PathVariable Integer tCompanyId, Model model) { |
| | | TCompany tCompany = tCompanyService.selectById(tCompanyId); |
| | | model.addAttribute("item",tCompany); |
| | | LogObjectHolder.me().set(tCompany); |
| | | |
| | | //省 |
| | | List<TRegion> provinceList = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); |
| | | model.addAttribute("provinceList",provinceList); |
| | | |
| | | //系统用户对象 |
| | | User user = userService.selectOne(new EntityWrapper<User>().eq("roleType", 2).eq("objectId", tCompanyId)); |
| | | model.addAttribute("user",user); |
| | | |
| | | //经营区域 |
| | | List<Map<String, Object>> scopeList = tCompanyService.getCompanyScopeById(tCompanyId); |
| | | model.addAttribute("scopeList",scopeList); |
| | | return PREFIX + "tCompany_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到查看加盟商 |
| | | */ |
| | | @RequestMapping("/tCompany_detailFranchisee/{tCompanyId}") |
| | | public String tCompany_detailFranchisee(@PathVariable Integer tCompanyId, Model model) { |
| | | TCompany tCompany = tCompanyService.selectById(tCompanyId); |
| | | model.addAttribute("item",tCompany); |
| | | LogObjectHolder.me().set(tCompany); |
| | | |
| | | Integer roleType = ShiroKit.getUser().getRoleType(); |
| | | model.addAttribute("roleType",roleType); |
| | | |
| | | TCompany obj = tCompanyService.selectById(tCompany.getSuperiorId()); |
| | | if (SinataUtil.isNotEmpty(obj)){ |
| | | model.addAttribute("companyName",obj.getName()); |
| | | }else { |
| | | model.addAttribute("companyName","平台"); |
| | | } |
| | | |
| | | |
| | | //系统用户对象 |
| | | User user = userService.selectOne(new EntityWrapper<User>().eq("roleType", 3).eq("objectId", tCompanyId)); |
| | | model.addAttribute("user",user); |
| | | return PREFIX + "tCompany_detailFranchisee.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改分公司管理 |
| | | */ |
| | | @RequestMapping("/tCompany_updateFranchisee/{tCompanyId}") |
| | | public String tCompany_updateFranchisee(@PathVariable Integer tCompanyId, Model model) { |
| | | TCompany tCompany = tCompanyService.selectById(tCompanyId); |
| | | model.addAttribute("item",tCompany); |
| | | LogObjectHolder.me().set(tCompany); |
| | | |
| | | Integer roleType = ShiroKit.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(ShiroKit.getUser().getObjectId()); |
| | | model.addAttribute("company",obj); |
| | | } |
| | | model.addAttribute("roleType",roleType); |
| | | |
| | | //系统用户对象 |
| | | User user = userService.selectOne(new EntityWrapper<User>().eq("roleType", 3).eq("objectId", tCompanyId)); |
| | | model.addAttribute("user",user); |
| | | |
| | | return PREFIX + "tCompany_updateFranchisee.html"; |
| | | } |
| | | |
| | | @RequestMapping(value = "/change") |
| | | @ResponseBody |
| | | public Object change(@RequestParam Integer code) { |
| | | List<TRegion> list = new ArrayList<>(); |
| | | if (SinataUtil.isNotEmpty(code)){ |
| | | TRegion region = tRegionService.selectOne(new EntityWrapper<TRegion>().eq("code", code)); |
| | | list = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", region.getId())); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 获取分公司管理列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String insertTime, |
| | | String name, |
| | | String principalName, |
| | | String principalPhone, |
| | | String adminName, |
| | | String adminPhone, |
| | | String serviceStr, |
| | | Integer state) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | 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(tCompanyService.getCompanyList(page,beginTime,endTime,name,principalName,principalPhone,adminName,adminPhone,serviceStr,state)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 获取分公司管理列表 |
| | | */ |
| | | @RequestMapping(value = "/listFranchisee") |
| | | @ResponseBody |
| | | public Object listFranchisee(String insertTime, |
| | | String name, |
| | | String account, |
| | | String principalName, |
| | | String principalPhone, |
| | | String serviceStr, |
| | | Integer state) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | 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 (ShiroKit.getUser().getRoleType() == 3){ |
| | | page.setRecords(null); |
| | | }else{ |
| | | page.setRecords(tCompanyService.getFranchiseeList(page,beginTime,endTime,name,account,principalName,principalPhone,serviceStr,state,ShiroKit.getUser().getRoleType(),ShiroKit.getUser().getObjectId())); |
| | | } |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 新增分公司管理 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(TCompany tCompany,@RequestParam String subArr,String account,String password) { |
| | | //判断账号是否已存在 |
| | | int count = userService.selectCount(new EntityWrapper<User>().eq("account", account).ne("status",3)); |
| | | if (count > 0){ |
| | | return "error"; |
| | | } |
| | | tCompany.setType(2); //2:分公司 |
| | | tCompany.setState(0); //0:正常 |
| | | tCompany.setInsertTime(new Date()); |
| | | tCompanyService.insert(tCompany); |
| | | |
| | | //添加User对象 |
| | | User user = new User(); |
| | | user.setAccount(account); |
| | | user.setSalt(ShiroKit.getRandomSalt(5)); |
| | | user.setPassword(ShiroKit.md5(password, user.getSalt())); |
| | | user.setRoleid("2"); |
| | | user.setDeptid(25); |
| | | user.setStatus(1); |
| | | user.setCreatetime(new Date()); |
| | | user.setRoleType(2); |
| | | user.setObjectId(tCompany.getId()); |
| | | user.setName(tCompany.getName()); |
| | | user.setSex(1); |
| | | userService.insert(user); |
| | | |
| | | //添加经营区域 |
| | | addSocpe(subArr,tCompany.getId()); |
| | | return SUCCESS_TIP; |
| | | } |
| | | //添加经营区域 |
| | | public void addSocpe(String subArr,Integer id){ |
| | | JSONArray jsonArray = JSON.parseArray(subArr); |
| | | tCompanyCityService.delete(new EntityWrapper<TCompanyCity>().eq("companyId", id)); |
| | | int size = jsonArray.size(); |
| | | for (int i = 0; i < size; i++){ |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | TCompanyCity tCompanyCity = tCompanyCityService.selectOne(new EntityWrapper<TCompanyCity>().eq("id", jsonObject.getInteger("recordId")).eq("companyId", id)); |
| | | if (SinataUtil.isEmpty(tCompanyCity)){ |
| | | tCompanyCity = new TCompanyCity(); |
| | | tCompanyCity.setProvinceCode(jsonObject.getInteger("provinceCode")); |
| | | tCompanyCity.setCityCode(jsonObject.getInteger("cityCode")); |
| | | tCompanyCity.setAreaCode(jsonObject.getInteger("areaCode")); |
| | | tCompanyCity.setCompanyId(id); |
| | | tCompanyCity.setState(1); |
| | | tCompanyCityService.insert(tCompanyCity); |
| | | }else{ |
| | | tCompanyCity.setProvinceCode(jsonObject.getInteger("provinceCode")); |
| | | tCompanyCity.setCityCode(jsonObject.getInteger("cityCode")); |
| | | tCompanyCity.setAreaCode(jsonObject.getInteger("areaCode")); |
| | | tCompanyCityService.updateById(tCompanyCity); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 新增加盟商管理 |
| | | */ |
| | | @RequestMapping(value = "/addFranchisee") |
| | | @ResponseBody |
| | | public Object addFranchisee(TCompany tCompany,String account,String password) { |
| | | //判断账号是否已存在 |
| | | int count = userService.selectCount(new EntityWrapper<User>().eq("account", account).ne("status",3)); |
| | | if (count > 0){ |
| | | return "error"; |
| | | } |
| | | tCompany.setType(3); //2:分公司 |
| | | if (ShiroKit.getUser().getRoleType() == 2){ |
| | | tCompany.setSuperiorId(ShiroKit.getUser().getObjectId()); |
| | | } |
| | | tCompany.setState(0); //0:正常 |
| | | tCompany.setInsertTime(new Date()); |
| | | tCompanyService.insert(tCompany); |
| | | |
| | | //添加User对象 |
| | | User user = new User(); |
| | | user.setAccount(account); |
| | | user.setSalt(ShiroKit.getRandomSalt(5)); |
| | | user.setPassword(ShiroKit.md5(password, user.getSalt())); |
| | | user.setRoleid("3"); |
| | | user.setDeptid(26); |
| | | user.setStatus(1); |
| | | user.setCreatetime(new Date()); |
| | | user.setRoleType(3); |
| | | user.setObjectId(tCompany.getId()); |
| | | user.setName(tCompany.getName()); |
| | | user.setSex(1); |
| | | userService.insert(user); |
| | | |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除分公司管理 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tCompanyId) { |
| | | TCompany tCompany = tCompanyService.selectById(tCompanyId); |
| | | tCompany.setFlag("3"); |
| | | tCompanyService.updateById(tCompany); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改分公司管理 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TCompany tCompany,@RequestParam String subArr,String account,String password,Integer userId) { |
| | | //判断账号 |
| | | User user = userService.selectById(userId); |
| | | if (SinataUtil.isNotEmpty(account) && SinataUtil.isNotEmpty(password)){ |
| | | if (!user.getAccount().equals(account)){ |
| | | //判断账号是否已存在 |
| | | int count = userService.selectCount(new EntityWrapper<User>().eq("account", account).ne("flag",3)); |
| | | if (count > 0){ |
| | | return "error"; |
| | | } |
| | | } |
| | | //修改账号密码 |
| | | user.setAccount(account); |
| | | user.setSalt(ShiroKit.getRandomSalt(5)); |
| | | user.setPassword(ShiroKit.md5(password, user.getSalt())); |
| | | } |
| | | tCompanyService.updateById(tCompany); |
| | | user.setName(tCompany.getName()); |
| | | userService.updateById(user); |
| | | |
| | | //添加经营区域 |
| | | addSocpe(subArr,tCompany.getId()); |
| | | |
| | | TCompany tCompany1 = tCompanyService.selectById(tCompany.getId()); |
| | | if(tCompany1.getType() == 1){ |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传平台数据 |
| | | pushMinistryOfTransportUtil.baseInfoCompanyPay();//上传网约车平台公司支付信息 |
| | | pushMinistryOfTransportUtil.baseInfoCompany(tCompany.getId()); |
| | | pushMinistryOfTransportUtil.baseInfoCompanyService(); |
| | | pushMinistryOfTransportUtil.baseInfoCompanyPermit(tCompany.getId()); |
| | | } |
| | | } |
| | | }).start(); |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改加盟商管理 |
| | | */ |
| | | @RequestMapping(value = "/updateFranchisee") |
| | | @ResponseBody |
| | | public Object updateFranchisee(TCompany tCompany,String account,String password,Integer userId) { |
| | | //判断账号 |
| | | User user = userService.selectById(userId); |
| | | if (!user.getAccount().equals(account)){ |
| | | //判断账号是否已存在 |
| | | int count = userService.selectCount(new EntityWrapper<User>().eq("account", account).ne("status",3)); |
| | | if (count > 0){ |
| | | return "error"; |
| | | } |
| | | } |
| | | tCompanyService.updateById(tCompany); |
| | | |
| | | //修改账号密码 |
| | | user.setAccount(account); |
| | | user.setSalt(ShiroKit.getRandomSalt(5)); |
| | | user.setPassword(ShiroKit.md5(password, user.getSalt())); |
| | | user.setName(tCompany.getName()); |
| | | userService.updateById(user); |
| | | |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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.TSystemNotice; |
| | | import com.stylefeng.guns.modular.system.service.ITSystemNoticeService; |
| | | import com.stylefeng.guns.modular.system.util.PushMinistryOfTransportUtil; |
| | | 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.TComplaint; |
| | | import com.stylefeng.guns.modular.system.service.ITComplaintService; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLDecoder; |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 投诉列表控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-09 17:31:24 |
| | | */ |
| | | @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; |
| | | |
| | | @Value("${pushMinistryOfTransport}") |
| | | private boolean pushMinistryOfTransport; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 跳转到投诉列表首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tComplaint.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到查看详情 |
| | | */ |
| | | @RequestMapping("/lookDetail/{id}/{type}") |
| | | public String lookDetail(@PathVariable Integer id, @PathVariable Integer type, Model model) { |
| | | TComplaint tComplaint = tComplaintService.selectById(id); |
| | | String str = ""; |
| | | if (1 == type){ |
| | | str = tComplaint.getReason(); |
| | | }else if (2 == type){ |
| | | str = tComplaint.getDescription(); |
| | | }else if (3 == type){ |
| | | str = tComplaint.getHandleResult(); |
| | | } |
| | | model.addAttribute("str",str); |
| | | return "/system/tComplaint/lookDetail.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到立即处理页面 |
| | | */ |
| | | @RequestMapping("/tComplaint_immediately/{tComplaintId}") |
| | | public String tComplaintUpdate(@PathVariable Integer tComplaintId, Model model) { |
| | | model.addAttribute("tComplaintId",tComplaintId); |
| | | return PREFIX + "tComplaint_immediately.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到查看详情 |
| | | */ |
| | | @RequestMapping("/lookDetail/{str}") |
| | | public String lookDetail(@PathVariable String str, Model model) { |
| | | System.out.println(str); |
| | | model.addAttribute("str",str); |
| | | return PREFIX + "lookDetail.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取投诉列表列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String insertTime, |
| | | String userName, |
| | | String userPhone, |
| | | String driverPhone, |
| | | Integer isHandle) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | 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(tComplaintService.getComplaintList(page,ShiroKit.getUser().getRoleType(),ShiroKit.getUser().getObjectId(),beginTime,endTime,userName,userPhone,driverPhone,isHandle)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 删除投诉列表 |
| | | */ |
| | | @RequestMapping(value = "/immediately") |
| | | @ResponseBody |
| | | public Object immediately(@RequestParam Integer id,@RequestParam String handleResult) { |
| | | TComplaint tComplaint = tComplaintService.selectById(id); |
| | | if(SinataUtil.isNotEmpty(tComplaint)){ |
| | | tComplaint.setHandleResult(handleResult); |
| | | tComplaint.setHandleUserId(ShiroKit.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.setUserId(tComplaint.getUserId()); |
| | | notice.setInsertTime(new Date()); |
| | | notice.setRead(1); |
| | | tSystemNoticeService.insert(notice); |
| | | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.ratedPassengerComplaint(tComplaint.getId()); |
| | | } |
| | | } |
| | | }).start(); |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除投诉 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(Integer tComplaintId) { |
| | | tComplaintService.deleteById(tComplaintId); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改投诉列表 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TComplaint tComplaint) { |
| | | tComplaintService.updateById(tComplaint); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 投诉列表详情 |
| | | */ |
| | | @RequestMapping(value = "/detail/{tComplaintId}") |
| | | @ResponseBody |
| | | public Object detail(@PathVariable("tComplaintId") Integer tComplaintId) { |
| | | return tComplaintService.selectById(tComplaintId); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.base.tips.ErrorTip; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.util.*; |
| | | import com.stylefeng.guns.modular.system.dao.DriverPunishMapper; |
| | | import com.stylefeng.guns.modular.system.dao.DriverTrainMapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.HttpRequestUtil; |
| | | import com.stylefeng.guns.modular.system.util.PushMinistryOfTransportUtil; |
| | | import com.stylefeng.guns.modular.system.util.PushURL; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import org.apache.commons.lang.time.DateUtils; |
| | | import org.apache.poi.hdf.extractor.TC; |
| | | import org.apache.poi.ss.usermodel.Cell; |
| | | import org.apache.poi.ss.usermodel.Row; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | 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.text.DateFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 司机审核列表控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-04 17:35:28 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tDriver") |
| | | public class TDriverController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tDriver/"; |
| | | |
| | | @Autowired |
| | | private ITDriverService tDriverService; |
| | | |
| | | @Autowired |
| | | private ITCompanyService tCompanyService; |
| | | |
| | | @Autowired |
| | | private ITDriverServiceService tDriverServiceService; |
| | | |
| | | @Autowired |
| | | private ITDriverLineService tDriverLineService; |
| | | |
| | | @Autowired |
| | | private ITLineService itLineService; |
| | | |
| | | @Autowired |
| | | private PushMinistryOfTransportUtil pushMinistryOfTransportUtil; |
| | | |
| | | @Resource |
| | | private DriverTrainMapper driverTrainMapper; |
| | | |
| | | @Resource |
| | | private DriverPunishMapper driverPunishMapper; |
| | | |
| | | @Value("${pushMinistryOfTransport}") |
| | | private boolean pushMinistryOfTransport; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 跳转到司机审核列表首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tDriver.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到审核通过司机首页 |
| | | */ |
| | | @RequestMapping("/yesDriver") |
| | | public String yesDriver() { |
| | | return PREFIX + "yesDriver.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加司机 |
| | | */ |
| | | @RequestMapping("/tDriver_add") |
| | | public String tDriverAdd(Model model) { |
| | | List<TCompany> companyList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 2).ne("flag", 3)); |
| | | model.addAttribute("companyList",companyList); |
| | | |
| | | Integer roleType = ShiroKit.getUser().getRoleType(); |
| | | model.addAttribute("roleType",roleType); |
| | | if (2 == roleType){ |
| | | List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>() |
| | | .eq("type", 3) |
| | | .eq("superiorId",ShiroKit.getUser().getObjectId()) |
| | | .notIn("state",1) |
| | | .notIn("flag",3)); |
| | | model.addAttribute("franchiseeList",franchiseeList); |
| | | }else{ |
| | | model.addAttribute("franchiseeList",null); |
| | | } |
| | | //查询当前用户所属分公司/加盟商 |
| | | model.addAttribute("objectName",tCompanyService.selectById(ShiroKit.getUser().getObjectId()).getName()); |
| | | |
| | | //查询线路列表 |
| | | List<TLine> lineList = itLineService.selectList(new EntityWrapper<TLine>().eq("state", 1)); |
| | | model.addAttribute("lineList",lineList); |
| | | return PREFIX + "tDriver_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改审核司机 |
| | | */ |
| | | @RequestMapping("/tDriver_immediately/{tDriverId}") |
| | | public String tDriver_immediately(@PathVariable Integer tDriverId, Model model) { |
| | | Map<String, Object> tDriver = tDriverService.getDriverById(tDriverId); |
| | | model.addAttribute("item",tDriver); |
| | | LogObjectHolder.me().set(tDriver); |
| | | return PREFIX + "tDriver_immediately.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到选择车辆页面 |
| | | */ |
| | | @RequestMapping("/tDriver_changeCar/{tDriverId}") |
| | | public String tDriver_changeCar(@PathVariable Integer tDriverId, Model model) { |
| | | model.addAttribute("tDriverId",tDriverId); |
| | | return PREFIX + "tDriver_changeCar.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到冻结/解冻司机页面 |
| | | */ |
| | | @RequestMapping("/tDriver_optDriver/{tDriverId}/{optType}") |
| | | public String tDriver_optDriver(@PathVariable Integer tDriverId,@PathVariable Integer optType, Model model) { |
| | | model.addAttribute("tDriverId",tDriverId); |
| | | model.addAttribute("optType",optType); |
| | | return PREFIX + "tDriver_optDriver.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到查看司机详情 |
| | | */ |
| | | @RequestMapping("/tDriver_look/{tDriverId}") |
| | | public String tDriver_look(@PathVariable Integer tDriverId, Model model) { |
| | | Map<String, Object> tDriver = tDriverService.getDriverById(tDriverId); |
| | | model.addAttribute("item",tDriver); |
| | | LogObjectHolder.me().set(tDriver); |
| | | return PREFIX + "tDriver_look.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改司机 |
| | | */ |
| | | @RequestMapping("/tDriver_update/{tDriverId}") |
| | | public String tDriverUpdate(@PathVariable Integer tDriverId, Model model) { |
| | | TDriver tDriver = tDriverService.selectById(tDriverId); |
| | | model.addAttribute("item",tDriver); |
| | | LogObjectHolder.me().set(tDriver); |
| | | |
| | | Integer roleType = ShiroKit.getUser().getRoleType(); |
| | | model.addAttribute("roleType",roleType); |
| | | model.addAttribute("objectName",tCompanyService.selectById(ShiroKit.getUser().getObjectId()).getName()); |
| | | |
| | | if (1 == roleType){ |
| | | List<TCompany> companyList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 2).ne("flag", 3)); |
| | | model.addAttribute("companyList",companyList); |
| | | 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",ShiroKit.getUser().getObjectId()).ne("flag", 3)); |
| | | model.addAttribute("franchiseeList",franchiseeList); |
| | | } |
| | | |
| | | //查询平台ID |
| | | TCompany company = tCompanyService.selectOne(new EntityWrapper<TCompany>().eq("type", 1)); |
| | | //判断是平台司机还是加盟司机 |
| | | if ((SinataUtil.isEmpty(tDriver.getCompanyId()) || tDriver.getCompanyId() == 0 || tDriver.getCompanyId() == company.getId()) && (SinataUtil.isEmpty(tDriver.getFranchiseeId()) || tDriver.getFranchiseeId() == 0)){ |
| | | model.addAttribute("companyType",1); |
| | | }else{ |
| | | model.addAttribute("companyType",2); |
| | | } |
| | | |
| | | //获取经营业务 |
| | | List<TDriverService> serviceList = tDriverServiceService.selectList(new EntityWrapper<TDriverService>().eq("driverId", tDriverId)); |
| | | Integer one = 1; |
| | | Integer two = 1; |
| | | Integer three = 1; |
| | | Integer four = 1; |
| | | Integer five = 1; |
| | | Integer six = 1; |
| | | Integer seven = 1; |
| | | for (TDriverService obj : serviceList){ |
| | | if (obj.getType() == 1){ |
| | | one = 2; |
| | | } |
| | | if (obj.getType() == 2){ |
| | | two = 2; |
| | | } |
| | | if (obj.getType() == 3){ |
| | | three = 2; |
| | | } |
| | | if (obj.getType() == 4){ |
| | | four = 2; |
| | | } |
| | | if (obj.getType() == 5){ |
| | | five = 2; |
| | | } |
| | | if (obj.getType() == 6){ |
| | | six = 2; |
| | | } |
| | | if (obj.getType() == 7){ |
| | | seven = 2; |
| | | } |
| | | } |
| | | model.addAttribute("one",one); |
| | | model.addAttribute("two",two); |
| | | model.addAttribute("three",three); |
| | | model.addAttribute("four",four); |
| | | model.addAttribute("five",five); |
| | | model.addAttribute("six",six); |
| | | model.addAttribute("seven",seven); |
| | | |
| | | //查询线路列表 |
| | | List<TLine> lineList = itLineService.selectList(new EntityWrapper<TLine>().eq("state", 1)); |
| | | model.addAttribute("lineList",lineList); |
| | | //查询驾驶员已添加的线路列表 |
| | | List<Map<String, Object>> driverLineList = tDriverLineService.getDriverLineListByDriverId(tDriverId); |
| | | model.addAttribute("driverLineList",driverLineList); |
| | | return PREFIX + "tDriver_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加培训页 |
| | | * @param id |
| | | * @param model |
| | | * @return |
| | | */ |
| | | @RequestMapping("/showTraining") |
| | | public String showTraining(Integer id, Model model){ |
| | | model.addAttribute("id", id); |
| | | return PREFIX + "training.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 保存培训数据 |
| | | * @param train |
| | | * @param driverId |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/saveTrain", method = RequestMethod.POST) |
| | | public ResultUtil saveTrain(String train, Integer driverId){ |
| | | if(ToolUtil.isEmpty(train)){ |
| | | return ResultUtil.error("请添加有效的培训记录"); |
| | | } |
| | | String[] split = train.split(","); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | try { |
| | | List<DriverTrain> update = new ArrayList<>(); |
| | | List<DriverTrain> add = new ArrayList<>(); |
| | | for(String s : split){ |
| | | String[] s1 = s.split("_"); |
| | | if(ToolUtil.isNotEmpty(s1[0])){//修改 |
| | | DriverTrain driverTrain = driverTrainMapper.selectById(s1[0]); |
| | | driverTrain.setDriverId(driverId); |
| | | driverTrain.setCourseName(s1[1]); |
| | | driverTrain.setCourseDate(sdf.parse(s1[2])); |
| | | driverTrain.setStartTime(s1[3]); |
| | | driverTrain.setStopTime(s1[4]); |
| | | driverTrain.setDuration(Integer.valueOf(s1[5])); |
| | | update.add(driverTrain); |
| | | }else{//添加 |
| | | DriverTrain driverTrain = new DriverTrain(); |
| | | driverTrain.setDriverId(driverId); |
| | | driverTrain.setCourseName(s1[1]); |
| | | driverTrain.setCourseDate(sdf.parse(s1[2])); |
| | | driverTrain.setStartTime(s1[3]); |
| | | driverTrain.setStopTime(s1[4]); |
| | | driverTrain.setDuration(Integer.valueOf(s1[5])); |
| | | add.add(driverTrain); |
| | | } |
| | | } |
| | | List<DriverTrain> driverTrains = driverTrainMapper.queryAllTrain(driverId); |
| | | for(DriverTrain driverTrain : driverTrains){ |
| | | boolean b = true; |
| | | for(String s : split){ |
| | | String[] s1 = s.split("_"); |
| | | if(ToolUtil.isNotEmpty(s1[0]) && driverTrain.getId() == Integer.valueOf(s1[0])){ |
| | | b = false; |
| | | break; |
| | | } |
| | | } |
| | | if(b){ |
| | | driverTrainMapper.deleteById(driverTrain.getId()); |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.baseInfoDriverEducate(driverTrain.getId(), 3); |
| | | } |
| | | } |
| | | }).start(); |
| | | } |
| | | } |
| | | if(update.size() > 0){ |
| | | for(DriverTrain driverTrain : update){ |
| | | driverTrainMapper.updateById(driverTrain); |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.baseInfoDriverEducate(driverTrain.getId(), 2); |
| | | } |
| | | } |
| | | }).start(); |
| | | } |
| | | } |
| | | if(add.size() > 0){ |
| | | for(DriverTrain driverTrain : add){ |
| | | driverTrainMapper.insert(driverTrain); |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.baseInfoDriverEducate(driverTrain.getId(), 1); |
| | | } |
| | | } |
| | | }).start(); |
| | | } |
| | | } |
| | | |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | /** |
| | | * 获取司机的所有培训数据 |
| | | * @param driverId |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/queryAllTrain", method = RequestMethod.POST) |
| | | public ResultUtil queryAllTrain(Integer driverId){ |
| | | List<DriverTrain> driverTrains = driverTrainMapper.queryAllTrain(driverId); |
| | | return ResultUtil.success(driverTrains); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 跳转到处罚页 |
| | | * @param id |
| | | * @param model |
| | | * @return |
| | | */ |
| | | @RequestMapping("/showPunish") |
| | | public String showPunish(Integer id, Model model){ |
| | | model.addAttribute("id", id); |
| | | return PREFIX + "punish.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 保存处罚数据 |
| | | * @param punish |
| | | * @param driverId |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/savePunish", method = RequestMethod.POST) |
| | | public ResultUtil savePunish(String punish, Integer driverId){ |
| | | if(ToolUtil.isEmpty(punish)){ |
| | | return ResultUtil.error("请添加有效的培训记录"); |
| | | } |
| | | String[] split = punish.split(","); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | try { |
| | | List<DriverPunish> update = new ArrayList<>(); |
| | | List<DriverPunish> add = new ArrayList<>(); |
| | | for(String s : split){ |
| | | String[] s1 = s.split("_"); |
| | | if(ToolUtil.isNotEmpty(s1[0])){//修改 |
| | | DriverPunish driverPunish = driverPunishMapper.selectById(s1[0]); |
| | | driverPunish.setDriverId(driverId); |
| | | driverPunish.setPunishTime(sdf.parse(s1[1])); |
| | | driverPunish.setPunishReason(s1[2]); |
| | | driverPunish.setPunishReault(s1[3]); |
| | | update.add(driverPunish); |
| | | }else{//添加 |
| | | DriverPunish driverPunish = new DriverPunish(); |
| | | driverPunish.setDriverId(driverId); |
| | | driverPunish.setPunishTime(sdf.parse(s1[1])); |
| | | driverPunish.setPunishReason(s1[2]); |
| | | driverPunish.setPunishReault(s1[3]); |
| | | add.add(driverPunish); |
| | | } |
| | | } |
| | | List<DriverPunish> driverPunishes = driverPunishMapper.queryAllPunish(driverId); |
| | | for(DriverPunish driverTrain : driverPunishes){ |
| | | boolean b = true; |
| | | for(String s : split){ |
| | | String[] s1 = s.split("_"); |
| | | if(ToolUtil.isNotEmpty(s1[0]) && driverTrain.getId() == Integer.valueOf(s1[0])){ |
| | | b = false; |
| | | break; |
| | | } |
| | | } |
| | | if(b){ |
| | | driverTrainMapper.deleteById(driverTrain.getId()); |
| | | } |
| | | } |
| | | if(update.size() > 0){ |
| | | for(DriverPunish driverTrain : update){ |
| | | driverPunishMapper.updateById(driverTrain); |
| | | } |
| | | } |
| | | if(add.size() > 0){ |
| | | for(DriverPunish driverTrain : add){ |
| | | driverPunishMapper.insert(driverTrain); |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.ratedDriverPunish(driverTrain.getId()); |
| | | } |
| | | } |
| | | }).start(); |
| | | } |
| | | } |
| | | |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取所有处罚数据 |
| | | * @param driverId |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping(value = "/queryAllPunish", method = RequestMethod.POST) |
| | | public ResultUtil queryAllPunish(Integer driverId){ |
| | | List<DriverPunish> driverPunishes = driverPunishMapper.queryAllPunish(driverId); |
| | | return ResultUtil.success(driverPunishes); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据分公司ID获取加盟商 |
| | | * @param oneId |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/oneChange") |
| | | @ResponseBody |
| | | public Object oneChange(@RequestParam Integer oneId) { |
| | | List<TCompany> list = new ArrayList<>(); |
| | | if (SinataUtil.isNotEmpty(oneId)){ |
| | | list = tCompanyService.selectList(new EntityWrapper<TCompany>() |
| | | .eq("type", 3) |
| | | .eq("superiorId", oneId) |
| | | .notIn("flag",3) |
| | | .notIn("state",1)); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 获取司机审核列表列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String insertTime, |
| | | String companyName, |
| | | String phone, |
| | | String account, |
| | | Integer addType, |
| | | Integer authState) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | 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 (ShiroKit.getUser().getRoleType() != 1){ |
| | | page.setRecords(null); |
| | | }else{ |
| | | page.setRecords(tDriverService.getAuthDriverList(page,beginTime,endTime,companyName,phone,account,addType,authState)); |
| | | } |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 获取审核通过的司机列表 |
| | | */ |
| | | @RequestMapping(value = "/listYesDriver") |
| | | @ResponseBody |
| | | public Object listYesDriver(String insertTime, |
| | | String companyName, |
| | | String phone, |
| | | String name, |
| | | Integer addType, |
| | | Integer authState) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | 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(tDriverService.getDriverList(page,ShiroKit.getUser().getRoleType(),ShiroKit.getUser().getObjectId(),beginTime,endTime,companyName,phone,name,addType,authState)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 获取可被选择的车辆列表 |
| | | */ |
| | | @RequestMapping(value = "/selectCarList/{tDriverId}") |
| | | @ResponseBody |
| | | public Object selectCarList(@PathVariable Integer tDriverId, |
| | | String carLicensePlate, |
| | | String brandName, |
| | | String modelName, |
| | | String color, |
| | | String serverStr) { |
| | | TDriver driver = tDriverService.selectById(tDriverId); |
| | | /*String useCarIdStr = null; |
| | | //查询已被使用的车辆ID |
| | | if (SinataUtil.isNotEmpty(driver.getCarId())){ |
| | | useCarIdStr = tDriverService.getUseCarIdStr(driver.getCarId()); |
| | | }else{ |
| | | useCarIdStr = tDriverService.getUseCarIdStr(null); |
| | | }*/ |
| | | //2020-08-21:新需求,已被绑定的车辆可以被继续绑定 |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | page.setRecords(tDriverService.getCanSelectCarList(page,ShiroKit.getUser().getRoleType(),ShiroKit.getUser().getObjectId(),null,carLicensePlate,brandName,modelName,color,serverStr)); |
| | | return super.packForBT(page); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 审核操作 1=通过 2=不通过 |
| | | */ |
| | | @RequestMapping(value = "/authOpt") |
| | | @ResponseBody |
| | | public Object authOpt(Integer id,Integer authState) { |
| | | if (SinataUtil.isNotEmpty(id) && SinataUtil.isNotEmpty(authState)){ |
| | | TDriver tDriver = tDriverService.selectById(id); |
| | | Integer type = 0; |
| | | if (1 == authState){ |
| | | type = 5; |
| | | tDriver.setAuthState(2); |
| | | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.baseInfoCompanyStat(); |
| | | pushMinistryOfTransportUtil.baseInfoDriver(id); |
| | | pushMinistryOfTransportUtil.baseInfoDriverApp(id); |
| | | } |
| | | } |
| | | }).start(); |
| | | }else{ |
| | | type = 6; |
| | | tDriver.setAuthState(4); |
| | | } |
| | | |
| | | Map<String,String> map = new HashMap<>(); |
| | | map.put("uid", String.valueOf(tDriver.getId())); |
| | | map.put("type", String.valueOf(type)); |
| | | String result = HttpRequestUtil.postRequest(PushURL.driver_auth_url, map); |
| | | System.out.println("司机注册审核发送短信 :【driverId="+tDriver.getId().toString()+"】,调用接口:"+result); |
| | | |
| | | tDriverService.updateById(tDriver); |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 更换车辆操作 |
| | | */ |
| | | @RequestMapping(value = "/selectCarOpt") |
| | | @ResponseBody |
| | | public Object selectCarOpt(Integer tDriverId,Integer carId) { |
| | | if (SinataUtil.isNotEmpty(tDriverId) && SinataUtil.isNotEmpty(carId)){ |
| | | TDriver tDriver = tDriverService.selectById(tDriverId); |
| | | tDriver.setCarId(carId); |
| | | tDriverService.updateById(tDriver); |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 新增司机审核列表 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(TDriver tDriver,@RequestParam String serverBox,@RequestParam String lineStr,Integer roleType,Integer companyType,Integer oneId,Integer twoId,Integer franchiseeId) { |
| | | //判断登录账户是否重复 |
| | | int count = tDriverService.selectCount(new EntityWrapper<TDriver>().eq("phone", tDriver.getPhone()).in("authState", Arrays.asList(1, 2, 3)).ne("flag", 3)); |
| | | if (count > 0){ |
| | | return "error"; |
| | | } |
| | | if (1 == roleType){ //平台 |
| | | if (2 == companyType.intValue()){ |
| | | if (SinataUtil.isNotEmpty(oneId)){ |
| | | tDriver.setCompanyId(oneId); |
| | | } |
| | | if (SinataUtil.isNotEmpty(twoId)){ |
| | | tDriver.setFranchiseeId(twoId); |
| | | } |
| | | }else if (1 == companyType.intValue()){ |
| | | TCompany company = tCompanyService.selectOne(new EntityWrapper<TCompany>().eq("type", 1)); |
| | | tDriver.setCompanyId(company.getId()); |
| | | tDriver.setFranchiseeId(franchiseeId); |
| | | } |
| | | tDriver.setAddType(2); |
| | | tDriver.setIsPlatCar(1); |
| | | tDriver.setAuthState(2); |
| | | }else if (2 == roleType){ //分公司 |
| | | if (SinataUtil.isNotEmpty(ShiroKit.getUser().getObjectId())){ |
| | | tDriver.setCompanyId(ShiroKit.getUser().getObjectId()); |
| | | } |
| | | if (SinataUtil.isNotEmpty(franchiseeId)){ |
| | | tDriver.setFranchiseeId(franchiseeId); |
| | | } |
| | | tDriver.setAddType(3); |
| | | tDriver.setIsPlatCar(2); |
| | | tDriver.setAuthState(1); |
| | | tDriver.setAddObjectId(ShiroKit.getUser().getObjectId()); |
| | | }else if (3 == roleType){ //加盟商 |
| | | TCompany tCompany = tCompanyService.selectById(ShiroKit.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(tCompany)){ |
| | | tDriver.setCompanyId(tCompany.getSuperiorId()); |
| | | } |
| | | if (SinataUtil.isNotEmpty(ShiroKit.getUser().getObjectId())){ |
| | | tDriver.setFranchiseeId(ShiroKit.getUser().getObjectId()); |
| | | } |
| | | tDriver.setAddType(4); |
| | | tDriver.setIsPlatCar(2); |
| | | tDriver.setAuthState(1); |
| | | tDriver.setAddObjectId(ShiroKit.getUser().getObjectId()); |
| | | } |
| | | tDriver.setInsertTime(new Date()); |
| | | tDriver.setInsertUser(ShiroKit.getUser().getId()); |
| | | // tDriver.setPassword(MD5Util.encrypt(tDriver.getPassword())); |
| | | |
| | | tDriver.setPassword(ShiroKit.md5(tDriver.getPassword(), "SA;d5#")); |
| | | |
| | | tDriverService.insert(tDriver); |
| | | |
| | | //添加经营业务 |
| | | String[] serverArray = serverBox.split(","); |
| | | for (int i=0;i<serverArray.length;i++){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(tDriver.getId()); |
| | | service.setType(Integer.valueOf(serverArray[i])); |
| | | tDriverServiceService.insert(service); |
| | | |
| | | if (3 == Integer.valueOf(serverArray[i])){ |
| | | //添加线路 |
| | | if (SinataUtil.isNotEmpty(lineStr)){ |
| | | addLine(lineStr,tDriver.getId()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 添加线路 |
| | | * @param subArr |
| | | * @param id |
| | | */ |
| | | public void addLine(String subArr,Integer id){ |
| | | JSONArray jsonArray = JSON.parseArray(subArr); |
| | | int size = jsonArray.size(); |
| | | for (int i = 0; i < size; i++){ |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | TDriverLine line = new TDriverLine(); |
| | | line.setCreateTime(new Date()); |
| | | line.setAddTime(jsonObject.getString("time")); |
| | | line.setLineId(jsonObject.getInteger("lineId")); |
| | | line.setDriverId(id); |
| | | tDriverLineService.insert(line); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除司机审核列表 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tDriverId) { |
| | | TDriver driver = tDriverService.selectById(tDriverId); |
| | | driver.setFlag("3"); |
| | | tDriverService.updateById(driver); |
| | | return SUCCESS_TIP; |
| | | } |
| | | /** |
| | | * 操作司机状态 |
| | | */ |
| | | @RequestMapping(value = "/optDriver") |
| | | @ResponseBody |
| | | public Object optDriver(@RequestParam Integer driverId,@RequestParam String remark,@RequestParam Integer optType) { |
| | | if (SinataUtil.isNotEmpty(driverId) && SinataUtil.isNotEmpty(optType)){ |
| | | TDriver tDriver = tDriverService.selectById(driverId); |
| | | if (1 == optType){ //解冻 |
| | | tDriver.setAuthState(2); |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.baseInfoCompanyStat(); |
| | | pushMinistryOfTransportUtil.baseInfoDriver(driverId); |
| | | } |
| | | } |
| | | }).start(); |
| | | }else if (2 == optType){ //冻结 |
| | | tDriver.setAuthState(3); |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.baseInfoCompanyStat(); |
| | | pushMinistryOfTransportUtil.baseInfoDriver(driverId); |
| | | } |
| | | } |
| | | }).start(); |
| | | } |
| | | tDriver.setRemark(remark); |
| | | tDriverService.updateById(tDriver); |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改司机审核列表 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TDriver tDriver,@RequestParam String serverBox,@RequestParam String lineStr,Integer roleType,Integer companyType,Integer oneId,Integer twoId,Integer franchiseeId) { |
| | | TDriver obj = tDriverService.selectById(tDriver.getId()); |
| | | if (!obj.getPhone().equals(tDriver.getPhone())){ |
| | | //判断登录账户是否重复 |
| | | int count = tDriverService.selectCount(new EntityWrapper<TDriver>().eq("phone", tDriver.getPhone()).in("authState", Arrays.asList(1, 2, 3)).ne("flag", 3)); |
| | | if (count > 0){ |
| | | return "error"; |
| | | } |
| | | } |
| | | if (1 == roleType){ //平台 |
| | | if (2 == companyType.intValue()){ |
| | | if (SinataUtil.isNotEmpty(oneId)){ |
| | | tDriver.setCompanyId(oneId); |
| | | } |
| | | if (SinataUtil.isNotEmpty(twoId)){ |
| | | tDriver.setFranchiseeId(twoId); |
| | | } |
| | | }else if (1 == companyType.intValue()){ |
| | | TCompany company = tCompanyService.selectOne(new EntityWrapper<TCompany>().eq("type", 1)); |
| | | tDriver.setCompanyId(company.getId()); |
| | | tDriver.setFranchiseeId(franchiseeId); |
| | | } |
| | | }else if (2 == roleType){ //分公司 |
| | | if (SinataUtil.isNotEmpty(ShiroKit.getUser().getObjectId())){ |
| | | tDriver.setCompanyId(ShiroKit.getUser().getObjectId()); |
| | | } |
| | | if (SinataUtil.isNotEmpty(franchiseeId)){ |
| | | tDriver.setFranchiseeId(franchiseeId); |
| | | } |
| | | }else if (3 == roleType){ //加盟商 |
| | | TCompany tCompany = tCompanyService.selectById(ShiroKit.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(tCompany)){ |
| | | tDriver.setCompanyId(tCompany.getSuperiorId()); |
| | | } |
| | | if (SinataUtil.isNotEmpty(ShiroKit.getUser().getObjectId())){ |
| | | tDriver.setFranchiseeId(ShiroKit.getUser().getObjectId()); |
| | | } |
| | | } |
| | | tDriver.setUpdateTime(new Date()); |
| | | tDriver.setUpdateUser(ShiroKit.getUser().getId()); |
| | | // tDriver.setPassword(MD5Util.encrypt(tDriver.getPassword())); |
| | | if(ToolUtil.isNotEmpty(tDriver.getPassword())){ |
| | | tDriver.setPassword(ShiroKit.md5(tDriver.getPassword(), "SA;d5#")); |
| | | }else{ |
| | | tDriver.setPassword(null); |
| | | } |
| | | tDriverService.updateById(tDriver); |
| | | |
| | | //删除业务 |
| | | tDriverServiceService.delete(new EntityWrapper<TDriverService>().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++){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(tDriver.getId()); |
| | | service.setType(Integer.valueOf(serverArray[i])); |
| | | tDriverServiceService.insert(service); |
| | | |
| | | if (3 == Integer.valueOf(serverArray[i])){ |
| | | //添加线路 |
| | | if (SinataUtil.isNotEmpty(lineStr)){ |
| | | addLine(lineStr,tDriver.getId()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.baseInfoDriver(tDriver.getId()); |
| | | } |
| | | } |
| | | }).start(); |
| | | |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 下载模板 |
| | | * @param request |
| | | * @param response |
| | | */ |
| | | @RequestMapping(value = "/uploadDriverModel") |
| | | public void uploadDriverModel(HttpServletRequest request, HttpServletResponse response) { |
| | | // 表格数据【封装】 |
| | | List<List<String>> dataList = new ArrayList<List<String>>(); |
| | | |
| | | String title = ""; |
| | | |
| | | // 首行【封装】 |
| | | List<String> shellList = new ArrayList<String>(); |
| | | if (ShiroKit.getUser().getRoleType() == 1){ |
| | | title = "平台导入司机模板"; |
| | | |
| | | shellList.add("司机名称"); |
| | | shellList.add("所属机构[平台司机/加盟司机]"); |
| | | shellList.add("所属分公司[提示:加盟司机选填]"); |
| | | shellList.add("所属加盟商[提示:加盟司机选填]"); |
| | | shellList.add("性别[男/女]"); |
| | | shellList.add("驾驶证号码"); |
| | | shellList.add("驾龄"); |
| | | shellList.add("身份证号"); |
| | | shellList.add("居住地址"); |
| | | shellList.add("出租车资格证号"); |
| | | shellList.add("工号[选填]"); |
| | | shellList.add("经营业务:专车[是/否]"); |
| | | shellList.add("经营业务:出租车[是/否]"); |
| | | shellList.add("经营业务:跨城[是/否]"); |
| | | shellList.add("经营业务:小件同城物流[是/否]"); |
| | | shellList.add("经营业务:小件跨城物流[是/否]"); |
| | | shellList.add("经营业务:包车[是/否]"); |
| | | shellList.add("登录账号[手机号]"); |
| | | shellList.add("登录密码[密码长度为6-18]"); |
| | | }else if (ShiroKit.getUser().getRoleType() == 2){ |
| | | title = "分公司导入司机模板"; |
| | | |
| | | shellList.add("司机名称"); |
| | | shellList.add("所属加盟商[选填]"); |
| | | shellList.add("性别[男/女]"); |
| | | shellList.add("驾驶证号码"); |
| | | shellList.add("驾龄"); |
| | | shellList.add("身份证号"); |
| | | shellList.add("居住地址"); |
| | | shellList.add("出租车资格证号"); |
| | | shellList.add("工号[选填]"); |
| | | shellList.add("经营业务:专车[是/否]"); |
| | | shellList.add("经营业务:出租车[是/否]"); |
| | | shellList.add("经营业务:跨城[是/否]"); |
| | | shellList.add("经营业务:小件同城物流[是/否]"); |
| | | shellList.add("经营业务:小件跨城物流[是/否]"); |
| | | shellList.add("经营业务:包车[是/否]"); |
| | | shellList.add("登录账号[手机号]"); |
| | | shellList.add("登录密码[密码长度为6-18]"); |
| | | }else if (ShiroKit.getUser().getRoleType() == 3){ |
| | | title = "加盟商导入司机模板"; |
| | | |
| | | shellList.add("司机名称"); |
| | | shellList.add("性别[男/女]"); |
| | | shellList.add("驾驶证号码"); |
| | | shellList.add("驾龄"); |
| | | shellList.add("身份证号"); |
| | | shellList.add("居住地址"); |
| | | shellList.add("出租车资格证号"); |
| | | shellList.add("工号[选填]"); |
| | | shellList.add("经营业务:专车[是/否]"); |
| | | shellList.add("经营业务:出租车[是/否]"); |
| | | shellList.add("经营业务:跨城[是/否]"); |
| | | shellList.add("经营业务:小件同城物流[是/否]"); |
| | | shellList.add("经营业务:小件跨城物流[是/否]"); |
| | | shellList.add("经营业务:包车[是/否]"); |
| | | shellList.add("登录账号[手机号]"); |
| | | shellList.add("登录密码[密码长度为6-18]"); |
| | | } |
| | | dataList.add(shellList); |
| | | |
| | | try { |
| | | // 调用工具类进行导出 |
| | | ExcelExportUtil.easySheet(title+DateUtil.formatDate(new Date(), "YYYYMMddHHmmss"), title, dataList, request, response); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 导入操作 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping(value="/exportDriver",method = RequestMethod.POST) |
| | | @ResponseBody |
| | | public Object exportDriver(HttpServletRequest request){ |
| | | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
| | | MultipartFile file = (MultipartFile) multipartRequest.getFile("myfile"); |
| | | try { |
| | | if (ShiroKit.getUser().getRoleType() == 1){ |
| | | Workbook book = WoUtil.ImportFile(file); |
| | | Sheet sh = book.getSheetAt(0); //获取到第一个表 |
| | | for (int i = 1; i <= sh.getLastRowNum(); i++) { |
| | | Row row = sh.getRow(i); |
| | | |
| | | Cell cell0 = row.getCell(0); //司机名称 |
| | | String zero = null; |
| | | if (SinataUtil.isNotEmpty(cell0)){ |
| | | zero = String.valueOf(cell0.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell1 = row.getCell(1); //所属机构[平台司机/加盟司机] |
| | | String one = null; |
| | | if (SinataUtil.isNotEmpty(cell1)){ |
| | | one = String.valueOf(cell1.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell2 = row.getCell(2); //所属分公司[提示:加盟司机选填] |
| | | String two = null; |
| | | if (SinataUtil.isNotEmpty(cell2)){ |
| | | two = String.valueOf(cell2.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell3 = row.getCell(3); //所属加盟商[提示:加盟司机选填] |
| | | String three = null; |
| | | if (SinataUtil.isNotEmpty(cell3)){ |
| | | three = String.valueOf(cell3.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell4 = row.getCell(4); //性别[男/女] |
| | | String four = null; |
| | | if (SinataUtil.isNotEmpty(cell4)){ |
| | | four = String.valueOf(cell4.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell5 = row.getCell(5); //驾驶证号码 |
| | | String five = null; |
| | | if (SinataUtil.isNotEmpty(cell5)){ |
| | | five = String.valueOf(cell5.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell6 = row.getCell(6); //驾龄 |
| | | String six = null; |
| | | if (SinataUtil.isNotEmpty(cell6)){ |
| | | six = String.valueOf(cell6.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell7 = row.getCell(7); //身份证号 |
| | | String seven = null; |
| | | if (SinataUtil.isNotEmpty(cell7)){ |
| | | seven = String.valueOf(cell7.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell8 = row.getCell(8); //居住地址 |
| | | String eight = null; |
| | | if (SinataUtil.isNotEmpty(cell8)){ |
| | | eight = String.valueOf(cell8.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell9 = row.getCell(9); //出租车资格证号 |
| | | String nine = null; |
| | | if (SinataUtil.isNotEmpty(cell9)){ |
| | | nine = String.valueOf(cell9.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell10 = row.getCell(10); //工号[选填] |
| | | String ten = null; |
| | | if (SinataUtil.isNotEmpty(cell10)){ |
| | | ten = String.valueOf(cell10.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell11 = row.getCell(11); //经营业务:专车[是/否] |
| | | String eleven = null; |
| | | if (SinataUtil.isNotEmpty(cell11)){ |
| | | eleven = String.valueOf(cell11.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell12 = row.getCell(12); //经营业务:专车[是/否] |
| | | String twelve = null; |
| | | if (SinataUtil.isNotEmpty(cell12)){ |
| | | twelve = String.valueOf(cell12.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell13 = row.getCell(13); //经营业务:跨城出行[是/否] |
| | | String thirteen = null; |
| | | if (SinataUtil.isNotEmpty(cell13)){ |
| | | thirteen = String.valueOf(cell13.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell14 = row.getCell(14); //经营业务:小件同城物流[是/否] |
| | | String fourteen = null; |
| | | if (SinataUtil.isNotEmpty(cell14)){ |
| | | fourteen = String.valueOf(cell14.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell15 = row.getCell(15); //经营业务:小件跨城物流[是/否] |
| | | String fifteen = null; |
| | | if (SinataUtil.isNotEmpty(cell15)){ |
| | | fifteen = String.valueOf(cell15.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell16 = row.getCell(16); //经营业务:包车[是/否] |
| | | String sixteen = null; |
| | | if (SinataUtil.isNotEmpty(cell16)){ |
| | | sixteen = String.valueOf(cell16.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell17 = row.getCell(17); //登录账号[手机号] |
| | | String seventeen = null; |
| | | if (SinataUtil.isNotEmpty(cell17)){ |
| | | seventeen = String.valueOf(cell17.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell18 = row.getCell(18); //登录密码[密码长度为6-18] |
| | | String eighteen = null; |
| | | if (SinataUtil.isNotEmpty(cell18)){ |
| | | eighteen = String.valueOf(cell18.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | if (SinataUtil.isEmpty(zero) || SinataUtil.isEmpty(one) || SinataUtil.isEmpty(four) |
| | | || SinataUtil.isEmpty(five) || SinataUtil.isEmpty(six) || SinataUtil.isEmpty(nine) |
| | | || SinataUtil.isEmpty(eleven) || SinataUtil.isEmpty(twelve) || SinataUtil.isEmpty(thirteen) |
| | | || SinataUtil.isEmpty(fourteen) || SinataUtil.isEmpty(fifteen) || SinataUtil.isEmpty(sixteen) |
| | | || SinataUtil.isEmpty(seventeen)|| SinataUtil.isEmpty(eighteen)){ |
| | | return new ErrorTip(500, "单元格不能为空"); |
| | | }else{ |
| | | //判断账号是否存在 |
| | | int count = tDriverService.selectCount(new EntityWrapper<TDriver>().eq("phone", seventeen).in("authState", "1,2,3").ne("flag", 3)); |
| | | if (count > 0){ |
| | | continue; |
| | | } |
| | | |
| | | //判断所属机构 |
| | | if (!one.equals("平台司机") && !one.equals("加盟司机")){ |
| | | return new ErrorTip(500, "所属机构内容不正确"); |
| | | } |
| | | //判断性别 |
| | | if (!four.equals("男") && !four.equals("女")){ |
| | | return new ErrorTip(500, "性别内容不正确"); |
| | | } |
| | | //判断经营业务【专车】 |
| | | if (!eleven.equals("是") && !eleven.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【专车】内容不正确"); |
| | | } |
| | | //判断经营业务【出租车】 |
| | | if (!twelve.equals("是") && !twelve.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【出租车】内容不正确"); |
| | | } |
| | | //判断经营业务【跨城出行】 |
| | | if (!thirteen.equals("是") && !thirteen.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【跨城】内容不正确"); |
| | | } |
| | | //判断经营业务【小件同城物流】 |
| | | if (!fourteen.equals("是") && !fourteen.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【小件同城物流】内容不正确"); |
| | | } |
| | | //判断经营业务【小件跨城物流】 |
| | | if (!fifteen.equals("是") && !fifteen.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【小件跨城物流】内容不正确"); |
| | | } |
| | | //判断经营业务【包车】 |
| | | if (!sixteen.equals("是") && !sixteen.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【包车】内容不正确"); |
| | | } |
| | | //判断驾龄 |
| | | if (!isInteger(six)){ |
| | | return new ErrorTip(500, "驾龄格式不正确"); |
| | | } |
| | | //判断手机号 |
| | | if (!isPhone(seventeen)){ |
| | | return new ErrorTip(500, "登录账号[手机号]格式不正确"); |
| | | } |
| | | //判断登录密码 |
| | | if (!isPassword(eighteen)){ |
| | | return new ErrorTip(500, "登录密码格式不正确"); |
| | | } |
| | | |
| | | //查找平台公司 |
| | | TCompany platCompany = itCompanyService.selectOne(new EntityWrapper<TCompany>().eq("type", 1).notIn("flag", "3").last(" limit 1")); |
| | | Integer companyId = platCompany.getId(); |
| | | Integer franchiseeId = 0; |
| | | if ("加盟司机".equals(one)){ |
| | | //判断所属分公司是否存在 |
| | | if (SinataUtil.isNotEmpty(two)){ |
| | | TCompany company = itCompanyService.selectOne(new EntityWrapper<TCompany>().eq("name", two).eq("type", 2).notIn("flag", "3").last(" limit 1")); |
| | | if (SinataUtil.isNotEmpty(company)){ |
| | | companyId = company.getId(); |
| | | //判断加盟商是否存在 |
| | | if (SinataUtil.isNotEmpty(three)){ |
| | | TCompany franchisee = itCompanyService.selectOne(new EntityWrapper<TCompany>().eq("superiorId",company.getId()).eq("name", three).eq("type", 3).notIn("flag", "3").last(" limit 1")); |
| | | if (SinataUtil.isNotEmpty(franchisee)){ |
| | | franchiseeId = franchisee.getId(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | TDriver driver = new TDriver(); |
| | | driver.setAccount(seventeen); |
| | | driver.setJobNumber(ten); |
| | | driver.setPhone(seventeen); |
| | | driver.setPassword(ShiroKit.md5(eighteen, "SA;d5#")); |
| | | driver.setName(zero); |
| | | if ("男".equals(four)){ |
| | | driver.setSex(1); |
| | | }else if ("女".equals(four)){ |
| | | driver.setSex(2); |
| | | } |
| | | driver.setIdCard(seven); |
| | | driver.setDriverAge(Integer.valueOf(six)); |
| | | driver.setDriveCard(five); |
| | | driver.setTaxiAptitudeCard(nine); |
| | | if ("平台司机".equals(one)){ |
| | | driver.setIsPlatCar(1); |
| | | }else if ("加盟司机".equals(one)){ |
| | | driver.setIsPlatCar(2); |
| | | } |
| | | driver.setCompanyId(companyId); |
| | | driver.setFranchiseeId(franchiseeId); |
| | | driver.setState(2); |
| | | driver.setAuthState(2); |
| | | driver.setFlag("1"); |
| | | driver.setInsertUser(ShiroKit.getUser().getId()); |
| | | driver.setInsertTime(new Date()); |
| | | driver.setAddType(2); |
| | | driver.setAddObjectId(ShiroKit.getUser().getObjectId()); |
| | | if(SinataUtil.isNotEmpty(eight)){ |
| | | driver.setDriverAddress(eight); |
| | | } |
| | | tDriverService.insert(driver); |
| | | |
| | | |
| | | //添加专车服务模式 |
| | | if ("是".equals(eleven)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(1); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加出租车服务模式 |
| | | if ("是".equals(twelve)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(2); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加跨城出行服务模式 |
| | | if ("是".equals(thirteen)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(3); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加小件同城物流服务模式 |
| | | if ("是".equals(fourteen)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(4); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加小件跨城物流服务模式 |
| | | if ("是".equals(fifteen)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(5); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加包车服务模式 |
| | | if ("是".equals(sixteen)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(6); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | } |
| | | } |
| | | }else if (ShiroKit.getUser().getRoleType() == 2){ |
| | | Workbook book = WoUtil.ImportFile(file); |
| | | Sheet sh = book.getSheetAt(0); //获取到第一个表 |
| | | for (int i = 1; i <= sh.getLastRowNum(); i++) { |
| | | Row row = sh.getRow(i); |
| | | |
| | | Cell cell0 = row.getCell(0); //司机名称 |
| | | String zero = null; |
| | | if (SinataUtil.isNotEmpty(cell0)){ |
| | | zero = String.valueOf(cell0.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell1 = row.getCell(1); //所属加盟商[选填] |
| | | String one = null; |
| | | if (SinataUtil.isNotEmpty(cell1)){ |
| | | one = String.valueOf(cell1.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell2 = row.getCell(2); //性别[男/女] |
| | | String two = null; |
| | | if (SinataUtil.isNotEmpty(cell2)){ |
| | | two = String.valueOf(cell2.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell3 = row.getCell(3); //驾驶证号码 |
| | | String three = null; |
| | | if (SinataUtil.isNotEmpty(cell3)){ |
| | | three = String.valueOf(cell3.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell4 = row.getCell(4); //驾龄 |
| | | String four = null; |
| | | if (SinataUtil.isNotEmpty(cell4)){ |
| | | four = String.valueOf(cell4.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell5 = row.getCell(5); //身份证号 |
| | | String five = null; |
| | | if (SinataUtil.isNotEmpty(cell5)){ |
| | | five = String.valueOf(cell5.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell6 = row.getCell(6); //居住地址 |
| | | String six = null; |
| | | if (SinataUtil.isNotEmpty(cell6)){ |
| | | six = String.valueOf(cell6.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell7 = row.getCell(7); //出租车资格证号 |
| | | String seven = null; |
| | | if (SinataUtil.isNotEmpty(cell7)){ |
| | | seven = String.valueOf(cell7.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell8 = row.getCell(8); //工号[选填] |
| | | String eight = null; |
| | | if (SinataUtil.isNotEmpty(cell8)){ |
| | | eight = String.valueOf(cell8.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell9 = row.getCell(9); //经营业务:专车[是/否] |
| | | String nine = null; |
| | | if (SinataUtil.isNotEmpty(cell9)){ |
| | | nine = String.valueOf(cell9.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell10 = row.getCell(10); //经营业务:出租车[是/否] |
| | | String ten = null; |
| | | if (SinataUtil.isNotEmpty(cell10)){ |
| | | ten = String.valueOf(cell10.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell11 = row.getCell(11); //经营业务:跨城出行[是/否] |
| | | String eleven = null; |
| | | if (SinataUtil.isNotEmpty(cell11)){ |
| | | eleven = String.valueOf(cell11.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell12 = row.getCell(12); //经营业务:小件同城物流[是/否] |
| | | String twelve = null; |
| | | if (SinataUtil.isNotEmpty(cell12)){ |
| | | twelve = String.valueOf(cell12.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell13 = row.getCell(13); //经营业务:小件跨城物流[是/否] |
| | | String thirteen = null; |
| | | if (SinataUtil.isNotEmpty(cell13)){ |
| | | thirteen = String.valueOf(cell13.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell14 = row.getCell(14); //经营业务:包车[是/否] |
| | | String fourteen = null; |
| | | if (SinataUtil.isNotEmpty(cell14)){ |
| | | fourteen = String.valueOf(cell14.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell15 = row.getCell(15); //登录账号[手机号] |
| | | String fifteen = null; |
| | | if (SinataUtil.isNotEmpty(cell15)){ |
| | | fifteen = String.valueOf(cell15.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell16 = row.getCell(16); //登录密码[密码长度为6-18] |
| | | String sixteen = null; |
| | | if (SinataUtil.isNotEmpty(cell16)){ |
| | | sixteen = String.valueOf(cell16.getStringCellValue()).trim(); |
| | | } |
| | | if (SinataUtil.isEmpty(zero) || SinataUtil.isEmpty(two) || SinataUtil.isEmpty(three) || SinataUtil.isEmpty(four) |
| | | || SinataUtil.isEmpty(five) || SinataUtil.isEmpty(seven) |
| | | || SinataUtil.isEmpty(nine) || SinataUtil.isEmpty(ten) |
| | | || SinataUtil.isEmpty(eleven) || SinataUtil.isEmpty(twelve) || SinataUtil.isEmpty(thirteen) |
| | | || SinataUtil.isEmpty(fourteen) || SinataUtil.isEmpty(fifteen) || SinataUtil.isEmpty(sixteen)){ |
| | | return new ErrorTip(500, "单元格不能为空"); |
| | | }else{ |
| | | //判断账号是否存在 |
| | | int count = tDriverService.selectCount(new EntityWrapper<TDriver>().eq("phone", fifteen).in("authState", "1,2,3").ne("flag", 3)); |
| | | if (count > 0){ |
| | | continue; |
| | | } |
| | | //判断性别 |
| | | if (!two.equals("男") && !two.equals("女")){ |
| | | return new ErrorTip(500, "性别内容不正确"); |
| | | } |
| | | //判断经营业务【专车】 |
| | | if (!nine.equals("是") && !nine.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【专车】内容不正确"); |
| | | } |
| | | //判断经营业务【出租车】 |
| | | if (!ten.equals("是") && !ten.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【出租车】内容不正确"); |
| | | } |
| | | //判断经营业务【跨城出行】 |
| | | if (!eleven.equals("是") && !eleven.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【跨城】内容不正确"); |
| | | } |
| | | //判断经营业务【小件同城物流】 |
| | | if (!twelve.equals("是") && !twelve.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【小件同城物流】内容不正确"); |
| | | } |
| | | //判断经营业务【小件跨城物流】 |
| | | if (!thirteen.equals("是") && !thirteen.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【小件跨城物流】内容不正确"); |
| | | } |
| | | //判断经营业务【包车】 |
| | | if (!fourteen.equals("是") && !fourteen.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【包车】内容不正确"); |
| | | } |
| | | //判断驾龄 |
| | | if (!isInteger(four)){ |
| | | return new ErrorTip(500, "驾龄格式不正确"); |
| | | } |
| | | //判断手机号 |
| | | if (!isPhone(fifteen)){ |
| | | return new ErrorTip(500, "登录账号[手机号]格式不正确"); |
| | | } |
| | | //判断登录密码 |
| | | if (!isPassword(sixteen)){ |
| | | return new ErrorTip(500, "登录密码格式不正确"); |
| | | } |
| | | //查找平台公司 |
| | | Integer companyId = ShiroKit.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)){ |
| | | franchiseeId = franchisee.getId(); |
| | | } |
| | | } |
| | | |
| | | TDriver driver = new TDriver(); |
| | | driver.setAccount(fifteen); |
| | | driver.setJobNumber(eight); |
| | | driver.setPhone(fifteen); |
| | | driver.setPassword(ShiroKit.md5(sixteen, "SA;d5#")); |
| | | driver.setName(zero); |
| | | if ("男".equals(two)){ |
| | | driver.setSex(1); |
| | | }else if ("女".equals(two)){ |
| | | driver.setSex(2); |
| | | } |
| | | driver.setIdCard(five); |
| | | driver.setDriverAge(Integer.valueOf(four)); |
| | | driver.setDriveCard(three); |
| | | driver.setTaxiAptitudeCard(seven); |
| | | driver.setIsPlatCar(2); |
| | | driver.setCompanyId(companyId); |
| | | driver.setFranchiseeId(franchiseeId); |
| | | driver.setState(1); |
| | | driver.setAuthState(1); |
| | | driver.setFlag("1"); |
| | | driver.setInsertUser(ShiroKit.getUser().getId()); |
| | | driver.setInsertTime(new Date()); |
| | | driver.setAddType(3); |
| | | driver.setAddObjectId(ShiroKit.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(six)){ |
| | | driver.setDriverAddress(six); |
| | | } |
| | | tDriverService.insert(driver); |
| | | |
| | | //添加专车服务模式 |
| | | if ("是".equals(nine)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(1); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加出租车服务模式 |
| | | if ("是".equals(ten)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(2); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加跨城出行服务模式 |
| | | if ("是".equals(eleven)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(3); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加小件同城物流服务模式 |
| | | if ("是".equals(twelve)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(4); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加小件跨城物流服务模式 |
| | | if ("是".equals(thirteen)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(5); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加包车服务模式 |
| | | if ("是".equals(fourteen)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(6); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | |
| | | } |
| | | } |
| | | }else if (ShiroKit.getUser().getRoleType() == 3){ |
| | | Workbook book = WoUtil.ImportFile(file); |
| | | Sheet sh = book.getSheetAt(0); //获取到第一个表 |
| | | for (int i = 1; i <= sh.getLastRowNum(); i++) { |
| | | Row row = sh.getRow(i); |
| | | |
| | | Cell cell0 = row.getCell(0); //司机名称 |
| | | String zero = null; |
| | | if (SinataUtil.isNotEmpty(cell0)){ |
| | | zero = String.valueOf(cell0.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell2 = row.getCell(1); //性别[男/女] |
| | | String one = null; |
| | | if (SinataUtil.isNotEmpty(cell2)){ |
| | | one = String.valueOf(cell2.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell3 = row.getCell(2); //驾驶证号码 |
| | | String two = null; |
| | | if (SinataUtil.isNotEmpty(cell3)){ |
| | | two = String.valueOf(cell3.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell4 = row.getCell(3); //驾龄 |
| | | String three = null; |
| | | if (SinataUtil.isNotEmpty(cell4)){ |
| | | three = String.valueOf(cell4.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell5 = row.getCell(4); //身份证号 |
| | | String four = null; |
| | | if (SinataUtil.isNotEmpty(cell5)){ |
| | | four = String.valueOf(cell5.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell6 = row.getCell(5); //居住地址 |
| | | String five = null; |
| | | if (SinataUtil.isNotEmpty(cell6)){ |
| | | five = String.valueOf(cell6.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell7 = row.getCell(6); //出租车资格证号 |
| | | String six = null; |
| | | if (SinataUtil.isNotEmpty(cell7)){ |
| | | six = String.valueOf(cell7.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell8 = row.getCell(7); //工号[选填] |
| | | String seven = null; |
| | | if (SinataUtil.isNotEmpty(cell8)){ |
| | | seven = String.valueOf(cell8.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell9 = row.getCell(8); //经营业务:专车[是/否] |
| | | String eight = null; |
| | | if (SinataUtil.isNotEmpty(cell9)){ |
| | | eight = String.valueOf(cell9.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell10 = row.getCell(9); //经营业务:出租车[是/否] |
| | | String nine = null; |
| | | if (SinataUtil.isNotEmpty(cell10)){ |
| | | nine = String.valueOf(cell10.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell11 = row.getCell(10); //经营业务:跨城出行[是/否] |
| | | String ten = null; |
| | | if (SinataUtil.isNotEmpty(cell11)){ |
| | | ten = String.valueOf(cell11.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell12 = row.getCell(11); //经营业务:小件同城物流[是/否] |
| | | String eleven = null; |
| | | if (SinataUtil.isNotEmpty(cell12)){ |
| | | eleven = String.valueOf(cell12.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell13 = row.getCell(12); //经营业务:小件跨城物流[是/否] |
| | | String twelve = null; |
| | | if (SinataUtil.isNotEmpty(cell13)){ |
| | | twelve = String.valueOf(cell13.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell14 = row.getCell(13); //经营业务:包车[是/否] |
| | | String thirteen = null; |
| | | if (SinataUtil.isNotEmpty(cell14)){ |
| | | thirteen = String.valueOf(cell14.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell15 = row.getCell(14); //登录账号[手机号] |
| | | String fourteen = null; |
| | | if (SinataUtil.isNotEmpty(cell15)){ |
| | | fourteen = String.valueOf(cell15.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell16 = row.getCell(15); //登录密码[密码长度为6-18] |
| | | String fifteen = null; |
| | | if (SinataUtil.isNotEmpty(cell16)){ |
| | | fifteen = String.valueOf(cell16.getStringCellValue()).trim(); |
| | | } |
| | | if (SinataUtil.isEmpty(zero) || SinataUtil.isEmpty(one) || SinataUtil.isEmpty(two) || SinataUtil.isEmpty(three) || SinataUtil.isEmpty(four) |
| | | || SinataUtil.isEmpty(six) || SinataUtil.isEmpty(eight) |
| | | || SinataUtil.isEmpty(nine) || SinataUtil.isEmpty(ten) |
| | | || SinataUtil.isEmpty(eleven) || SinataUtil.isEmpty(twelve) || SinataUtil.isEmpty(thirteen) |
| | | || SinataUtil.isEmpty(fourteen) || SinataUtil.isEmpty(fifteen) ){ |
| | | return new ErrorTip(500, "单元格不能为空"); |
| | | }else{ |
| | | //判断账号是否存在 |
| | | int count = tDriverService.selectCount(new EntityWrapper<TDriver>().eq("phone", fourteen).in("authState", "1,2,3").ne("flag", 3)); |
| | | if (count > 0){ |
| | | continue; |
| | | } |
| | | //判断性别 |
| | | if (!one.equals("男") && !one.equals("女")){ |
| | | return new ErrorTip(500, "性别内容不正确"); |
| | | } |
| | | //判断经营业务【专车】 |
| | | if (!eight.equals("是") && !eight.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【专车】内容不正确"); |
| | | } |
| | | //判断经营业务【出租车】 |
| | | if (!nine.equals("是") && !nine.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【出租车】内容不正确"); |
| | | } |
| | | //判断经营业务【跨城出行】 |
| | | if (!ten.equals("是") && !ten.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【跨城】内容不正确"); |
| | | } |
| | | //判断经营业务【小件同城物流】 |
| | | if (!eleven.equals("是") && !eleven.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【小件同城物流】内容不正确"); |
| | | } |
| | | //判断经营业务【小件跨城物流】 |
| | | if (!twelve.equals("是") && !twelve.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【小件跨城物流】内容不正确"); |
| | | } |
| | | //判断经营业务【包车】 |
| | | if (!thirteen.equals("是") && !thirteen.equals("否")){ |
| | | return new ErrorTip(500, "经营业务【包车】内容不正确"); |
| | | } |
| | | //判断驾龄 |
| | | if (!isInteger(three)){ |
| | | return new ErrorTip(500, "驾龄格式不正确"); |
| | | } |
| | | //判断手机号 |
| | | if (!isPhone(fourteen)){ |
| | | return new ErrorTip(500, "登录账号[手机号]格式不正确"); |
| | | } |
| | | //判断登录密码 |
| | | if (!isPassword(fifteen)){ |
| | | return new ErrorTip(500, "登录密码格式不正确"); |
| | | } |
| | | //查找平台公司 |
| | | Integer companyId = 0; |
| | | Integer franchiseeId = 0; |
| | | TCompany franchisee = itCompanyService.selectById(ShiroKit.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(franchisee)){ |
| | | companyId = franchisee.getSuperiorId(); |
| | | franchiseeId = franchisee.getId(); |
| | | } |
| | | if (companyId == 0 && franchiseeId == 0){ |
| | | return new ErrorTip(500, "当前登录账户上级分公司不能为空"); |
| | | } |
| | | |
| | | TDriver driver = new TDriver(); |
| | | driver.setAccount(fourteen); |
| | | driver.setJobNumber(seven); |
| | | driver.setPhone(fourteen); |
| | | driver.setPassword(ShiroKit.md5(fifteen, "SA;d5#")); |
| | | driver.setName(zero); |
| | | if ("男".equals(one)){ |
| | | driver.setSex(1); |
| | | }else if ("女".equals(one)){ |
| | | driver.setSex(2); |
| | | } |
| | | driver.setIdCard(four); |
| | | driver.setDriverAge(Integer.valueOf(three)); |
| | | driver.setDriveCard(two); |
| | | driver.setTaxiAptitudeCard(six); |
| | | driver.setIsPlatCar(2); |
| | | driver.setCompanyId(companyId); |
| | | driver.setFranchiseeId(franchiseeId); |
| | | driver.setState(1); |
| | | driver.setAuthState(1); |
| | | driver.setFlag("1"); |
| | | driver.setInsertUser(ShiroKit.getUser().getId()); |
| | | driver.setInsertTime(new Date()); |
| | | driver.setAddType(4); |
| | | driver.setAddObjectId(ShiroKit.getUser().getObjectId()); |
| | | if (SinataUtil.isNotEmpty(five)){ |
| | | driver.setDriverAddress(five); |
| | | } |
| | | tDriverService.insert(driver); |
| | | |
| | | //添加专车服务模式 |
| | | if ("是".equals(eight)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(1); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加出租车服务模式 |
| | | if ("是".equals(nine)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(2); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加跨城出行服务模式 |
| | | if ("是".equals(ten)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(3); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加小件同城物流服务模式 |
| | | if ("是".equals(eleven)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(4); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加小件跨城物流服务模式 |
| | | if ("是".equals(twelve)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(5); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | //添加包车服务模式 |
| | | if ("是".equals(thirteen)){ |
| | | TDriverService service = new TDriverService(); |
| | | service.setDriverId(driver.getId()); |
| | | service.setType(6); |
| | | itDriverServiceService.insert(service); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private ITCompanyService itCompanyService; |
| | | |
| | | @Autowired |
| | | private ITDriverServiceService itDriverServiceService; |
| | | |
| | | /** |
| | | * 验证是否可以字符转为整数 |
| | | * @param str |
| | | * @return |
| | | */ |
| | | public static boolean isInteger(String str) { |
| | | try{ |
| | | String reg = "^[0-9]\\d*$"; |
| | | boolean flag = str.matches(reg); |
| | | return flag; |
| | | }catch(NumberFormatException e) { |
| | | System.out.println("异常:\"" + str + "\"..."); |
| | | return false; |
| | | } |
| | | } |
| | | /** |
| | | * 验证手机号格式是否正确 |
| | | * @param str |
| | | * @return |
| | | */ |
| | | public static boolean isPhone(String str) { |
| | | try{ |
| | | String reg = "^1\\d{10}$"; |
| | | boolean flag = str.matches(reg); |
| | | return flag; |
| | | }catch(NumberFormatException e) { |
| | | System.out.println("异常:\"" + str + "\"..."); |
| | | return false; |
| | | } |
| | | } |
| | | /** |
| | | * 验证密码长度是否正确 |
| | | * @param str |
| | | * @return |
| | | */ |
| | | public static boolean isPassword(String str) { |
| | | try{ |
| | | String reg = "^.{6,18}$"; |
| | | boolean flag = str.matches(reg); |
| | | return flag; |
| | | }catch(NumberFormatException e) { |
| | | System.out.println("异常:\"" + str + "\"..."); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 导出司机信息 |
| | | */ |
| | | @RequestMapping(value = "/outDriver") |
| | | public void outDriver(HttpServletRequest request, HttpServletResponse response) { |
| | | List<Map<String,Object>> listMap = tDriverService.getDriverListNoPage(ShiroKit.getUser().getRoleType(),ShiroKit.getUser().getObjectId()); |
| | | |
| | | // 表格数据【封装】 |
| | | List<List<String>> dataList = new ArrayList<>(); |
| | | |
| | | //第一行显示【封装】 |
| | | List<String> twoList = new ArrayList<String>(); |
| | | twoList.add("总计:"); |
| | | twoList.add(String.valueOf(listMap.size())+"条"); |
| | | dataList.add(twoList); |
| | | |
| | | // 列【封装】 |
| | | List<String> shellList = new ArrayList<String>(); |
| | | shellList.add("添加时间"); |
| | | shellList.add("姓名"); |
| | | shellList.add("登录账号【手机号】"); |
| | | shellList.add("性别"); |
| | | shellList.add("司机来源"); |
| | | shellList.add("所属分公司"); |
| | | shellList.add("所属加盟商"); |
| | | shellList.add("当前车辆"); |
| | | shellList.add("服务模式"); |
| | | shellList.add("关联线路"); |
| | | shellList.add("评分"); |
| | | shellList.add("历史接单数"); |
| | | shellList.add("历史订单总金额"); |
| | | shellList.add("当前钱包余额"); |
| | | shellList.add("钱包活动余额"); |
| | | shellList.add("钱包收入余额"); |
| | | shellList.add("状态"); |
| | | dataList.add(shellList); |
| | | |
| | | for (Map<String,Object> object : listMap){ |
| | | // 详细数据列【封装】 |
| | | shellList = new ArrayList<String>(); |
| | | if(SinataUtil.isNotEmpty(object.get("insertTime"))){ |
| | | shellList.add(DateUtil.formatDate(DateUtil.parse(object.get("insertTime").toString(),"YYYY-MM-dd HH:mm:ss.S"), "YYYY-MM-dd HH:mm:ss")); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("name"))){ |
| | | shellList.add(object.get("name").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("phone"))){ |
| | | shellList.add(object.get("phone").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("sex"))){ |
| | | shellList.add(object.get("sex").toString() == "1"?"男":"女"); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("addType"))){ |
| | | |
| | | shellList.add(object.get("addType").toString().equals("1")?"司机注册":(object.get("addType").toString().equals("2")?"平台添加":(object.get("addType").toString().equals("3")?"分公司添加":(object.get("addType").toString().equals("4")?"加盟商添加":"")))); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("companyName"))){ |
| | | shellList.add(object.get("companyName").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("franchiseeName"))){ |
| | | shellList.add(object.get("franchiseeName").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("carLicensePlate"))){ |
| | | shellList.add(object.get("carLicensePlate").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("serverStr"))){ |
| | | shellList.add(object.get("serverStr").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("lineStr"))){ |
| | | shellList.add(object.get("lineStr").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("evaluateNum"))){ |
| | | shellList.add(object.get("evaluateNum").toString()); |
| | | }else{ |
| | | shellList.add("0"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("historyNum"))){ |
| | | shellList.add(object.get("historyNum").toString()); |
| | | }else{ |
| | | shellList.add("0"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("historyMoney"))){ |
| | | shellList.add(object.get("historyMoney").toString()); |
| | | }else{ |
| | | shellList.add("0"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("balance"))){ |
| | | shellList.add(object.get("balance").toString()); |
| | | }else{ |
| | | shellList.add("0"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("laveActivityMoney"))){ |
| | | shellList.add(object.get("laveActivityMoney").toString()); |
| | | }else{ |
| | | shellList.add("0"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("laveBusinessMoney"))){ |
| | | shellList.add(object.get("laveBusinessMoney").toString()); |
| | | }else{ |
| | | shellList.add("0"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("authState"))){ |
| | | shellList.add(object.get("authState").toString().equals("1")?"待审核":(object.get("authState").toString().equals("2")?"正常":(object.get("authState").toString().equals("3")?"冻结":(object.get("authState").toString().equals("4")?"已拒绝":"")))); |
| | | |
| | | shellList.add(object.get("authState").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | dataList.add(shellList); |
| | | } |
| | | try { |
| | | // 调用工具类进行导出 |
| | | ExcelExportUtil.easySheet("司机信息导出记录"+DateUtil.formatDate(new Date(), "YYYYMMddHHmmss"), "司机信息导出记录", dataList,request, response); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.modular.system.model.TCarBrand; |
| | | import com.stylefeng.guns.modular.system.model.TDriver; |
| | | import com.stylefeng.guns.modular.system.model.TDriverFacialFail; |
| | | import com.stylefeng.guns.modular.system.service.ITCarBrandService; |
| | | import com.stylefeng.guns.modular.system.service.ITDriverFacialFailService; |
| | | import com.stylefeng.guns.modular.system.service.ITDriverService; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.util.StringUtils; |
| | | 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 java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 司机人脸识别异常记录管理控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-05 14:31:28 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tDriverFacialFail") |
| | | public class TDriverFacialFailController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tDriverFacialFail/"; |
| | | |
| | | @Autowired |
| | | private ITDriverFacialFailService tDriverFacialFailService; |
| | | @Autowired |
| | | private ITDriverService driverService; |
| | | |
| | | /** |
| | | * 跳转到司机人脸识别异常记录管理首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tDriverFacialFail.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加司机人脸识别异常记录管理 |
| | | */ |
| | | @RequestMapping("/tDriverFacialFail_add") |
| | | public String tDriverFacialFailAdd(Model model) { |
| | | return PREFIX + "tDriverFacialFail_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改司机人脸识别异常记录管理 |
| | | */ |
| | | @RequestMapping("/tDriverFacialFail_update/{tDriverFacialFailId}") |
| | | public String tDriverFacialFailUpdate(@PathVariable Integer tDriverFacialFailId, Model model) { |
| | | TDriverFacialFail tDriverFacialFail = tDriverFacialFailService.selectById(tDriverFacialFailId); |
| | | TDriver driver = driverService.selectById(tDriverFacialFail.getDriverId()); |
| | | model.addAttribute("item",tDriverFacialFail); |
| | | model.addAttribute("driverName",driver.getName()); |
| | | model.addAttribute("driverPhone",driver.getPhone()); |
| | | LogObjectHolder.me().set(tDriverFacialFail); |
| | | return PREFIX + "tDriverFacialFail_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取司机人脸识别异常记录管理列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String createTime, |
| | | String name, |
| | | String phone) { |
| | | 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(); |
| | | page.setRecords(tDriverFacialFailService.getDriverFacialFailList(page,beginTime,endTime,name,phone)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 删除司机人脸识别异常记录管理 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tDriverFacialFailId) { |
| | | TDriverFacialFail tDriverFacialFail = tDriverFacialFailService.selectById(tDriverFacialFailId); |
| | | tDriverFacialFail.setIsDelete(2); |
| | | tDriverFacialFailService.updateById(tDriverFacialFail); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除司机人脸识别异常记录管理 |
| | | */ |
| | | @RequestMapping(value = "/deleteBatch") |
| | | @ResponseBody |
| | | public Object deleteBatch(@RequestParam String tDriverFacialFailIds) { |
| | | |
| | | if(!StringUtils.hasLength(tDriverFacialFailIds)){ |
| | | return ResultUtil.error("请选择要删除的数据"); |
| | | } |
| | | |
| | | String[] split = tDriverFacialFailIds.split(","); |
| | | List<Integer> driverFacialFailIds = new ArrayList<>(); |
| | | for (String s : split) { |
| | | driverFacialFailIds.add(Integer.valueOf(s)); |
| | | } |
| | | |
| | | List<TDriverFacialFail> driverFacialFails = tDriverFacialFailService.selectList(new EntityWrapper<TDriverFacialFail>() |
| | | .in("id", driverFacialFailIds)); |
| | | driverFacialFails.forEach(tDriverFacialFail -> { |
| | | tDriverFacialFail.setIsDelete(2); |
| | | }); |
| | | tDriverFacialFailService.updateBatchById(driverFacialFails); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 解封司机人脸识别 |
| | | */ |
| | | @RequestMapping(value = "/unsealing") |
| | | @ResponseBody |
| | | public Object unsealing(@RequestParam Integer tDriverFacialFailId) { |
| | | TDriverFacialFail tDriverFacialFail = tDriverFacialFailService.selectById(tDriverFacialFailId); |
| | | // 重置司机失败次数,并且更新是否需要进行人脸识别和识别时间 |
| | | TDriver driver = driverService.selectById(tDriverFacialFail.getDriverId()); |
| | | driver.setFailCount(0); |
| | | driver.setIsNeedFacial(0); |
| | | driver.setLastFacialTime(new Date()); |
| | | driverService.updateById(driver); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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.service.ITSystemNoticeService; |
| | | 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.TFeedback; |
| | | import com.stylefeng.guns.modular.system.service.ITFeedbackService; |
| | | |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 反馈管理控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-10 10:24:59 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tFeedback") |
| | | public class TFeedbackController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tFeedback/"; |
| | | |
| | | @Autowired |
| | | private ITFeedbackService tFeedbackService; |
| | | |
| | | @Autowired |
| | | private ITSystemNoticeService tSystemNoticeService; |
| | | |
| | | /** |
| | | * 跳转到司机反馈管理首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tFeedback.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到用户反馈管理首页 |
| | | */ |
| | | @RequestMapping("/userFeedback") |
| | | public String userFeedback() { |
| | | return PREFIX + "userFeedback.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加反馈管理 |
| | | */ |
| | | @RequestMapping("/tFeedback_add") |
| | | public String tFeedbackAdd() { |
| | | return PREFIX + "tFeedback_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改反馈管理 |
| | | */ |
| | | @RequestMapping("/tFeedback_immediately/{tFeedbackId}/{type}") |
| | | public String tFeedbackUpdate(@PathVariable Integer tFeedbackId, @PathVariable Integer type, Model model) { |
| | | model.addAttribute("tFeedbackId",tFeedbackId); |
| | | model.addAttribute("type",type); |
| | | return PREFIX + "tFeedback_immediately.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到查看详情 |
| | | */ |
| | | @RequestMapping("/lookDetail/{id}/{type}") |
| | | public String lookDetail(@PathVariable Integer id, @PathVariable Integer type, Model model) { |
| | | TFeedback tFeedback = tFeedbackService.selectById(id); |
| | | String str = ""; |
| | | if (1 == type){ |
| | | str = tFeedback.getContent(); |
| | | }else if (2 == type){ |
| | | str = tFeedback.getRemark(); |
| | | } |
| | | model.addAttribute("str",str); |
| | | return "/system/tComplaint/lookDetail.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取司机反馈管理列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String insertTime, |
| | | String driverName, |
| | | String driverPhone, |
| | | Integer state) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | 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 (ShiroKit.getUser().getRoleType() != 1){ |
| | | page.setRecords(null); |
| | | }else{ |
| | | page.setRecords(tFeedbackService.getFeedbackList(page,beginTime,endTime,2,driverName,driverPhone,state)); |
| | | } |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 获取用户反馈管理列表 |
| | | */ |
| | | @RequestMapping(value = "/listUser") |
| | | @ResponseBody |
| | | public Object listUser(String insertTime, |
| | | String userName, |
| | | String userPhone, |
| | | Integer state) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | 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 (ShiroKit.getUser().getRoleType() != 1){ |
| | | page.setRecords(null); |
| | | }else{ |
| | | page.setRecords(tFeedbackService.getFeedbackList(page,beginTime,endTime,1,userName,userPhone,state)); |
| | | } |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 立即处理操作 |
| | | */ |
| | | @RequestMapping(value = "/immediately") |
| | | @ResponseBody |
| | | public Object immediately(@RequestParam Integer id,@RequestParam String remark) { |
| | | TFeedback tFeedback = tFeedbackService.selectById(id); |
| | | if (SinataUtil.isNotEmpty(tFeedback)){ |
| | | tFeedback.setCldate(new Date()); |
| | | tFeedback.setRemark(remark); |
| | | tFeedback.setHandleUserId(ShiroKit.getUser().getId()); |
| | | tFeedback.setState(2); |
| | | tFeedbackService.updateById(tFeedback); |
| | | |
| | | //增加系统消息 |
| | | TSystemNotice notice = new TSystemNotice(); |
| | | notice.setType(2); |
| | | notice.setUserType(tFeedback.getType()); |
| | | notice.setContent("反馈处理结果:【"+remark+"】。"); |
| | | notice.setUserId(tFeedback.getUserId()); |
| | | notice.setInsertTime(new Date()); |
| | | notice.setRead(1); |
| | | tSystemNoticeService.insert(notice); |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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.TInvoice; |
| | | import com.stylefeng.guns.modular.system.service.ITInvoiceService; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 开发票列表控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-09 10:55:26 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tInvoice") |
| | | public class TInvoiceController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tInvoice/"; |
| | | |
| | | @Autowired |
| | | private ITInvoiceService tInvoiceService; |
| | | |
| | | /** |
| | | * 跳转到开发票列表首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tInvoice.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到查看详情 |
| | | */ |
| | | @RequestMapping("/lookDetail/{id}/{type}") |
| | | public String lookDetail(@PathVariable Integer id, @PathVariable Integer type, Model model) { |
| | | TInvoice tInvoice = tInvoiceService.selectById(id); |
| | | String str = ""; |
| | | if (1 == type){ |
| | | str = tInvoice.getContent(); |
| | | } |
| | | model.addAttribute("str",str); |
| | | return "/system/tComplaint/lookDetail.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加开发票列表 |
| | | */ |
| | | @RequestMapping("/tInvoice_add") |
| | | public String tInvoiceAdd() { |
| | | return PREFIX + "tInvoice_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改开发票列表 |
| | | */ |
| | | @RequestMapping("/tInvoice_update/{tInvoiceId}") |
| | | public String tInvoiceUpdate(@PathVariable Integer tInvoiceId, Model model) { |
| | | TInvoice tInvoice = tInvoiceService.selectById(tInvoiceId); |
| | | model.addAttribute("item",tInvoice); |
| | | LogObjectHolder.me().set(tInvoice); |
| | | return PREFIX + "tInvoice_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取开发票列表列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String insertTime, |
| | | String email, |
| | | String name, |
| | | Integer type, |
| | | Integer state) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | 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 (ShiroKit.getUser().getRoleType() != 1){ |
| | | page.setRecords(null); |
| | | }else{ |
| | | page.setRecords(tInvoiceService.getInvoiceList(page,beginTime,endTime,email,name,type,state)); |
| | | } |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 重新开发票 |
| | | */ |
| | | @RequestMapping(value = "/again") |
| | | @ResponseBody |
| | | public Object again(@RequestParam Integer tInvoiceId) { |
| | | TInvoice tInvoice = tInvoiceService.selectById(tInvoiceId); |
| | | // TODO 对接诺诺 |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除开发票列表 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tInvoiceId) { |
| | | tInvoiceService.deleteById(tInvoiceId); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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.SinataUtil; |
| | | import com.stylefeng.guns.modular.system.util.task.base.QuartzManager; |
| | | import com.stylefeng.guns.modular.system.util.task.base.TimeJobType; |
| | | import com.stylefeng.guns.modular.system.util.task.jobs.AddNotice; |
| | | 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.TNotices; |
| | | import com.stylefeng.guns.modular.system.service.ITNoticesService; |
| | | |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 滚动消息设置控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-10 15:21:25 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tNotices") |
| | | public class TNoticesController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tNotices/"; |
| | | |
| | | @Autowired |
| | | private ITNoticesService tNoticesService; |
| | | |
| | | /** |
| | | * 跳转到滚动消息设置首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tNotices.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到系统公告设置首页 |
| | | */ |
| | | @RequestMapping("/system") |
| | | public String system() { |
| | | return PREFIX + "system.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加滚动消息设置 |
| | | */ |
| | | @RequestMapping("/tNotices_add") |
| | | public String tNoticesAdd() { |
| | | return PREFIX + "tNotices_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加系统公告 |
| | | */ |
| | | @RequestMapping("/system_add") |
| | | public String system_add() { |
| | | return PREFIX + "system_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改滚动消息设置 |
| | | */ |
| | | @RequestMapping("/tNotices_update/{tNoticesId}") |
| | | public String tNoticesUpdate(@PathVariable Integer tNoticesId, Model model) { |
| | | TNotices tNotices = tNoticesService.selectById(tNoticesId); |
| | | model.addAttribute("item",tNotices); |
| | | LogObjectHolder.me().set(tNotices); |
| | | return PREFIX + "tNotices_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改系统公告 |
| | | */ |
| | | @RequestMapping("/system_update/{tNoticesId}") |
| | | public String system_update(@PathVariable Integer tNoticesId, Model model) { |
| | | TNotices tNotices = tNoticesService.selectById(tNoticesId); |
| | | model.addAttribute("item",tNotices); |
| | | LogObjectHolder.me().set(tNotices); |
| | | return PREFIX + "system_update.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取滚动消息设置列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String insertTime,String content) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | 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 (ShiroKit.getUser().getRoleType() != 1){ |
| | | page.setRecords(null); |
| | | }else{ |
| | | page.setRecords(tNoticesService.getRollingNoticeList(page,beginTime,endTime,1,content)); |
| | | } |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 获取系统公告设置列表 |
| | | */ |
| | | @RequestMapping(value = "/listSystem") |
| | | @ResponseBody |
| | | public Object listSystem(String insertTime,String content) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | 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 (ShiroKit.getUser().getRoleType() != 1){ |
| | | page.setRecords(null); |
| | | }else{ |
| | | page.setRecords(tNoticesService.getRollingNoticeList(page,beginTime,endTime,2,content)); |
| | | } |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 新增滚动消息设置 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(TNotices tNotices) { |
| | | tNotices.setIsDelete(1); |
| | | tNotices.setInsertTime(new Date()); |
| | | tNotices.setInsertUser(ShiroKit.getUser().getId()); |
| | | tNotices.setType(1); |
| | | tNoticesService.insert(tNotices); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 新增系统公告 |
| | | */ |
| | | @RequestMapping(value = "/addSystem") |
| | | @ResponseBody |
| | | public Object addSystem(TNotices tNotices) { |
| | | tNotices.setIsDelete(1); |
| | | tNotices.setInsertTime(new Date()); |
| | | tNotices.setInsertUser(ShiroKit.getUser().getId()); |
| | | tNotices.setType(2); |
| | | tNoticesService.insert(tNotices); |
| | | |
| | | if (tNotices.getIsShow() == 1){ //发布 |
| | | //定时1秒后执行 |
| | | Map<String,Object> maps=new HashMap<>(); |
| | | maps.put("noticeId",tNotices.getId()); |
| | | QuartzManager.addJob(AddNotice.class, (AddNotice.name+tNotices.getId()).toUpperCase(), TimeJobType.UNLOCK,DateUtil.getDate_strYMdHms(new Date().getTime() + 1*1000) , maps); |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 发布系统公告 |
| | | */ |
| | | @RequestMapping(value = "/sendSystem") |
| | | @ResponseBody |
| | | public Object sendSystem(@RequestParam Integer tNoticesId) { |
| | | TNotices tNotices = tNoticesService.selectById(tNoticesId); |
| | | if (tNotices.getIsShow() == 2){ |
| | | //定时1秒后执行 |
| | | Map<String,Object> maps=new HashMap<>(); |
| | | maps.put("noticeId",tNotices.getId()); |
| | | QuartzManager.addJob(AddNotice.class, (AddNotice.name+tNotices.getId()).toUpperCase(), TimeJobType.UNLOCK,DateUtil.getDate_strYMdHms(new Date().getTime() + 1*1000) , maps); |
| | | } |
| | | tNotices.setIsShow(1); |
| | | tNotices.setUpdateTime(new Date()); |
| | | tNotices.setUpdateUser(ShiroKit.getUser().getId()); |
| | | tNoticesService.updateById(tNotices); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tNoticesId) { |
| | | TNotices tNotices = tNoticesService.selectById(tNoticesId); |
| | | tNotices.setIsDelete(2); |
| | | tNotices.setFlag("3"); |
| | | tNotices.setUpdateTime(new Date()); |
| | | tNotices.setUpdateUser(ShiroKit.getUser().getId()); |
| | | tNoticesService.updateById(tNotices); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改滚动消息设置 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TNotices tNotices) { |
| | | tNotices.setUpdateUser(ShiroKit.getUser().getId()); |
| | | tNotices.setUpdateTime(new Date()); |
| | | tNoticesService.updateById(tNotices); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改系统公告 |
| | | */ |
| | | @RequestMapping(value = "/updateSystem") |
| | | @ResponseBody |
| | | public Object updateSystem(TNotices tNotices) { |
| | | tNotices.setUpdateUser(ShiroKit.getUser().getId()); |
| | | tNotices.setUpdateTime(new Date()); |
| | | tNoticesService.updateById(tNotices); |
| | | |
| | | if (tNotices.getIsShow() == 1){ //发布 |
| | | //定时1秒后执行 |
| | | Map<String,Object> maps=new HashMap<>(); |
| | | maps.put("noticeId",tNotices.getId()); |
| | | QuartzManager.addJob(AddNotice.class, (AddNotice.name+tNotices.getId()).toUpperCase(), TimeJobType.UNLOCK,DateUtil.getDate_strYMdHms(new Date().getTime() + 1*1000) , maps); |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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.SinataUtil; |
| | | import com.stylefeng.guns.modular.system.dao.TOpenCitySiteMapper; |
| | | import com.stylefeng.guns.modular.system.model.TOpenCityBusiness; |
| | | import com.stylefeng.guns.modular.system.model.TOpenCitySite; |
| | | import com.stylefeng.guns.modular.system.model.TRegion; |
| | | import com.stylefeng.guns.modular.system.service.ITOpenCityBusinessService; |
| | | import com.stylefeng.guns.modular.system.service.ITRegionService; |
| | | import com.stylefeng.guns.modular.system.util.GaoDeMapUtil; |
| | | 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.TOpenCity; |
| | | import com.stylefeng.guns.modular.system.service.ITOpenCityService; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | |
| | | /** |
| | | * 城市管理控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-02 11:40:31 |
| | | */ |
| | | @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; |
| | | @Autowired |
| | | private TOpenCitySiteMapper tOpenCitySiteMapper; |
| | | /** |
| | | * 跳转到城市管理首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tOpenCity.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加城市管理 |
| | | */ |
| | | @RequestMapping("/tOpenCity_add") |
| | | public String tOpenCityAdd(Model model) { |
| | | List<TRegion> provinceList = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); |
| | | model.addAttribute("provinceList",provinceList); |
| | | return PREFIX + "tOpenCity_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改城市管理 |
| | | */ |
| | | @RequestMapping("/tOpenCity_update/{tOpenCityId}") |
| | | public String tOpenCityUpdate(@PathVariable Integer tOpenCityId, Model model) { |
| | | TOpenCity tOpenCity = tOpenCityService.selectById(tOpenCityId); |
| | | model.addAttribute("item",tOpenCity); |
| | | LogObjectHolder.me().set(tOpenCity); |
| | | //省 |
| | | List<TRegion> provinceList = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); |
| | | model.addAttribute("provinceList",provinceList); |
| | | //市 |
| | | List<TRegion> cityList = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", tOpenCity.getAreaId())); |
| | | model.addAttribute("cityList",cityList); |
| | | //区 |
| | | List<TRegion> areaList = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", tOpenCity.getCityId())); |
| | | model.addAttribute("areaList",areaList); |
| | | //经营业务 |
| | | List<Map<String,Object>> businessList = tOpenCityService.getBusinessByCityId(tOpenCityId); |
| | | model.addAttribute("businessList",businessList); |
| | | // 机场/动车站点 |
| | | List<TOpenCitySite> siteList = tOpenCitySiteMapper.selectList(new EntityWrapper<TOpenCitySite>() |
| | | .eq("openCityId", tOpenCityId) |
| | | .ne("flag",3)); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy.MM.dd"); |
| | | for (TOpenCitySite openCitySite : siteList) { |
| | | String format = simpleDateFormat.format(openCitySite.getInsertTime()); |
| | | openCitySite.setInsertTime1(format); |
| | | } |
| | | model.addAttribute("siteList",siteList); |
| | | return PREFIX + "tOpenCity_edit.html"; |
| | | } |
| | | |
| | | @RequestMapping(value = "/change") |
| | | @ResponseBody |
| | | public Object change(@RequestParam Integer id) { |
| | | List<TRegion> list = new ArrayList<>(); |
| | | if (SinataUtil.isNotEmpty(id)){ |
| | | list = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", id)); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 获取城市管理列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String insertTime,String condition) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | 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(tOpenCityService.getOpenCityList(page,beginTime,endTime,condition)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 新增城市管理 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(TOpenCity tOpenCity,@RequestParam String businessTypeStr, |
| | | String sites, |
| | | Integer areaId,Integer cityId, |
| | | Integer provinceId) { |
| | | //获取code |
| | | if (SinataUtil.isNotEmpty(areaId)){ |
| | | TRegion area = tRegionService.selectById(areaId); |
| | | tOpenCity.setCode(area.getCode()); |
| | | } |
| | | if (SinataUtil.isNotEmpty(cityId)){ |
| | | TRegion city = tRegionService.selectById(cityId); |
| | | tOpenCity.setCode(city.getCode()); |
| | | } |
| | | if (SinataUtil.isNotEmpty(provinceId)){ |
| | | TRegion province = tRegionService.selectById(provinceId); |
| | | tOpenCity.setCode(province.getCode()); |
| | | } |
| | | tOpenCity.setAreaId(areaId); |
| | | tOpenCity.setCityId(cityId); |
| | | tOpenCity.setProvinceId(provinceId); |
| | | //获取经纬度 |
| | | String address = tOpenCity.getAreaName(); |
| | | if (SinataUtil.isNotEmpty(tOpenCity.getCityName())){ |
| | | address+=tOpenCity.getCityName(); |
| | | } |
| | | if (SinataUtil.isNotEmpty(tOpenCity.getProvinceName())){ |
| | | address+=tOpenCity.getProvinceName(); |
| | | } |
| | | JSONObject positionObj = GaoDeMapUtil.getLngAndLat(address); |
| | | String longitude = positionObj.getString("longitude"); |
| | | String latitude = positionObj.getString("latitude"); |
| | | tOpenCity.setLon(Double.valueOf(longitude)); |
| | | tOpenCity.setLat(Double.valueOf(latitude)); |
| | | tOpenCity.setInsertTime(new Date()); |
| | | tOpenCity.setInsertUser(ShiroKit.getUser().getId()); |
| | | tOpenCityService.insert(tOpenCity); |
| | | |
| | | //添加经营业务 |
| | | testJSONStrToJSONArray(businessTypeStr,tOpenCity.getId()); |
| | | // 添加机场/动车站点 |
| | | JSONArray jsonArray = JSON.parseArray(sites); |
| | | int size = jsonArray.size(); |
| | | for (int i = 0; i < size; i++){ |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | TOpenCitySite openCitySite = new TOpenCitySite(); |
| | | openCitySite.setOpenCityId(tOpenCity.getId()); |
| | | String string = jsonObject.getString("lonAndLat"); |
| | | // 去除转义符 |
| | | String unescaped = string.replaceAll("& #40;", "(").replaceAll("& #41;", ")"); |
| | | // 提取括号中的内容 |
| | | Pattern pattern = Pattern.compile("\\(([^)]+)\\)"); |
| | | Matcher matcher = pattern.matcher(unescaped); |
| | | if (matcher.find()) { |
| | | String lonAndLat = matcher.group(1); |
| | | System.out.println("括号中的内容: " + lonAndLat); |
| | | // 使用逗号分割字符串 |
| | | String[] parts = lonAndLat.split(","); |
| | | // 提取需要的部分 |
| | | String lon = parts[0]; |
| | | String lat = parts[1]; |
| | | openCitySite.setLon(lon); |
| | | openCitySite.setLat(lat); |
| | | } |
| | | openCitySite.setFlag(1); |
| | | openCitySite.setName(jsonObject.getString("name")); |
| | | openCitySite.setInsertTime(DateUtil.parse(jsonObject.getString("time")+" 00:00:00","yyyy-MM-dd HH:mm:ss")); |
| | | tOpenCitySiteMapper.insert(openCitySite); |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | public void testJSONStrToJSONArray(String subArr,Integer tOpenCityId){ |
| | | JSONArray jsonArray = JSON.parseArray(subArr); |
| | | int size = jsonArray.size(); |
| | | 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){ |
| | | business = tOpenCityBusinessService.selectById(jsonObject.getInteger("busId")); |
| | | business.setUpdateTime(new Date()); |
| | | business.setUpdateUser(ShiroKit.getUser().getId()); |
| | | business.setFlag("2"); |
| | | }else{ |
| | | business.setInsertTime(DateUtil.parse(jsonObject.getString("time")+" 00:00:00","yyyy-MM-dd HH:mm:ss")); |
| | | business.setInsertUser(ShiroKit.getUser().getId()); |
| | | } |
| | | business.setOpenCityId(tOpenCityId); |
| | | String type = jsonObject.getString("type"); |
| | | Integer businessType = 0; |
| | | if ("专车".equals(type)){ |
| | | businessType = 1; |
| | | }else if ("出租车".equals(type)){ |
| | | businessType = 2; |
| | | }else if ("跨城".equals(type)){ |
| | | businessType = 3; |
| | | }else if ("跨城小件物流".equals(type)){ |
| | | businessType = 4; |
| | | }else if ("同城小件物流".equals(type)){ |
| | | businessType = 5; |
| | | }else if ("包车".equals(type)){ |
| | | businessType = 6; |
| | | }else if ("接送机".equals(type)){ |
| | | businessType = 7; |
| | | } |
| | | business.setBusinessType(businessType); |
| | | business.setSort(jsonObject.getInteger("sort")); |
| | | if (SinataUtil.isNotEmpty(jsonObject.getInteger("busId")) && jsonObject.getInteger("busId") != 0){ |
| | | tOpenCityBusinessService.updateById(business); |
| | | }else{ |
| | | tOpenCityBusinessService.insert(business); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 删除城市管理 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tOpenCityId) { |
| | | TOpenCity tOpenCity = tOpenCityService.selectById(tOpenCityId); |
| | | tOpenCity.setFlag("3"); |
| | | tOpenCityService.updateById(tOpenCity); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改城市管理 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TOpenCity tOpenCity,@RequestParam String businessTypeStr,Integer areaId,Integer cityId,Integer provinceId,String sites) { |
| | | if (SinataUtil.isNotEmpty(areaId)){ |
| | | TRegion area = tRegionService.selectById(areaId); |
| | | tOpenCity.setCode(area.getCode()); |
| | | } |
| | | if (SinataUtil.isNotEmpty(cityId)){ |
| | | TRegion city = tRegionService.selectById(cityId); |
| | | tOpenCity.setCode(city.getCode()); |
| | | } |
| | | if (SinataUtil.isNotEmpty(provinceId)){ |
| | | TRegion province = tRegionService.selectById(provinceId); |
| | | tOpenCity.setCode(province.getCode()); |
| | | } |
| | | if (SinataUtil.isEmpty(areaId)){ |
| | | tOpenCity.setAreaId(0); |
| | | tOpenCity.setAreaName(""); |
| | | }else{ |
| | | tOpenCity.setAreaId(areaId); |
| | | } |
| | | if (SinataUtil.isEmpty(cityId)){ |
| | | tOpenCity.setCityId(0); |
| | | tOpenCity.setCityName(""); |
| | | }else{ |
| | | tOpenCity.setCityId(cityId); |
| | | } |
| | | if (SinataUtil.isEmpty(provinceId)){ |
| | | tOpenCity.setProvinceId(0); |
| | | tOpenCity.setProvinceName(""); |
| | | }else{ |
| | | tOpenCity.setProvinceId(provinceId); |
| | | } |
| | | |
| | | //获取经纬度 |
| | | String address = tOpenCity.getAreaName(); |
| | | if (SinataUtil.isNotEmpty(tOpenCity.getCityName())){ |
| | | address+=tOpenCity.getCityName(); |
| | | } |
| | | if (SinataUtil.isNotEmpty(tOpenCity.getProvinceName())){ |
| | | address+=tOpenCity.getProvinceName(); |
| | | } |
| | | JSONObject positionObj = GaoDeMapUtil.getLngAndLat(address); |
| | | String longitude = positionObj.getString("longitude"); |
| | | String latitude = positionObj.getString("latitude"); |
| | | tOpenCity.setLon(Double.valueOf(longitude)); |
| | | tOpenCity.setLat(Double.valueOf(latitude)); |
| | | tOpenCity.setUpdateTime(new Date()); |
| | | tOpenCity.setUpdateUser(ShiroKit.getUser().getId()); |
| | | tOpenCityService.updateById(tOpenCity); |
| | | |
| | | //删除经营业务 |
| | | TOpenCityBusiness business = new TOpenCityBusiness(); |
| | | business.setFlag("3"); |
| | | tOpenCityBusinessService.update(business,new EntityWrapper<TOpenCityBusiness>().eq("openCityId",tOpenCity.getId())); |
| | | //添加经营业务 |
| | | testJSONStrToJSONArray(businessTypeStr,tOpenCity.getId()); |
| | | // TOpenCitySite openCitySite = new TOpenCitySite(); |
| | | // // 删除站点 |
| | | // tOpenCitySiteMapper.update(openCitySite,new EntityWrapper<TOpenCitySite>().eq("openCityId",tOpenCity.getId())); |
| | | List<TOpenCitySite> openCityId = tOpenCitySiteMapper.selectList(new EntityWrapper<TOpenCitySite>() |
| | | .eq("openCityId", tOpenCity.getId())); |
| | | for (TOpenCitySite openCitySite : openCityId) { |
| | | openCitySite.setFlag(3); |
| | | tOpenCitySiteMapper.updateById(openCitySite); |
| | | } |
| | | // 添加站点 |
| | | // 添加机场/动车站点 |
| | | JSONArray jsonArray = JSON.parseArray(sites); |
| | | int size = jsonArray.size(); |
| | | for (int i = 0; i < size; i++){ |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | String string = jsonObject.getString("lonAndLat"); |
| | | // 去除转义符 |
| | | String unescaped = string.replaceAll("& #40;", "(").replaceAll("& #41;", ")"); |
| | | // 提取括号中的内容 |
| | | Pattern pattern = Pattern.compile("\\(([^)]+)\\)"); |
| | | Matcher matcher = pattern.matcher(unescaped); |
| | | String lon = ""; |
| | | String lat = ""; |
| | | if (matcher.find()) { |
| | | String lonAndLat = matcher.group(1); |
| | | System.out.println("括号中的内容: " + lonAndLat); |
| | | // 使用逗号分割字符串 |
| | | String[] parts = lonAndLat.split(","); |
| | | // 提取需要的部分 |
| | | lon = parts[0]; |
| | | lat = parts[1]; |
| | | } |
| | | if (SinataUtil.isNotEmpty(jsonObject.getInteger("busId")) && jsonObject.getInteger("busId") != 0){ |
| | | // 修改 |
| | | TOpenCitySite openCitySite1 = tOpenCitySiteMapper.selectById(jsonObject.getInteger("busId")); |
| | | openCitySite1.setLon(lon); |
| | | openCitySite1.setLat(lat); |
| | | openCitySite1.setName(jsonObject.getString("name")); |
| | | openCitySite1.setFlag(2); |
| | | openCitySite1.setType(jsonObject.getInteger("siteType")); |
| | | tOpenCitySiteMapper.updateById(openCitySite1); |
| | | }else{ |
| | | // 新增 |
| | | TOpenCitySite openCitySite3 = new TOpenCitySite(); |
| | | openCitySite3.setOpenCityId(tOpenCity.getId()); |
| | | openCitySite3.setLon(lon); |
| | | openCitySite3.setLat(lat); |
| | | openCitySite3.setFlag(1); |
| | | openCitySite3.setName(jsonObject.getString("name")); |
| | | openCitySite3.setType(jsonObject.getInteger("siteType")); |
| | | openCitySite3.setInsertTime(DateUtil.parse(jsonObject.getString("time")+" 00:00:00","yyyy-MM-dd HH:mm:ss")); |
| | | tOpenCitySiteMapper.insert(openCitySite3); |
| | | } |
| | | |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 城市管理详情 |
| | | */ |
| | | @RequestMapping(value = "/detail/{tOpenCityId}") |
| | | @ResponseBody |
| | | public Object detail(@PathVariable("tOpenCityId") Integer tOpenCityId) { |
| | | return tOpenCityService.selectById(tOpenCityId); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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.TOrderEvaluate; |
| | | import com.stylefeng.guns.modular.system.service.ITOrderEvaluateService; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 评价列表控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-09 11:44:36 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tOrderEvaluate") |
| | | public class TOrderEvaluateController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tOrderEvaluate/"; |
| | | |
| | | @Autowired |
| | | private ITOrderEvaluateService tOrderEvaluateService; |
| | | |
| | | /** |
| | | * 跳转到评价列表首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tOrderEvaluate.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到查看详情 |
| | | */ |
| | | @RequestMapping("/lookDetail/{id}/{type}") |
| | | public String lookDetail(@PathVariable Integer id, @PathVariable Integer type, Model model) { |
| | | TOrderEvaluate tOrderEvaluate = tOrderEvaluateService.selectById(id); |
| | | String str = ""; |
| | | if (1 == type){ |
| | | str = tOrderEvaluate.getContent(); |
| | | } |
| | | model.addAttribute("str",str); |
| | | return "/system/tComplaint/lookDetail.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加评价列表 |
| | | */ |
| | | @RequestMapping("/tOrderEvaluate_add") |
| | | public String tOrderEvaluateAdd() { |
| | | return PREFIX + "tOrderEvaluate_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改评价列表 |
| | | */ |
| | | @RequestMapping("/tOrderEvaluate_update/{tOrderEvaluateId}") |
| | | public String tOrderEvaluateUpdate(@PathVariable Integer tOrderEvaluateId, Model model) { |
| | | TOrderEvaluate tOrderEvaluate = tOrderEvaluateService.selectById(tOrderEvaluateId); |
| | | model.addAttribute("item",tOrderEvaluate); |
| | | LogObjectHolder.me().set(tOrderEvaluate); |
| | | return PREFIX + "tOrderEvaluate_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取评价列表列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String insertTime, |
| | | String userName, |
| | | String userPhone, |
| | | String driverName, |
| | | String driverPhone, |
| | | String fraction, |
| | | Integer orderType) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | 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(tOrderEvaluateService.getOrderEvaluateList(page,ShiroKit.getUser().getRoleType(),ShiroKit.getUser().getObjectId(),beginTime,endTime,userName,userPhone,driverName,driverPhone,fraction,orderType)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 新增评价列表 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(TOrderEvaluate tOrderEvaluate) { |
| | | tOrderEvaluateService.insert(tOrderEvaluate); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除评价列表 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tOrderEvaluateId) { |
| | | tOrderEvaluateService.deleteById(tOrderEvaluateId); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改评价列表 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TOrderEvaluate tOrderEvaluate) { |
| | | tOrderEvaluateService.updateById(tOrderEvaluate); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 评价列表详情 |
| | | */ |
| | | @RequestMapping(value = "/detail/{tOrderEvaluateId}") |
| | | @ResponseBody |
| | | public Object detail(@PathVariable("tOrderEvaluateId") Integer tOrderEvaluateId) { |
| | | return tOrderEvaluateService.selectById(tOrderEvaluateId); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.modular.system.model.TDriverFacialFail; |
| | | import com.stylefeng.guns.modular.system.model.TOrderTape; |
| | | import com.stylefeng.guns.modular.system.service.ITOrderTapeService; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 行程录音管理控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-05 14:31:28 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tOrderTape") |
| | | public class TOrderTapeController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tOrderTape/"; |
| | | |
| | | @Autowired |
| | | private ITOrderTapeService tOrderTapeService; |
| | | |
| | | /** |
| | | * 跳转到行程录音管理首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tOrderTape.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取行程录音管理列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String createTime, |
| | | String fileName, |
| | | String orderNum, |
| | | String state) { |
| | | 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(); |
| | | page.setRecords(tOrderTapeService.getOrderTapeList(page,beginTime,endTime,fileName,orderNum,state)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 删除行程录音管理 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tOrderTapeId) { |
| | | TOrderTape tOrderTape = tOrderTapeService.selectById(tOrderTapeId); |
| | | tOrderTape.setIsDelete(2); |
| | | tOrderTapeService.updateById(tOrderTape); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除行程录音管理 |
| | | */ |
| | | @RequestMapping(value = "/getDetailById") |
| | | @ResponseBody |
| | | public Object getDetailById(@RequestParam Integer tOrderTapeId) { |
| | | TOrderTape tOrderTape = tOrderTapeService.selectById(tOrderTapeId); |
| | | return ResultUtil.success(tOrderTape); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除行程录音管理 |
| | | */ |
| | | @RequestMapping(value = "/deleteBatch") |
| | | @ResponseBody |
| | | public Object deleteBatch(@RequestParam String tOrderTapeIds) { |
| | | |
| | | if(!StringUtils.hasLength(tOrderTapeIds)){ |
| | | return ResultUtil.error("请选择要删除的数据"); |
| | | } |
| | | |
| | | String[] split = tOrderTapeIds.split(","); |
| | | List<Integer> orderTapeIds = new ArrayList<>(); |
| | | for (String s : split) { |
| | | orderTapeIds.add(Integer.valueOf(s)); |
| | | } |
| | | |
| | | List<TOrderTape> orderTapes = tOrderTapeService.selectList(new EntityWrapper<TOrderTape>() |
| | | .in("id", orderTapeIds)); |
| | | orderTapes.forEach(item -> { |
| | | item.setIsDelete(2); |
| | | }); |
| | | tOrderTapeService.updateBatchById(orderTapes); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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.TSystemNotice; |
| | | import com.stylefeng.guns.modular.system.service.ITSystemNoticeService; |
| | | 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.TProblem; |
| | | import com.stylefeng.guns.modular.system.service.ITProblemService; |
| | | |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 用户留言管理控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-24 11:20:23 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tProblem") |
| | | public class TProblemController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tProblem/"; |
| | | |
| | | @Autowired |
| | | private ITProblemService tProblemService; |
| | | |
| | | @Autowired |
| | | private ITSystemNoticeService itSystemNoticeService; |
| | | |
| | | /** |
| | | * 跳转到用户留言管理首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tProblem.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到查看详情 |
| | | */ |
| | | @RequestMapping("/lookDetail/{id}/{type}") |
| | | public String lookDetail(@PathVariable Integer id, @PathVariable Integer type, Model model) { |
| | | TProblem tProblem = tProblemService.selectById(id); |
| | | String str = ""; |
| | | if (1 == type){ |
| | | str = tProblem.getContent(); |
| | | }else if (2 == type){ |
| | | str = tProblem.getAnswer(); |
| | | } |
| | | model.addAttribute("str",str); |
| | | return "/system/tComplaint/lookDetail.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到立即处理页面 |
| | | */ |
| | | @RequestMapping("/tProblem_immediately/{tProblemId}") |
| | | public String tProblemUpdate(@PathVariable Integer tProblemId, Model model) { |
| | | model.addAttribute("tProblemId",tProblemId); |
| | | return PREFIX + "tProblem_immediately.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取用户留言管理列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String insertTime, |
| | | String userName, |
| | | Integer state) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | 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 (ShiroKit.getUser().getRoleType() != 1){ |
| | | page.setRecords(null); |
| | | }else{ |
| | | page.setRecords(tProblemService.getProblemList(page,beginTime,endTime,userName,state)); |
| | | } |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 立即处理 |
| | | */ |
| | | @RequestMapping(value = "/immediately") |
| | | @ResponseBody |
| | | public Object immediately(@RequestParam Integer tProblemId,@RequestParam String answer) { |
| | | TProblem tProblem = tProblemService.selectById(tProblemId); |
| | | if (SinataUtil.isNotEmpty(tProblem)){ |
| | | tProblem.setAnswer(answer); |
| | | tProblem.setHandleTime(new Date()); |
| | | tProblem.setHandleUserId(ShiroKit.getUser().getId()); |
| | | tProblem.setState(2); |
| | | tProblemService.updateById(tProblem); |
| | | |
| | | //增加系统消息 |
| | | TSystemNotice notice = new TSystemNotice(); |
| | | notice.setType(2); |
| | | notice.setUserType(1); |
| | | notice.setContent("您的留言被回复啦:【"+answer+"】"); |
| | | notice.setUserId(tProblem.getUserId()); |
| | | notice.setInsertTime(new Date()); |
| | | notice.setRead(1); |
| | | itSystemNoticeService.insert(notice); |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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.ITDriverService; |
| | | import com.stylefeng.guns.modular.system.service.ITSystemNoticeService; |
| | | import com.stylefeng.guns.modular.system.service.ITUserService; |
| | | import com.stylefeng.guns.modular.system.util.HttpRequestUtil; |
| | | import com.stylefeng.guns.modular.system.util.PushURL; |
| | | 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.service.ITPubWithdrawalService; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 提现列表控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-09 09:30:59 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tPubWithdrawal") |
| | | public class TPubWithdrawalController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tPubWithdrawal/"; |
| | | |
| | | @Autowired |
| | | private ITPubWithdrawalService tPubWithdrawalService; |
| | | |
| | | @Autowired |
| | | private ITSystemNoticeService tSystemNoticeService; |
| | | |
| | | /** |
| | | * 跳转到提现列表首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tPubWithdrawal.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到查看详情 |
| | | */ |
| | | @RequestMapping("/lookDetail/{id}/{type}") |
| | | public String lookDetail(@PathVariable Integer id, @PathVariable Integer type, Model model) { |
| | | TPubWithdrawal tPubWithdrawal = tPubWithdrawalService.selectById(id); |
| | | String str = ""; |
| | | if (1 == type){ |
| | | str = tPubWithdrawal.getRemark(); |
| | | } |
| | | model.addAttribute("str",str); |
| | | return "/system/tComplaint/lookDetail.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到立即处理页面 |
| | | */ |
| | | @RequestMapping("/tPubWithdrawal_immediately/{tPubWithdrawalId}") |
| | | public String tPubWithdrawalUpdate(@PathVariable Integer tPubWithdrawalId, Model model) { |
| | | model.addAttribute("tPubWithdrawalId",tPubWithdrawalId); |
| | | return PREFIX + "tPubWithdrawal_immediately.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取提现列表列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String insertTime, String company, |
| | | String name, |
| | | Integer withdrawalType) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | 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 (ShiroKit.getUser().getRoleType() != 1){ |
| | | page.setRecords(null); |
| | | }else{ |
| | | page.setRecords(tPubWithdrawalService.getWithdrawalList(page,beginTime,endTime,company,name,withdrawalType)); |
| | | } |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 新增提现列表 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(TPubWithdrawal tPubWithdrawal) { |
| | | tPubWithdrawalService.insert(tPubWithdrawal); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | @Autowired |
| | | private ITUserService userService; |
| | | |
| | | @Autowired |
| | | private ITDriverService driverService; |
| | | /** |
| | | * 立即处理操作 |
| | | */ |
| | | @RequestMapping(value = "/immediately") |
| | | @ResponseBody |
| | | public Object immediately(@RequestParam Integer id,@RequestParam Integer state,@RequestParam String remark) { |
| | | TPubWithdrawal tPubWithdrawal = tPubWithdrawalService.selectById(id); |
| | | if (SinataUtil.isNotEmpty(tPubWithdrawal)){ |
| | | tPubWithdrawal.setState(state); //调用接口修改状态 |
| | | tPubWithdrawal.setRemark(remark); |
| | | tPubWithdrawal.setHandleTime(new Date()); |
| | | |
| | | Integer stateObj = 1; |
| | | if (2 == state){ //同意提现 |
| | | stateObj = 1; |
| | | }else if (3 == state){ //拒绝提现 |
| | | |
| | | |
| | | //退钱给司机 |
| | | TDriver tDriver = driverService.selectById(tPubWithdrawal.getUserId()); |
| | | |
| | | |
| | | if (tPubWithdrawal.getType()!=null&&tPubWithdrawal.getType()==1) { |
| | | tDriver.setLaveActivityMoney(tDriver.getLaveActivityMoney()+tPubWithdrawal.getMoney().doubleValue()); |
| | | driverService.updateById(tDriver); |
| | | |
| | | }else if (tPubWithdrawal.getType()==null){ |
| | | TUser tUser = userService.selectById(tPubWithdrawal.getUserId()); |
| | | tUser.setBalance(BigDecimal.valueOf(tUser.getBalance().doubleValue()+tPubWithdrawal.getMoney().doubleValue())); |
| | | userService.updateById(tUser); |
| | | }else { |
| | | tDriver.setLaveBusinessMoney(tDriver.getLaveBusinessMoney()+tPubWithdrawal.getMoney().doubleValue()); |
| | | driverService.updateById(tDriver); |
| | | |
| | | } |
| | | |
| | | stateObj = 2; |
| | | } |
| | | tPubWithdrawalService.updateById(tPubWithdrawal); |
| | | |
| | | Map<String,String> map = new HashMap<>(); |
| | | map.put("id", String.valueOf(tPubWithdrawal.getId())); |
| | | map.put("state", String.valueOf(stateObj)); |
| | | String result = HttpRequestUtil.postRequest(PushURL.withdraw_auth_url, map); |
| | | System.out.println("提现审核接口 :【recordId="+tPubWithdrawal.getId().toString()+"】,调用接口:"+result); |
| | | |
| | | //增加系统消息 |
| | | TSystemNotice notice = new TSystemNotice(); |
| | | notice.setType(2); |
| | | notice.setUserType(tPubWithdrawal.getUserType()); |
| | | notice.setContent("提现处理结果:【"+remark+"】。"); |
| | | notice.setUserId(tPubWithdrawal.getUserId()); |
| | | notice.setInsertTime(new Date()); |
| | | notice.setRead(1); |
| | | tSystemNoticeService.insert(notice); |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改提现列表 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TPubWithdrawal tPubWithdrawal) { |
| | | tPubWithdrawalService.updateById(tPubWithdrawal); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 提现列表详情 |
| | | */ |
| | | @RequestMapping(value = "/detail/{tPubWithdrawalId}") |
| | | @ResponseBody |
| | | public Object detail(@PathVariable("tPubWithdrawalId") Integer tPubWithdrawalId) { |
| | | return tPubWithdrawalService.selectById(tPubWithdrawalId); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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 java.util.Map; |
| | | |
| | | /** |
| | | * 短信记录控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-10 19:43:13 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tSmsrecord") |
| | | public class TSmsrecordController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tSmsrecord/"; |
| | | |
| | | @Autowired |
| | | private ITSmsrecordService tSmsrecordService; |
| | | |
| | | /** |
| | | * 跳转到短信记录首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tSmsrecord.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到查看详情 |
| | | */ |
| | | @RequestMapping("/lookDetail/{id}/{type}") |
| | | public String lookDetail(@PathVariable Integer id, @PathVariable Integer type, Model model) { |
| | | TSmsrecord tSmsrecord = tSmsrecordService.selectById(id); |
| | | String str = ""; |
| | | if (1 == type){ |
| | | str = tSmsrecord.getContent(); |
| | | } |
| | | model.addAttribute("str",str); |
| | | return "/system/tComplaint/lookDetail.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取短信记录列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String insertTime, |
| | | String phone) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | 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 (ShiroKit.getUser().getRoleType() != 1){ |
| | | page.setRecords(null); |
| | | }else{ |
| | | page.setRecords(tSmsrecordService.getSmsCodeList(page,beginTime,endTime,phone)); |
| | | } |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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.*; |
| | | 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 java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 系统设置控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-09 13:43:44 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tSysReformist") |
| | | public class TSysReformistController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tSysReformist/"; |
| | | |
| | | @Autowired |
| | | private ITSysReformistService tSysReformistService; |
| | | |
| | | @Autowired |
| | | private ITSysIntegralService tSysIntegralService; |
| | | |
| | | @Autowired |
| | | private ITSysFaceDistinguishService tSysFaceDistinguishService; |
| | | |
| | | @Autowired |
| | | private ITSysPushOrderService tSysPushOrderService; |
| | | |
| | | @Autowired |
| | | private ITSysCancleOrderService tSysCancleOrderService; |
| | | |
| | | @Autowired |
| | | private ITPhoneService tPhoneService; |
| | | |
| | | |
| | | /** |
| | | * 跳转到系统设置首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index(Model model) { |
| | | //改派设置 |
| | | TSysReformist reformist = tSysReformistService.selectOne(new EntityWrapper<TSysReformist>().eq("companyId", ShiroKit.getUser().getObjectId())); |
| | | model.addAttribute("reformist",reformist); |
| | | //积分设置 |
| | | TSysIntegral integral = tSysIntegralService.selectOne(new EntityWrapper<TSysIntegral>().eq("companyId", ShiroKit.getUser().getObjectId())); |
| | | model.addAttribute("integral",integral); |
| | | //人脸识别 |
| | | TSysFaceDistinguish faceDistinguish = tSysFaceDistinguishService.selectOne(new EntityWrapper<TSysFaceDistinguish>().eq("companyId", ShiroKit.getUser().getObjectId())); |
| | | model.addAttribute("faceDistinguish",faceDistinguish); |
| | | |
| | | //专车推单(第一轮) |
| | | TSysPushOrder zcOne = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 1).eq("type", 1)); |
| | | model.addAttribute("zcOne",zcOne); |
| | | //专车推单(第二轮) |
| | | TSysPushOrder zcTwo = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 1).eq("type", 2)); |
| | | model.addAttribute("zcTwo",zcTwo); |
| | | //专车推单(第三轮) |
| | | TSysPushOrder zcThree = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 1).eq("type", 3)); |
| | | model.addAttribute("zcThree",zcThree); |
| | | |
| | | //接送机推单(第一轮) |
| | | TSysPushOrder jsjOne = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 7).eq("type", 1)); |
| | | model.addAttribute("jsjOne",jsjOne); |
| | | //接送机推单(第二轮) |
| | | TSysPushOrder jsjTwo = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 7).eq("type", 2)); |
| | | model.addAttribute("jsjTwo",jsjTwo); |
| | | //接送机推单(第三轮) |
| | | TSysPushOrder jsjThree = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 7).eq("type", 3)); |
| | | model.addAttribute("jsjThree",jsjThree); |
| | | |
| | | //普通取消设置(专车) |
| | | TSysCancleOrder ptCancel1 = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 1).eq("orderType", 1)); |
| | | model.addAttribute("ptCancel1",ptCancel1); |
| | | //普通取消设置(接送机) |
| | | TSysCancleOrder ptCancel2 = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 1).eq("orderType", 7)); |
| | | model.addAttribute("ptCancel2",ptCancel2); |
| | | //普通取消设置(跨城出行) |
| | | TSysCancleOrder ptCancel3 = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 1).eq("orderType", 3)); |
| | | model.addAttribute("ptCancel3",ptCancel3); |
| | | |
| | | //预约取消设置(专车) |
| | | TSysCancleOrder yyCancel1 = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 2).eq("orderType", 1)); |
| | | model.addAttribute("yyCancel1",yyCancel1); |
| | | //预约取消设置(接送机) |
| | | TSysCancleOrder yyCancel2 = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 2).eq("orderType", 7)); |
| | | model.addAttribute("yyCancel2",yyCancel2); |
| | | |
| | | //报警电话 |
| | | TPhone phone1 = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 1)); |
| | | model.addAttribute("phone1",phone1); |
| | | //客服电话 |
| | | TPhone phone2 = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 2)); |
| | | model.addAttribute("phone2",phone2); |
| | | //客服电话 |
| | | TPhone phone3 = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 3)); |
| | | model.addAttribute("phone3",phone3); |
| | | return PREFIX + "tSysReformist.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除系统设置 |
| | | */ |
| | | @RequestMapping(value = "/setUp") |
| | | @ResponseBody |
| | | public Object setUp(@RequestParam BigDecimal one, @RequestParam Integer two, @RequestParam Integer three, @RequestParam Integer openValue, |
| | | @RequestParam Integer isSpecialCar,@RequestParam Integer isTaxiCar,@RequestParam Integer isTransfer, |
| | | @RequestParam Double zc1,@RequestParam Integer zc2,@RequestParam Double zc3, |
| | | @RequestParam Double zc4,@RequestParam Integer zc5,@RequestParam Double zc6, |
| | | @RequestParam Double zc7,@RequestParam Integer zc8,@RequestParam Double zc9, |
| | | @RequestParam Double jsj1,@RequestParam Integer jsj2,@RequestParam Double jsj3, |
| | | @RequestParam Double jsj4,@RequestParam Integer jsj5,@RequestParam Double jsj6, |
| | | @RequestParam Double jsj7,@RequestParam Integer jsj8,@RequestParam Double jsj9, |
| | | @RequestParam Integer ptCancel1,@RequestParam BigDecimal ptCancel2,@RequestParam Integer ptCancel3,@RequestParam BigDecimal ptCancel4,@RequestParam Integer ptCancel5,@RequestParam BigDecimal ptCancel6, |
| | | @RequestParam Integer yyCancel1,@RequestParam BigDecimal yyCancel2,@RequestParam Integer yyCancel3,@RequestParam BigDecimal yyCancel4, |
| | | @RequestParam String phone1,@RequestParam String phone2,@RequestParam String phone3,@RequestParam String userQrCode,@RequestParam String driverQrCode) { |
| | | //改派设置 |
| | | TSysReformist reformist = tSysReformistService.selectOne(new EntityWrapper<TSysReformist>().eq("companyId", ShiroKit.getUser().getObjectId())); |
| | | if (SinataUtil.isNotEmpty(reformist)){ |
| | | reformist.setMoney(one); |
| | | reformist.setIsSpecialCar(isSpecialCar); |
| | | reformist.setIsTaxiCar(isTaxiCar); |
| | | reformist.setUserQrCode(userQrCode); |
| | | reformist.setDriverQrCode(driverQrCode); |
| | | tSysReformistService.updateById(reformist); |
| | | }else{ |
| | | reformist = new TSysReformist(); |
| | | reformist.setCompanyId(ShiroKit.getUser().getObjectId()); |
| | | reformist.setMoney(one); |
| | | reformist.setIsSpecialCar(isSpecialCar); |
| | | reformist.setIsTaxiCar(isTaxiCar); |
| | | reformist.setUserQrCode(userQrCode); |
| | | reformist.setDriverQrCode(driverQrCode); |
| | | tSysReformistService.insert(reformist); |
| | | } |
| | | |
| | | //积分设置 |
| | | TSysIntegral integral = tSysIntegralService.selectOne(new EntityWrapper<TSysIntegral>().eq("companyId", ShiroKit.getUser().getObjectId())); |
| | | if (SinataUtil.isNotEmpty(integral)){ |
| | | integral.setIntegral(two); |
| | | tSysIntegralService.updateById(integral); |
| | | }else{ |
| | | integral = new TSysIntegral(); |
| | | integral.setCompanyId(ShiroKit.getUser().getObjectId()); |
| | | integral.setIntegral(two); |
| | | tSysIntegralService.insert(integral); |
| | | } |
| | | |
| | | //人脸识别 |
| | | TSysFaceDistinguish faceDistinguish = tSysFaceDistinguishService.selectOne(new EntityWrapper<TSysFaceDistinguish>().eq("companyId", ShiroKit.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(ShiroKit.getUser().getObjectId()); |
| | | tSysFaceDistinguishService.insert(faceDistinguish); |
| | | } |
| | | |
| | | //专车推单(第一轮) |
| | | TSysPushOrder zcOne = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.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(ShiroKit.getUser().getObjectId()); |
| | | zcOne.setPushType(1); |
| | | zcOne.setType(1); |
| | | tSysPushOrderService.insert(zcOne); |
| | | } |
| | | //专车推单(第二轮) |
| | | TSysPushOrder zcTwo = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.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(ShiroKit.getUser().getObjectId()); |
| | | zcTwo.setPushType(1); |
| | | zcTwo.setType(2); |
| | | tSysPushOrderService.insert(zcTwo); |
| | | } |
| | | //专车推单(第三轮) |
| | | TSysPushOrder zcThree = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.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(ShiroKit.getUser().getObjectId()); |
| | | zcThree.setPushType(1); |
| | | zcThree.setType(3); |
| | | tSysPushOrderService.insert(zcThree); |
| | | } |
| | | |
| | | //接送机推单(第一轮) |
| | | TSysPushOrder jsjOne = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 7).eq("type", 1)); |
| | | if (SinataUtil.isNotEmpty(jsjOne)){ |
| | | jsjOne.setPushDistance(jsj1); |
| | | jsjOne.setPushTime(jsj2); |
| | | jsjOne.setDriverProportion(jsj3); |
| | | tSysPushOrderService.updateById(jsjOne); |
| | | }else{ |
| | | jsjOne = new TSysPushOrder(); |
| | | jsjOne.setPushDistance(jsj1); |
| | | jsjOne.setPushTime(jsj2); |
| | | jsjOne.setDriverProportion(jsj3); |
| | | jsjOne.setCompanyId(ShiroKit.getUser().getObjectId()); |
| | | jsjOne.setPushType(7); |
| | | jsjOne.setType(1); |
| | | tSysPushOrderService.insert(jsjOne); |
| | | } |
| | | //接送机推单(第二轮) |
| | | TSysPushOrder jsjTwo = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 7).eq("type", 2)); |
| | | if (SinataUtil.isNotEmpty(jsjTwo)){ |
| | | jsjTwo.setPushDistance(jsj4); |
| | | jsjTwo.setPushTime(jsj5); |
| | | jsjTwo.setDriverProportion(jsj6); |
| | | tSysPushOrderService.updateById(jsjTwo); |
| | | }else{ |
| | | jsjTwo = new TSysPushOrder(); |
| | | jsjTwo.setPushDistance(jsj4); |
| | | jsjTwo.setPushTime(jsj5); |
| | | jsjTwo.setDriverProportion(jsj6); |
| | | jsjTwo.setCompanyId(ShiroKit.getUser().getObjectId()); |
| | | jsjTwo.setPushType(7); |
| | | jsjTwo.setType(2); |
| | | tSysPushOrderService.insert(jsjTwo); |
| | | } |
| | | //接送机推单(第三轮) |
| | | TSysPushOrder jsjThree = tSysPushOrderService.selectOne(new EntityWrapper<TSysPushOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("pushType", 7).eq("type", 3)); |
| | | if (SinataUtil.isNotEmpty(jsjThree)){ |
| | | jsjThree.setPushDistance(jsj7); |
| | | jsjThree.setPushTime(jsj8); |
| | | jsjThree.setDriverProportion(jsj9); |
| | | tSysPushOrderService.updateById(jsjThree); |
| | | }else{ |
| | | jsjThree = new TSysPushOrder(); |
| | | jsjThree.setPushDistance(jsj7); |
| | | jsjThree.setPushTime(jsj8); |
| | | jsjThree.setDriverProportion(jsj9); |
| | | jsjThree.setCompanyId(ShiroKit.getUser().getObjectId()); |
| | | jsjThree.setPushType(7); |
| | | jsjThree.setType(3); |
| | | tSysPushOrderService.insert(jsjThree); |
| | | } |
| | | |
| | | //普通取消设置(专车) |
| | | TSysCancleOrder ptCancelOne = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.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(ShiroKit.getUser().getObjectId()); |
| | | ptCancelOne.setType(1); |
| | | ptCancelOne.setOrderType(1); |
| | | tSysCancleOrderService.insert(ptCancelOne); |
| | | } |
| | | |
| | | //普通取消设置(接送机) |
| | | TSysCancleOrder ptCancelTwo = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 1).eq("orderType", 7)); |
| | | 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(ShiroKit.getUser().getObjectId()); |
| | | ptCancelTwo.setType(1); |
| | | ptCancelTwo.setOrderType(7); |
| | | tSysCancleOrderService.insert(ptCancelTwo); |
| | | } |
| | | |
| | | //普通取消设置(跨城出行) |
| | | TSysCancleOrder ptCancelThree = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.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(ShiroKit.getUser().getObjectId()); |
| | | ptCancelThree.setType(1); |
| | | ptCancelThree.setOrderType(3); |
| | | tSysCancleOrderService.insert(ptCancelThree); |
| | | } |
| | | |
| | | //预约取消设置(专车) |
| | | TSysCancleOrder yyCancelOne = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.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(ShiroKit.getUser().getObjectId()); |
| | | yyCancelOne.setType(2); |
| | | yyCancelOne.setOrderType(1); |
| | | tSysCancleOrderService.insert(yyCancelOne); |
| | | } |
| | | //预约取消设置(接送机) |
| | | TSysCancleOrder yyCancelTwo = tSysCancleOrderService.selectOne(new EntityWrapper<TSysCancleOrder>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 2).eq("orderType", 7)); |
| | | 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(ShiroKit.getUser().getObjectId()); |
| | | yyCancelTwo.setType(2); |
| | | yyCancelTwo.setOrderType(7); |
| | | tSysCancleOrderService.insert(yyCancelTwo); |
| | | } |
| | | |
| | | //报警电话 |
| | | TPhone phoneOne = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 1)); |
| | | if (SinataUtil.isNotEmpty(phoneOne)){ |
| | | phoneOne.setPhone(phone1); |
| | | tPhoneService.updateById(phoneOne); |
| | | }else{ |
| | | phoneOne = new TPhone(); |
| | | phoneOne.setPhone(phone1); |
| | | phoneOne.setCompanyId(ShiroKit.getUser().getObjectId()); |
| | | phoneOne.setType(1); |
| | | if (ShiroKit.getUser().getRoleType() == 1){ |
| | | phoneOne.setPlatform(1); |
| | | }else{ |
| | | phoneOne.setPlatform(2); |
| | | } |
| | | tPhoneService.insert(phoneOne); |
| | | } |
| | | //客服电话 |
| | | TPhone phoneTwo = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 2)); |
| | | if (SinataUtil.isNotEmpty(phoneTwo)){ |
| | | phoneTwo.setPhone(phone2); |
| | | tPhoneService.updateById(phoneTwo); |
| | | }else{ |
| | | phoneTwo = new TPhone(); |
| | | phoneTwo.setPhone(phone2); |
| | | phoneTwo.setCompanyId(ShiroKit.getUser().getObjectId()); |
| | | phoneTwo.setType(2); |
| | | if (ShiroKit.getUser().getRoleType() == 1){ |
| | | phoneTwo.setPlatform(1); |
| | | }else{ |
| | | phoneTwo.setPlatform(2); |
| | | } |
| | | tPhoneService.insert(phoneTwo); |
| | | } |
| | | |
| | | //客服电话 |
| | | TPhone phone = tPhoneService.selectOne(new EntityWrapper<TPhone>().eq("companyId", ShiroKit.getUser().getObjectId()).eq("type", 3)); |
| | | if (SinataUtil.isNotEmpty(phone)){ |
| | | phone.setPhone(phone3); |
| | | tPhoneService.updateById(phone); |
| | | }else{ |
| | | phone = new TPhone(); |
| | | phone.setPhone(phone3); |
| | | phone.setCompanyId(ShiroKit.getUser().getObjectId()); |
| | | phone.setType(3); |
| | | if (ShiroKit.getUser().getRoleType() == 1){ |
| | | phone.setPlatform(1); |
| | | }else{ |
| | | phone.setPlatform(2); |
| | | } |
| | | tPhoneService.insert(phone); |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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 java.util.Date; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 敏感词管理控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-09 19:45:29 |
| | | */ |
| | | @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"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加敏感词管理 |
| | | */ |
| | | @RequestMapping("/tSysSensitiveWords_add") |
| | | public String tSysSensitiveWordsAdd() { |
| | | return PREFIX + "tSysSensitiveWords_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取敏感词管理列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @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 (ShiroKit.getUser().getRoleType() != 1){ |
| | | page.setRecords(null); |
| | | }else{ |
| | | page.setRecords(tSysSensitiveWordsService.getSensitiveWordList(page,beginTime,endTime,content)); |
| | | } |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 新增敏感词管理 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(TSysSensitiveWords tSysSensitiveWords) { |
| | | tSysSensitiveWords.setCreateTime(new Date()); |
| | | tSysSensitiveWordsService.insert(tSysSensitiveWords); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除敏感词管理 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tSysSensitiveWordsId) { |
| | | tSysSensitiveWordsService.deleteById(tSysSensitiveWordsId); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.base.tips.ErrorTip; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.util.*; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.ITCompanyService; |
| | | import com.stylefeng.guns.modular.system.util.HttpRequestUtil; |
| | | import com.stylefeng.guns.modular.system.util.PushURL; |
| | | import org.apache.commons.lang.time.DateUtils; |
| | | import org.apache.poi.ss.usermodel.Cell; |
| | | import org.apache.poi.ss.usermodel.Row; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | | import org.apache.poi.ss.usermodel.Workbook; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import com.stylefeng.guns.modular.system.service.ITUserService; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.multipart.MultipartHttpServletRequest; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | import java.text.DateFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 用户管理控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-01 15:47:58 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tUser") |
| | | public class TUserController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tUser/"; |
| | | |
| | | @Autowired |
| | | private ITUserService tUserService; |
| | | |
| | | /** |
| | | * 跳转到用户管理首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tUser.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改用户管理 |
| | | */ |
| | | @RequestMapping("/tUser_userDetail/{tUserId}") |
| | | public String tUser_userDetail(@PathVariable Integer tUserId, Model model) { |
| | | Map<String,Object> tUser = tUserService.getUserDetailById(tUserId); |
| | | model.addAttribute("item",tUser); |
| | | return PREFIX + "tUser_userDetail.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改用户余额页面 |
| | | */ |
| | | @RequestMapping("/tUser_updateBalance/{tUserId}") |
| | | public String tUser_updateBalance(@PathVariable Integer tUserId, Model model) { |
| | | model.addAttribute("tUserId",tUserId); |
| | | return PREFIX + "tUser_updateBalance.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改用户密码页面 |
| | | */ |
| | | @RequestMapping("/tUser_updatePassword/{tUserId}") |
| | | public String tUser_updatePassword(@PathVariable Integer tUserId, Model model) { |
| | | model.addAttribute("tUserId",tUserId); |
| | | return PREFIX + "tUser_updatePassword.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改用户状态页面 |
| | | */ |
| | | @RequestMapping("/tUser_optUser/{tUserId}/{optType}") |
| | | public String tUser_optUser(@PathVariable Integer tUserId,@PathVariable Integer optType, Model model) { |
| | | model.addAttribute("tUserId",tUserId); |
| | | model.addAttribute("optType",optType); |
| | | return PREFIX + "tUser_optUser.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取用户管理列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String insertTime, |
| | | String id, |
| | | String nickName, |
| | | String phone, |
| | | Integer isAuth, |
| | | Integer state,String companyName) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | 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(tUserService.getUserList(page,beginTime,endTime,ShiroKit.getUser().getRoleType(),ShiroKit.getUser().getObjectId(),isAuth,state,id,nickName,phone,companyName)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 修改余额操作 |
| | | */ |
| | | @RequestMapping(value = "/updateBalance") |
| | | @ResponseBody |
| | | public Object updateBalance(@RequestParam Integer tUserId, |
| | | @RequestParam Integer updateType, |
| | | @RequestParam BigDecimal money) { |
| | | TUser tUser = tUserService.selectById(tUserId); |
| | | 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){ |
| | | tUser.setBalance(new BigDecimal(0)); |
| | | }else{ |
| | | tUser.setBalance(tUser.getBalance().subtract(money)); |
| | | } |
| | | } |
| | | tUser.setUpdateTime(new Date()); |
| | | tUser.setUpdateUser(ShiroKit.getUser().getId()); |
| | | tUserService.updateById(tUser); |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改密码操作 |
| | | */ |
| | | @RequestMapping(value = "/updatePassword") |
| | | @ResponseBody |
| | | public Object updatePassword(@RequestParam Integer tUserId, |
| | | @RequestParam String password) { |
| | | TUser tUser = tUserService.selectById(tUserId); |
| | | if (SinataUtil.isNotEmpty(tUser)){ |
| | | // tUser.setPassWord(MD5Util.encrypt(password)); |
| | | tUser.setPassWord(ShiroKit.md5(password, "&a.s")); |
| | | tUser.setUpdateTime(new Date()); |
| | | tUser.setUpdateUser(ShiroKit.getUser().getId()); |
| | | tUserService.updateById(tUser); |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 操作用户 |
| | | */ |
| | | @RequestMapping(value = "/optUser") |
| | | @ResponseBody |
| | | 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()){ //冻结 |
| | | tUser.setState(2); |
| | | tUser.setRemark(remark); |
| | | |
| | | //增加推送 |
| | | 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()){ //解冻 |
| | | tUser.setState(1); |
| | | tUser.setRemark(remark); |
| | | } |
| | | tUser.setUpdateTime(new Date()); |
| | | tUser.setUpdateUser(ShiroKit.getUser().getId()); |
| | | tUserService.updateById(tUser); |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 下载模板 |
| | | * @param request |
| | | * @param response |
| | | */ |
| | | @RequestMapping(value = "/uploadUserModel") |
| | | public void uploadUserModel(HttpServletRequest request, HttpServletResponse response) { |
| | | // 表格数据【封装】 |
| | | List<List<String>> dataList = new ArrayList<List<String>>(); |
| | | |
| | | // 首行【封装】 |
| | | List<String> shellList = new ArrayList<String>(); |
| | | shellList.add("昵称"); |
| | | shellList.add("手机号"); |
| | | shellList.add("生日[例如:1995-09-09]"); |
| | | shellList.add("性别[男/女]"); |
| | | shellList.add("紧急联系人[选填]"); |
| | | shellList.add("紧急联系电话[选填]"); |
| | | shellList.add("是否实名认证[是/否]"); |
| | | shellList.add("真实姓名"); |
| | | shellList.add("身份证号"); |
| | | shellList.add("余额"); |
| | | shellList.add("密码[6-18个长度]"); |
| | | dataList.add(shellList); |
| | | |
| | | try { |
| | | // 调用工具类进行导出 |
| | | ExcelExportUtil.easySheet("平台导入用户模板"+DateUtil.formatDate(new Date(), "YYYYMMddHHmmss"), "平台导入用户模板", dataList, request, response); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 导入操作 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping(value="/exportUser",method = RequestMethod.POST) |
| | | @ResponseBody |
| | | public Object exportUser(HttpServletRequest request){ |
| | | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
| | | MultipartFile file = (MultipartFile) multipartRequest.getFile("myfile"); |
| | | try { |
| | | //定时五秒后执行 |
| | | /*Map<String,Object> maps=new HashMap<>(); |
| | | Workbook book = WoUtil.ImportFile(file); |
| | | maps.put("book",book); |
| | | QuartzManager.addJob(AddContract.class, (AddContract.name+new Date().getTime()).toUpperCase(), TimeJobType.ADMIN,DateUtil.getDate_strYMdHms(new Date().getTime() + 1*1000) , maps);*/ |
| | | |
| | | Workbook book = WoUtil.ImportFile(file); |
| | | Sheet sh = book.getSheetAt(0); //获取到第一个表 |
| | | for (int i = 1; i <= sh.getLastRowNum(); i++) { |
| | | Row row = sh.getRow(i); |
| | | |
| | | Cell cell0 = row.getCell(0); //昵称 |
| | | String nickName = null; |
| | | if (SinataUtil.isNotEmpty(cell0)){ |
| | | nickName = String.valueOf(cell0.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell1 = row.getCell(1); //手机号 |
| | | String phone = null; |
| | | if (SinataUtil.isNotEmpty(cell1)){ |
| | | phone = String.valueOf(cell1.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell2 = row.getCell(2); //生日[例如:1995-09-09] |
| | | String birthday = null; |
| | | if (SinataUtil.isNotEmpty(cell2)){ |
| | | birthday = String.valueOf(cell2.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell3 = row.getCell(3); //性别[男/女] |
| | | String sex = null; |
| | | if (SinataUtil.isNotEmpty(cell3)){ |
| | | sex = String.valueOf(cell3.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell4 = row.getCell(4); //紧急联系人[选填] |
| | | String emergencyContact = null; |
| | | if (SinataUtil.isNotEmpty(cell4)){ |
| | | emergencyContact = String.valueOf(cell4.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell5 = row.getCell(5); //紧急联系电话[选填] |
| | | String emergencyContactNumber = null; |
| | | if (SinataUtil.isNotEmpty(cell5)){ |
| | | emergencyContactNumber = String.valueOf(cell5.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell6 = row.getCell(6); //是否实名认证[是/否] |
| | | String isAuth = null; |
| | | if (SinataUtil.isNotEmpty(cell6)){ |
| | | isAuth = String.valueOf(cell6.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell7 = row.getCell(7); //真实姓名 |
| | | String name = null; |
| | | if (SinataUtil.isNotEmpty(cell7)){ |
| | | name = String.valueOf(cell7.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell8 = row.getCell(8); //身份证号 |
| | | String idCard = null; |
| | | if (SinataUtil.isNotEmpty(cell8)){ |
| | | idCard = String.valueOf(cell8.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell9 = row.getCell(9); //余额 |
| | | String balance = null; |
| | | if (SinataUtil.isNotEmpty(cell9)){ |
| | | balance = String.valueOf(cell9.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | Cell cell10 = row.getCell(10); //密码 |
| | | String passWord = null; |
| | | if (SinataUtil.isNotEmpty(cell10)){ |
| | | passWord = String.valueOf(cell10.getStringCellValue()).trim(); |
| | | } |
| | | |
| | | if (SinataUtil.isEmpty(nickName) || SinataUtil.isEmpty(phone) || SinataUtil.isEmpty(birthday) |
| | | || SinataUtil.isEmpty(sex) || SinataUtil.isEmpty(isAuth) || SinataUtil.isEmpty(balance) |
| | | || SinataUtil.isEmpty(passWord) ){ |
| | | return new ErrorTip(500, "单元格不能为空"); |
| | | }else{ |
| | | int count = tUserService.selectCount(new EntityWrapper<TUser>().eq("phone", phone).notIn("flag", 3)); |
| | | if (count > 0){ |
| | | return new ErrorTip(500, "手机号已存在,请重新填写"); |
| | | } |
| | | //判断性别 |
| | | if (!sex.equals("男") && !sex.equals("女")){ |
| | | return new ErrorTip(500, "性别内容不正确"); |
| | | } |
| | | //判断是否实名认证 |
| | | if (!isAuth.equals("是") && !isAuth.equals("否")){ |
| | | return new ErrorTip(500, "是否实名认证内容不正确"); |
| | | } |
| | | if ("是".equals(isAuth)){ |
| | | //判断紧急联系电话 |
| | | if (SinataUtil.isNotEmpty(emergencyContactNumber)){ |
| | | if (!isPhone(emergencyContactNumber)){ |
| | | return new ErrorTip(500, "紧急联系电话格式不正确"); |
| | | } |
| | | } |
| | | } |
| | | //判断生日格式 |
| | | try { |
| | | if (!isValidDate(birthday)) { |
| | | birthday = importByExcelForDate(birthday); |
| | | } |
| | | }catch (Exception e){ |
| | | return new ErrorTip(500, "年检到期时间格式不正确"); |
| | | } |
| | | //判断手机号 |
| | | if (!isPhone(phone)){ |
| | | return new ErrorTip(500, "手机号格式不正确"); |
| | | } |
| | | //判断余额 |
| | | if (!isDouble(balance)){ |
| | | return new ErrorTip(500, "余额格式不正确"); |
| | | } |
| | | //判断登录密码 |
| | | if (!isPassword(passWord)){ |
| | | return new ErrorTip(500, "登录密码格式不正确"); |
| | | } |
| | | TUser user = new TUser(); |
| | | TCompany company = itCompanyService.selectOne(new EntityWrapper<TCompany>().eq("type", 1).notIn("flag", 3).last(" limit 1")); |
| | | user.setCompanyId(company.getId()); |
| | | user.setPhone(phone); |
| | | user.setNickName(nickName); |
| | | user.setBirthday(DateUtil.parseDate(birthday)); |
| | | if (sex.equals("男")){ |
| | | user.setSex(1); |
| | | }else if (sex.equals("女")){ |
| | | user.setSex(2); |
| | | } |
| | | user.setEmergencyContact(emergencyContact); |
| | | user.setEmergencyContactNumber(emergencyContactNumber); |
| | | if ("是".equals(isAuth)){ |
| | | user.setIsAuth(2); |
| | | }else if ("否".equals(isAuth)){ |
| | | user.setIsAuth(1); |
| | | } |
| | | user.setName(name); |
| | | user.setIdCard(idCard); |
| | | user.setBalance(new BigDecimal(balance)); |
| | | user.setPassWord(ShiroKit.md5(passWord, "&a.s")); |
| | | user.setState(1); |
| | | user.setFlag("1"); |
| | | user.setInsertTime(new Date()); |
| | | user.setInsertUser(ShiroKit.getUser().getId()); |
| | | tUserService.insert(user); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | @Autowired |
| | | private ITCompanyService itCompanyService; |
| | | |
| | | /** |
| | | * 判断日期是否满足yyyy-MM-dd格式 |
| | | * @param str |
| | | * @return |
| | | */ |
| | | public static boolean isValidDate(String str) { |
| | | boolean convertSuccess=true; |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | try { |
| | | format.setLenient(false); |
| | | format.parse(str); |
| | | } catch (Exception e) { |
| | | convertSuccess=false; |
| | | } |
| | | return convertSuccess; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 转换日期 |
| | | * @return |
| | | */ |
| | | public static String importByExcelForDate(String value) {//value就是它的天数 |
| | | String currentCellValue = ""; |
| | | if(value != null && !value.equals("")){ |
| | | Calendar calendar = new GregorianCalendar(1900,0,-1); |
| | | Date d = calendar.getTime(); |
| | | Date dd = DateUtils.addDays(d,Integer.valueOf(value)); |
| | | DateFormat formater = new SimpleDateFormat("yyyy-MM-dd"); |
| | | currentCellValue = formater.format(dd); |
| | | } |
| | | return currentCellValue; |
| | | } |
| | | |
| | | /** |
| | | * 验证手机号格式是否正确 |
| | | * @param str |
| | | * @return |
| | | */ |
| | | public static boolean isPhone(String str) { |
| | | try{ |
| | | String reg = "^1\\d{10}$"; |
| | | boolean flag = str.matches(reg); |
| | | return flag; |
| | | }catch(NumberFormatException e) { |
| | | System.out.println("异常:\"" + str + "\"..."); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 验证密码长度是否正确 |
| | | * @param str |
| | | * @return |
| | | */ |
| | | public static boolean isPassword(String str) { |
| | | try{ |
| | | String reg = "^.{6,18}$"; |
| | | boolean flag = str.matches(reg); |
| | | return flag; |
| | | }catch(NumberFormatException e) { |
| | | System.out.println("异常:\"" + str + "\"..."); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 验证是否可以字符转为金额值 |
| | | * @param str |
| | | * @return |
| | | */ |
| | | public static boolean isDouble(String str) { |
| | | try{ |
| | | Double.parseDouble(str); |
| | | return true; |
| | | }catch(NumberFormatException e) { |
| | | System.out.println("异常:\"" + str + "\"不是数字/整数/小数..."); |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 导出用户信息 |
| | | */ |
| | | @RequestMapping(value = "/outUser") |
| | | public void outUser(HttpServletRequest request, HttpServletResponse response) { |
| | | List<Map<String,Object>> listMap = tUserService.getUserListNoPage(ShiroKit.getUser().getRoleType(),ShiroKit.getUser().getObjectId()); |
| | | |
| | | // 表格数据【封装】 |
| | | List<List<String>> dataList = new ArrayList<>(); |
| | | |
| | | //第一行显示【封装】 |
| | | List<String> twoList = new ArrayList<String>(); |
| | | twoList.add("总计:"); |
| | | twoList.add(String.valueOf(listMap.size())+"条"); |
| | | dataList.add(twoList); |
| | | |
| | | // 列【封装】 |
| | | List<String> shellList = new ArrayList<String>(); |
| | | shellList.add("注册时间"); |
| | | shellList.add("用户ID"); |
| | | shellList.add("注册地所属分公司"); |
| | | shellList.add("昵称"); |
| | | shellList.add("手机号"); |
| | | shellList.add("紧急联系人姓名"); |
| | | shellList.add("紧急联系人电话"); |
| | | shellList.add("是否实名认证"); |
| | | shellList.add("历史出行次数"); |
| | | shellList.add("历史消费"); |
| | | shellList.add("积分"); |
| | | shellList.add("备注"); |
| | | shellList.add("状态"); |
| | | dataList.add(shellList); |
| | | |
| | | for (Map<String,Object> object : listMap){ |
| | | // 详细数据列【封装】 |
| | | shellList = new ArrayList<String>(); |
| | | if(SinataUtil.isNotEmpty(object.get("insertTime"))){ |
| | | shellList.add(DateUtil.formatDate(DateUtil.parse(object.get("insertTime").toString(),"YYYY-MM-dd HH:mm:ss.S"), "YYYY-MM-dd HH:mm:ss")); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | shellList.add(String.valueOf(object.get("id"))); |
| | | if(SinataUtil.isNotEmpty(object.get("companyName"))){ |
| | | shellList.add(object.get("companyName").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("nickName"))){ |
| | | shellList.add(object.get("nickName").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("phone"))){ |
| | | shellList.add(object.get("phone").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("emergencyContact"))){ |
| | | shellList.add(object.get("emergencyContact").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("emergencyContactNumber"))){ |
| | | shellList.add(object.get("emergencyContactNumber").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("isAuth"))){ |
| | | shellList.add(object.get("isAuth").toString().equals("是")?"是":"否"); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("historyNum"))){ |
| | | shellList.add(object.get("historyNum").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("consumptionNum"))){ |
| | | shellList.add(object.get("consumptionNum").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("integral"))){ |
| | | shellList.add(object.get("integral").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("remark"))){ |
| | | shellList.add(object.get("remark").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("state"))){ |
| | | shellList.add(Integer.valueOf(object.get("state").toString()) == 1?"正常":"冻结"); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | dataList.add(shellList); |
| | | } |
| | | try { |
| | | // 调用工具类进行导出 |
| | | ExcelExportUtil.easySheet("用户信息导出记录"+DateUtil.formatDate(new Date(), "YYYYMMddHHmmss"), "用户信息导出记录", dataList,request, response); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.modular.system.service.IUserCouponRecordService; |
| | | 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.TUserRedPacketRecord; |
| | | import com.stylefeng.guns.modular.system.service.ITUserRedPacketRecordService; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-07-10 15:33:49 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tUserRedPacketRecord") |
| | | public class TUserRedPacketRecordController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tUserRedPacketRecord/"; |
| | | |
| | | @Autowired |
| | | private ITUserRedPacketRecordService tUserRedPacketRecordService; |
| | | |
| | | @Autowired |
| | | private IUserCouponRecordService userCouponRecordService; |
| | | |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index(Model model,Integer couponActivityId) { |
| | | model.addAttribute("couponActivityId",couponActivityId); |
| | | return PREFIX + "tUserRedPacketRecord.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加 |
| | | */ |
| | | @RequestMapping("/tUserRedPacketRecord_add") |
| | | public String tUserRedPacketRecordAdd() { |
| | | return PREFIX + "tUserRedPacketRecord_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改 |
| | | */ |
| | | @RequestMapping("/tUserRedPacketRecord_update/{tUserRedPacketRecordId}") |
| | | public String tUserRedPacketRecordUpdate(@PathVariable Integer tUserRedPacketRecordId, Model model) { |
| | | TUserRedPacketRecord tUserRedPacketRecord = tUserRedPacketRecordService.selectById(tUserRedPacketRecordId); |
| | | model.addAttribute("item",tUserRedPacketRecord); |
| | | LogObjectHolder.me().set(tUserRedPacketRecord); |
| | | return PREFIX + "tUserRedPacketRecord_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String createTime,String userName,String userPhone,Integer couponActivityId,Integer state) { |
| | | 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(); |
| | | page.setRecords(userCouponRecordService.getRedList(page,beginTime,endTime,userName,userPhone,couponActivityId,state)); |
| | | return super.packForBT(page); |
| | | } |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(TUserRedPacketRecord tUserRedPacketRecord) { |
| | | tUserRedPacketRecordService.insert(tUserRedPacketRecord); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tUserRedPacketRecordId) { |
| | | tUserRedPacketRecordService.deleteById(tUserRedPacketRecordId); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TUserRedPacketRecord tUserRedPacketRecord) { |
| | | tUserRedPacketRecordService.updateById(tUserRedPacketRecord); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @RequestMapping(value = "/detail/{tUserRedPacketRecordId}") |
| | | @ResponseBody |
| | | public Object detail(@PathVariable("tUserRedPacketRecordId") Integer tUserRedPacketRecordId) { |
| | | return tUserRedPacketRecordService.selectById(tUserRedPacketRecordId); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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.service.ITSystemNoticeService; |
| | | import com.stylefeng.guns.modular.system.service.ITUserService; |
| | | 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.TVerified; |
| | | import com.stylefeng.guns.modular.system.service.ITVerifiedService; |
| | | |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 实名认证列表控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-09 08:46:44 |
| | | */ |
| | | @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; |
| | | |
| | | /** |
| | | * 跳转到实名认证列表首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tVerified.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加实名认证列表 |
| | | */ |
| | | @RequestMapping("/tVerified_add") |
| | | public String tVerifiedAdd() { |
| | | return PREFIX + "tVerified_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改实名认证列表 |
| | | */ |
| | | @RequestMapping("/tVerified_immediately/{tVerifiedId}") |
| | | public String tVerifiedUpdate(@PathVariable Integer tVerifiedId, Model model) { |
| | | model.addAttribute("tVerifiedId",tVerifiedId); |
| | | return PREFIX + "tVerified_immediately.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取实名认证列表列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String insertTime, |
| | | String userName, |
| | | String userPhone, |
| | | String name, |
| | | Integer state) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | 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 (ShiroKit.getUser().getRoleType() != 1){ |
| | | page.setRecords(null); |
| | | }else{ |
| | | page.setRecords(tVerifiedService.getVerifiedList(page,beginTime,endTime,userName,userPhone,name,state)); |
| | | } |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 立即审核操作 |
| | | */ |
| | | @RequestMapping(value = "/immediately") |
| | | @ResponseBody |
| | | public Object immediately(@RequestParam Integer id,@RequestParam Integer state) { |
| | | if (SinataUtil.isNotEmpty(id) && SinataUtil.isNotEmpty(state)){ |
| | | TVerified tVerified = tVerifiedService.selectById(id); |
| | | tVerified.setState(state); |
| | | tVerifiedService.updateById(tVerified); |
| | | |
| | | //增加系统消息 |
| | | /*TSystemNotice notice = new TSystemNotice(); |
| | | notice.setType(2); |
| | | notice.setUserType(2); //todo |
| | | if (2 == state){ |
| | | notice.setContent("实名认证处理结果:【您的实名认证申请已通过审核】。"); |
| | | }else if (3 == state){ |
| | | notice.setContent("实名认证处理结果:【您的实名认证申请未通过审核】。"); |
| | | } |
| | | notice.setUserId(tVerified.getUserId()); |
| | | notice.setInsertTime(new Date()); |
| | | notice.setRead(1); |
| | | tSystemNoticeService.insert(notice);*/ |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除实名认证列表 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tVerifiedId) { |
| | | tVerifiedService.deleteById(tVerifiedId); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.config.properties.GunsProperties; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.util.ObsUploadUtil; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.model.TPubWithdrawal; |
| | | import com.stylefeng.guns.modular.system.util.OssUploadUtil; |
| | | import com.stylefeng.guns.modular.system.util.PushMinistryOfTransportUtil; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import com.stylefeng.guns.modular.system.model.TVersionManagement; |
| | | import com.stylefeng.guns.modular.system.service.ITVersionManagementService; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.multipart.MultipartHttpServletRequest; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.File; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * 版本管理控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-10 18:43:26 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tVersionManagement") |
| | | public class TVersionManagementController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tVersionManagement/"; |
| | | |
| | | @Autowired |
| | | private ITVersionManagementService tVersionManagementService; |
| | | |
| | | @Autowired |
| | | private PushMinistryOfTransportUtil pushMinistryOfTransportUtil; |
| | | |
| | | @Value("${pushMinistryOfTransport}") |
| | | private boolean pushMinistryOfTransport; |
| | | |
| | | /** |
| | | * 跳转到版本管理首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tVersionManagement.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到查看详情 |
| | | */ |
| | | @RequestMapping("/lookDetail/{id}/{type}") |
| | | public String lookDetail(@PathVariable Integer id, @PathVariable Integer type, Model model) { |
| | | TVersionManagement tVersionManagement = tVersionManagementService.selectById(id); |
| | | String str = ""; |
| | | if (1 == type){ |
| | | str = tVersionManagement.getContent(); |
| | | } |
| | | model.addAttribute("str",str); |
| | | return "/system/tComplaint/lookDetail.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加版本管理 |
| | | */ |
| | | @RequestMapping("/tVersionManagement_add") |
| | | public String tVersionManagementAdd() { |
| | | return PREFIX + "tVersionManagement_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改版本管理 |
| | | */ |
| | | @RequestMapping("/tVersionManagement_update/{tVersionManagementId}") |
| | | public String tVersionManagementUpdate(@PathVariable Integer tVersionManagementId, Model model) { |
| | | TVersionManagement tVersionManagement = tVersionManagementService.selectById(tVersionManagementId); |
| | | model.addAttribute("item",tVersionManagement); |
| | | LogObjectHolder.me().set(tVersionManagement); |
| | | return PREFIX + "tVersionManagement_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取版本管理列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String insertTime, |
| | | String version) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | 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 (ShiroKit.getUser().getRoleType() != 1){ |
| | | page.setRecords(null); |
| | | }else{ |
| | | page.setRecords(tVersionManagementService.getVersionList(page,beginTime,endTime,version)); |
| | | } |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | @Autowired |
| | | private GunsProperties gunsProperties; |
| | | |
| | | /** |
| | | * 异步上传包 |
| | | * @param myfile |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/saveApk") |
| | | public Map<String, Object> saveApk(@RequestPart("myfile") MultipartFile myfile, HttpServletRequest request){ |
| | | Map<String, Object> m = new HashMap<>(); |
| | | /*try { |
| | | String pictureName = UUID.randomUUID().toString() + "." + ToolUtil.getFileSuffix(file.getOriginalFilename()); |
| | | try { |
| | | String fileSavePath = gunsProperties.getFileUploadPath()+"apk\\"; |
| | | file.transferTo(new File(fileSavePath + pictureName)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | m.put("imgUrl", gunsProperties.getPictureServerAddress()+"apk/"+pictureName); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | }*/ |
| | | try { |
| | | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
| | | MultipartFile file = (MultipartFile) myfile; |
| | | |
| | | String pictureName = OssUploadUtil.ossUpload(request, file); |
| | | m.put("imgUrl", pictureName); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | return m; |
| | | } |
| | | |
| | | /** |
| | | * 新增版本管理 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(TVersionManagement tVersionManagement) { |
| | | //判断版本号是否相同 |
| | | int count = tVersionManagementService.selectCount( |
| | | new EntityWrapper<TVersionManagement>() |
| | | .eq("version", tVersionManagement.getVersion()) |
| | | .eq("type", tVersionManagement.getType())); |
| | | if (count > 0){ |
| | | return "error"; |
| | | } |
| | | |
| | | tVersionManagement.setInsertTime(new Date()); |
| | | tVersionManagementService.insert(tVersionManagement); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除版本管理 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tVersionManagementId) { |
| | | tVersionManagementService.deleteById(tVersionManagementId); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改版本管理 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TVersionManagement tVersionManagement) { |
| | | int count = tVersionManagementService.selectCount( |
| | | new EntityWrapper<TVersionManagement>() |
| | | .eq("version", tVersionManagement.getVersion()) |
| | | .eq("type", tVersionManagement.getType())); |
| | | if (count > 0){ |
| | | return "error"; |
| | | } |
| | | tVersionManagementService.updateById(tVersionManagement); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 版本管理详情 |
| | | */ |
| | | @RequestMapping(value = "/detail/{tVersionManagementId}") |
| | | @ResponseBody |
| | | public Object detail(@PathVariable("tVersionManagementId") Integer tVersionManagementId) { |
| | | return tVersionManagementService.selectById(tVersionManagementId); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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.UserActivityBalance; |
| | | import com.stylefeng.guns.modular.system.service.IUserActivityBalanceService; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-19 14:32:36 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/userActivityBalance") |
| | | public class UserActivityBalanceController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/userActivityBalance/"; |
| | | |
| | | @Autowired |
| | | private IUserActivityBalanceService userActivityBalanceService; |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "userActivityBalance.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加 |
| | | */ |
| | | @RequestMapping("/userActivityBalance_add") |
| | | public String userActivityBalanceAdd() { |
| | | return PREFIX + "userActivityBalance_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改 |
| | | */ |
| | | @RequestMapping("/userActivityBalance_update/{userActivityBalanceId}") |
| | | public String userActivityBalanceUpdate(@PathVariable Integer userActivityBalanceId, Model model) { |
| | | UserActivityBalance userActivityBalance = userActivityBalanceService.selectById(userActivityBalanceId); |
| | | model.addAttribute("item",userActivityBalance); |
| | | LogObjectHolder.me().set(userActivityBalance); |
| | | return PREFIX + "userActivityBalance_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String condition) { |
| | | return userActivityBalanceService.selectList(null); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(UserActivityBalance userActivityBalance) { |
| | | userActivityBalanceService.insert(userActivityBalance); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer userActivityBalanceId) { |
| | | userActivityBalanceService.deleteById(userActivityBalanceId); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(UserActivityBalance userActivityBalance) { |
| | | userActivityBalanceService.updateById(userActivityBalance); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @RequestMapping(value = "/detail/{userActivityBalanceId}") |
| | | @ResponseBody |
| | | public Object detail(@PathVariable("userActivityBalanceId") Integer userActivityBalanceId) { |
| | | return userActivityBalanceService.selectById(userActivityBalanceId); |
| | | } |
| | | } |
New file |
| | |
| | | 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.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.page.PageInfoBT; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.shiro.ShiroUser; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | 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 java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-19 14:32:29 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/userActivity") |
| | | public class UserActivityController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/userActivity/"; |
| | | |
| | | @Autowired |
| | | private IUserActivityService userActivityService; |
| | | |
| | | @Autowired |
| | | private IUserActivityBalanceService userActivityBalanceService; |
| | | |
| | | @Autowired |
| | | private IUserActivityDiscount1Service userActivityDiscount1Service; |
| | | |
| | | @Autowired |
| | | private IUserActivityInviteService userActivityInviteService; |
| | | |
| | | @Autowired |
| | | private IUserActivityRedenvelopeService userActivityRedenvelopeService; |
| | | |
| | | @Autowired |
| | | private IUserActivityRegisteredService userActivityRegisteredService; |
| | | |
| | | @Autowired |
| | | private ISysCouponRecordService sysCouponRecordService; |
| | | |
| | | @Autowired |
| | | private ISysRedPacketRecordService sysRedPacketRecordService; |
| | | |
| | | @Autowired |
| | | private IUserCouponRecordService userCouponRecordService; |
| | | |
| | | @Autowired |
| | | private ITUserRedPacketRecordService redPacketRecordService; |
| | | |
| | | /** |
| | | * 跳转领取统计 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/receiveRecord") |
| | | 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())); |
| | | model.addAttribute("endTime", sdf.format(userActivity.getEndTime())); |
| | | UserActivityRegistered userActivityRegistered = userActivityRegisteredService.selectOne(new EntityWrapper<UserActivityRegistered>().eq("userActivityId",activityId)); |
| | | UserActivityInvite userActivityInvite = userActivityInviteService.selectOne(new EntityWrapper<UserActivityInvite>().eq("userActivityId",activityId)); |
| | | UserActivityDiscount1 userActivityDiscount1 = userActivityDiscount1Service.selectOne(new EntityWrapper<UserActivityDiscount1>().eq("userActivityId",activityId)); |
| | | UserActivityRedenvelope userActivityRedenvelope = userActivityRedenvelopeService.selectOne(new EntityWrapper<UserActivityRedenvelope>().eq("userActivityId",activityId)); |
| | | if(SinataUtil.isNotEmpty(userActivityRegistered)){ |
| | | model.addAttribute("userActivityRegisteredId",userActivityRegistered.getId()); |
| | | }else{ |
| | | model.addAttribute("userActivityRegisteredId",0); |
| | | } |
| | | if(SinataUtil.isNotEmpty(userActivityInvite)){ |
| | | model.addAttribute("userActivityInviteId",userActivityInvite.getId()); |
| | | }else{ |
| | | model.addAttribute("userActivityInviteId",0); |
| | | } |
| | | if(SinataUtil.isNotEmpty(userActivityDiscount1)){ |
| | | model.addAttribute("userActivityDiscount1Id",userActivityDiscount1.getId()); |
| | | }else{ |
| | | model.addAttribute("userActivityDiscount1Id",0); |
| | | } |
| | | if(SinataUtil.isNotEmpty(userActivityRedenvelope)){ |
| | | model.addAttribute("userActivityRedenvelopeId",userActivityRedenvelope.getId()); |
| | | }else{ |
| | | model.addAttribute("userActivityRedenvelopeId",0); |
| | | } |
| | | return PREFIX + "receiveRecord.html"; |
| | | } |
| | | |
| | | @RequestMapping(value = "/receiveRecordDetail") |
| | | @ResponseBody |
| | | public Object receiveRecordDetail(String createTime,Integer activityId) { |
| | | String startTimes = null; |
| | | String endTimes = null; |
| | | if (SinataUtil.isNotEmpty(createTime)){ |
| | | String[] timeArray = createTime.split(" - "); |
| | | startTimes = timeArray[0]; |
| | | endTimes = timeArray[1]; |
| | | }else{ |
| | | UserActivity userActivity = userActivityService.selectById(activityId); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | startTimes=sdf.format(userActivity.getStartTime()); |
| | | endTimes=sdf.format(userActivity.getEndTime()); |
| | | } |
| | | Map<String,Object> map = new HashMap<>(); |
| | | Double totalMOney=0d; |
| | | UserActivityRegistered userActivityRegistered = userActivityRegisteredService.selectOne(new EntityWrapper<UserActivityRegistered>().eq("userActivityId",activityId)); |
| | | UserActivityInvite userActivityInvite = userActivityInviteService.selectOne(new EntityWrapper<UserActivityInvite>().eq("userActivityId",activityId)); |
| | | UserActivityDiscount1 userActivityDiscount1 = userActivityDiscount1Service.selectOne(new EntityWrapper<UserActivityDiscount1>().eq("userActivityId",activityId)); |
| | | UserActivityRedenvelope userActivityRedenvelope = userActivityRedenvelopeService.selectOne(new EntityWrapper<UserActivityRedenvelope>().eq("userActivityId",activityId)); |
| | | if(SinataUtil.isNotEmpty(userActivityRegistered)){ |
| | | Map<String,Object> resultMap = userCouponRecordService.getCouponStatic(startTimes,endTimes,userActivityRegistered.getId(),2); |
| | | totalMOney+=Double.parseDouble(resultMap.get("money").toString()); |
| | | map.put("userActivityRegisteredMoney",resultMap.get("money")); |
| | | map.put("userActivityRegisteredNumber",resultMap.get("number")); |
| | | map.put("userActivityRegisteredUseMoney",resultMap.get("useMoney")); |
| | | }else{ |
| | | map.put("userActivityRegisteredMoney",0); |
| | | map.put("userActivityRegisteredNumber",0); |
| | | map.put("userActivityRegisteredUseMoney",0); |
| | | } |
| | | if(SinataUtil.isNotEmpty(userActivityInvite)){ |
| | | Map<String,Object> resultMap = userCouponRecordService.getCouponStatic(startTimes,endTimes,userActivityInvite.getId(),3); |
| | | totalMOney+=Double.parseDouble(resultMap.get("money").toString()); |
| | | map.put("userActivityInviteMoney",resultMap.get("money")); |
| | | map.put("userActivityInviteNumber",resultMap.get("number")); |
| | | map.put("userActivityInviteUseMoney",resultMap.get("useMoney")); |
| | | }else{ |
| | | map.put("userActivityInviteMoney",0); |
| | | map.put("userActivityInviteNumber",0); |
| | | map.put("userActivityInviteUseMoney",0); |
| | | } |
| | | if(SinataUtil.isNotEmpty(userActivityDiscount1)){ |
| | | Map<String,Object> resultMap = userCouponRecordService.getDiscountStatic(startTimes,endTimes,userActivityDiscount1.getId()); |
| | | map.put("userActivityDiscount1Money",resultMap.get("money")); |
| | | map.put("userActivityDiscount1Number",resultMap.get("number")); |
| | | }else{ |
| | | map.put("userActivityDiscount1Money",0); |
| | | map.put("userActivityDiscount1Number",0); |
| | | } |
| | | if(SinataUtil.isNotEmpty(userActivityRedenvelope)){ |
| | | Map<String,Object> resultMap = userCouponRecordService.getRedStatic(startTimes,endTimes,userActivityRedenvelope.getId()); |
| | | totalMOney+=Double.parseDouble(resultMap.get("money").toString()); |
| | | map.put("userActivityRedenvelopeMoney",resultMap.get("money")); |
| | | map.put("userActivityRedenvelopeNumber",resultMap.get("number")); |
| | | map.put("userActivityRedenvelopeUseMoney",resultMap.get("useMoney")); |
| | | }else{ |
| | | map.put("userActivityRedenvelopeMoney",0); |
| | | map.put("userActivityRedenvelopeNumber",0); |
| | | map.put("userActivityRedenvelopeUseMoney",0); |
| | | } |
| | | Map<String,Object> resultMap = userCouponRecordService.getRegStatic(startTimes,endTimes,activityId); |
| | | |
| | | totalMOney+=Double.parseDouble(resultMap.get("money").toString()); |
| | | map.put("totalMOney",totalMOney); |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "userActivity.html"; |
| | | } |
| | | /** |
| | | * 跳转添加注册送优惠券页面 |
| | | * @return |
| | | */ |
| | | @RequestMapping("addRegist") |
| | | public String addRegist() { |
| | | return PREFIX + "addRegist.html"; |
| | | } |
| | | /** |
| | | * 跳转红包选择页面 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/sysRedPacketRecord") |
| | | public String sysRedPacketRecord() { |
| | | return PREFIX + "sysRedPacketRecord.html"; |
| | | } |
| | | /** |
| | | * 跳转到选择优惠券页面 |
| | | * @return |
| | | */ |
| | | @RequestMapping("/sysCouponRecord") |
| | | public String sysCouponRecord() { |
| | | return PREFIX + "sysCouponRecord.html"; |
| | | } |
| | | |
| | | @RequestMapping("/sysCouponRecord1") |
| | | public String sysCouponRecord1() { |
| | | return PREFIX + "sysCouponRecord1.html"; |
| | | } |
| | | @RequestMapping("/sysCouponRecord2") |
| | | public String sysCouponRecord2(Model model,Integer type) { |
| | | model.addAttribute("type",type); |
| | | return PREFIX + "sysCouponRecord2.html"; |
| | | } |
| | | /** |
| | | * 跳转到添加 |
| | | */ |
| | | @RequestMapping("/userActivity_add") |
| | | public String userActivityAdd() { |
| | | return PREFIX + "userActivity_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改 |
| | | */ |
| | | @RequestMapping("/userActivity_update/{userActivityId}") |
| | | public String userActivityUpdate(@PathVariable Integer userActivityId, Model model) { |
| | | UserActivity userActivity = userActivityService.selectById(userActivityId); |
| | | model.addAttribute("item",userActivity); |
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | model.addAttribute("startTime", sdf.format(userActivity.getStartTime())); |
| | | model.addAttribute("endTime", sdf.format(userActivity.getEndTime())); |
| | | UserActivityRegistered userActivityRegistered = userActivityRegisteredService.selectOne(new EntityWrapper<UserActivityRegistered>().eq("userActivityId",userActivity.getId())); |
| | | model.addAttribute("item1",userActivityRegistered); |
| | | if(userActivityRegistered!=null){ |
| | | model.addAttribute("item1Coupon",sysCouponRecordService.selectById(userActivityRegistered.getCouponId())); |
| | | } |
| | | UserActivityInvite userActivityInvite = userActivityInviteService.selectOne(new EntityWrapper<UserActivityInvite>().eq("userActivityId",userActivity.getId())); |
| | | model.addAttribute("item2",userActivityInvite); |
| | | if(userActivityInvite!=null){ |
| | | model.addAttribute("item2Coupon",sysCouponRecordService.selectById(userActivityInvite.getCouponId())); |
| | | } |
| | | List<UserActivityBalance> balanceInfoList = userActivityBalanceService.selectList(new EntityWrapper<UserActivityBalance>().eq("userActivityId",userActivity.getId())); |
| | | model.addAttribute("balanceInfoList",balanceInfoList); |
| | | model.addAttribute("item4",userActivityDiscount1Service.selectOne(new EntityWrapper<UserActivityDiscount1>().eq("userActivityId",userActivity.getId()))); |
| | | UserActivityRedenvelope userActivityRedenvelope = userActivityRedenvelopeService.selectOne(new EntityWrapper<UserActivityRedenvelope>().eq("userActivityId",userActivity.getId())); |
| | | model.addAttribute("item5",userActivityRedenvelope); |
| | | if(userActivityRedenvelope!=null){ |
| | | model.addAttribute("item5Red",sysRedPacketRecordService.selectById(userActivityRedenvelope.getRedEnvelopeId())); |
| | | } |
| | | LogObjectHolder.me().set(userActivity); |
| | | return PREFIX + "userActivity_edit.html"; |
| | | } |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | | @RequestMapping(value = "/blanceList") |
| | | @ResponseBody |
| | | public Object blanceList(String createTime,Integer activityId) { |
| | | ShiroUser user = ShiroKit.getUser(); |
| | | 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(); |
| | | page.setRecords(userCouponRecordService.getBlanceList(page,beginTime,endTime,activityId)); |
| | | return super.packForBT(page); |
| | | } |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String createTime,String name,Integer status, Integer offset, Integer limit) { |
| | | 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"); |
| | | } |
| | | Integer uid = ShiroKit.getUser().getId(); |
| | | return userActivityService.queryUserActivityList(uid, startTimes, endTimes, name, status, offset, limit); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param name 活动时间 |
| | | * @param startTime 时间区间 |
| | | * @param registCouponId 注册活动-优惠券id |
| | | * @param registEnable 注册活动-是否启动(1=不启动,2=启动) |
| | | * @param registNumber 注册活动-优惠券数量 |
| | | * @param registEffective 注册活动-优惠券有效期 |
| | | * @param inviteCouponId 邀请活动-优惠券id |
| | | * @param inviteEnable 邀请活动-是否启动(1=不启动,2=启动) |
| | | * @param inviteNumber 邀请活动-优惠券数量 |
| | | * @param inviteEffective 邀请活动-优惠券有效期 |
| | | * @param balanceEnable 充值活动-是否启动(1=不启动,2=启动) |
| | | * @param balanceInfo 充值活动-详情 |
| | | * @param discountEnable 折扣活动-是否启动(1=不启动,2=启动) |
| | | * @param discountSpecial 折扣活动-专车 |
| | | * @param discountTaxi 折扣活动-出租车 |
| | | * @param discountLogistics 折扣活动-小件物流 |
| | | * @param redenvelopeId -红包活动-红包id |
| | | * @param redenvelopeEnable 红包活动-是否启动(1=不启动,2=启动) |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(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) { |
| | | userActivityService.insertOrUpdate(null,name,startTime, registCouponId, |
| | | registEnable, registNumber, registEffective, |
| | | inviteCouponId, inviteEnable, inviteNumber, inviteEffective, |
| | | balanceEnable, balanceInfo, |
| | | discountEnable, discountSpecial, discountTaxi, discountLogistics, |
| | | redenvelopeId, redenvelopeEnable, registerPrice, invitationPrice, redPrice); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer userActivityId) { |
| | | userActivityService.deleteById(userActivityId); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param name 活动时间 |
| | | * @param startTime 时间区间 |
| | | * @param registCouponId 注册活动-优惠券id |
| | | * @param registEnable 注册活动-是否启动(1=不启动,2=启动) |
| | | * @param registNumber 注册活动-优惠券数量 |
| | | * @param registEffective 注册活动-优惠券有效期 |
| | | * @param inviteCouponId 邀请活动-优惠券id |
| | | * @param inviteEnable 邀请活动-是否启动(1=不启动,2=启动) |
| | | * @param inviteNumber 邀请活动-优惠券数量 |
| | | * @param inviteEffective 邀请活动-优惠券有效期 |
| | | * @param balanceEnable 充值活动-是否启动(1=不启动,2=启动) |
| | | * @param balanceInfo 充值活动-详情 |
| | | * @param discountEnable 折扣活动-是否启动(1=不启动,2=启动) |
| | | * @param discountSpecial 折扣活动-专车 |
| | | * @param discountTaxi 折扣活动-出租车 |
| | | * @param discountLogistics 折扣活动-小件物流 |
| | | * @param redenvelopeId -红包活动-红包id |
| | | * @param redenvelopeEnable 红包活动-是否启动(1=不启动,2=启动) |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(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) { |
| | | userActivityService.insertOrUpdate(id,name,startTime, registCouponId, |
| | | registEnable, registNumber, registEffective, |
| | | inviteCouponId, inviteEnable, inviteNumber, inviteEffective, |
| | | balanceEnable, balanceInfo, |
| | | discountEnable, discountSpecial, discountTaxi, discountLogistics, |
| | | redenvelopeId, redenvelopeEnable, registerPrice, invitationPrice, redPrice); |
| | | return SUCCESS_TIP; |
| | | } |
| | | /** |
| | | * 修改状态 |
| | | * @param driverActivity |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/updateStatus") |
| | | @ResponseBody |
| | | public Object updateStatus(UserActivity driverActivity) { |
| | | userActivityService.updateById(driverActivity); |
| | | return SUCCESS_TIP; |
| | | } |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @RequestMapping(value = "/userActivity_detail/{userActivityId}") |
| | | public Object detail(@PathVariable("userActivityId") Integer userActivityId,Model model) { |
| | | UserActivity userActivity = userActivityService.selectById(userActivityId); |
| | | model.addAttribute("item",userActivity); |
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | model.addAttribute("startTime", sdf.format(userActivity.getStartTime())); |
| | | model.addAttribute("endTime", sdf.format(userActivity.getEndTime())); |
| | | UserActivityRegistered userActivityRegistered = userActivityRegisteredService.selectOne(new EntityWrapper<UserActivityRegistered>().eq("userActivityId",userActivity.getId())); |
| | | model.addAttribute("item1",userActivityRegistered); |
| | | if(userActivityRegistered!=null){ |
| | | model.addAttribute("item1Coupon",sysCouponRecordService.selectById(userActivityRegistered.getCouponId())); |
| | | } |
| | | UserActivityInvite userActivityInvite = userActivityInviteService.selectOne(new EntityWrapper<UserActivityInvite>().eq("userActivityId",userActivity.getId())); |
| | | model.addAttribute("item2",userActivityInvite); |
| | | if(userActivityInvite!=null){ |
| | | model.addAttribute("item2Coupon",sysCouponRecordService.selectById(userActivityInvite.getCouponId())); |
| | | } |
| | | List<UserActivityBalance> balanceInfoList = userActivityBalanceService.selectList(new EntityWrapper<UserActivityBalance>().eq("userActivityId",userActivity.getId())); |
| | | model.addAttribute("balanceInfoList",balanceInfoList); |
| | | model.addAttribute("item4",userActivityDiscount1Service.selectOne(new EntityWrapper<UserActivityDiscount1>().eq("userActivityId",userActivity.getId()))); |
| | | UserActivityRedenvelope userActivityRedenvelope = userActivityRedenvelopeService.selectOne(new EntityWrapper<UserActivityRedenvelope>().eq("userActivityId",userActivity.getId())); |
| | | model.addAttribute("item5",userActivityRedenvelope); |
| | | if(userActivityRedenvelope!=null){ |
| | | model.addAttribute("item5Red",sysRedPacketRecordService.selectById(userActivityRedenvelope.getRedEnvelopeId())); |
| | | } |
| | | return PREFIX + "userActivity_detail.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到立即处理页面 |
| | | */ |
| | | @RequestMapping("/userActivity_immediately/{id}") |
| | | public String userActivityImmediately(@PathVariable Integer id, Model model) { |
| | | model.addAttribute("id",id); |
| | | return PREFIX + "userActivity_immediately.html"; |
| | | } |
| | | /** |
| | | * 立即处理操作 |
| | | */ |
| | | @RequestMapping(value = "/immediately") |
| | | @ResponseBody |
| | | public Object immediately(@RequestParam Integer id,@RequestParam Integer state,@RequestParam String remark) { |
| | | UserActivity userActivity = userActivityService.selectById(id); |
| | | if (SinataUtil.isNotEmpty(userActivity)){ |
| | | userActivity.setStatus(state); |
| | | userActivity.setRemark(remark); |
| | | userActivityService.updateById(userActivity); |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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.UserActivityDiscount1; |
| | | import com.stylefeng.guns.modular.system.service.IUserActivityDiscount1Service; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-19 14:32:41 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/userActivityDiscount1") |
| | | public class UserActivityDiscount1Controller extends BaseController { |
| | | |
| | | private String PREFIX = "/system/userActivityDiscount1/"; |
| | | |
| | | @Autowired |
| | | private IUserActivityDiscount1Service userActivityDiscount1Service; |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "userActivityDiscount1.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加 |
| | | */ |
| | | @RequestMapping("/userActivityDiscount1_add") |
| | | public String userActivityDiscount1Add() { |
| | | return PREFIX + "userActivityDiscount1_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改 |
| | | */ |
| | | @RequestMapping("/userActivityDiscount1_update/{userActivityDiscount1Id}") |
| | | public String userActivityDiscount1Update(@PathVariable Integer userActivityDiscount1Id, Model model) { |
| | | UserActivityDiscount1 userActivityDiscount1 = userActivityDiscount1Service.selectById(userActivityDiscount1Id); |
| | | model.addAttribute("item",userActivityDiscount1); |
| | | LogObjectHolder.me().set(userActivityDiscount1); |
| | | return PREFIX + "userActivityDiscount1_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String condition) { |
| | | return userActivityDiscount1Service.selectList(null); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(UserActivityDiscount1 userActivityDiscount1) { |
| | | userActivityDiscount1Service.insert(userActivityDiscount1); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer userActivityDiscount1Id) { |
| | | userActivityDiscount1Service.deleteById(userActivityDiscount1Id); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(UserActivityDiscount1 userActivityDiscount1) { |
| | | userActivityDiscount1Service.updateById(userActivityDiscount1); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @RequestMapping(value = "/detail/{userActivityDiscount1Id}") |
| | | @ResponseBody |
| | | public Object detail(@PathVariable("userActivityDiscount1Id") Integer userActivityDiscount1Id) { |
| | | return userActivityDiscount1Service.selectById(userActivityDiscount1Id); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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.UserActivityDiscount2; |
| | | import com.stylefeng.guns.modular.system.service.IUserActivityDiscount2Service; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-19 14:32:46 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/userActivityDiscount2") |
| | | public class UserActivityDiscount2Controller extends BaseController { |
| | | |
| | | private String PREFIX = "/system/userActivityDiscount2/"; |
| | | |
| | | @Autowired |
| | | private IUserActivityDiscount2Service userActivityDiscount2Service; |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "userActivityDiscount2.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加 |
| | | */ |
| | | @RequestMapping("/userActivityDiscount2_add") |
| | | public String userActivityDiscount2Add() { |
| | | return PREFIX + "userActivityDiscount2_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改 |
| | | */ |
| | | @RequestMapping("/userActivityDiscount2_update/{userActivityDiscount2Id}") |
| | | public String userActivityDiscount2Update(@PathVariable Integer userActivityDiscount2Id, Model model) { |
| | | UserActivityDiscount2 userActivityDiscount2 = userActivityDiscount2Service.selectById(userActivityDiscount2Id); |
| | | model.addAttribute("item",userActivityDiscount2); |
| | | LogObjectHolder.me().set(userActivityDiscount2); |
| | | return PREFIX + "userActivityDiscount2_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String condition) { |
| | | return userActivityDiscount2Service.selectList(null); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(UserActivityDiscount2 userActivityDiscount2) { |
| | | userActivityDiscount2Service.insert(userActivityDiscount2); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer userActivityDiscount2Id) { |
| | | userActivityDiscount2Service.deleteById(userActivityDiscount2Id); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(UserActivityDiscount2 userActivityDiscount2) { |
| | | userActivityDiscount2Service.updateById(userActivityDiscount2); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @RequestMapping(value = "/detail/{userActivityDiscount2Id}") |
| | | @ResponseBody |
| | | public Object detail(@PathVariable("userActivityDiscount2Id") Integer userActivityDiscount2Id) { |
| | | return userActivityDiscount2Service.selectById(userActivityDiscount2Id); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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.UserActivityInvite; |
| | | import com.stylefeng.guns.modular.system.service.IUserActivityInviteService; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-19 14:32:57 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/userActivityInvite") |
| | | public class UserActivityInviteController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/userActivityInvite/"; |
| | | |
| | | @Autowired |
| | | private IUserActivityInviteService userActivityInviteService; |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "userActivityInvite.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加 |
| | | */ |
| | | @RequestMapping("/userActivityInvite_add") |
| | | public String userActivityInviteAdd() { |
| | | return PREFIX + "userActivityInvite_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改 |
| | | */ |
| | | @RequestMapping("/userActivityInvite_update/{userActivityInviteId}") |
| | | public String userActivityInviteUpdate(@PathVariable Integer userActivityInviteId, Model model) { |
| | | UserActivityInvite userActivityInvite = userActivityInviteService.selectById(userActivityInviteId); |
| | | model.addAttribute("item",userActivityInvite); |
| | | LogObjectHolder.me().set(userActivityInvite); |
| | | return PREFIX + "userActivityInvite_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String condition) { |
| | | return userActivityInviteService.selectList(null); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(UserActivityInvite userActivityInvite) { |
| | | userActivityInviteService.insert(userActivityInvite); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer userActivityInviteId) { |
| | | userActivityInviteService.deleteById(userActivityInviteId); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(UserActivityInvite userActivityInvite) { |
| | | userActivityInviteService.updateById(userActivityInvite); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @RequestMapping(value = "/detail/{userActivityInviteId}") |
| | | @ResponseBody |
| | | public Object detail(@PathVariable("userActivityInviteId") Integer userActivityInviteId) { |
| | | return userActivityInviteService.selectById(userActivityInviteId); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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.UserActivityRedenvelope; |
| | | import com.stylefeng.guns.modular.system.service.IUserActivityRedenvelopeService; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-19 14:33:03 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/userActivityRedenvelope") |
| | | public class UserActivityRedenvelopeController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/userActivityRedenvelope/"; |
| | | |
| | | @Autowired |
| | | private IUserActivityRedenvelopeService userActivityRedenvelopeService; |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "userActivityRedenvelope.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加 |
| | | */ |
| | | @RequestMapping("/userActivityRedenvelope_add") |
| | | public String userActivityRedenvelopeAdd() { |
| | | return PREFIX + "userActivityRedenvelope_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改 |
| | | */ |
| | | @RequestMapping("/userActivityRedenvelope_update/{userActivityRedenvelopeId}") |
| | | public String userActivityRedenvelopeUpdate(@PathVariable Integer userActivityRedenvelopeId, Model model) { |
| | | UserActivityRedenvelope userActivityRedenvelope = userActivityRedenvelopeService.selectById(userActivityRedenvelopeId); |
| | | model.addAttribute("item",userActivityRedenvelope); |
| | | LogObjectHolder.me().set(userActivityRedenvelope); |
| | | return PREFIX + "userActivityRedenvelope_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String condition) { |
| | | return userActivityRedenvelopeService.selectList(null); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(UserActivityRedenvelope userActivityRedenvelope) { |
| | | userActivityRedenvelopeService.insert(userActivityRedenvelope); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer userActivityRedenvelopeId) { |
| | | userActivityRedenvelopeService.deleteById(userActivityRedenvelopeId); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(UserActivityRedenvelope userActivityRedenvelope) { |
| | | userActivityRedenvelopeService.updateById(userActivityRedenvelope); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @RequestMapping(value = "/detail/{userActivityRedenvelopeId}") |
| | | @ResponseBody |
| | | public Object detail(@PathVariable("userActivityRedenvelopeId") Integer userActivityRedenvelopeId) { |
| | | return userActivityRedenvelopeService.selectById(userActivityRedenvelopeId); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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.UserActivityRegistered; |
| | | import com.stylefeng.guns.modular.system.service.IUserActivityRegisteredService; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-19 14:33:09 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/userActivityRegistered") |
| | | public class UserActivityRegisteredController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/userActivityRegistered/"; |
| | | |
| | | @Autowired |
| | | private IUserActivityRegisteredService userActivityRegisteredService; |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "userActivityRegistered.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加 |
| | | */ |
| | | @RequestMapping("/userActivityRegistered_add") |
| | | public String userActivityRegisteredAdd() { |
| | | return PREFIX + "userActivityRegistered_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改 |
| | | */ |
| | | @RequestMapping("/userActivityRegistered_update/{userActivityRegisteredId}") |
| | | public String userActivityRegisteredUpdate(@PathVariable Integer userActivityRegisteredId, Model model) { |
| | | UserActivityRegistered userActivityRegistered = userActivityRegisteredService.selectById(userActivityRegisteredId); |
| | | model.addAttribute("item",userActivityRegistered); |
| | | LogObjectHolder.me().set(userActivityRegistered); |
| | | return PREFIX + "userActivityRegistered_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String condition) { |
| | | return userActivityRegisteredService.selectList(null); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(UserActivityRegistered userActivityRegistered) { |
| | | userActivityRegisteredService.insert(userActivityRegistered); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer userActivityRegisteredId) { |
| | | userActivityRegisteredService.deleteById(userActivityRegisteredId); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(UserActivityRegistered userActivityRegistered) { |
| | | userActivityRegisteredService.updateById(userActivityRegistered); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @RequestMapping(value = "/detail/{userActivityRegisteredId}") |
| | | @ResponseBody |
| | | public Object detail(@PathVariable("userActivityRegisteredId") Integer userActivityRegisteredId) { |
| | | return userActivityRegisteredService.selectById(userActivityRegisteredId); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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.UserCouponRecord; |
| | | import com.stylefeng.guns.modular.system.service.IUserCouponRecordService; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-17 09:15:18 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/userCouponRecord") |
| | | public class UserCouponRecordController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/userCouponRecord/"; |
| | | |
| | | @Autowired |
| | | private IUserCouponRecordService userCouponRecordService; |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index( Model model,Integer couponActivityId,Integer activityType) { |
| | | model.addAttribute("activityType",activityType); |
| | | model.addAttribute("couponActivityId",couponActivityId); |
| | | return PREFIX + "userCouponRecord.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加 |
| | | */ |
| | | @RequestMapping("/userCouponRecord_add") |
| | | public String userCouponRecordAdd() { |
| | | return PREFIX + "userCouponRecord_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改 |
| | | */ |
| | | @RequestMapping("/userCouponRecord_update/{userCouponRecordId}") |
| | | public String userCouponRecordUpdate(@PathVariable Integer userCouponRecordId, Model model) { |
| | | UserCouponRecord userCouponRecord = userCouponRecordService.selectById(userCouponRecordId); |
| | | model.addAttribute("item",userCouponRecord); |
| | | LogObjectHolder.me().set(userCouponRecord); |
| | | return PREFIX + "userCouponRecord_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String createTime,String userName,String userPhone,Integer couponActivityId,Integer activityType,Integer state) { |
| | | 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(); |
| | | page.setRecords(userCouponRecordService.getList(page,beginTime,endTime,userName,userPhone,couponActivityId,activityType,state)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(UserCouponRecord userCouponRecord) { |
| | | userCouponRecordService.insert(userCouponRecord); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer userCouponRecordId) { |
| | | userCouponRecordService.deleteById(userCouponRecordId); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(UserCouponRecord userCouponRecord) { |
| | | userCouponRecordService.updateById(userCouponRecord); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 详情 |
| | | */ |
| | | @RequestMapping(value = "/detail/{userCouponRecordId}") |
| | | @ResponseBody |
| | | public Object detail(@PathVariable("userCouponRecordId") Integer userCouponRecordId) { |
| | | return userCouponRecordService.selectById(userCouponRecordId); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.specialTrain; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.base.tips.ErrorTip; |
| | | 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.TCompany; |
| | | import com.stylefeng.guns.modular.system.service.ITCompanyService; |
| | | import com.stylefeng.guns.modular.system.service.IUserService; |
| | | 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.TDispatch; |
| | | import com.stylefeng.guns.modular.system.service.ITDispatchService; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 调度管理控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-09-01 16:00:16 |
| | | */ |
| | | @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"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加调度管理 |
| | | */ |
| | | @RequestMapping("/tDispatch_add") |
| | | public String tDispatchAdd(Model model) { |
| | | model.addAttribute("roleType",ShiroKit.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 == ShiroKit.getUser().getRoleType()){ |
| | | List<TCompany> franchiseeList = tCompanyService.selectList(new EntityWrapper<TCompany>().eq("type", 3) |
| | | .eq("superiorId",ShiroKit.getUser().getObjectId())); |
| | | model.addAttribute("franchiseeList",franchiseeList); |
| | | }else{ |
| | | model.addAttribute("franchiseeList",null); |
| | | } |
| | | return PREFIX + "tDispatch_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 根据分公司ID获取加盟商 |
| | | * @param oneId |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/companyChange") |
| | | @ResponseBody |
| | | public Object companyChange(@RequestParam Integer oneId) { |
| | | List<TCompany> list = new ArrayList<>(); |
| | | if (SinataUtil.isNotEmpty(oneId)){ |
| | | list = tCompanyService.selectList(new EntityWrapper<TCompany>() |
| | | .eq("type", 3) |
| | | .eq("isCross", 1) |
| | | .eq("superiorId", oneId) |
| | | .last(" and state != 1 and FIND_IN_SET(flag,'1,2')")); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改调度管理 |
| | | */ |
| | | @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 = ShiroKit.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",ShiroKit.getUser().getObjectId()) |
| | | .eq("isCross", 1) |
| | | .last(" and state != 1 and FIND_IN_SET(flag,'1,2')")); |
| | | model.addAttribute("franchiseeList",franchiseeList); |
| | | } |
| | | return PREFIX + "tDispatch_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取调度管理列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String insertTime,String name,String companyName,String franchiseeName,String account,Integer state) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | 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(tDispatchService.getDispatchList(page,ShiroKit.getUser().getRoleType(),ShiroKit.getUser().getObjectId(),beginTime,endTime,name,companyName,franchiseeName,account,state)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 新增调度管理 |
| | | */ |
| | | @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 = ShiroKit.getUser().getRoleType(); |
| | | Integer objectId = ShiroKit.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(ShiroKit.getUser().getId()); |
| | | tDispatch.setInsertUserRole(roleType); |
| | | tDispatch.setState(1); |
| | | if(tDispatch.getCompanyId() == null){ |
| | | Integer objectId1 = userService.selectById(ShiroKit.getUser().getId()).getObjectId(); |
| | | tDispatch.setCompanyId(objectId1); |
| | | } |
| | | tDispatch.setPassword(ShiroKit.md5(tDispatch.getPassword(), "WL:x9#")); |
| | | tDispatchService.insert(tDispatch); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除调度管理 |
| | | * @param tDispatchId |
| | | * @param optType 1=删除 2=冻结 3=解冻 |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/opt") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tDispatchId,@RequestParam Integer optType) { |
| | | TDispatch dispatch = tDispatchService.selectById(tDispatchId); |
| | | if (1 == optType){ |
| | | dispatch.setState(3); |
| | | }else if (2 == optType){ |
| | | dispatch.setState(2); |
| | | }else if (3 == optType){ |
| | | dispatch.setState(1); |
| | | } |
| | | tDispatchService.updateById(dispatch); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改调度管理 |
| | | */ |
| | | @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 = ShiroKit.getUser().getRoleType(); |
| | | Integer objectId = ShiroKit.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; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.specialTrain; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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.TIntegralGoods; |
| | | import com.stylefeng.guns.modular.system.service.ITIntegralGoodsService; |
| | | |
| | | import java.util.Date; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 商品管理控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-09-02 11:28:36 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tIntegralGoods") |
| | | public class TIntegralGoodsController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tIntegralGoods/"; |
| | | |
| | | @Autowired |
| | | private ITIntegralGoodsService tIntegralGoodsService; |
| | | |
| | | /** |
| | | * 跳转到商品管理首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tIntegralGoods.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加商品管理 |
| | | */ |
| | | @RequestMapping("/tIntegralGoods_add") |
| | | public String tIntegralGoodsAdd() { |
| | | return PREFIX + "tIntegralGoods_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改商品管理 |
| | | */ |
| | | @RequestMapping("/tIntegralGoods_update/{tIntegralGoodsId}") |
| | | public String tIntegralGoodsUpdate(@PathVariable Integer tIntegralGoodsId, Model model) { |
| | | TIntegralGoods tIntegralGoods = tIntegralGoodsService.selectById(tIntegralGoodsId); |
| | | model.addAttribute("item",tIntegralGoods); |
| | | LogObjectHolder.me().set(tIntegralGoods); |
| | | return PREFIX + "tIntegralGoods_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取商品管理列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String insertTime,String name,Integer state) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | 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 (ShiroKit.getUser().getRoleType() != 1){ |
| | | page.setRecords(null); |
| | | }else{ |
| | | page.setRecords(tIntegralGoodsService.getIntegralGoodsList(page,beginTime,endTime,name,state)); |
| | | } |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 新增商品管理 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(TIntegralGoods tIntegralGoods) { |
| | | tIntegralGoods.setInsertTime(new Date()); |
| | | tIntegralGoods.setInsertUserId(ShiroKit.getUser().getId()); |
| | | tIntegralGoods.setInsertUserRole(ShiroKit.getUser().getRoleType()); |
| | | tIntegralGoods.setState(1); |
| | | tIntegralGoodsService.insert(tIntegralGoods); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * c操作商品 |
| | | * @param tIntegralGoodsId |
| | | * @param optType 1=上架 2=下架 3=删除 |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/opt") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tIntegralGoodsId,@RequestParam Integer optType) { |
| | | TIntegralGoods tIntegralGoods = tIntegralGoodsService.selectById(tIntegralGoodsId); |
| | | if (1 == optType){ |
| | | tIntegralGoods.setState(1); |
| | | }else if (2 == optType){ |
| | | tIntegralGoods.setState(2); |
| | | }else if (3 == optType){ |
| | | tIntegralGoods.setState(3); |
| | | } |
| | | tIntegralGoodsService.updateById(tIntegralGoods); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 修改商品管理 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TIntegralGoods tIntegralGoods) { |
| | | tIntegralGoodsService.updateById(tIntegralGoods); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.specialTrain; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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 java.util.Map; |
| | | |
| | | /** |
| | | * 积分兑换订单控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-09-02 15:22:24 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tIntegralOrder") |
| | | public class TIntegralOrderController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tIntegralOrder/"; |
| | | |
| | | @Autowired |
| | | private ITIntegralOrderService tIntegralOrderService; |
| | | |
| | | /** |
| | | * 跳转到积分兑换订单首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tIntegralOrder.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到查看详情 |
| | | */ |
| | | @RequestMapping("/lookDetail/{id}") |
| | | public String lookDetail(@PathVariable Integer id, Model model) { |
| | | TIntegralOrder tIntegralOrder = tIntegralOrderService.selectById(id); |
| | | model.addAttribute("str",tIntegralOrder.getRemark()); |
| | | return "/system/tComplaint/lookDetail.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转至立即处理页面 |
| | | */ |
| | | @RequestMapping("/tIntegralOrder_immediately/{tIntegralOrderId}") |
| | | public String tIntegralOrder_immediately(@PathVariable Integer tIntegralOrderId, Model model) { |
| | | model.addAttribute("id",tIntegralOrderId); |
| | | return PREFIX + "tIntegralOrder_immediately.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取积分兑换订单列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | 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)){ |
| | | String[] timeArray = insertTime.split(" - "); |
| | | beginTime = timeArray[0]; |
| | | endTime = timeArray[1]; |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | if (ShiroKit.getUser().getRoleType() != 1){ |
| | | page.setRecords(null); |
| | | }else{ |
| | | page.setRecords(tIntegralOrderService.getIntegralOrderList(page,beginTime,endTime,userName,goodsName,consigneeName,consigneePhone,state)); |
| | | } |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 立即处理 |
| | | */ |
| | | @RequestMapping(value = "/immediately") |
| | | @ResponseBody |
| | | public Object immediately(TIntegralOrder tIntegralOrder) { |
| | | tIntegralOrder.setState(2); |
| | | tIntegralOrderService.updateById(tIntegralOrder); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除积分兑换订单 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tIntegralOrderId) { |
| | | TIntegralOrder tIntegralOrder = tIntegralOrderService.selectById(tIntegralOrderId); |
| | | tIntegralOrder.setState(3); |
| | | tIntegralOrderService.updateById(tIntegralOrder); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.specialTrain; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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.*; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | 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 java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 跨城线路管理控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-09-15 16:17:29 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tLine") |
| | | public class TLineController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tLine/"; |
| | | |
| | | @Autowired |
| | | private ITLineService tLineService; |
| | | |
| | | @Autowired |
| | | private ITSiteService itSiteService; |
| | | |
| | | @Autowired |
| | | private ITServerCarmodelService itServerCarmodelService; |
| | | |
| | | @Autowired |
| | | private ITLineSiteService itLineSiteService; |
| | | |
| | | @Autowired |
| | | private ITLinePriceService itLinePriceService; |
| | | |
| | | @Autowired |
| | | private ITLineShiftService itLineShiftService; |
| | | |
| | | @Autowired |
| | | private ITCompanyService itCompanyService; |
| | | |
| | | @Autowired |
| | | private ITLineCompanyService itLineCompanyService; |
| | | |
| | | @Autowired |
| | | private IUserService userService; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 跳转到跨城站点管理首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tLine.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加跨城站点管理 |
| | | */ |
| | | @RequestMapping("/tLine_add") |
| | | public String tLineAdd(Model model) { |
| | | //站点 |
| | | Integer objectId = ShiroKit.getUser().getObjectId(); |
| | | Integer roleType = ShiroKit.getUser().getRoleType(); |
| | | Wrapper<TSite> wrapper = new EntityWrapper<TSite>().eq("state", 1); |
| | | if(roleType != 1){ |
| | | List<User> users = userService.selectList(new EntityWrapper<User>().ne("roleType", 1).eq("objectId", objectId)); |
| | | List<Integer> collect = users.stream().map(User::getId).collect(Collectors.toList()); |
| | | wrapper.in("insertUserId", collect); |
| | | } |
| | | List<TSite> siteList = itSiteService.selectList(wrapper); |
| | | model.addAttribute("siteList",siteList); |
| | | //跨城车型 |
| | | List<TServerCarmodel> carmodelList = itServerCarmodelService.selectList(new EntityWrapper<TServerCarmodel>().eq("type", 2).eq("state", 1)); |
| | | model.addAttribute("carmodelList",carmodelList); |
| | | return PREFIX + "tLine_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 分配企业页面 |
| | | */ |
| | | @RequestMapping("/tLine_addCompany/{tLineId}") |
| | | public String tLine_addCompany(@PathVariable Integer tLineId,Model model) { |
| | | TLine tLine = tLineService.selectById(tLineId); |
| | | model.addAttribute("tLine",tLine); |
| | | //查询所有企业 |
| | | List<TCompany> companyList = itCompanyService.selectList(new EntityWrapper<TCompany>().last(" where not FIND_IN_SET(state,'1') and not FIND_IN_SET(flag,'3')")); |
| | | model.addAttribute("companyList",companyList); |
| | | //查询已分配企业 |
| | | List<Map<String, Object>> lineCompanyList = tLineService.getLineCompanyList(tLineId); |
| | | model.addAttribute("lineCompanyList",lineCompanyList); |
| | | return PREFIX + "tLine_addCompany.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改跨城站点管理 |
| | | */ |
| | | @RequestMapping("/tLine_update/{tLineId}") |
| | | public String tLineUpdate(@PathVariable Integer tLineId, Model model) { |
| | | TLine tLine = tLineService.selectById(tLineId); |
| | | model.addAttribute("item",tLine); |
| | | LogObjectHolder.me().set(tLine); |
| | | |
| | | //查找站点起点+终点 |
| | | TLineSite start = itLineSiteService.selectOne(new EntityWrapper<TLineSite>().eq("lineId", tLineId).eq("type", 1)); |
| | | model.addAttribute("start",start); |
| | | TLineSite end = itLineSiteService.selectOne(new EntityWrapper<TLineSite>().eq("lineId", tLineId).eq("type", 2)); |
| | | model.addAttribute("end",end); |
| | | //站点 |
| | | Integer objectId = ShiroKit.getUser().getObjectId(); |
| | | Integer roleType = ShiroKit.getUser().getRoleType(); |
| | | Wrapper<TSite> wrapper = new EntityWrapper<TSite>().eq("state", 1); |
| | | if(roleType != 1){ |
| | | List<User> users = userService.selectList(new EntityWrapper<User>().ne("roleType", 1).eq("objectId", objectId)); |
| | | List<Integer> collect = users.stream().map(User::getId).collect(Collectors.toList()); |
| | | wrapper.in("insertUserId", collect); |
| | | } |
| | | List<TSite> siteList = itSiteService.selectList(wrapper); |
| | | model.addAttribute("siteList",siteList); |
| | | //跨城车型 |
| | | List<TServerCarmodel> carmodelList = itServerCarmodelService.selectList(new EntityWrapper<TServerCarmodel>().eq("type", 2).eq("state", 1)); |
| | | model.addAttribute("carmodelList",carmodelList); |
| | | //查询所有站点 |
| | | List<Map<String, Object>> linePriceList = tLineService.getLinePriceList(tLineId); |
| | | model.addAttribute("linePriceList",linePriceList); |
| | | //查询所有班次 |
| | | List<TLineShift> lineShiftList = itLineShiftService.selectList(new EntityWrapper<TLineShift>().eq("lineId", tLineId).last(" and not FIND_IN_SET(state,'3')")); |
| | | model.addAttribute("lineShiftList",lineShiftList); |
| | | model.addAttribute("zcOne",tLine.getIsOpen()); |
| | | return PREFIX + "tLine_edit.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取跨城站点管理列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String insertTime,String name,String insertUser,String modelStr,Integer state) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | 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 (ShiroKit.getUser().getRoleType() != 1){ |
| | | page.setRecords(tLineService.getLineList1(page,beginTime,endTime,name,insertUser,modelStr,state, ShiroKit.getUser().getObjectId())); |
| | | }else{ |
| | | page.setRecords(tLineService.getLineList(page,beginTime,endTime,name,insertUser,modelStr,state)); |
| | | } |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 新增跨城站点管理 |
| | | */ |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public ResultUtil add(TLine tLine,Integer startSiteId,Integer endSiteId,@RequestParam String subArr,@RequestParam String shuArr) { |
| | | String name = tLine.getName(); |
| | | name = name.replaceAll("& lt;", "<"); |
| | | name = name.replaceAll("& gt;", ">"); |
| | | name = name.replaceAll("& #40;", "("); |
| | | name = name.replaceAll("& #41;", ")"); |
| | | tLine.setName(name); |
| | | tLine.setState(1); |
| | | tLine.setInsertTime(new Date()); |
| | | tLine.setInsertUserId(ShiroKit.getUser().getId()); |
| | | tLineService.insert(tLine); |
| | | |
| | | //添加线路站点起点+终点 |
| | | TLineSite start = new TLineSite(); |
| | | start.setLineId(tLine.getId()); |
| | | start.setSiteId(startSiteId); |
| | | start.setType(1); |
| | | itLineSiteService.insert(start); |
| | | TLineSite end = new TLineSite(); |
| | | end.setLineId(tLine.getId()); |
| | | end.setSiteId(endSiteId); |
| | | end.setType(2); |
| | | itLineSiteService.insert(end); |
| | | |
| | | //添加价格设置 |
| | | addPrice(tLine.getId(), subArr); |
| | | |
| | | //添加班次设置 |
| | | return addShift(tLine.getId(), shuArr); |
| | | } |
| | | |
| | | /** |
| | | * 添加线路班次 |
| | | * @param lineId |
| | | * @param shuArr |
| | | */ |
| | | private ResultUtil addShift(Integer lineId, @RequestParam String shuArr) { |
| | | try { |
| | | JSONArray jsonArray1 = JSON.parseArray(shuArr); |
| | | int size1 = jsonArray1.size(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | List<String> list = new ArrayList<>(); |
| | | for (int i = 0; i < size1; i++) { |
| | | List<TLineShift> tLineShifts = itLineShiftService.selectList(new EntityWrapper<TLineShift>().eq("lineId", lineId).ne("state", 3).orderBy("startTime")); |
| | | JSONObject jsonObject = jsonArray1.getJSONObject(i); |
| | | TLineShift shift = new TLineShift(); |
| | | shift.setLineId(lineId); |
| | | String shiftTime = jsonObject.getString("shiftTime"); |
| | | String startTime = null; |
| | | String endTime = null; |
| | | if (SinataUtil.isNotEmpty(shiftTime)){ |
| | | String[] timeArray = shiftTime.split(" - "); |
| | | startTime = timeArray[0]; |
| | | endTime = timeArray[1]; |
| | | } |
| | | Date s1 = sdf.parse("2020-11-11 " + startTime + ":00"); |
| | | Date e1 = sdf.parse("2020-11-11 " + endTime + ":00"); |
| | | boolean b = false; |
| | | for(TLineShift lineShift : tLineShifts){ |
| | | Date s2 = sdf.parse("2020-11-11 " + lineShift.getStartTime() + ":00"); |
| | | Date e2 = sdf.parse("2020-11-11 " + lineShift.getEndTime() + ":00"); |
| | | if(s2.getTime() <= s1.getTime() && e1.getTime() <= e2.getTime()){ |
| | | list.add(startTime + " - " + endTime); |
| | | b = true; |
| | | break; |
| | | } |
| | | if(s1.getTime() <= s2.getTime() && s1.getTime() <= e2.getTime() && e1.getTime() >= s2.getTime()){ |
| | | list.add(startTime + " - " + endTime); |
| | | b = true; |
| | | break; |
| | | } |
| | | if(s1.getTime() >= s2.getTime() && s1.getTime() <= e2.getTime() && e1.getTime() >= e2.getTime()){ |
| | | list.add(startTime + " - " + endTime); |
| | | b = true; |
| | | break; |
| | | } |
| | | } |
| | | if(b){ |
| | | continue; |
| | | } |
| | | shift.setStartTime(startTime); |
| | | shift.setEndTime(endTime); |
| | | shift.setCarNum(jsonObject.getInteger("carNum")); |
| | | shift.setInsertTime(new Date()); |
| | | shift.setAddTime(jsonObject.getString("time2")); |
| | | shift.setState(1); |
| | | itLineShiftService.insert(shift); |
| | | } |
| | | if(list.size() > 0){ |
| | | return ResultUtil.error("【" + JSON.toJSONString(list) + "】时间段与现存时间段重合,添加失败!"); |
| | | } |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 添加线路价格 |
| | | * @param lineId |
| | | * @param subArr |
| | | */ |
| | | private void addPrice(Integer lineId, @RequestParam String subArr) { |
| | | JSONArray jsonArray = JSON.parseArray(subArr); |
| | | int size = jsonArray.size(); |
| | | for (int i = 0; i < size; i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | TLinePrice price = new TLinePrice(); |
| | | price.setLineId(lineId); |
| | | price.setServerCarModelId(jsonObject.getInteger("serverModelId")); |
| | | price.setType(jsonObject.getInteger("type")); |
| | | price.setContent(jsonObject.getString("content")); |
| | | price.setContentStr(jsonObject.getString("contentStr")); |
| | | price.setState(1); |
| | | price.setInsertTime(new Date()); |
| | | price.setAddTime(jsonObject.getString("time")); |
| | | itLinePriceService.insert(price); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 操作跨城站点管理 |
| | | * optType 1=删除 2=冻结 3=解冻 |
| | | */ |
| | | @RequestMapping(value = "/opt") |
| | | @ResponseBody |
| | | public Object opt(@RequestParam Integer tLineId,@RequestParam Integer optType) { |
| | | TLine tLine = tLineService.selectById(tLineId); |
| | | if (1 == optType){ |
| | | tLine.setState(3); |
| | | }else if (2 == optType){ |
| | | tLine.setState(2); |
| | | }else if (3 == optType){ |
| | | tLine.setState(1); |
| | | } |
| | | tLineService.updateById(tLine); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 分配企业操作 |
| | | */ |
| | | @RequestMapping(value = "/addCompany") |
| | | @ResponseBody |
| | | public Object addCompany(Integer lineId,@RequestParam String comArr) { |
| | | //删除分配企业 |
| | | itLineCompanyService.delete(new EntityWrapper<TLineCompany>().eq("lineId",lineId)); |
| | | //添加企业 |
| | | if (SinataUtil.isNotEmpty(comArr)){ |
| | | JSONArray jsonArray = JSON.parseArray(comArr); |
| | | int size = jsonArray.size(); |
| | | for (int i = 0; i < size; i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | TLineCompany lineCompany = new TLineCompany(); |
| | | lineCompany.setLineId(lineId); |
| | | lineCompany.setCompanyId(jsonObject.getInteger("companyId")); |
| | | lineCompany.setInsertTime(new Date()); |
| | | lineCompany.setInsertUserId(ShiroKit.getUser().getId()); |
| | | itLineCompanyService.insert(lineCompany); |
| | | } |
| | | } |
| | | return SUCCESS_TIP; |
| | | } |
| | | /** |
| | | * 修改跨城站点管理 |
| | | */ |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public ResultUtil update(TLine tLine,Integer startSiteId,Integer endSiteId,@RequestParam String subArr,@RequestParam String shuArr) { |
| | | String name = tLine.getName(); |
| | | name = name.replaceAll("& lt;", "<"); |
| | | name = name.replaceAll("& gt;", ">"); |
| | | name = name.replaceAll("& #40;", "("); |
| | | name = name.replaceAll("& #41;", ")"); |
| | | tLine.setName(name); |
| | | tLineService.updateById(tLine); |
| | | |
| | | //修改站点起点 |
| | | TLineSite start = itLineSiteService.selectOne(new EntityWrapper<TLineSite>().eq("lineId", tLine.getId()).eq("type", 1)); |
| | | if (SinataUtil.isNotEmpty(start)){ |
| | | if (start.getSiteId().intValue() != startSiteId.intValue()){ |
| | | start.setSiteId(startSiteId); |
| | | itLineSiteService.updateById(start); |
| | | } |
| | | }else{ |
| | | start = new TLineSite(); |
| | | start.setLineId(tLine.getId()); |
| | | start.setSiteId(startSiteId); |
| | | start.setType(1); |
| | | itLineSiteService.insert(start); |
| | | } |
| | | //修改站点终点 |
| | | TLineSite end = itLineSiteService.selectOne(new EntityWrapper<TLineSite>().eq("lineId", tLine.getId()).eq("type", 2)); |
| | | if (SinataUtil.isNotEmpty(end)){ |
| | | if (end.getSiteId().intValue() != endSiteId.intValue()){ |
| | | end.setSiteId(endSiteId); |
| | | itLineSiteService.updateById(end); |
| | | } |
| | | }else{ |
| | | end = new TLineSite(); |
| | | end.setLineId(tLine.getId()); |
| | | end.setSiteId(endSiteId); |
| | | end.setType(2); |
| | | itLineSiteService.insert(end); |
| | | } |
| | | |
| | | //删除线路价格 |
| | | itLinePriceService.delete(new EntityWrapper<TLinePrice>().eq("lineId",tLine.getId())); |
| | | //添加价格设置 |
| | | addPrice(tLine.getId(), subArr); |
| | | //删除线路班次 |
| | | itLineShiftService.delete(new EntityWrapper<TLineShift>().eq("lineId",tLine.getId())); |
| | | //添加班次设置 |
| | | return addShift(tLine.getId(), shuArr); |
| | | |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.specialTrain; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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 java.util.Map; |
| | | |
| | | /** |
| | | * 包车订单控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-09-02 10:39:00 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tOrderCharter") |
| | | public class TOrderCharterController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tOrderCharter/"; |
| | | |
| | | @Autowired |
| | | private ITOrderCharterService tOrderCharterService; |
| | | |
| | | /** |
| | | * 跳转到包车订单首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tOrderCharter.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到查看详情 |
| | | */ |
| | | @RequestMapping("/lookDetail/{id}") |
| | | public String lookDetail(@PathVariable Integer id, Model model) { |
| | | TOrderCharter tOrderCharter = tOrderCharterService.selectById(id); |
| | | model.addAttribute("str",tOrderCharter.getRemark()); |
| | | return "/system/tComplaint/lookDetail.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改包车订单 |
| | | */ |
| | | @RequestMapping("/tOrderCharter_immediately/{tOrderCharterId}") |
| | | public String tOrderCharterUpdate(@PathVariable Integer tOrderCharterId, Model model) { |
| | | model.addAttribute("id",tOrderCharterId); |
| | | return PREFIX + "tOrderCharter_immediately.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取包车订单列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | 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)){ |
| | | String[] timeArray = insertTime.split(" - "); |
| | | beginTime = timeArray[0]; |
| | | endTime = timeArray[1]; |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | if (ShiroKit.getUser().getRoleType() != 1){ |
| | | page.setRecords(null); |
| | | }else{ |
| | | page.setRecords(tOrderCharterService.getCharterOrderList(page,beginTime,endTime,userName,contactName,contactPhone,useDemand,state)); |
| | | } |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 立即处理 |
| | | */ |
| | | @RequestMapping(value = "/immediately") |
| | | @ResponseBody |
| | | public Object immediately(TOrderCharter tOrderCharter) { |
| | | tOrderCharter.setState(2); |
| | | tOrderCharterService.updateById(tOrderCharter); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除包车订单 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tOrderCharterId) { |
| | | TOrderCharter tOrderCharter = tOrderCharterService.selectById(tOrderCharterId); |
| | | tOrderCharter.setState(3); |
| | | tOrderCharterService.updateById(tOrderCharter); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.specialTrain; |
| | | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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.TOrderCharteredCar; |
| | | import com.stylefeng.guns.modular.system.service.ITOrderCharteredCarService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 包车订单控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-09-24 11:08:23 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tOrderCharteredCar") |
| | | public class TOrderCharteredCarController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tOrderCharteredCar/"; |
| | | |
| | | @Autowired |
| | | private ITOrderCharteredCarService tOrderCharteredCarService; |
| | | |
| | | /** |
| | | * 跳转到包车订单首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tOrderCharteredCar.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到修改包车订单 |
| | | */ |
| | | @RequestMapping("/tOrderCharteredCar_immediately/{tOrderCharteredCarId}") |
| | | public String tOrderCharteredCarUpdate(@PathVariable Integer tOrderCharteredCarId, Model model) { |
| | | model.addAttribute("id",tOrderCharteredCarId); |
| | | return PREFIX + "tOrderCharteredCar_immediately.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取包车订单列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | 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)){ |
| | | String[] timeArray = insertTime.split(" - "); |
| | | beginTime = timeArray[0]; |
| | | endTime = timeArray[1]; |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | if (ShiroKit.getUser().getRoleType() != 1){ |
| | | page.setRecords(null); |
| | | }else{ |
| | | List<Map<String, Object>> charterCarOrderList = tOrderCharteredCarService.getCharterCarOrderList(page, beginTime, endTime, userName, contactPerson, contactPhone, modelUse, state, ShiroKit.getUser().getRoleType(), ShiroKit.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()); |
| | | // map.put("price", p); |
| | | // |
| | | // } |
| | | page.setRecords(charterCarOrderList); |
| | | } |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 立即处理 |
| | | */ |
| | | @RequestMapping(value = "/immediately") |
| | | @ResponseBody |
| | | public Object immediately(Integer id, String remark) { |
| | | TOrderCharteredCar tOrderCharteredCar = tOrderCharteredCarService.selectById(id); |
| | | tOrderCharteredCar.setState(2); |
| | | tOrderCharteredCar.setRemark(remark); |
| | | tOrderCharteredCarService.updateById(tOrderCharteredCar); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除包车订单 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tOrderCharterId) { |
| | | TOrderCharteredCar tOrderCharter = tOrderCharteredCarService.selectById(tOrderCharterId); |
| | | tOrderCharter.setIsDelete(2); |
| | | tOrderCharteredCarService.updateById(tOrderCharter); |
| | | return SUCCESS_TIP; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.specialTrain; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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.SinataUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.dao.LineShiftDriverMapper; |
| | | import com.stylefeng.guns.modular.system.dao.OrderCancelMapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.BufferedReader; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.InputStreamReader; |
| | | import java.math.BigDecimal; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 跨城出行订单控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-09-16 14:56:46 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tOrderCrossCity") |
| | | public class TOrderCrossCityController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tOrderCrossCity/"; |
| | | |
| | | @Autowired |
| | | private ITOrderCrossCityService tOrderCrossCityService; |
| | | |
| | | @Autowired |
| | | private ITServerCarmodelService tServerCarmodelService; |
| | | |
| | | @Autowired |
| | | private ITLineService itLineService; |
| | | |
| | | @Autowired |
| | | private ITOrderPositionService tOrderPositionService; |
| | | |
| | | @Autowired |
| | | private PayMoneyUtil payMoneyUtil; |
| | | |
| | | private ResultUtil resultUtil; |
| | | |
| | | @Autowired |
| | | private IOrderFrequentPassengersService orderFrequentPassengersService; |
| | | |
| | | @Autowired |
| | | private IFrequentPassengersService frequentPassengersService; |
| | | |
| | | @Value("${filePath}") |
| | | private String filePath; |
| | | |
| | | /** |
| | | * 跳转到跨城出行订单首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index(Model model) { |
| | | //服务专车车型 |
| | | List<TServerCarmodel> carmodelList = tServerCarmodelService.selectList(new EntityWrapper<TServerCarmodel>().eq("type", 2).eq("state", 1)); |
| | | model.addAttribute("carmodelList",carmodelList); |
| | | //线路 |
| | | List<TLine> lineList = itLineService.selectList(new EntityWrapper<TLine>().last(" where not FIND_IN_SET(state,'3')")); |
| | | model.addAttribute("lineList",lineList); |
| | | return PREFIX + "tOrderCrossCity.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到查看跨城出行订单详情页面 |
| | | */ |
| | | @RequestMapping("/tOrderCrossCity_detail/{tOrderCrossCityId}") |
| | | public String tOrderCrossCityUpdate(@PathVariable Integer tOrderCrossCityId, Model model) throws ParseException { |
| | | Map<String, Object> item = tOrderCrossCityService.getCrossCityOrderDetailById(tOrderCrossCityId); |
| | | model.addAttribute("item",item); |
| | | List<OrderFrequentPassengers> orderFrequentPassengers = orderFrequentPassengersService.selectList(new EntityWrapper<OrderFrequentPassengers>().eq("orderType", 3).eq("orderId", tOrderCrossCityId)); |
| | | List<FrequentPassengers> frequentPassengers = new ArrayList<>(); |
| | | if(orderFrequentPassengers.size() > 0){ |
| | | List<Integer> collect = orderFrequentPassengers.stream().map(OrderFrequentPassengers::getFrequentPassengersId).collect(Collectors.toList()); |
| | | frequentPassengers = frequentPassengersService.selectBatchIds(collect); |
| | | } |
| | | model.addAttribute("frequentPassengers",frequentPassengers); |
| | | if(Objects.nonNull(item.get("routeRecord"))){ |
| | | List<String> routeRecordList = Arrays.asList(item.get("routeRecord").toString().split(",")); |
| | | model.addAttribute("routeRecordList",routeRecordList); |
| | | } |
| | | if(Objects.nonNull(item.get("routeRecord")) && Objects.nonNull(item.get("recordTime"))){ |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | LocalDateTime recordTime = DateUtil.dateToLocalDateTime(format.parse(item.get("recordTime").toString())); |
| | | if(LocalDateTime.now().isBefore(recordTime.plusMonths(1))){ |
| | | model.addAttribute("recordState",1); |
| | | }else { |
| | | model.addAttribute("recordState",2); |
| | | } |
| | | } |
| | | return PREFIX + "tOrderCrossCity_detail.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到跨城出行订单轨迹页面 |
| | | */ |
| | | @RequestMapping("/tOrderCrossCity_track/{tOrderCrossCityId}") |
| | | public String tOrderCrossCity_track(@PathVariable Integer tOrderCrossCityId, Model model) { |
| | | 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)){ |
| | | try { |
| | | //将数据存储到文件中 |
| | | File file = new File(filePath + orderDetailId + "_3.txt"); |
| | | if(!file.exists()){ |
| | | return ResultUtil.success(new ArrayList<>()); |
| | | } |
| | | //读取文件(字符流) |
| | | BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file),"UTF-8")); |
| | | //循环取出数据 |
| | | String str = null; |
| | | StringBuffer sb = new StringBuffer(); |
| | | while ((str = in.readLine()) != null) { |
| | | sb.append(str); |
| | | } |
| | | List<TOrderPosition> list = JSONArray.parseArray(sb.toString(), TOrderPosition.class); |
| | | // List<TOrderPosition> list = tOrderPositionService.selectList(new EntityWrapper<TOrderPosition>().eq("orderType", 3).eq("orderId", orderDetailId).orderBy("insertTime")); |
| | | /*if(list.size() == 0){ |
| | | return ResultUtil.error("该订单没有运行轨迹"); |
| | | }*/ |
| | | resultUtil = ResultUtil.success(list); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | resultUtil = ResultUtil.runErr(); |
| | | } |
| | | }else { |
| | | resultUtil = ResultUtil.paranErr(); |
| | | } |
| | | return resultUtil; |
| | | } |
| | | |
| | | /** |
| | | * 获取跨城出行订单列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String insertTime, |
| | | String orderNum, |
| | | Integer orderSource, |
| | | String userName, |
| | | String userPhone, |
| | | String passengers, |
| | | String passengersPhone, |
| | | Integer serverCarModelId, |
| | | String driver, |
| | | Integer lineId, |
| | | Integer state) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | 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(tOrderCrossCityService.getCrossCityOrderList(page,beginTime,endTime,ShiroKit.getUser().getRoleType(),ShiroKit.getUser().getObjectId(),orderNum,orderSource,userName,userPhone,passengers,passengersPhone,serverCarModelId,driver,lineId,state)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | @Autowired |
| | | private ITDriverService tDriverService; |
| | | |
| | | @Resource |
| | | private LineShiftDriverMapper lineShiftDriverMapper; |
| | | |
| | | @Autowired |
| | | private ITUserService userService; |
| | | |
| | | @Autowired |
| | | private ITransactionDetailsService transactionDetailsService; |
| | | |
| | | @Autowired |
| | | private IPaymentRecordService paymentRecordService; |
| | | |
| | | // @Autowired |
| | | // private ICBCPayUtil icbcPayUtil; |
| | | |
| | | @Resource |
| | | private OrderCancelMapper orderCancelMapper; |
| | | |
| | | @Autowired |
| | | private IIncomeService incomeService; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 取消跨城出行订单 |
| | | */ |
| | | @RequestMapping(value = "/cancel") |
| | | @ResponseBody |
| | | public Object cancel(@RequestParam Integer tOrderCrossCityId) throws Exception { |
| | | TOrderCrossCity tOrderCrossCity = tOrderCrossCityService.selectById(tOrderCrossCityId); |
| | | ShiroUser user = ShiroKit.getUser(); |
| | | |
| | | TOrderCrossCity orderCrossCity = tOrderCrossCityService.selectById(tOrderCrossCityId); |
| | | if(orderCrossCity.getState() > 5 && orderCrossCity.getState() != 11 && orderCrossCity.getState() != 7){ |
| | | return ResultUtil.error("订单状态不在可取消范围内"); |
| | | } |
| | | orderCrossCity.setState(10); |
| | | tOrderCrossCityService.updateById(orderCrossCity); |
| | | |
| | | if(orderCrossCity.getDriverId() != null){ |
| | | //修改司机信息 |
| | | LineShiftDriver lineShiftDriver = lineShiftDriverMapper.selectById(orderCrossCity.getLineShiftDriverId()); |
| | | lineShiftDriver.setLaveSeat(lineShiftDriver.getLaveSeat() + orderCrossCity.getPeopleNumber() > lineShiftDriver.getTotalSeat() ? |
| | | lineShiftDriver.getTotalSeat() : lineShiftDriver.getLaveSeat() + orderCrossCity.getPeopleNumber()); |
| | | String seat = ""; |
| | | String[] split = orderCrossCity.getSeatNumber().split(","); |
| | | for(String s : split){ |
| | | seat += s + ","; |
| | | } |
| | | seat = lineShiftDriver.getLaveSeatNumber() + "," + seat.substring(0, seat.length() - 1); |
| | | |
| | | //总和大于总座位数的情况 |
| | | if(lineShiftDriver.getLaveSeat() + orderCrossCity.getPeopleNumber() > lineShiftDriver.getTotalSeat()){ |
| | | seat = ""; |
| | | for(int i = 1; i <= lineShiftDriver.getTotalSeat(); i++){ |
| | | seat += i + ","; |
| | | } |
| | | seat = seat.substring(0, seat.length() - 1); |
| | | } |
| | | lineShiftDriver.setLaveSeatNumber(seat); |
| | | lineShiftDriverMapper.updateById(lineShiftDriver); |
| | | if(lineShiftDriver.getLaveSeat() >= lineShiftDriver.getTotalSeat()){ |
| | | TDriver driver = tDriverService.selectById(orderCrossCity.getDriverId()); |
| | | driver.setState(2); |
| | | tDriverService.updateById(driver); |
| | | } |
| | | } |
| | | |
| | | |
| | | //已支付的情况下进行退款操作 |
| | | if(null != orderCrossCity.getPayType() && null != orderCrossCity.getPayMoney()) { |
| | | if (orderCrossCity.getPayType() == 3) {//余额支付 |
| | | TUser tUser = userService.selectById(orderCrossCity.getUserId()); |
| | | tUser.setBalance(tUser.getBalance().add(orderCrossCity.getPayMoney())); |
| | | userService.updateById(tUser); |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(orderCrossCity.getUserId(), "跨城取消退款", orderCrossCity.getPayMoney().doubleValue(), 1, 1, 1, 3, tOrderCrossCityId); |
| | | } else { |
| | | PaymentRecord query = paymentRecordService.query(1, null, null, tOrderCrossCityId, 3, null, 2).get(0); |
| | | if (null == query) { |
| | | return ResultUtil.error("订单还未进行支付"); |
| | | } |
| | | if(query.getPayType() == 1){//微信 |
| | | Map<String, String> map = payMoneyUtil.wxRefund(query.getCode(), orderCrossCity.getId() + "_3", query.getAmount().toString(), query.getAmount().toString(), "/user/base/cancleOrderWXPay"); |
| | | if(!"SUCCESS".equals(map.get("return_code"))){ |
| | | return ResultUtil.error(map.get("return_msg")); |
| | | } |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(query.getUserId(), "跨城取消退款", query.getAmount(), 1, 1, query.getType(), 3, orderCrossCity.getId()); |
| | | }else{//支付宝 |
| | | Map<String, String> map = payMoneyUtil.aliRefund(query.getCode(), query.getAmount().toString()); |
| | | if(!"10000".equals(map.get("code"))){ |
| | | return ResultUtil.error(map.get("msg")); |
| | | } |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(query.getUserId(), "跨城取消退款", query.getAmount(), 1, 1, query.getType(), 3, orderCrossCity.getId()); |
| | | } |
| | | } |
| | | |
| | | //添加负的收入明细 |
| | | List<Income> incomes = incomeService.selectList(new EntityWrapper<Income>().eq("type", 2).eq("incomeId", tOrderCrossCityId).eq("orderType", 3)); |
| | | for(Income income : incomes){ |
| | | if(income.getUserType() == 2){//处理司机的收入 |
| | | TDriver driver = tDriverService.selectById(income.getObjectId()); |
| | | driver.setBalance(driver.getBalance().subtract(new BigDecimal(income.getMoney()))); |
| | | driver.setLaveBusinessMoney(new BigDecimal(driver.getLaveBusinessMoney()).subtract(new BigDecimal(income.getMoney())).doubleValue()); |
| | | driver.setBusinessMoney(new BigDecimal(driver.getBusinessMoney()).subtract(new BigDecimal(income.getMoney())).doubleValue()); |
| | | tDriverService.updateById(driver); |
| | | } |
| | | Income income1 = new Income(); |
| | | BeanUtils.copyProperties(income, income1); |
| | | income1.setMoney(income.getMoney() * -1); |
| | | income1.setId(null); |
| | | income1.setInsertTime(new Date()); |
| | | incomeService.insert(income1); |
| | | } |
| | | } |
| | | //添加取消记录 |
| | | OrderCancel orderCancel = new OrderCancel(); |
| | | orderCancel.setOrderId(tOrderCrossCityId); |
| | | orderCancel.setOrderType(3); |
| | | orderCancel.setReason("调度端取消订单"); |
| | | orderCancel.setRemark("调度“" + user.getName() + "-" + user.getId() + "”执行取消操作"); |
| | | orderCancel.setState(2); |
| | | orderCancel.setInsertTime(new Date()); |
| | | orderCancel.setUserType(3); |
| | | orderCancel.setUserId(user.getId()); |
| | | orderCancelMapper.insert(orderCancel); |
| | | |
| | | |
| | | //增加推送 |
| | | Map<String,String> map1 = new HashMap<>(); |
| | | map1.put("id", tOrderCrossCity.getId().toString()); |
| | | map1.put("orderType", "3"); |
| | | String result1 = HttpRequestUtil.postRequest(PushURL.cancel_order_url, map1); |
| | | System.out.println("跨城取消:【orderId="+tOrderCrossCity.getId().toString()+"】,调用接口:"+result1); |
| | | |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除跨城出行订单 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tOrderCrossCityId) { |
| | | TOrderCrossCity tOrderCrossCity = tOrderCrossCityService.selectById(tOrderCrossCityId); |
| | | tOrderCrossCity.setIsDelete(2); |
| | | tOrderCrossCityService.updateById(tOrderCrossCity); |
| | | return SUCCESS_TIP; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.specialTrain; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | 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.SinataUtil; |
| | | import com.stylefeng.guns.modular.system.dao.OrderCancelMapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import org.springframework.beans.BeanUtils; |
| | | 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 javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 小件物流订单控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-09-24 14:20:41 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tOrderLogistics") |
| | | public class TOrderLogisticsController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tOrderLogistics/"; |
| | | |
| | | @Autowired |
| | | private ITOrderLogisticsService tOrderLogisticsService; |
| | | |
| | | @Resource |
| | | private OrderCancelMapper orderCancelMapper; |
| | | |
| | | @Autowired |
| | | private ITUserService userService; |
| | | |
| | | @Autowired |
| | | private ITransactionDetailsService transactionDetailsService; |
| | | |
| | | @Autowired |
| | | private IPaymentRecordService paymentRecordService; |
| | | |
| | | // @Autowired |
| | | // private ICBCPayUtil icbcPayUtil; |
| | | |
| | | @Autowired |
| | | private IIncomeService incomeService; |
| | | |
| | | @Autowired |
| | | private ITDriverService tDriverService; |
| | | |
| | | @Autowired |
| | | private PayMoneyUtil payMoneyUtil; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 跳转到小件物流订单首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tOrderLogistics.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加小件物流订单 |
| | | */ |
| | | @RequestMapping("/tOrderLogistics_add") |
| | | public String tOrderLogisticsAdd() { |
| | | return PREFIX + "tOrderLogistics_add.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到查看小件物流订单 |
| | | */ |
| | | @RequestMapping("/tOrderLogistics_detail/{tOrderLogisticsId}") |
| | | public String tOrderLogistics_detail(@PathVariable Integer tOrderLogisticsId, Model model) { |
| | | Map<String,Object> tOrderLogistics = tOrderLogisticsService.getLogisticsOrderDetailById(tOrderLogisticsId); |
| | | model.addAttribute("item",tOrderLogistics); |
| | | return PREFIX + "tOrderLogistics_detail.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取小件物流订单列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String insertTime, |
| | | String orderNum, |
| | | Integer type, |
| | | Integer orderSource, |
| | | String userName, |
| | | String userPhone, |
| | | String recipient, |
| | | String recipientPhone, |
| | | String driver, |
| | | Integer state) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | 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,ShiroKit.getUser().getRoleType(),ShiroKit.getUser().getObjectId(), |
| | | orderNum,orderSource,type,userName,userPhone,recipient,recipientPhone,driver,state)); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | @Autowired |
| | | private ITDriverService itDriverService; |
| | | |
| | | /** |
| | | * 取消小件物流订单 |
| | | */ |
| | | @RequestMapping(value = "/cancel") |
| | | @ResponseBody |
| | | public Object cancel(@RequestParam Integer tOrderLogisticsId) { |
| | | try{ |
| | | ShiroUser user = ShiroKit.getUser(); |
| | | TOrderLogistics tOrderLogistics = tOrderLogisticsService.selectById(tOrderLogisticsId); |
| | | tOrderLogistics.setState(10); |
| | | |
| | | //已支付的情况下进行退款操作 |
| | | 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); |
| | | } else { |
| | | List<PaymentRecord> paymentRecords = paymentRecordService.query(1, null, null, tOrderLogisticsId, tOrderLogistics.getType(), null, 2); |
| | | if (paymentRecords.size() == 0) { |
| | | return ResultUtil.error("订单还未进行支付"); |
| | | } |
| | | boolean b = false; |
| | | for(PaymentRecord query : paymentRecords){ |
| | | |
| | | if(query.getPayType() == 1){//微信 |
| | | Map<String, String> map = payMoneyUtil.wxRefund(query.getCode(), tOrderLogistics.getId() + "_" + tOrderLogistics.getType(), query.getAmount().toString(), query.getAmount().toString(), "/user/base/cancleOrderWXPay"); |
| | | if(!"SUCCESS".equals(map.get("return_code"))){ |
| | | return ResultUtil.error(map.get("return_msg")); |
| | | } |
| | | }else{//支付宝 |
| | | Map<String, String> map = payMoneyUtil.aliRefund(query.getCode(), query.getAmount().toString()); |
| | | if(!"10000".equals(map.get("code"))){ |
| | | return ResultUtil.error(map.get("msg")); |
| | | } |
| | | } |
| | | |
| | | |
| | | // Map<String, Object> merrefund = icbcPayUtil.merrefund(query.getCode(), "", query.getAmount(), tOrderLogistics.getId() + "_" + tOrderLogistics.getType(), tOrderLogistics.getOrderNum()); |
| | | // if (Integer.valueOf(merrefund.get("code").toString()) == 0) { |
| | | // Map<String, Object> refundqry = icbcPayUtil.refundqry("", query.getCode(), tOrderLogistics.getOrderNum()); |
| | | // if (Integer.valueOf(refundqry.get("code").toString()) == 0 && Integer.valueOf(refundqry.get("pay_status").toString()) == 0) {//成功 |
| | | // b = true; |
| | | // } |
| | | // if (Integer.valueOf(refundqry.get("code").toString()) == 0 && Integer.valueOf(refundqry.get("pay_status").toString()) == 1) {//失败 |
| | | // return ResultUtil.error("订单取消失败(退款不成功)"); |
| | | // } |
| | | // if (Integer.valueOf(refundqry.get("code").toString()) == 0 && Integer.valueOf(refundqry.get("pay_status").toString()) == 2) {//未知 |
| | | // return ResultUtil.error("退款返回未知异常"); |
| | | // } |
| | | // } |
| | | } |
| | | if(b){ |
| | | //添加交易明细 |
| | | |
| | | } |
| | | } |
| | | |
| | | transactionDetailsService.saveData(tOrderLogistics.getUserId(), "小件订单取消退款", tOrderLogistics.getPayMoney().doubleValue(), 1, 1, 1, 4, tOrderLogistics.getId()); |
| | | |
| | | //添加负的收入明细 |
| | | List<Income> incomes = incomeService.selectList(new EntityWrapper<Income>().eq("type", 2).eq("incomeId", tOrderLogistics.getId()).eq("orderType", tOrderLogistics.getType())); |
| | | for(Income income : incomes){ |
| | | if(income.getUserType() == 2){//处理司机的收入 |
| | | TDriver driver = tDriverService.selectById(income.getObjectId()); |
| | | driver.setBalance(driver.getBalance().subtract(new BigDecimal(income.getMoney()))); |
| | | driver.setLaveBusinessMoney(new BigDecimal(driver.getLaveBusinessMoney()).subtract(new BigDecimal(income.getMoney())).doubleValue()); |
| | | driver.setBusinessMoney(new BigDecimal(driver.getBusinessMoney()).subtract(new BigDecimal(income.getMoney())).doubleValue()); |
| | | tDriverService.updateById(driver); |
| | | } |
| | | Income income1 = new Income(); |
| | | BeanUtils.copyProperties(income, income1); |
| | | income1.setMoney(income.getMoney() * -1); |
| | | income1.setId(null); |
| | | income1.setInsertTime(new Date()); |
| | | incomeService.insert(income1); |
| | | } |
| | | } |
| | | tOrderLogisticsService.updateById(tOrderLogistics); |
| | | |
| | | //添加取消记录 |
| | | OrderCancel orderCancel = new OrderCancel(); |
| | | orderCancel.setOrderId(tOrderLogistics.getId()); |
| | | orderCancel.setOrderType(tOrderLogistics.getType()); |
| | | orderCancel.setReason("调度端取消订单"); |
| | | orderCancel.setRemark("调度“" + user.getName() + "-" + user.getId() + "”执行取消操作"); |
| | | orderCancel.setState(2); |
| | | orderCancel.setInsertTime(new Date()); |
| | | orderCancel.setUserType(3); |
| | | orderCancel.setUserId(user.getId()); |
| | | orderCancelMapper.insert(orderCancel); |
| | | |
| | | //增加推送 |
| | | Map<String,String> map = new HashMap<>(); |
| | | map.put("id", tOrderLogistics.getId().toString()); |
| | | map.put("orderType", tOrderLogistics.getType().toString()); |
| | | String result = HttpRequestUtil.postRequest(PushURL.cancel_order_url, map); |
| | | System.out.println("小件物流取消:【orderId="+tOrderLogistics.getId().toString()+"】,调用接口:"+result); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | /** |
| | | * 删除小件物流订单 |
| | | */ |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(@RequestParam Integer tOrderLogisticsId) { |
| | | TOrderLogistics tOrderLogistics = tOrderLogisticsService.selectById(tOrderLogisticsId); |
| | | tOrderLogistics.setIsDelete(2); |
| | | tOrderLogisticsService.updateById(tOrderLogistics); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | } |
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderPrivateCarController.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderTransferController.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TReassignController.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TServerCarmodelController.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TSiteController.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TSystemPriceController.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/BlackboardController.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/DeptController.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/DictController.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/KaptchaController.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/LogController.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/LoginController.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/LoginLogController.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/MenuController.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/RoleController.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/UediterController.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/system/UserMgrController.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/taxi/TOrderTaxiController.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/util/MD5.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/util/MyQrCodeUtil.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/util/QRCodeUtil.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/util/SendSms.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/util/SignUtil.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/util/UploadUtil.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/util/VenueLatVo.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/util/WoUtil.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/util/WrapperUtil.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/CarInsuranceMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/DeptMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/DictMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/DriverActivityHistoryMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/DriverActivityMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/DriverActivityOnlineMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/DriverActivityOrderMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/DriverActivityRegisteredMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/DriverOnlineMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/DriverPunishMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/DriverTrainMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/FrequentPassengersMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/GDInterfaceMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/IncomeMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/LineShiftDriverMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/LoginLogMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/MenuMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/NoticeMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/OperationLogMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/OrderCancelMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/OrderFrequentPassengersMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/PaymentRecordMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/RegionMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/RelationMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/RoleMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/SysCouponActivityMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/SysCouponRecordMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/SysRedPacketRecordMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TActivityGeneralizationMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TAdvertisementMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TAgreementMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TCarBrandMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TCarMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TCarModelMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TCarServiceMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TCharteredServiceMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TCompanyCityMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TCompanyMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TComplaintMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TDispatchMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TDriverFacialFailMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TDriverLineMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TDriverMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TDriverServiceMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TFeedbackMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TIntegralGoodsMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TIntegralOrderMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TInvoiceMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TLineCompanyMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TLineMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TLinePriceMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TLineShiftMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TLineSiteMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TLocationMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TNoticesMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TOpenCityBusinessMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TOpenCityMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TOpenCitySiteMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TOrderCharterMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TOrderCharteredCarMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TOrderCrossCityMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TOrderEvaluateMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TOrderLogisticsMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TOrderPositionMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TOrderPrivateCarMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TOrderTapeMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TOrderTaxiMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TOrderTransferMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TPhoneMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TProblemMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TPubTransactionDetailsMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TPubWithdrawalMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TReassignMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TRegionMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TServerCarmodelMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TSiteMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TSmsrecordMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TSysCancleOrderMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TSysFaceDistinguishMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TSysIntegralMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TSysPushOrderMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TSysReformistMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TSysSensitiveWordsMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TSystemNoticeMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TSystemPriceMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TUserMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TUserRedPacketRecordMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TVerifiedMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TVersionManagementMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/TransactionDetailsMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/UserActivityBalanceMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/UserActivityDiscount1Mapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/UserActivityDiscount2Mapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/UserActivityInviteMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/UserActivityMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/UserActivityRedenvelopeMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/UserActivityRegisteredMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/UserCouponRecordMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/UserMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/UserRedPacketRecordMapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/CarInsuranceMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DeptMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DictMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverActivityHistoryMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverActivityMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverActivityOnlineMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverActivityOrderMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverActivityRegisteredMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverOnlineMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverPunishMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/DriverTrainMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/FrequentPassengersMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/GDInterfaceMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/IncomeMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/LineShiftDriverMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/LoginLogMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/MenuMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/NoticeMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/OperationLogMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/OrderCancelMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/OrderFrequentPassengersMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/PaymentRecordMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/RegionMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/RelationMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/RoleMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/SysCouponActivityMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/SysCouponRecordMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/SysRedPacketRecordMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TActivityGeneralizationMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TAdvertisementMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TAgreementMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TCarBrandMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TCarMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TCarModelMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TCarServiceMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TCharteredServiceMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TCompanyCityMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TCompanyMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TComplaintMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TDispatchMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TDriverFacialFailMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TDriverLineMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TDriverMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TDriverServiceMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TFeedbackMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TIntegralGoodsMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TIntegralOrderMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TInvoiceMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TLineCompanyMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TLineMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TLinePriceMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TLineShiftMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TLineSiteMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TLocationMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TNoticesMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOpenCityBusinessMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOpenCityMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOpenCitySiteMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderCharterMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderCharteredCarMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderCrossCityMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderEvaluateMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderLogisticsMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderPositionMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderPrivateCarMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderTapeMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderTaxiMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TOrderTransferMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TPhoneMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TProblemMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TPubTransactionDetailsMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TPubWithdrawalMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TReassignMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TRegionMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TServerCarmodelMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TSiteMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TSmsrecordMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TSysCancleOrderMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TSysFaceDistinguishMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TSysIntegralMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TSysPushOrderMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TSysReformistMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TSysSensitiveWordsMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TSystemNoticeMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TSystemPriceMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TUserMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TUserRedPacketRecordMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TVerifiedMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TVersionManagementMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TransactionDetailsMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserActivityBalanceMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserActivityDiscount1Mapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserActivityDiscount2Mapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserActivityInviteMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserActivityMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserActivityRedenvelopeMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserActivityRegisteredMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserCouponRecordMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/UserRedPacketRecordMapper.xml
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/factory/UserFactory.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/CarInsurance.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/Dept.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/Dict.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/DriverActivity.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/DriverActivityHistory.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/DriverActivityOnline.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/DriverActivityOrder.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/DriverActivityRegistered.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/DriverOnline.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/DriverPunish.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/DriverTrain.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/FrequentPassengers.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/GDInterface.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/Income.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/LineShiftDriver.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/LoginLog.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/Menu.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/Notice.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/OperationLog.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/OrderCancel.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/OrderFrequentPassengers.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/PaymentRecord.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/Region.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/Relation.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/Role.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/SysCouponActivity.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/SysCouponRecord.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/SysRedPacketRecord.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TActivityGeneralization.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TAdvertisement.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TAgreement.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TCar.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TCarBrand.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TCarModel.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TCarService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TCharteredService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TCompany.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TCompanyCity.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TComplaint.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TDispatch.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TDriver.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TDriverFacialFail.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TDriverLine.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TDriverService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TFeedback.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TIntegralGoods.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TIntegralOrder.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TInvoice.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TLine.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TLineCompany.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TLinePrice.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TLineShift.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TLineSite.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TLocation.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TNotices.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TOpenCity.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TOpenCityBusiness.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TOpenCitySite.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TOrderCharter.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TOrderCharteredCar.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TOrderCrossCity.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TOrderEvaluate.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TOrderLogistics.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TOrderPosition.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TOrderPrivateCar.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TOrderTape.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TOrderTaxi.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TOrderTransfer.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TPhone.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TProblem.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TPubTransactionDetails.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TPubWithdrawal.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TReassign.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TRegion.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TServerCarmodel.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TSite.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TSmsrecord.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TSysCancleOrder.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TSysFaceDistinguish.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TSysIntegral.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TSysPushOrder.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TSysReformist.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TSysSensitiveWords.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TSystemNotice.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TSystemPrice.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TUser.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TUserRedPacketRecord.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TVerified.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TVersionManagement.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/TransactionDetails.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/User.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/UserActivity.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/UserActivityBalance.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/UserActivityDiscount1.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/UserActivityDiscount2.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/UserActivityInvite.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/UserActivityRedenvelope.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/UserActivityRegistered.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/UserCouponRecord.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/UserRedPacketRecord.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IDeptService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IDictService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IDriverActivityHistoryService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IDriverActivityOnlineService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IDriverActivityOrderService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IDriverActivityRegisteredService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IDriverActivityService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IDriverOnlineService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IFrequentPassengersService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IGDInterfaceService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IIncomeService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ILoginLogService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IMenuService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/INoticeService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IOperationLogService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IOrderFrequentPassengersService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IPaymentRecordService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IRelationService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IRoleService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ISysCouponActivityService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ISysCouponRecordService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ISysRedPacketRecordService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITActivityGeneralizationService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITAdvertisementService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITAgreementService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITCarBrandService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITCarModelService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITCarService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITCarServiceService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITCharteredServiceService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITCompanyCityService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITCompanyService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITComplaintService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITDispatchService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITDriverFacialFailService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITDriverLineService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITDriverService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITDriverServiceService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITFeedbackService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITIntegralGoodsService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITIntegralOrderService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITInvoiceService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITLineCompanyService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITLinePriceService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITLineService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITLineShiftService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITLineSiteService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITLocationService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITNoticesService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITOpenCityBusinessService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITOpenCityService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITOrderCharterService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITOrderCharteredCarService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITOrderCrossCityService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITOrderEvaluateService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITOrderLogisticsService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITOrderPositionService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITOrderPrivateCarService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITOrderTapeService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITOrderTaxiService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITOrderTransferService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITPhoneService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITProblemService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITPubTransactionDetailsService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITPubWithdrawalService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITReassignService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITRegionService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITServerCarmodelService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITSiteService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITSmsrecordService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITSysCancleOrderService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITSysFaceDistinguishService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITSysIntegralService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITSysPushOrderService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITSysReformistService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITSysSensitiveWordsService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITSystemNoticeService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITSystemPriceService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITUserRedPacketRecordService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITUserService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITVerifiedService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITVersionManagementService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/ITransactionDetailsService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IUserActivityBalanceService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IUserActivityDiscount1Service.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IUserActivityDiscount2Service.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IUserActivityInviteService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IUserActivityRedenvelopeService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IUserActivityRegisteredService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IUserActivityService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IUserCouponRecordService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IUserRedPacketRecordService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/IUserService.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DeptServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DictServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverActivityHistoryServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverActivityOnlineServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverActivityOrderServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverActivityRegisteredServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverActivityServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/DriverOnlineServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/FrequentPassengersServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/GDInterfaceServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/IncomeServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/LoginLogServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/MenuServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/NoticeServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/OperationLogServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/OrderFrequentPassengersServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/PaymentRecordServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/RelationServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/RoleServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/SysCouponActivityServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/SysCouponRecordServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/SysRedPacketRecordServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TActivityGeneralizationServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TAdvertisementServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TAgreementServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TCarBrandServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TCarModelServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TCarServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TCarServiceServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TCharteredServiceServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TCompanyCityServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TCompanyServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TComplaintServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TDispatchServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TDriverFacialFailServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TDriverLineServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TDriverServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TDriverServiceServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TFeedbackServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TIntegralGoodsServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TIntegralOrderServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TInvoiceServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TLineCompanyServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TLinePriceServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TLineServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TLineShiftServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TLineSiteServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TLocationServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TNoticesServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TOpenCityBusinessServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TOpenCityServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TOrderCharterServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TOrderCharteredCarServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TOrderCrossCityServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TOrderEvaluateServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TOrderLogisticsServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TOrderPositionServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TOrderPrivateCarServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TOrderTapeServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TOrderTaxiServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TOrderTransferServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TPhoneServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TProblemServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TPubTransactionDetailsServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TPubWithdrawalServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TReassignServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TRegionServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TServerCarmodelServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TSiteServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TSmsrecordServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TSysCancleOrderServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TSysFaceDistinguishServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TSysIntegralServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TSysPushOrderServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TSysReformistServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TSysSensitiveWordsServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TSystemNoticeServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TSystemPriceServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TUserRedPacketRecordServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TUserServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TVerifiedServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TVersionManagementServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TransactionDetailsServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserActivityBalanceServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserActivityDiscount1ServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserActivityDiscount2ServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserActivityInviteServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserActivityRedenvelopeServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserActivityRegisteredServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserActivityServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserCouponRecordServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserRedPacketRecordServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserServiceImpl.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/transfer/ManagerUser.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/transfer/ReqAddManager.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/transfer/ReqEditManager.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/transfer/UserDto.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/AESUtils.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/AddAdminLogUtil.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/ConstellationUtil.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/DateUtil.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GDMapElectricFenceUtil.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GDMapGeocodingUtil.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/GaoDeMapUtil.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/HttpClientUtil.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/HttpRequestUtil.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/HuaWeiSMSUtil.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/ICBCPayUtil.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/JpushUtil.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/MD5AndKL.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/OrderUtil.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/OssUploadUtil.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PayMoneyUtil.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushMinistryOfTransportUtil.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/PushURL.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/RedisUtil.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/ResultUtil.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/RongCloudUtil.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/SpringContextsUtil.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/TaskUtil.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/UUIDUtil.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/WoUtil.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/task/QuartzTest.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/task/TestJob.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/task/ThreadTes.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/task/base/AbstractJob.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/task/base/QuartzManager.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/task/base/TimeJobType.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/task/exceptions/TimeException.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/task/jobs/AddMachine.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/task/jobs/AddNotice.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/task/jobs/AddSensitiveWord.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/task/jobs/SendSms.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/task/start/TimerServerStartJob.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/three/Base64Coder.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/three/HMACSHA1Util.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/three/PlatformUtil.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/three/TokenUtil.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/CustomWarpper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/DeptWarpper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/DictWarpper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/LogWarpper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/MenuWarpper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/NoticeWrapper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/RoleWarpper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/TFeedbackWarpper.java
ManagementNTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/warpper/UserWarpper.java
ManagementNTTravel/guns-admin/src/main/resources/META-INF/spring-devtools.properties
ManagementNTTravel/guns-admin/src/main/resources/application.yml
ManagementNTTravel/guns-admin/src/main/resources/ehcache.xml
ManagementNTTravel/guns-admin/src/main/resources/logback-spring.xml
ManagementNTTravel/guns-admin/src/test/sql/test.sql
ManagementNTTravel/guns-core/pom.xml
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/CoreFlag.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/aop/BaseControllerExceptionHandler.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/base/controller/BaseController.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/base/controller/GlobalController.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/base/controller/GunsErrorView.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/base/tips/ErrorTip.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/base/tips/SuccessTip.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/base/tips/Tip.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/base/warpper/BaseControllerWarpper.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/cache/BaseCacheFactory.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/cache/CacheKit.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/cache/EhcacheFactory.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/cache/ICache.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/cache/ILoader.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/config/DefaultFastjsonConfig.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/config/DefaultMultiConfig.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/config/DefaultProperties.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/config/DefaultWebConfig.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/config/properties/DruidProperties.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/config/properties/MutiDataSourceProperties.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/constant/IsMenu.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/datascope/DataScope.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/datascope/DataScopeInterceptor.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/db/Db.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/exception/GunsException.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/exception/GunsExceptionEnum.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/exception/ServiceExceptionEnum.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/mutidatasource/DataSourceContextHolder.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/mutidatasource/DynamicDataSource.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/mutidatasource/annotion/DataSource.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/mutidatasource/aop/MultiSourceExAop.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/node/MenuNode.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/node/ZTreeNode.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/page/PageBT.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/page/PageInfoBT.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/qr/ImgQrTool.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/qr/MatrixToImageConfig.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/qr/MatrixToImageWriter.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/qr/QrImage.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/support/BasicType.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/support/BeanKit.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/support/ClassKit.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/support/CollectionKit.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/support/DateTime.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/support/DateTimeKit.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/support/HexKit.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/support/HttpKit.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/support/ObjectKit.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/support/PageKit.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/support/StrKit.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/support/WafKit.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/support/WafRequestWrapper.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/support/exception/ToolBoxException.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/util/Convert.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/util/DateUtil.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/util/ExcelExportUtil.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/util/FileUtil.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/util/HttpSessionHolder.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/util/IdGenerator.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/util/MD5Util.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/util/NumUtil.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/util/PingYinUtil.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/util/RenderUtil.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/util/ResKit.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/util/SimpleContrast.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/util/SpringContextHolder.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/util/SqlUtil.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/util/ToolUtil.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/xss/XssFilter.java
ManagementNTTravel/guns-core/src/main/java/com/stylefeng/guns/core/xss/XssHttpServletRequestWrapper.java
ManagementNTTravel/guns-core/src/main/resources/META-INF/spring.factories
ManagementNTTravel/guns-core/src/main/resources/default-config.properties
ManagementNTTravel/guns-generator/pom.xml
ManagementNTTravel/guns-generator/src/main/java/com/stylefeng/guns/generator/action/GunsCodeGenerator.java
ManagementNTTravel/guns-generator/src/main/java/com/stylefeng/guns/generator/action/config/AbstractGeneratorConfig.java
ManagementNTTravel/guns-generator/src/main/java/com/stylefeng/guns/generator/action/config/GunsGeneratorConfig.java
ManagementNTTravel/guns-generator/src/main/java/com/stylefeng/guns/generator/action/config/WebGeneratorConfig.java
ManagementNTTravel/guns-generator/src/main/java/com/stylefeng/guns/generator/action/model/GenQo.java
ManagementNTTravel/guns-generator/src/main/java/com/stylefeng/guns/generator/engine/SimpleTemplateEngine.java
ManagementNTTravel/guns-generator/src/main/java/com/stylefeng/guns/generator/engine/base/AbstractTemplateEngine.java
ManagementNTTravel/guns-generator/src/main/java/com/stylefeng/guns/generator/engine/base/GunsTemplateEngine.java
ManagementNTTravel/guns-generator/src/main/java/com/stylefeng/guns/generator/engine/config/ContextConfig.java
ManagementNTTravel/guns-generator/src/main/java/com/stylefeng/guns/generator/engine/config/ControllerConfig.java
ManagementNTTravel/guns-generator/src/main/java/com/stylefeng/guns/generator/engine/config/DaoConfig.java
ManagementNTTravel/guns-generator/src/main/java/com/stylefeng/guns/generator/engine/config/Menu.java
ManagementNTTravel/guns-generator/src/main/java/com/stylefeng/guns/generator/engine/config/PageConfig.java
ManagementNTTravel/guns-generator/src/main/java/com/stylefeng/guns/generator/engine/config/ServiceConfig.java
ManagementNTTravel/guns-generator/src/main/java/com/stylefeng/guns/generator/engine/config/SqlConfig.java
ManagementNTTravel/guns-generator/src/main/resources/gunsTemplate/advanced/Controller.java.btl
ManagementNTTravel/guns-generator/src/main/resources/gunsTemplate/advanced/menu_sql.sql.btl
ManagementNTTravel/guns-generator/src/main/resources/gunsTemplate/advanced/page.html.btl
ManagementNTTravel/guns-generator/src/main/resources/gunsTemplate/advanced/page.js.btl
ManagementNTTravel/guns-generator/src/main/resources/gunsTemplate/advanced/page_add.html.btl
ManagementNTTravel/guns-generator/src/main/resources/gunsTemplate/advanced/page_edit.html.btl
ManagementNTTravel/guns-generator/src/main/resources/gunsTemplate/advanced/page_info.js.btl
ManagementNTTravel/guns-rest/pom.xml
ManagementNTTravel/guns-rest/src/main/java/com/stylefeng/guns/rest/GunsRestApplication.java
ManagementNTTravel/guns-rest/src/main/java/com/stylefeng/guns/rest/GunsRestServletInitializer.java
ManagementNTTravel/guns-rest/src/main/java/com/stylefeng/guns/rest/common/SimpleObject.java
ManagementNTTravel/guns-rest/src/main/java/com/stylefeng/guns/rest/common/aop/GlobalExceptionHandler.java
ManagementNTTravel/guns-rest/src/main/java/com/stylefeng/guns/rest/common/exception/BizExceptionEnum.java
ManagementNTTravel/guns-rest/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/UserMapper.java
ManagementNTTravel/guns-rest/src/main/java/com/stylefeng/guns/rest/common/persistence/dao/mapping/UserMapper.xml
ManagementNTTravel/guns-rest/src/main/java/com/stylefeng/guns/rest/common/persistence/model/User.java
ManagementNTTravel/guns-rest/src/main/java/com/stylefeng/guns/rest/config/MessageConverConfig.java
ManagementNTTravel/guns-rest/src/main/java/com/stylefeng/guns/rest/config/MybatisPlusConfig.java
ManagementNTTravel/guns-rest/src/main/java/com/stylefeng/guns/rest/config/WebConfig.java
ManagementNTTravel/guns-rest/src/main/java/com/stylefeng/guns/rest/config/properties/JwtProperties.java
ManagementNTTravel/guns-rest/src/main/java/com/stylefeng/guns/rest/config/properties/RestProperties.java
ManagementNTTravel/guns-rest/src/main/java/com/stylefeng/guns/rest/modular/auth/controller/AuthController.java
ManagementNTTravel/guns-rest/src/main/java/com/stylefeng/guns/rest/modular/auth/controller/dto/AuthRequest.java
ManagementNTTravel/guns-rest/src/main/java/com/stylefeng/guns/rest/modular/auth/controller/dto/AuthResponse.java
ManagementNTTravel/guns-rest/src/main/java/com/stylefeng/guns/rest/modular/auth/converter/BaseTransferEntity.java
ManagementNTTravel/guns-rest/src/main/java/com/stylefeng/guns/rest/modular/auth/converter/WithSignMessageConverter.java
ManagementNTTravel/guns-rest/src/main/java/com/stylefeng/guns/rest/modular/auth/filter/AuthFilter.java
ManagementNTTravel/guns-rest/src/main/java/com/stylefeng/guns/rest/modular/auth/security/DataSecurityAction.java
ManagementNTTravel/guns-rest/src/main/java/com/stylefeng/guns/rest/modular/auth/security/impl/Base64SecurityAction.java
ManagementNTTravel/guns-rest/src/main/java/com/stylefeng/guns/rest/modular/auth/util/JwtTokenUtil.java
ManagementNTTravel/guns-rest/src/main/java/com/stylefeng/guns/rest/modular/auth/validator/IReqValidator.java
ManagementNTTravel/guns-rest/src/main/java/com/stylefeng/guns/rest/modular/auth/validator/dto/Credence.java
ManagementNTTravel/guns-rest/src/main/java/com/stylefeng/guns/rest/modular/auth/validator/impl/DbValidator.java
ManagementNTTravel/guns-rest/src/main/java/com/stylefeng/guns/rest/modular/auth/validator/impl/SimpleValidator.java
ManagementNTTravel/guns-rest/src/main/java/com/stylefeng/guns/rest/modular/example/ExampleController.java
ManagementNTTravel/guns-rest/src/main/resources/application.yml
ManagementNTTravel/pom.xml |