yonge 3 years ago
parent
commit
53d7db8b39
44 changed files with 2851 additions and 57 deletions
  1. 47 6
      cooleshow-cms/pom.xml
  2. 0 13
      cooleshow-cms/src/main/java/com/yonge/cooleshow/App.java
  3. 34 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/CmsServerApplication.java
  4. 52 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/config/PermissionCheckService.java
  5. 44 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/config/ResourceServerConfig.java
  6. 47 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/config/WebMvcConfig.java
  7. 85 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/controller/HelpCenterCatalogController.java
  8. 89 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/controller/HelpCenterContentControlller.java
  9. 127 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/controller/NewsController.java
  10. 27 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/controller/TaskController.java
  11. 42 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/controller/queryinfo/HelpCenterContentQueryInfo.java
  12. 99 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/controller/queryinfo/NewsInformationQueryInfo.java
  13. 13 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dal/dao/HelpCenterCatalogDao.java
  14. 13 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dal/dao/HelpCenterContentDao.java
  15. 15 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dal/dao/StudentRegistrationDao.java
  16. 24 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dal/dao/SysConfigDao.java
  17. 37 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dal/dao/SysNewsInformationDao.java
  18. 13 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dal/dao/SysNewsTypeDao.java
  19. 126 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dal/entity/HelpCenterCatalog.java
  20. 121 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dal/entity/HelpCenterContent.java
  21. 20 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dal/entity/NewsStatusEnum.java
  22. 104 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dal/entity/SysConfig.java
  23. 281 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dal/entity/SysNewsInformation.java
  24. 81 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dal/entity/SysNewsType.java
  25. 17 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dal/entity/SysNewsTypeTree.java
  26. 26 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dto/SysNewsInformationDto.java
  27. 33 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/interceptor/OperationLogInterceptor.java
  28. 31 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/service/HelpCenterCatalogService.java
  29. 11 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/service/HelpCenterContentService.java
  30. 49 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/service/SysNewsInformationService.java
  31. 15 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/service/SysNewsTypeService.java
  32. 51 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/service/impl/HelpCenterCatalogServiceImpl.java
  33. 41 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/service/impl/HelpCenterContentServiceImpl.java
  34. 159 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/service/impl/SysNewsInformationServiceImpl.java
  35. 49 0
      cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/service/impl/SysNewsTypeServiceImpl.java
  36. 15 0
      cooleshow-cms/src/main/resources/bootstrap-dev.properties
  37. 21 0
      cooleshow-cms/src/main/resources/config/mybatis/Global.mapper.xml
  38. 96 0
      cooleshow-cms/src/main/resources/config/mybatis/HelpCenterCatalogMapper.xml
  39. 164 0
      cooleshow-cms/src/main/resources/config/mybatis/HelpCenterContentMapper.xml
  40. 85 0
      cooleshow-cms/src/main/resources/config/mybatis/SysConfigMapper.xml
  41. 309 0
      cooleshow-cms/src/main/resources/config/mybatis/SysNewsInformationMapper.xml
  42. 83 0
      cooleshow-cms/src/main/resources/config/mybatis/SysNewsTypeMapper.xml
  43. 55 0
      cooleshow-cms/src/main/resources/logback-spring.xml
  44. 0 38
      cooleshow-cms/src/test/java/com/yonge/cooleshow/AppTest.java

+ 47 - 6
cooleshow-cms/pom.xml

@@ -21,11 +21,52 @@
   </properties>
 
   <dependencies>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-      <scope>test</scope>
-    </dependency>
+
+		<dependency>
+			<groupId>com.alibaba.cloud</groupId>
+			<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
+		</dependency>
+
+		<dependency>
+			<groupId>com.alibaba.cloud</groupId>
+			<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
+		</dependency>
+
+		<!-- swagger-spring-boot -->
+		<dependency>
+			<groupId>com.spring4all</groupId>
+			<artifactId>swagger-spring-boot-starter</artifactId>
+		</dependency>
+
+		<dependency>
+			<groupId>com.github.xiaoymin</groupId>
+			<artifactId>swagger-bootstrap-ui</artifactId>
+		</dependency>
+
+		<dependency>
+			<groupId>com.alibaba</groupId>
+			<artifactId>druid-spring-boot-starter</artifactId>
+		</dependency>
+
+		<dependency>
+			<groupId>mysql</groupId>
+			<artifactId>mysql-connector-java</artifactId>
+		</dependency>
+
+		<dependency>
+			<groupId>com.yonge.cooleshow</groupId>
+			<artifactId>auth-api</artifactId>
+		</dependency>
+
+		<dependency>
+			<groupId>com.yonge.toolset</groupId>
+			<artifactId>audit-log</artifactId>
+			<exclusions>
+				<exclusion>
+					<artifactId>freemarker</artifactId>
+					<groupId>org.freemarker</groupId>
+				</exclusion>
+			</exclusions>
+		</dependency>
   </dependencies>
 </project>

+ 0 - 13
cooleshow-cms/src/main/java/com/yonge/cooleshow/App.java

@@ -1,13 +0,0 @@
-package com.yonge.cooleshow;
-
-/**
- * Hello world!
- *
- */
-public class App 
-{
-    public static void main( String[] args )
-    {
-        System.out.println( "Hello World!" );
-    }
-}

+ 34 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/CmsServerApplication.java

@@ -0,0 +1,34 @@
+package com.yonge.cooleshow.cms;
+
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
+import org.springframework.cloud.client.loadbalancer.LoadBalanced;
+import org.springframework.cloud.openfeign.EnableFeignClients;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.ComponentScan;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.client.RestTemplate;
+
+import com.spring4all.swagger.EnableSwagger2Doc;
+
+@SpringBootApplication
+@EnableDiscoveryClient
+@EnableFeignClients("com.yonge.cooleshow")
+@MapperScan("com.yonge.cooleshow.cms.dal.dao")
+@ComponentScan(basePackages = { "com.yonge.cooleshow.cms", "com.yonge.cooleshow.auth", "com.yonge.cooleshow.common.config", "com.yonge.cooleshow.common.security", "com.yonge.toolset.log" })
+@Configuration
+@EnableSwagger2Doc
+public class CmsServerApplication {
+
+	public static void main(String[] args) {
+		SpringApplication.run(CmsServerApplication.class, args);
+	}
+
+	@Bean
+	@LoadBalanced
+	public RestTemplate restTemplate() {
+		return new RestTemplate();
+	}
+}

+ 52 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/config/PermissionCheckService.java

@@ -0,0 +1,52 @@
+package com.yonge.cooleshow.cms.config;
+
+import java.util.Collection;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.stereotype.Component;
+
+import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
+import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.cooleshow.common.security.SecurityUtils;
+
+@Component("pcs")
+public class PermissionCheckService {
+	
+	@Autowired
+	@Lazy
+	private SysUserFeignService sysUserFeignService;
+
+	public boolean hasPermissions(String... permissions) {
+		Authentication authentication = SecurityUtils.getAuthentication();
+		if (authentication == null) {
+			return false;
+		}
+
+		SysUser user = sysUserFeignService.queryUserInfo();
+		if(user.getIsSuperAdmin()){
+			return true;
+		}
+
+		Collection<? extends GrantedAuthority> authorities = authentication.getAuthorities();
+
+		for (String perm : permissions) {
+			for (GrantedAuthority authority : authorities) {
+				if (StringUtils.equalsIgnoreCase(perm, authority.getAuthority())) {
+					return true;
+				}
+			}
+		}
+
+		return false;
+	}
+
+	public boolean hasRoles(String... roles) {
+
+		return hasPermissions(roles);
+	}
+
+}

+ 44 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/config/ResourceServerConfig.java

@@ -0,0 +1,44 @@
+package com.yonge.cooleshow.cms.config;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
+import org.springframework.security.oauth2.config.annotation.web.configuration.ResourceServerConfigurerAdapter;
+import org.springframework.security.oauth2.config.annotation.web.configurers.ResourceServerSecurityConfigurer;
+
+import com.yonge.cooleshow.common.security.BaseAccessDeniedHandler;
+import com.yonge.cooleshow.common.security.BaseAuthenticationEntryPoint;
+
+@Configuration
+@EnableResourceServer
+@EnableGlobalMethodSecurity(prePostEnabled = true)
+public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
+
+	@Autowired
+	private BaseAccessDeniedHandler baseAccessDeniedHandler;
+
+	@Autowired
+	private BaseAuthenticationEntryPoint baseAuthenticationEntryPoint;
+
+	@Override
+	public void configure(HttpSecurity http) throws Exception {
+		http.authorizeRequests()
+		.antMatchers("/task/**")
+		.hasIpAddress("0.0.0.0/0")
+				.antMatchers("/v2/api-docs", "/news/list", "/news/query", "/news/homeList", "/news/typeList")
+				.permitAll()
+				// 任何人不登录都可以获取的资源
+				// .antMatchers("/ipController/**").hasIpAddress("127.0.0.1") //特定ip可以不登录获取资源
+				// .antMatchers("/ipControll/**").access("isAuthenticated() and hasIpAddress('127.0.0.1')")// 特定ip必须登录才能获取
+				.anyRequest().authenticated().and().csrf().disable().exceptionHandling().accessDeniedHandler(baseAccessDeniedHandler)
+				.authenticationEntryPoint(baseAuthenticationEntryPoint).and();
+	}
+
+	@Override
+	public void configure(ResourceServerSecurityConfigurer resources) throws Exception {
+		resources.authenticationEntryPoint(baseAuthenticationEntryPoint).accessDeniedHandler(baseAccessDeniedHandler);
+	}
+
+}

+ 47 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/config/WebMvcConfig.java

@@ -0,0 +1,47 @@
+package com.yonge.cooleshow.cms.config;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.format.FormatterRegistry;
+import org.springframework.http.MediaType;
+import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+import com.yonge.cooleshow.cms.interceptor.OperationLogInterceptor;
+import com.yonge.cooleshow.common.config.EnumConverterFactory;
+import com.yonge.cooleshow.common.config.LocalFastJsonHttpMessageConverter;
+
+@Configuration
+public class WebMvcConfig implements WebMvcConfigurer {
+	
+	@Autowired
+	private OperationLogInterceptor operationLogInterceptor;
+
+	/**
+	 * 枚举类的转换器 addConverterFactory
+	 */
+	@Override
+	public void addFormatters(FormatterRegistry registry) {
+		registry.addConverterFactory(new EnumConverterFactory());
+	}
+	
+	@Override
+	public void addInterceptors(InterceptorRegistry registry) {
+		registry.addInterceptor(operationLogInterceptor).addPathPatterns("/**").excludePathPatterns("/login");
+	}
+
+	@Bean
+    public HttpMessageConverters fastJsonHttpMessageConverters(){
+		LocalFastJsonHttpMessageConverter converter = new LocalFastJsonHttpMessageConverter();
+        List<MediaType> fastMediaTypes =  new ArrayList<MediaType>();
+        fastMediaTypes.add(MediaType.APPLICATION_JSON_UTF8);
+        converter.setSupportedMediaTypes(fastMediaTypes);
+        return new HttpMessageConverters(converter);
+    }
+
+}

+ 85 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/controller/HelpCenterCatalogController.java

@@ -0,0 +1,85 @@
+package com.yonge.cooleshow.cms.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+
+import java.util.Date;
+import java.util.List;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.yonge.cooleshow.cms.dal.entity.HelpCenterCatalog;
+import com.yonge.cooleshow.cms.service.HelpCenterCatalogService;
+import com.yonge.cooleshow.cms.service.HelpCenterContentService;
+import com.yonge.cooleshow.common.controller.BaseController;
+import com.yonge.toolset.log.model.AuditLogAnnotation;
+
+@RestController
+@RequestMapping("helpCenterCatalog")
+@Api(tags = "帮助中心分类")
+public class HelpCenterCatalogController extends BaseController {
+
+	@Autowired
+	private HelpCenterCatalogService helpCenterCatalogService;
+
+	@Autowired
+	private HelpCenterContentService helpCenterContentService;
+
+	@ApiOperation("分类列表分页查询")
+	@GetMapping(value = "list")
+	@ApiImplicitParams({ @ApiImplicitParam(name = "parentId", value = "父分类编号(可为空)", required = true, dataType = "Integer"),
+			@ApiImplicitParam(name = "status", value = "状态(1,显示 0,隐藏;可为空)", required = true, dataType = "Integer") })
+	public Object list(Integer parentId, Integer status) {
+		List<HelpCenterCatalog> dataList = helpCenterCatalogService.queryByParentId(parentId, status);
+		return succeed(dataList);
+	}
+
+	@ApiOperation("分类详情查询")
+	@GetMapping(value = "get")
+	@ApiImplicitParam(name = "id", value = "分类编号", required = true, dataType = "Integer", paramType = "path")
+	public Object findHelpCatalogById(Integer id) {
+		if (id == null || id <= 0)
+			return failed("请检查输入的ID");
+		return succeed(helpCenterCatalogService.get(id));
+	}
+
+	@ApiOperation("修改分类")
+	@PostMapping(value = "modify", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@AuditLogAnnotation(operateName = "帮助中心分类修改",interfaceURL = "helpCenterCatalog/modify")
+	public Object modifyHelpCatalog(HelpCenterCatalog helpCatalog) {
+		if (helpCatalog == null)
+			return failed("参数输入有误");
+		if (helpCatalog.getId() != null && helpCatalog.getId() > 0) {
+			helpCatalog.setModifyOn(new Date());
+			return helpCenterCatalogService.updateCatalog(helpCatalog) ? succeed() : failed("修改失败");
+		} else {
+			if (StringUtils.isBlank(helpCatalog.getText())) {
+				return failed("帮助分类不能为空");
+			}
+			helpCatalog.setCreateOn(new Date());
+			return helpCenterCatalogService.insert(helpCatalog) > 0 ? succeed() : failed("添加失败");
+		}
+	}
+
+	@ApiOperation("删除分类")
+	@PostMapping(value = "delete", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@ApiImplicitParam(name = "id", value = "分类编号", required = true, dataType = "Integer", paramType = "path")
+	@AuditLogAnnotation(operateName = "帮助中心分类删除",interfaceURL = "helpCenterCatalog/delete")
+	public Object delHelpCatalog(Integer id) {
+		if (id == null || id <= 0)
+			return failed("ID解析失败");
+		List<HelpCenterCatalog> list = helpCenterCatalogService.queryByParentId(id, null);
+		if (list != null && list.size() > 0) {
+			return failed("删除失败,请先删除子集分类");
+		}
+		return helpCenterCatalogService.deleteCatalog(id) ? succeed() : failed("删除失败");
+	}
+}

+ 89 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/controller/HelpCenterContentControlller.java

@@ -0,0 +1,89 @@
+package com.yonge.cooleshow.cms.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiOperation;
+
+import java.util.Date;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.yonge.cooleshow.cms.controller.queryinfo.HelpCenterContentQueryInfo;
+import com.yonge.cooleshow.cms.dal.entity.HelpCenterContent;
+import com.yonge.cooleshow.cms.service.HelpCenterCatalogService;
+import com.yonge.cooleshow.cms.service.HelpCenterContentService;
+import com.yonge.cooleshow.common.controller.BaseController;
+import com.yonge.cooleshow.common.page.PageInfo;
+import com.yonge.toolset.log.model.AuditLogAnnotation;
+
+@RestController
+@RequestMapping("helpCenterContent")
+@Api(tags = "帮助中心内容")
+public class HelpCenterContentControlller extends BaseController {
+
+	@Autowired
+	private HelpCenterContentService helpCenterContentService;
+
+	@Autowired
+	private HelpCenterCatalogService helpCenterCatalogService;
+
+	@ApiOperation("帮助中心内容列表分页查询")
+	@GetMapping(value = "list")
+	public Object findHelpContentByCondition(HelpCenterContentQueryInfo queryInfo) {
+
+		PageInfo<HelpCenterContent> data = helpCenterContentService.queryPage(queryInfo);
+		return succeed(data);
+	}
+
+	@ApiOperation("帮助中心内容明细查询")
+	@GetMapping(value = "get")
+	@ApiImplicitParam(name = "id", value = "编号", required = true, dataType = "Integer", paramType = "path")
+	public Object findHelpContentByKey(Integer id) {
+		if (id == null || id <= 0) {
+			return failed("请检查输入的参数");
+		}
+		return succeed(helpCenterContentService.get(id));
+	}
+
+	@ApiOperation("修改帮助中心内容")
+	@PostMapping(value = "modify", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@AuditLogAnnotation(operateName = "帮助中心内容修改",interfaceURL = "helpCenterContent/modify")
+	public Object modifyHelpContent(HelpCenterContent helpContent) {
+		if (helpContent == null) {
+			return failed("参数输入有误");
+		}
+
+		if (helpContent.getId() != null && helpContent.getId() > 0) {
+			helpContent.setModifyOn(new Date());
+			return helpCenterContentService.update(helpContent) > 0 ? succeed() : failed("修改失败");
+		} else {
+			if (StringUtils.isBlank(helpContent.getContent())) {
+				return failed("帮助内容不能为空");
+			}
+			if (StringUtils.isBlank(helpContent.getTitle())) {
+				return failed("帮助中心标题不能为空");
+			}
+			if (helpContent.getCatalogId() < 0) {
+				return failed("请选择分类");
+			}
+			helpContent.setCreateOn(new Date());
+			return helpCenterContentService.insert(helpContent) > 0 ? succeed() : failed("添加失败");
+		}
+	}
+
+	@ApiOperation("删除帮助中心内容")
+	@PostMapping(value = "delete", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@ApiImplicitParam(name = "id", value = "编号", required = true, dataType = "Integer", paramType = "path")
+	@AuditLogAnnotation(operateName = "帮助中心内容删除",interfaceURL = "helpCenterContent/delete")
+	public Object delHelpContent(Integer id) {
+		if (id == null || id <= 0)
+			return failed("ID解析失败");
+		return helpCenterContentService.delete(id) > 0 ? succeed() : failed("删除失败");
+	}
+}

+ 127 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/controller/NewsController.java

@@ -0,0 +1,127 @@
+package com.yonge.cooleshow.cms.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiOperation;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
+import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.cooleshow.cms.controller.queryinfo.NewsInformationQueryInfo;
+import com.yonge.cooleshow.cms.dal.dao.StudentRegistrationDao;
+import com.yonge.cooleshow.cms.dal.dao.SysNewsInformationDao;
+import com.yonge.cooleshow.cms.dal.entity.SysNewsInformation;
+import com.yonge.cooleshow.cms.service.SysNewsInformationService;
+import com.yonge.cooleshow.cms.service.SysNewsTypeService;
+import com.yonge.cooleshow.common.controller.BaseController;
+import com.yonge.toolset.log.model.AuditLogAnnotation;
+import com.yonge.toolset.utils.collection.MapUtil;
+
+@RestController
+@RequestMapping("news")
+@Api(tags = "资讯服务")
+public class NewsController extends BaseController {
+
+	@Autowired
+	private SysNewsInformationService sysNewsInformationService;
+	
+	@Autowired
+	private SysNewsTypeService sysNewsTypeService;
+	
+	@Autowired
+	private SysNewsInformationDao sysNewsInformationDao;
+	
+	@Autowired
+	private SysUserFeignService sysUserFeignService;
+	
+	@Autowired
+	private StudentRegistrationDao studentRegistrationDao;
+
+	@ApiOperation("资讯列表分页查询")
+	@GetMapping(value = "/list")
+	public Object getList(NewsInformationQueryInfo queryInfo) {
+		
+		Map<String, Object> params = new HashMap<String, Object>();
+		MapUtil.populateMap(params, queryInfo);
+		int count = sysNewsInformationDao.queryCount(params);
+		if(count == 0){
+			queryInfo.setMemo(null);
+		}
+		return succeed(sysNewsInformationService.queryPage(queryInfo));
+	}
+
+	@ApiOperation("资讯列表分页查询")
+	@GetMapping(value = "/queryPage")
+	public Object queryPage(NewsInformationQueryInfo queryInfo) {
+		
+		Map<String, Object> params = new HashMap<String, Object>();
+		MapUtil.populateMap(params, queryInfo);
+		int count = sysNewsInformationDao.queryCount(params);
+		if(count == 0){
+			queryInfo.setMemo(null);
+		}
+		return succeed(sysNewsInformationService.queryPage(queryInfo));
+	}
+
+	@ApiOperation("资讯类型列表查询")
+	@GetMapping(value = "/typeList")
+	public Object getTypeList(Integer parentId) {
+		return succeed(sysNewsTypeService.queryByParentId(parentId));
+	}
+
+	@ApiOperation("资讯列表分页查询")
+	@GetMapping(value = "/homeList")
+	public Object getHomeList(NewsInformationQueryInfo queryInfo) {
+		queryInfo.setRows(10);
+		SysUser user = sysUserFeignService.queryUserInfo();
+		return succeed(sysNewsInformationService.getHomeList(user, queryInfo));
+	}
+
+	@ApiOperation("查询资讯详情")
+	@ApiImplicitParam(name = "id", value = "资讯ID编号", required = true, dataType = "Long", paramType = "path")
+	@GetMapping(value = "/query")
+	public Object query(Long id) {
+
+		return succeed(sysNewsInformationService.queryById(id));
+	}
+
+	@ApiOperation("新增资讯")
+	@PostMapping(value = "/add", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@AuditLogAnnotation(operateName = "资讯新增",interfaceURL = "news/add")
+	@PreAuthorize("@pcs.hasPermissions('news/add')")
+	public Object add(SysNewsInformation newsInfo) {
+		return succeed(sysNewsInformationService.insert(newsInfo));
+	}
+
+	@ApiOperation("更新资讯")
+	@PostMapping(value = "/update", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@AuditLogAnnotation(operateName = "资讯更新",interfaceURL = "news/update")
+	@PreAuthorize("@pcs.hasPermissions('news/update')")
+	public Object update(SysNewsInformation newsInfo) {
+		Date date = new Date();
+		newsInfo.setUpdateTime(date);
+
+		return succeed(sysNewsInformationService.update(newsInfo));
+	}
+
+	@ApiOperation("删除")
+	@PostMapping(value = "/del/{id}", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@AuditLogAnnotation(operateName = "资讯删除",interfaceURL = "news/del")
+	@PreAuthorize("@pcs.hasPermissions('news/del')")
+	public Object add(@PathVariable("id") Long id) {
+		return succeed(sysNewsInformationService.deleteWithLogical(id));
+	}
+
+}

+ 27 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/controller/TaskController.java

@@ -0,0 +1,27 @@
+package com.yonge.cooleshow.cms.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.yonge.cooleshow.cms.service.SysNewsInformationService;
+import com.yonge.cooleshow.common.controller.BaseController;
+
+@RequestMapping("task")
+@RestController
+@Api(tags = "资讯定时任务服务")
+public class TaskController extends BaseController {
+
+	@Autowired
+	private SysNewsInformationService sysNewsInformationService;
+
+	@ApiOperation(value = "更新资讯发布状态")
+	@GetMapping("/updateStatus")
+	public void updateStatus(){
+		sysNewsInformationService.autoUpdateStatus();
+	}
+}

+ 42 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/controller/queryinfo/HelpCenterContentQueryInfo.java

@@ -0,0 +1,42 @@
+package com.yonge.cooleshow.cms.controller.queryinfo;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import com.yonge.cooleshow.common.page.QueryInfo;
+
+public class HelpCenterContentQueryInfo extends QueryInfo {
+
+	@ApiModelProperty(value = "父分类ID,多个用逗号分隔", required = false)
+	private String catalogIds;
+
+	@ApiModelProperty(value = "标题", required = false)
+	private String title;
+
+	@ApiModelProperty(value = "状态(1-显示 0-隐藏)", required = false)
+	private Integer status;
+
+	public String getCatalogIds() {
+		return catalogIds;
+	}
+
+	public void setCatalogIds(String catalogIds) {
+		this.catalogIds = catalogIds;
+	}
+
+	public String getTitle() {
+		return title;
+	}
+
+	public void setTitle(String title) {
+		this.title = title;
+	}
+
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+}

+ 99 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/controller/queryinfo/NewsInformationQueryInfo.java

@@ -0,0 +1,99 @@
+package com.yonge.cooleshow.cms.controller.queryinfo;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.Date;
+import java.util.List;
+
+import com.yonge.cooleshow.cms.dal.entity.NewsStatusEnum;
+import com.yonge.cooleshow.common.page.QueryInfo;
+
+public class NewsInformationQueryInfo extends QueryInfo {
+
+	@ApiModelProperty(value = "类型,1精彩活动,2热门资讯,3banner类型", required = false)
+	private Integer type;
+	
+	@ApiModelProperty(value = "子类型", required = false)
+	private Integer subType;
+
+	@ApiModelProperty(value = "资讯状态", required = false)
+	private NewsStatusEnum status;
+
+	@ApiModelProperty(value = "标题", required = false)
+	private String title;
+
+	@ApiModelProperty(value = "备注", required = false)
+	private String memo;
+	
+	@ApiModelProperty(value = "声部编号", required = false)
+	private Integer subjectId;
+	
+	@ApiModelProperty(value = "需排除编号")
+	private List<Integer> excludeIds;
+	
+	private Date date;
+
+	public Integer getType() {
+		return type;
+	}
+
+	public void setType(Integer type) {
+		this.type = type;
+	}
+
+	public Integer getSubType() {
+		return subType;
+	}
+
+	public void setSubType(Integer subType) {
+		this.subType = subType;
+	}
+
+	public NewsStatusEnum getStatus() {
+		return status;
+	}
+
+	public void setStatus(NewsStatusEnum status) {
+		this.status = status;
+	}
+
+	public String getTitle() {
+		return title;
+	}
+
+	public void setTitle(String title) {
+		this.title = title;
+	}
+
+	public Date getDate() {
+		return date;
+	}
+
+	public void setDate(Date date) {
+		this.date = date;
+	}
+
+	public String getMemo() {
+		return memo;
+	}
+
+	public void setMemo(String memo) {
+		this.memo = memo;
+	}
+
+	public Integer getSubjectId() {
+		return subjectId;
+	}
+
+	public void setSubjectId(Integer subjectId) {
+		this.subjectId = subjectId;
+	}
+
+	public List<Integer> getExcludeIds() {
+		return excludeIds;
+	}
+
+	public void setExcludeIds(List<Integer> excludeIds) {
+		this.excludeIds = excludeIds;
+	}
+}

+ 13 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dal/dao/HelpCenterCatalogDao.java

@@ -0,0 +1,13 @@
+package com.yonge.cooleshow.cms.dal.dao;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+
+import com.yonge.cooleshow.cms.dal.entity.HelpCenterCatalog;
+import com.yonge.cooleshow.common.dal.BaseDAO;
+
+public interface HelpCenterCatalogDao extends BaseDAO<Integer, HelpCenterCatalog> {
+
+	public List<HelpCenterCatalog> queryByParentId(@Param("parentId") Integer parentId, @Param("status") Integer status);
+}

+ 13 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dal/dao/HelpCenterContentDao.java

@@ -0,0 +1,13 @@
+package com.yonge.cooleshow.cms.dal.dao;
+
+import java.util.Map;
+
+import com.yonge.cooleshow.cms.dal.entity.HelpCenterContent;
+import com.yonge.cooleshow.common.dal.BaseDAO;
+
+public interface HelpCenterContentDao extends BaseDAO<Integer, HelpCenterContent> {
+
+	public int updateContentByCatalog(Map<String, Object> map);
+
+	public int deleteContentByCatalog(Integer catalogId);
+}

+ 15 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dal/dao/StudentRegistrationDao.java

@@ -0,0 +1,15 @@
+package com.yonge.cooleshow.cms.dal.dao;
+
+import org.apache.ibatis.annotations.Param;
+
+public interface StudentRegistrationDao {
+
+    /**
+     * @describe 统计学员所在会员团的数量
+     * @author Joburgess
+     * @date 2021/9/9 0009
+     * @param studentId:
+     * @return int
+     */
+    int countStudentMemberGroupNum(@Param("studentId") Integer studentId);
+}

+ 24 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dal/dao/SysConfigDao.java

@@ -0,0 +1,24 @@
+package com.yonge.cooleshow.cms.dal.dao;
+
+import com.yonge.cooleshow.cms.dal.entity.SysConfig;
+import com.yonge.cooleshow.common.dal.BaseDAO;
+
+public interface SysConfigDao extends BaseDAO<Long, SysConfig> {
+
+    /**
+     * @Author: Joburgess
+     * @Date: 2019/10/9
+     * @params [paramName]
+     * @return com.ym.mec.biz.dal.entity.SysConfig
+     * @describe 根据配置名称获取配置信息
+     */
+    SysConfig findByParamName(String paramName);
+
+    /**
+     * 获取value
+     * @param paramName
+     * @return
+     */
+    String findConfigValue(String paramName);
+	
+}

+ 37 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dal/dao/SysNewsInformationDao.java

@@ -0,0 +1,37 @@
+package com.yonge.cooleshow.cms.dal.dao;
+
+import java.util.List;
+import java.util.Map;
+
+import com.yonge.cooleshow.cms.dal.entity.SysNewsInformation;
+import com.yonge.cooleshow.cms.dto.SysNewsInformationDto;
+import com.yonge.cooleshow.common.dal.BaseDAO;
+
+public interface SysNewsInformationDao extends BaseDAO<Long, SysNewsInformation> {
+
+	/**
+	 * 根据类型查询资讯列表
+	 * @param type
+	 * @return
+	 */
+	List<SysNewsInformation> queryByType(Integer type);
+
+	/**
+	 * 逻辑删除
+	 * @param id
+	 * @return
+	 */
+	int deleteWithLogical(Long id);
+	
+	List<SysNewsInformation> queryHomePage(Map<String, Object> params);
+	
+	int queryHomeCount(Map<String, Object> params);
+	
+	/**
+	 * 查询需要更新状态的对象集合
+	 * @return
+	 */
+	List<SysNewsInformation> queryNeedUpdateStatusList();
+	
+	SysNewsInformationDto queryById(Long id);
+}

+ 13 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dal/dao/SysNewsTypeDao.java

@@ -0,0 +1,13 @@
+package com.yonge.cooleshow.cms.dal.dao;
+
+import java.util.List;
+
+import com.yonge.cooleshow.cms.dal.entity.SysNewsType;
+import com.yonge.cooleshow.cms.dal.entity.SysNewsTypeTree;
+import com.yonge.cooleshow.common.dal.BaseDAO;
+
+public interface SysNewsTypeDao extends BaseDAO<Integer, SysNewsType> {
+
+	// 根据父级查询子集
+	List<SysNewsTypeTree> queryByParentId(Integer parentId);
+}

+ 126 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dal/entity/HelpCenterCatalog.java

@@ -0,0 +1,126 @@
+package com.yonge.cooleshow.cms.dal.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.List;
+
+public class HelpCenterCatalog {
+
+	@ApiModelProperty(value = "编号", required = false)
+	private Integer id;
+
+	@ApiModelProperty(value = "父分类ID", required = false)
+	private Integer parentId;
+
+	@ApiModelProperty(value = "分类名称", required = false)
+	private String text;
+
+	@ApiModelProperty(value = "描述", required = false)
+	private String description;
+
+	/**  */
+	private java.util.Date createOn;
+
+	/**  */
+	private java.util.Date modifyOn;
+
+	@ApiModelProperty(value = "排序", required = false)
+	private Integer order;
+
+	/**
+	 * 子集合
+	 */
+	private List<HelpCenterCatalog> children;
+
+	@ApiModelProperty(value = "状态 1 显示 0隐藏", required = false)
+	private Integer status;
+
+	public void setId(Integer id) {
+		this.id = id;
+	}
+
+	public Integer getId() {
+		return this.id;
+	}
+
+	public String getText() {
+		return text;
+	}
+
+	public void setText(String text) {
+		this.text = text;
+	}
+
+	public List<HelpCenterCatalog> getChildren() {
+		return children;
+	}
+
+	public void setChildren(List<HelpCenterCatalog> children) {
+		this.children = children;
+	}
+
+	public void setParentId(Integer parentId) {
+		this.parentId = parentId;
+	}
+
+	public Integer getParentId() {
+		return this.parentId;
+	}
+
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	public String getDescription() {
+		return this.description;
+	}
+
+	public void setCreateOn(java.util.Date createOn) {
+		this.createOn = createOn;
+	}
+
+	public java.util.Date getCreateOn() {
+		return this.createOn;
+	}
+
+	public void setModifyOn(java.util.Date modifyOn) {
+		this.modifyOn = modifyOn;
+	}
+
+	public java.util.Date getModifyOn() {
+		return this.modifyOn;
+	}
+
+	public Integer getOrder() {
+		return order;
+	}
+
+	public void setOrder(Integer order) {
+		this.order = order;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	public Integer getStatus() {
+		return this.status;
+	}
+
+	public String toString() {
+		StringBuilder buf = new StringBuilder();
+		buf.append("HelpCatalog [");
+		buf.append("id=").append(id).append(",");
+		buf.append("parentId=").append(parentId).append(",");
+		buf.append("text=").append(text).append(",");
+		buf.append("description=").append(description).append(",");
+		buf.append("createOn=").append(createOn).append(",");
+		buf.append("modifyOn=").append(modifyOn).append(",");
+		buf.append("order=").append(order).append(",");
+		buf.append("status=").append(status).append(",");
+		buf.setLength(buf.length() - 1);
+		buf.append("]");
+		return buf.toString();
+	}
+
+}

+ 121 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dal/entity/HelpCenterContent.java

@@ -0,0 +1,121 @@
+package com.yonge.cooleshow.cms.dal.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+
+public class HelpCenterContent {
+
+	@ApiModelProperty(value = "编号", required = false)
+	private Integer id;
+
+	@ApiModelProperty(value = "标题", required = false)
+	private String title;
+
+	@ApiModelProperty(value = "内容", required = false)
+	private String content = "";
+
+	@ApiModelProperty(value = "分类ID", required = false)
+	private Integer catalogId;
+
+	/** 创建时间 */
+	private java.util.Date createOn;
+
+	/** 修改时间 */
+	private java.util.Date modifyOn;
+
+	@ApiModelProperty(value = "状态 1显示 0隐藏", required = false)
+	private Integer status;
+
+	@ApiModelProperty(value = "排序", required = false)
+	private Integer order;
+
+	private HelpCenterCatalog catalog;
+
+	public HelpCenterCatalog getCatalog() {
+		return catalog;
+	}
+
+	public void setCatalog(HelpCenterCatalog catalog) {
+		this.catalog = catalog;
+	}
+
+	public Integer getOrder() {
+		return order;
+	}
+
+	public void setOrder(Integer order) {
+		this.order = order;
+	}
+
+	public void setId(Integer id) {
+		this.id = id;
+	}
+
+	public Integer getId() {
+		return this.id;
+	}
+
+	public void setTitle(String title) {
+		this.title = title;
+	}
+
+	public String getTitle() {
+		return this.title;
+	}
+
+	public void setContent(String content) {
+		this.content = content;
+	}
+
+	public String getContent() {
+		return this.content;
+	}
+
+	public void setCatalogId(Integer catalogId) {
+		this.catalogId = catalogId;
+	}
+
+	public Integer getCatalogId() {
+		return this.catalogId;
+	}
+
+	public void setCreateOn(java.util.Date createOn) {
+		this.createOn = createOn;
+	}
+
+	public java.util.Date getCreateOn() {
+		return this.createOn;
+	}
+
+	public void setModifyOn(java.util.Date modifyOn) {
+		this.modifyOn = modifyOn;
+	}
+
+	public java.util.Date getModifyOn() {
+		return this.modifyOn;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+	public Integer getStatus() {
+		return this.status;
+	}
+
+	public String toString() {
+		StringBuilder buf = new StringBuilder();
+		buf.append("HelpContent [");
+		buf.append("id=").append(id).append(",");
+		buf.append("title=").append(title).append(",");
+		buf.append("content=").append(content).append(",");
+		buf.append("order=").append(order).append(",");
+		buf.append("catalogId=").append(catalogId).append(",");
+		buf.append("createOn=").append(createOn).append(",");
+		buf.append("modifyOn=").append(modifyOn).append(",");
+		buf.append("status=").append(status).append(",");
+		buf.setLength(buf.length() - 1);
+		buf.append("]");
+		return buf.toString();
+	}
+
+}

+ 20 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dal/entity/NewsStatusEnum.java

@@ -0,0 +1,20 @@
+package com.yonge.cooleshow.cms.dal.entity;
+
+import com.yonge.cooleshow.common.enums.BaseEnum;
+
+public enum NewsStatusEnum implements BaseEnum<Integer, NewsStatusEnum> {
+
+	SHOW(1), HIDDEN(0);
+
+	private Integer code;
+
+	NewsStatusEnum(int code) {
+		this.code = code;
+	}
+
+	@Override
+	public Integer getCode() {
+		return code;
+	}
+
+}

+ 104 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dal/entity/SysConfig.java

@@ -0,0 +1,104 @@
+package com.yonge.cooleshow.cms.dal.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(sys_config):
+ */
+public class SysConfig {
+
+	/**  */
+	private Long id;
+	
+	/** 参数名称 */
+	@ApiModelProperty(value = "参数名称", required = true)
+	private String paramName;
+	
+	/** 参数值 */
+	@ApiModelProperty(value = "参数值", required = true)
+	private String paranValue;
+	
+	/** 描述 */
+	@ApiModelProperty(value = "描述", required = true)
+	private String description;
+	
+	/** 创建时间 */
+	private java.util.Date createOn;
+	
+	/** 修改时间 */
+	private java.util.Date modifyOn;
+	
+	@ApiModelProperty(value = "消息组", required = true)
+	private String group;
+	
+	public void setId(Long id){
+		this.id = id;
+	}
+	
+	public Long getId(){
+		return this.id;
+	}
+			
+	public void setParamName(String paramName){
+		this.paramName = paramName;
+	}
+	
+	public String getParamName(){
+		return this.paramName;
+	}
+			
+	public void setParanValue(String paranValue){
+		this.paranValue = paranValue;
+	}
+	
+	public String getParanValue(){
+		return this.paranValue;
+	}
+
+	public <T> T getParanValue(Class<T> cla){
+		try {
+			return cla.cast(cla.getMethod("valueOf", String.class).invoke(cla.getInterfaces(),this.paranValue));
+		} catch (Exception e) {
+			return (T)this.paranValue.getClass();
+		}
+	}
+			
+	public void setDescription(String description){
+		this.description = description;
+	}
+	
+	public String getDescription(){
+		return this.description;
+	}
+			
+	public void setCreateOn(java.util.Date createOn){
+		this.createOn = createOn;
+	}
+	
+	public java.util.Date getCreateOn(){
+		return this.createOn;
+	}
+			
+	public void setModifyOn(java.util.Date modifyOn){
+		this.modifyOn = modifyOn;
+	}
+	
+	public java.util.Date getModifyOn(){
+		return this.modifyOn;
+	}
+			
+	public String getGroup() {
+		return group;
+	}
+
+	public void setGroup(String group) {
+		this.group = group;
+	}
+
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 281 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dal/entity/SysNewsInformation.java

@@ -0,0 +1,281 @@
+package com.yonge.cooleshow.cms.dal.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.Date;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(sys_news_information):
+ */
+public class SysNewsInformation {
+
+	/**  */
+	private Long id;
+
+	/** 标题 */
+	@ApiModelProperty(value = "标题", required = true)
+	private String title;
+
+	/** 内容 */
+	@ApiModelProperty(value = "内容", required = true)
+	private String content;
+
+	/** 封面图片 */
+	@ApiModelProperty(value = "封面图片", required = false)
+	private String coverImage;
+
+	/** 视频封面图片 */
+	@ApiModelProperty(value = "视频封面图片", required = false)
+	private String videoCoverImage;
+
+	/** 类型 */
+	@ApiModelProperty(value = "类型,1精彩活动,2热门资讯,3banner类型", required = true)
+	private Integer type;
+	
+	@ApiModelProperty(value = "子类型", required = false)
+	private Integer subType;
+
+	/** 状态(1-可见 0-不可见) */
+	@ApiModelProperty(value = "状态(1-可见 0-不可见)", required = true)
+	private NewsStatusEnum status;
+
+	@ApiModelProperty(value = "链接地址", required = true)
+	private String linkUrl;
+
+	@ApiModelProperty(value = "跳转类型_bank,_slef", required = true)
+	private String hrefTarget;
+
+	@ApiModelProperty(value = "顺序号", required = true)
+	private Integer order;
+	
+	@ApiModelProperty(value = "上线时间", required = false)
+	private Date onlineTime;
+	
+	@ApiModelProperty(value = "下线时间", required = false)
+	private Date offlineTime;
+
+	/**  */
+	private java.util.Date createTime;
+
+	/**  */
+	private java.util.Date updateTime;
+
+	@ApiModelProperty(value = "备注", required = false)
+	private String memo;
+
+	private Boolean delFlag;
+
+	private Integer tenantId;
+
+	private String attribute1;
+	
+	private String attribute2;
+	
+	private String subjectIdList;
+	
+	private String organIdList;
+	
+	private String subjectName;
+	
+	private String organNameList;
+
+	public String getLinkUrl() {
+		return linkUrl;
+	}
+
+	public void setLinkUrl(String linkUrl) {
+		this.linkUrl = linkUrl;
+	}
+
+	public String getHrefTarget() {
+		return hrefTarget;
+	}
+
+	public void setHrefTarget(String hrefTarget) {
+		this.hrefTarget = hrefTarget;
+	}
+
+	public Integer getOrder() {
+		return order;
+	}
+
+	public void setOrder(Integer order) {
+		this.order = order;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public Long getId() {
+		return this.id;
+	}
+
+	public void setTitle(String title) {
+		this.title = title;
+	}
+
+	public String getTitle() {
+		return this.title;
+	}
+
+	public void setContent(String content) {
+		this.content = content;
+	}
+
+	public String getContent() {
+		return this.content;
+	}
+
+	public void setCoverImage(String coverImage) {
+		this.coverImage = coverImage;
+	}
+
+	public String getCoverImage() {
+		return this.coverImage;
+	}
+
+	public String getVideoCoverImage() {
+		return videoCoverImage;
+	}
+
+	public void setVideoCoverImage(String videoCoverImage) {
+		this.videoCoverImage = videoCoverImage;
+	}
+
+	public void setType(Integer type) {
+		this.type = type;
+	}
+
+	public Integer getType() {
+		return this.type;
+	}
+
+	public NewsStatusEnum getStatus() {
+		return status;
+	}
+
+	public void setStatus(NewsStatusEnum status) {
+		this.status = status;
+	}
+
+	public void setCreateTime(java.util.Date createTime) {
+		this.createTime = createTime;
+	}
+
+	public java.util.Date getCreateTime() {
+		return this.createTime;
+	}
+
+	public void setUpdateTime(java.util.Date updateTime) {
+		this.updateTime = updateTime;
+	}
+
+	public java.util.Date getUpdateTime() {
+		return this.updateTime;
+	}
+
+	public String getMemo() {
+		return memo;
+	}
+
+	public void setMemo(String memo) {
+		this.memo = memo;
+	}
+
+	public Boolean getDelFlag() {
+		return delFlag;
+	}
+
+	public void setDelFlag(Boolean delFlag) {
+		this.delFlag = delFlag;
+	}
+
+	public Integer getTenantId() {
+		return tenantId;
+	}
+
+	public void setTenantId(Integer tenantId) {
+		this.tenantId = tenantId;
+	}
+
+	public Integer getSubType() {
+		return subType;
+	}
+
+	public void setSubType(Integer subType) {
+		this.subType = subType;
+	}
+
+	public String getAttribute1() {
+		return attribute1;
+	}
+
+	public void setAttribute1(String attribute1) {
+		this.attribute1 = attribute1;
+	}
+
+	public String getAttribute2() {
+		return attribute2;
+	}
+
+	public void setAttribute2(String attribute2) {
+		this.attribute2 = attribute2;
+	}
+
+	public Date getOnlineTime() {
+		return onlineTime;
+	}
+
+	public void setOnlineTime(Date onlineTime) {
+		this.onlineTime = onlineTime;
+	}
+
+	public Date getOfflineTime() {
+		return offlineTime;
+	}
+
+	public void setOfflineTime(Date offlineTime) {
+		this.offlineTime = offlineTime;
+	}
+
+	public String getSubjectIdList() {
+		return subjectIdList;
+	}
+
+	public void setSubjectIdList(String subjectIdList) {
+		this.subjectIdList = subjectIdList;
+	}
+
+	public String getOrganIdList() {
+		return organIdList;
+	}
+
+	public void setOrganIdList(String organIdList) {
+		this.organIdList = organIdList;
+	}
+
+	public String getSubjectName() {
+		return subjectName;
+	}
+
+	public void setSubjectName(String subjectName) {
+		this.subjectName = subjectName;
+	}
+
+	public String getOrganNameList() {
+		return organNameList;
+	}
+
+	public void setOrganNameList(String organNameList) {
+		this.organNameList = organNameList;
+	}
+
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 81 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dal/entity/SysNewsType.java

@@ -0,0 +1,81 @@
+package com.yonge.cooleshow.cms.dal.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(sys_news_type):
+ */
+public class SysNewsType {
+
+	/**  */
+	private Integer id;
+	
+	/**  */
+	private String name;
+	
+	/**  */
+	private Integer parentId;
+	
+	/**  */
+	private boolean delFlag;
+	
+	/**  */
+	private java.util.Date createTime;
+	
+	/**  */
+	private java.util.Date updateTime;
+	
+	public void setId(Integer id){
+		this.id = id;
+	}
+	
+	public Integer getId(){
+		return this.id;
+	}
+			
+	public void setName(String name){
+		this.name = name;
+	}
+	
+	public String getName(){
+		return this.name;
+	}
+			
+	public void setParentId(Integer parentId){
+		this.parentId = parentId;
+	}
+	
+	public Integer getParentId(){
+		return this.parentId;
+	}
+			
+	public void setDelFlag(boolean delFlag){
+		this.delFlag = delFlag;
+	}
+	
+	public boolean isDelFlag(){
+		return this.delFlag;
+	}
+			
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	public void setUpdateTime(java.util.Date updateTime){
+		this.updateTime = updateTime;
+	}
+	
+	public java.util.Date getUpdateTime(){
+		return this.updateTime;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 17 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dal/entity/SysNewsTypeTree.java

@@ -0,0 +1,17 @@
+package com.yonge.cooleshow.cms.dal.entity;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class SysNewsTypeTree extends SysNewsType {
+
+	private List<SysNewsTypeTree> subTypeList = new ArrayList<SysNewsTypeTree>();
+
+	public List<SysNewsTypeTree> getSubTypeList() {
+		return subTypeList;
+	}
+
+	public void setSubTypeList(List<SysNewsTypeTree> subTypeList) {
+		this.subTypeList = subTypeList;
+	}
+}

+ 26 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/dto/SysNewsInformationDto.java

@@ -0,0 +1,26 @@
+package com.yonge.cooleshow.cms.dto;
+
+import com.yonge.cooleshow.cms.dal.entity.SysNewsInformation;
+
+public class SysNewsInformationDto extends SysNewsInformation {
+
+	private String typeName;
+
+	private String subTypeName;
+
+	public String getTypeName() {
+		return typeName;
+	}
+
+	public void setTypeName(String typeName) {
+		this.typeName = typeName;
+	}
+
+	public String getSubTypeName() {
+		return subTypeName;
+	}
+
+	public void setSubTypeName(String subTypeName) {
+		this.subTypeName = subTypeName;
+	}
+}

+ 33 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/interceptor/OperationLogInterceptor.java

@@ -0,0 +1,33 @@
+package com.yonge.cooleshow.cms.interceptor;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Lazy;
+import org.springframework.stereotype.Component;
+
+import com.yonge.cooleshow.auth.api.client.SysUserFeignService;
+import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.toolset.log.interceptor.AuditLogInterceptor;
+
+@Component
+public class OperationLogInterceptor extends AuditLogInterceptor {
+
+	@Autowired
+	@Lazy
+	private SysUserFeignService sysUserFeignService;
+
+	@Override
+	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws ServletException, IOException {
+		SysUser sysUser = sysUserFeignService.queryUserInfo();
+		if (sysUser != null) {
+			setUsername(sysUser.getRealName(),sysUser.getId());
+		}
+		return true;
+	}
+
+}

+ 31 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/service/HelpCenterCatalogService.java

@@ -0,0 +1,31 @@
+package com.yonge.cooleshow.cms.service;
+
+import java.util.List;
+
+import com.yonge.cooleshow.cms.dal.entity.HelpCenterCatalog;
+import com.yonge.cooleshow.common.service.BaseService;
+
+public interface HelpCenterCatalogService extends BaseService<Integer, HelpCenterCatalog> {
+
+	/**
+	 * 根据父节点查询所有子节点对象
+	 * @param parentId 父节点(可为null)
+	 * @param status 状态(可为null)
+	 * @return
+	 */
+	public List<HelpCenterCatalog> queryByParentId(Integer parentId, Integer status);
+
+	/**
+	 * 修改分类信息
+	 * @param catalog
+	 * @return
+	 */
+	public boolean updateCatalog(HelpCenterCatalog catalog);
+
+	/**
+	 * 删除分类信息
+	 * @param id
+	 * @return
+	 */
+	public boolean deleteCatalog(Integer id);
+}

+ 11 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/service/HelpCenterContentService.java

@@ -0,0 +1,11 @@
+package com.yonge.cooleshow.cms.service;
+
+import com.yonge.cooleshow.cms.dal.entity.HelpCenterContent;
+import com.yonge.cooleshow.common.service.BaseService;
+
+public interface HelpCenterContentService extends BaseService<Integer,HelpCenterContent>{
+	
+	public boolean updateContentByCatalog(Integer catalogId,Integer status);
+	
+	public boolean deleteContentByCatalog(Integer catalogId);
+}

+ 49 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/service/SysNewsInformationService.java

@@ -0,0 +1,49 @@
+package com.yonge.cooleshow.cms.service;
+
+import java.util.List;
+import java.util.Map;
+
+import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.cooleshow.cms.controller.queryinfo.NewsInformationQueryInfo;
+import com.yonge.cooleshow.cms.dal.entity.SysNewsInformation;
+import com.yonge.cooleshow.cms.dto.SysNewsInformationDto;
+import com.yonge.cooleshow.common.page.PageInfo;
+import com.yonge.cooleshow.common.service.BaseService;
+
+public interface SysNewsInformationService extends BaseService<Long, SysNewsInformation> {
+
+	/**
+	 * 根据类型查询资讯列表
+	 * @param type
+	 * @return
+	 */
+	List<SysNewsInformation> queryByType(Integer type);
+
+	/**
+	 * 逻辑删除
+	 * @param id
+	 * @return
+	 */
+	boolean deleteWithLogical(Long id);
+
+	/**
+	 * 获取首页新闻列表
+	 * @param user
+	 * @param queryInfo
+	 * @return
+	 */
+	Map<String, PageInfo<SysNewsInformation>> getHomeList(SysUser user, NewsInformationQueryInfo queryInfo);
+
+	/**
+	 * 获取详情
+	 * @param id
+	 * @return
+	 */
+	SysNewsInformationDto queryById(Long id);
+
+	/**
+	 * 自动更新状态
+	 * @return
+	 */
+	boolean autoUpdateStatus();
+}

+ 15 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/service/SysNewsTypeService.java

@@ -0,0 +1,15 @@
+package com.yonge.cooleshow.cms.service;
+
+import java.util.List;
+
+import com.yonge.cooleshow.cms.dal.entity.SysNewsType;
+import com.yonge.cooleshow.cms.dal.entity.SysNewsTypeTree;
+import com.yonge.cooleshow.common.service.BaseService;
+
+public interface SysNewsTypeService extends BaseService<Integer, SysNewsType> {
+	
+	List<SysNewsTypeTree> queryTree(Integer parentId);
+
+	//根据父级查询子集
+	List<SysNewsTypeTree> queryByParentId(Integer parentId);
+}

+ 51 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/service/impl/HelpCenterCatalogServiceImpl.java

@@ -0,0 +1,51 @@
+package com.yonge.cooleshow.cms.service.impl;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.yonge.cooleshow.cms.dal.dao.HelpCenterCatalogDao;
+import com.yonge.cooleshow.cms.dal.entity.HelpCenterCatalog;
+import com.yonge.cooleshow.cms.service.HelpCenterCatalogService;
+import com.yonge.cooleshow.cms.service.HelpCenterContentService;
+import com.yonge.cooleshow.common.dal.BaseDAO;
+import com.yonge.cooleshow.common.service.impl.BaseServiceImpl;
+
+@Service
+public class HelpCenterCatalogServiceImpl extends BaseServiceImpl<Integer, HelpCenterCatalog> implements HelpCenterCatalogService {
+
+	@Autowired
+	private HelpCenterCatalogDao helpCenterCatalogDao;
+
+	@Autowired
+	private HelpCenterContentService helpCenterContentService;
+
+	@Override
+	public BaseDAO<Integer, HelpCenterCatalog> getDAO() {
+
+		return helpCenterCatalogDao;
+	}
+
+	@Override
+	public List<HelpCenterCatalog> queryByParentId(Integer parentId, Integer status) {
+
+		List<HelpCenterCatalog> dataList = helpCenterCatalogDao.queryByParentId(parentId, status);
+		if (dataList != null) {
+			for (HelpCenterCatalog sub : dataList) {
+				sub.setChildren(queryByParentId(sub.getId(), status));
+			}
+		}
+		return dataList;
+	}
+
+	public boolean updateCatalog(HelpCenterCatalog catalog) {
+		return helpCenterCatalogDao.update(catalog) > 0 && helpCenterContentService.updateContentByCatalog(catalog.getId(), catalog.getStatus());
+	}
+
+	@Override
+	public boolean deleteCatalog(Integer id) {
+		return helpCenterCatalogDao.delete(id) > 0 && helpCenterContentService.deleteContentByCatalog(id);
+	}
+
+}

+ 41 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/service/impl/HelpCenterContentServiceImpl.java

@@ -0,0 +1,41 @@
+package com.yonge.cooleshow.cms.service.impl;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.yonge.cooleshow.cms.dal.dao.HelpCenterContentDao;
+import com.yonge.cooleshow.cms.dal.entity.HelpCenterContent;
+import com.yonge.cooleshow.cms.service.HelpCenterContentService;
+import com.yonge.cooleshow.common.dal.BaseDAO;
+import com.yonge.cooleshow.common.service.impl.BaseServiceImpl;
+
+@Service
+public class HelpCenterContentServiceImpl extends BaseServiceImpl<Integer, HelpCenterContent> implements HelpCenterContentService {
+
+	@Autowired
+	private HelpCenterContentDao contentCenterDao;
+
+	@Override
+	public BaseDAO<Integer, HelpCenterContent> getDAO() {
+		return contentCenterDao;
+	}
+
+	@Override
+	public boolean updateContentByCatalog(Integer catalogId, Integer status) {
+		Map<String, Object> map = new HashMap<String, Object>();
+		map.put("catalogId", catalogId);
+		map.put("status", status);
+		contentCenterDao.updateContentByCatalog(map);
+		return true;
+	}
+
+	@Override
+	public boolean deleteContentByCatalog(Integer catalogId) {
+		contentCenterDao.deleteContentByCatalog(catalogId);
+		return true;
+	}
+
+}

+ 159 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/service/impl/SysNewsInformationServiceImpl.java

@@ -0,0 +1,159 @@
+package com.yonge.cooleshow.cms.service.impl;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.yonge.cooleshow.auth.api.entity.SysUser;
+import com.yonge.cooleshow.cms.controller.queryinfo.NewsInformationQueryInfo;
+import com.yonge.cooleshow.cms.dal.dao.SysNewsInformationDao;
+import com.yonge.cooleshow.cms.dal.entity.NewsStatusEnum;
+import com.yonge.cooleshow.cms.dal.entity.SysNewsInformation;
+import com.yonge.cooleshow.cms.dto.SysNewsInformationDto;
+import com.yonge.cooleshow.cms.service.SysNewsInformationService;
+import com.yonge.cooleshow.common.dal.BaseDAO;
+import com.yonge.cooleshow.common.page.PageInfo;
+import com.yonge.cooleshow.common.page.QueryInfo;
+import com.yonge.cooleshow.common.service.impl.BaseServiceImpl;
+import com.yonge.toolset.utils.collection.MapUtil;
+
+@Service
+public class SysNewsInformationServiceImpl extends BaseServiceImpl<Long, SysNewsInformation> implements SysNewsInformationService {
+
+	@Autowired
+	private SysNewsInformationDao sysNewsInformationDao;
+
+	@Override
+	public BaseDAO<Long, SysNewsInformation> getDAO() {
+		return sysNewsInformationDao;
+	}
+
+	@Override
+	public List<SysNewsInformation> queryByType(Integer type) {
+		return sysNewsInformationDao.queryByType(type);
+	}
+
+	@Override
+	public boolean deleteWithLogical(Long id) {
+		sysNewsInformationDao.deleteWithLogical(id);
+		return true;
+	}
+
+	@Override
+	public Map<String,PageInfo<SysNewsInformation>> getHomeList(SysUser user, NewsInformationQueryInfo queryInfo) {
+		//1精彩活动,2热门资讯,3banner类型
+		Map<String,PageInfo<SysNewsInformation>> homeList = new HashMap<>();
+		queryInfo.setStatus(NewsStatusEnum.SHOW);
+		
+		String memo = queryInfo.getMemo();
+		
+		Map<String, Object> params = new HashMap<String, Object>();
+
+		queryInfo.setType(3);
+		MapUtil.populateMap(params, queryInfo);
+		int count = sysNewsInformationDao.queryHomeCount(params);
+		if(count == 0){
+			queryInfo.setMemo(null);
+		}
+		PageInfo<SysNewsInformation> pageInfos = queryHomePage(queryInfo);
+
+		/*boolean isNewer = false;
+		Date date = new Date();
+		Date startDate = queryInfo.getDate();
+		Date endDate = null;
+		if (startDate == null) {
+			try {
+				String startDateStr = "2020-05-01";
+				startDate = sdf.parse(startDateStr);
+				endDate = sdf.parse("2021-02-01");
+			} catch (ParseException e) {
+				throw new RuntimeException(e);
+			}
+		}
+		if (queryInfo.getTenantId() == 1 && date.after(startDate) && date.before(endDate)) {
+			if (user != null && "18696158274".equals(user.getPhone()) == false) {
+				isNewer = webFeignService.isPurchasedPracticeCourse(user.getId()) == false;
+				SysNewsInformation info = new SysNewsInformation();
+				info.setOrder(1);
+				info.setCreateTime(date);
+				info.setUpdateTime(date);
+				if (isNewer) {
+					info.setLinkUrl(serverContextPath + "/#/auditionActive");
+					info.setCoverImage("https://daya-online.oss-cn-beijing.aliyuncs.com/tempActivity/3_1.png");
+				} else {
+					info.setLinkUrl(serverContextPath + "/#/auditionActive");
+					info.setCoverImage("https://daya-online.oss-cn-beijing.aliyuncs.com/tempActivity/3_2.png");
+				}
+				pageInfos.getRows().add(info);
+			}
+		}*/
+		homeList.put("banner",pageInfos);
+		
+		queryInfo.setMemo(memo);
+		queryInfo.setType(6);
+		MapUtil.populateMap(params, queryInfo);
+		count = sysNewsInformationDao.queryHomeCount(params);
+		if(count == 0){
+			queryInfo.setMemo(null);
+		}
+		homeList.put("app",queryHomePage(queryInfo));
+		
+		queryInfo.setMemo(null);
+		queryInfo.setType(1);
+		homeList.put("active",queryHomePage(queryInfo));
+		queryInfo.setType(2);
+		homeList.put("hot",queryHomePage(queryInfo));
+		
+		queryInfo.setType(5);
+		homeList.put("flash",queryHomePage(queryInfo));
+		return homeList;
+	}
+	
+	@Override
+	public SysNewsInformationDto queryById(Long id) {
+		return sysNewsInformationDao.queryById(id);
+	}
+
+	private PageInfo<SysNewsInformation> queryHomePage(QueryInfo queryInfo) {
+		PageInfo<SysNewsInformation> pageInfo = new PageInfo<SysNewsInformation>(queryInfo.getPage(), queryInfo.getRows());
+		Map<String, Object> params = new HashMap<String, Object>();
+		MapUtil.populateMap(params, queryInfo);
+		
+		List<SysNewsInformation> dataList = null;
+		int count = sysNewsInformationDao.queryHomeCount(params);
+		if (count > 0) {
+			pageInfo.setTotal(count);
+			params.put("offset", pageInfo.getOffset());
+			dataList = sysNewsInformationDao.queryHomePage(params);
+		}
+		if (count == 0) {
+			dataList = new ArrayList<SysNewsInformation>();
+		}
+		pageInfo.setRows(dataList);
+		return pageInfo;
+	}
+
+	@Override
+	public boolean autoUpdateStatus() {
+		List<SysNewsInformation> list = sysNewsInformationDao.queryNeedUpdateStatusList();
+		if(list != null && list.size() > 0){
+			Date now = new Date();
+			for(SysNewsInformation news : list){
+				if(news.getStatus() == NewsStatusEnum.SHOW){
+					news.setStatus(NewsStatusEnum.HIDDEN);
+				}else{
+					news.setStatus(NewsStatusEnum.SHOW);
+				}
+				news.setUpdateTime(now);
+				sysNewsInformationDao.update(news);
+			}
+		}
+		return true;
+	}
+
+}

+ 49 - 0
cooleshow-cms/src/main/java/com/yonge/cooleshow/cms/service/impl/SysNewsTypeServiceImpl.java

@@ -0,0 +1,49 @@
+package com.yonge.cooleshow.cms.service.impl;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.yonge.cooleshow.cms.dal.dao.SysNewsTypeDao;
+import com.yonge.cooleshow.cms.dal.entity.SysNewsType;
+import com.yonge.cooleshow.cms.dal.entity.SysNewsTypeTree;
+import com.yonge.cooleshow.cms.service.SysNewsTypeService;
+import com.yonge.cooleshow.common.dal.BaseDAO;
+import com.yonge.cooleshow.common.service.impl.BaseServiceImpl;
+
+@Service
+public class SysNewsTypeServiceImpl extends BaseServiceImpl<Integer, SysNewsType>  implements SysNewsTypeService {
+	
+	@Autowired
+	private SysNewsTypeDao sysNewsTypeDao;
+
+	@Override
+	public BaseDAO<Integer, SysNewsType> getDAO() {
+		return sysNewsTypeDao;
+	}
+
+	@Override
+	public List<SysNewsTypeTree> queryTree(Integer parentId) {
+		if(parentId == null){
+			parentId = 0 ;
+		}
+		List<SysNewsTypeTree> sysNewsTypeList = queryByParentId(parentId);
+		if(sysNewsTypeList != null && sysNewsTypeList.size() > 0){
+			for(SysNewsTypeTree type : sysNewsTypeList){
+				type.setSubTypeList(queryTree(type.getId()));
+			}
+		}
+		
+		return sysNewsTypeList;
+	}
+
+	@Override
+	public List<SysNewsTypeTree> queryByParentId(Integer parentId) {
+		if(parentId == null){
+			parentId = 0 ;
+		}
+		return sysNewsTypeDao.queryByParentId(parentId);
+	}
+	
+}

+ 15 - 0
cooleshow-cms/src/main/resources/bootstrap-dev.properties

@@ -0,0 +1,15 @@
+
+#\u670d\u52a1\u5668\u5730\u5740
+spring.cloud.nacos.config.server-addr=47.114.1.200:8848
+#\u9ed8\u8ba4\u4e3aPublic\u547d\u540d\u7a7a\u95f4,\u53ef\u4ee5\u7701\u7565\u4e0d\u5199
+spring.cloud.nacos.config.namespace=6f8374a9-598f-4889-bb17-476070ffb8de
+#\u6307\u5b9a\u914d\u7f6e\u7fa4\u7ec4 --\u5982\u679c\u662fPublic\u547d\u540d\u7a7a\u95f4 \u5219\u53ef\u4ee5\u7701\u7565\u7fa4\u7ec4\u914d\u7f6e
+spring.cloud.nacos.config.group=DEFAULT_GROUP
+#\u6587\u4ef6\u540d -- \u5982\u679c\u6ca1\u6709\u914d\u7f6e\u5219\u9ed8\u8ba4\u4e3a ${spring.appliction.name}
+spring.cloud.nacos.config.prefix=cms
+#\u6307\u5b9a\u6587\u4ef6\u540e\u7f00
+spring.cloud.nacos.config.file-extension=yaml
+#\u662f\u5426\u52a8\u6001\u5237\u65b0
+spring.cloud.nacos.config.refresh.enabled=true
+#\u662f\u5426\u542f\u7528nacos\u914d\u7f6e\u4e2d\u5fc3
+spring.cloud.nacos.config.enabled=true

+ 21 - 0
cooleshow-cms/src/main/resources/config/mybatis/Global.mapper.xml

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+
+<mapper namespace="global">
+
+	<sql id="limit">
+		<if test="offset != null">
+			 limit #{offset},#{rows}
+		</if>
+	</sql>
+
+	<sql id="orderby">
+		<if test="sort != null and sort != ''">
+			 ORDER BY ${sort}
+			 <if test="order != null and order != ''">
+			 	${order}
+			 </if>
+		</if>
+	</sql>	
+ </mapper>

+ 96 - 0
cooleshow-cms/src/main/resources/config/mybatis/HelpCenterCatalogMapper.xml

@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.yonge.cooleshow.cms.dal.dao.HelpCenterCatalogDao">
+	<resultMap id="HelpCenterCatalog" type="com.yonge.cooleshow.cms.dal.entity.HelpCenterCatalog">
+		<id column="id_" property="id" jdbcType="INTEGER" />
+		<result column="parent_id_" property="parentId" jdbcType="INTEGER" />
+		<result column="name_" property="text" jdbcType="VARCHAR" />
+		<result column="description_" property="description" jdbcType="VARCHAR" />
+		<result column="create_on_" property="createOn" jdbcType="TIMESTAMP" />
+		<result column="modify_on_" property="modifyOn" jdbcType="TIMESTAMP" />
+		<result column="order_" property="order" jdbcType="INTEGER" />
+		<result column="status_" property="status" jdbcType="INTEGER" />
+	</resultMap>
+
+	<sql id="Base_Column_List">
+		id_, parent_id_, name_, description_, create_on_, modify_on_, order_,status_
+	</sql>
+
+	<select id="get" resultMap="HelpCenterCatalog" parameterType="java.lang.Integer">
+		select
+		<include refid="Base_Column_List" />
+		from help_center_catalog
+		where id_ = #{id,jdbcType=INTEGER}
+	</select>
+
+	<select id="queryPage" parameterType="map" resultMap="HelpCenterCatalog">
+		select
+		<include refid="Base_Column_List" />
+		from
+		help_center_catalog
+		order by order_ asc
+	</select>
+
+	<select id="queryByParentId" parameterType="map" resultMap="HelpCenterCatalog">
+		select
+		<include refid="Base_Column_List" />
+		from
+		help_center_catalog
+		where 1 = 1
+		<if test="parentId != null">
+			and parent_id_= #{parentId,jdbcType=INTEGER}
+		</if>
+		<if test="status != null">
+			and status_ = #{status,jdbcType=INTEGER}
+		</if>
+		order by order_ desc
+	</select>
+
+	<delete id="delete" parameterType="java.lang.Integer">
+		delete from help_center_catalog
+		where id_ = #{id,jdbcType=INTEGER}
+	</delete>
+	
+	<delete id="batchDelete" parameterType="String">
+		delete from help_center_catalog
+		where id_ in #{ids}
+	</delete>
+	
+	<insert id="insert" parameterType="com.yonge.cooleshow.cms.dal.entity.HelpCenterCatalog">
+		insert into help_center_catalog (id_, parent_id_, name_,
+		description_, create_on_, modify_on_,
+		order_,status_)
+		values (#{id,jdbcType=INTEGER}, #{parentId,jdbcType=INTEGER},
+		#{text,jdbcType=VARCHAR},
+		#{description,jdbcType=VARCHAR}, #{createOn,jdbcType=TIMESTAMP}, #{modifyOn,jdbcType=TIMESTAMP},
+		#{order,jdbcType=INTEGER},#{status,jdbcType=INTEGER})
+	</insert>
+	
+	<update id="update" parameterType="com.yonge.cooleshow.cms.dal.entity.HelpCenterCatalog">
+		update help_center_catalog
+		<set>
+			<if test="parentId != null">
+				parent_id_ = #{parentId,jdbcType=INTEGER},
+			</if>
+			<if test="text != null">
+				name_ = #{text,jdbcType=VARCHAR},
+			</if>
+			<if test="description != null">
+				description_ = #{description,jdbcType=VARCHAR},
+			</if>
+			<if test="createOn != null">
+				create_on_ = #{createOn,jdbcType=TIMESTAMP},
+			</if>
+			<if test="modifyOn != null">
+				modify_on_ = #{modifyOn,jdbcType=TIMESTAMP},
+			</if>
+			<if test="order != null">
+				order_ = #{order,jdbcType=INTEGER},
+			</if>
+			<if test="status != null">
+				status_ = #{status,jdbcType=INTEGER},
+			</if>
+		</set>
+		where id_ = #{id,jdbcType=INTEGER}
+	</update>
+</mapper>

+ 164 - 0
cooleshow-cms/src/main/resources/config/mybatis/HelpCenterContentMapper.xml

@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.yonge.cooleshow.cms.dal.dao.HelpCenterContentDao">
+	<resultMap id="HelpCenterContent" type="com.yonge.cooleshow.cms.dal.entity.HelpCenterContent">
+		<id column="id_" property="id" jdbcType="INTEGER" />
+		<result column="title_" property="title" jdbcType="VARCHAR" />
+		<result column="create_on_" property="createOn" jdbcType="TIMESTAMP" />
+		<result column="modify_on_" property="modifyOn" jdbcType="TIMESTAMP" />
+		<result column="status_" property="status" jdbcType="INTEGER" />
+		<result column="order_" property="order" jdbcType="INTEGER" />
+		<result column="catalog_id_" property="catalogId" jdbcType="INTEGER" />
+		<association property="catalog" 
+			javaType="com.yonge.cooleshow.cms.dal.entity.HelpCenterCatalog">
+			<result column="catalog_id_" property="id" />
+			<result column="name_" property="text" />
+			<result column="parent_id_" property="parentId" />
+		</association>
+	</resultMap>
+
+	<resultMap id="HelpCenterContentBlobs" type="com.yonge.cooleshow.cms.dal.entity.HelpCenterContent"
+		extends="HelpCenterContent">
+		<result column="content_" property="content" jdbcType="LONGVARCHAR" />
+	</resultMap>
+	<!-- 查询条件 -->
+	<sql id="queryConditionUnion">
+		<where>
+			<if test="catalogIds != null">
+				and content.catalog_id_ in (${catalogIds})
+			</if>
+			<if test="title!= null and title != ''">
+				and content.title_ like '%' #{title} '%'
+			</if>
+			<if test="status!= null">
+				and content.status_ = #{status}
+			</if>
+		</where>
+	</sql>
+	
+	<sql id="Base_Column_List">
+		id_, title_, catalog_id_, create_on_, modify_on_,status_,order_
+	</sql>
+
+	<sql id="Base_Column_List_union">
+		content.id_, content.title_, content.catalog_id_,
+		content.create_on_,
+		content.modify_on_,content.status_,content.content_,content.order_,
+		catalog.id_,
+		catalog.name_, catalog.parent_id_
+	</sql>
+
+	<sql id="Blob_Column_List">
+		content_
+	</sql>
+
+	<select id="get" resultMap="HelpCenterContentBlobs" parameterType="java.lang.Integer">
+		select
+		<include refid="Base_Column_List_union" />
+		from help_center_content content left join help_center_catalog catalog on
+		content.catalog_id_=catalog.id_
+		where content.id_ =
+		#{id,jdbcType=INTEGER}
+	</select>
+
+	<select id="queryPage" parameterType="map" resultMap="HelpCenterContentBlobs">
+		select
+		<include refid="Base_Column_List_union" />
+		from help_center_content content left join help_center_catalog catalog on
+		content.catalog_id_=catalog.id_
+		<include refid="queryConditionUnion" />
+		order by order_ asc
+		<include refid="global.limit" />
+	</select>
+
+	<select id="queryCount" parameterType="map" resultType="int">
+		select count(*) from help_center_content content left join help_center_catalog catalog on
+		content.catalog_id_=catalog.id_
+		<include refid="queryConditionUnion" />
+	</select>
+
+	<delete id="delete" parameterType="java.lang.Integer">
+		delete from help_center_content
+		where id_ = #{id,jdbcType=INTEGER}
+	</delete>
+	
+	<delete id="deleteContentByCatalog" parameterType="java.lang.Integer">
+		delete from help_center_content
+		where catalog_id_ = #{catalogId,jdbcType=INTEGER}
+	</delete>
+
+	<insert id="insert" parameterType="com.yonge.cooleshow.cms.dal.entity.HelpCenterContent">
+		insert into help_center_content
+		(id_, title_, catalog_id_,
+		create_on_, modify_on_, content_,status_,order_
+		)
+		values
+		(#{id,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR},
+		#{catalogId,jdbcType=INTEGER},
+		#{createOn,jdbcType=TIMESTAMP},
+		#{modifyOn,jdbcType=TIMESTAMP}, #{content,jdbcType=LONGVARCHAR},#{status,jdbcType=INTEGER},#{order,jdbcType=INTEGER}
+		)
+	</insert>
+
+	<update id="update" parameterType="com.yonge.cooleshow.cms.dal.entity.HelpCenterContent">
+		update help_center_content
+		<set>
+			<if test="title != null">
+				title_ = #{title,jdbcType=VARCHAR},
+			</if>
+			<if test="catalogId != null">
+				catalog_id_ = #{catalogId,jdbcType=INTEGER},
+			</if>
+			<if test="createOn != null">
+				create_on_ = #{createOn,jdbcType=TIMESTAMP},
+			</if>
+			<if test="modifyOn != null">
+				modify_on_ = #{modifyOn,jdbcType=TIMESTAMP},
+			</if>
+			<if test="content != null">
+				content_ = #{content,jdbcType=LONGVARCHAR},
+			</if>
+			<if test="status != null">
+				status_ = #{status,jdbcType=INTEGER},
+			</if>
+			<if test="order != null">
+				order_ = #{order,jdbcType=INTEGER},
+			</if>
+		</set>
+		where id_ = #{id,jdbcType=INTEGER}
+	</update>
+
+	<update id="updateBlobs" parameterType="com.yonge.cooleshow.cms.dal.entity.HelpCenterContent">
+		update help_center_content
+		set title_ = #{title,jdbcType=VARCHAR},
+		catalog_id_ =
+		#{catalogId,jdbcType=INTEGER},
+		create_on_ =
+		#{createOn,jdbcType=TIMESTAMP},
+		modify_on_ =
+		#{modifyOn,jdbcType=TIMESTAMP},
+		content_ =
+		#{content,jdbcType=LONGVARCHAR},
+		status_= #{status,jdbcType=INTEGER},
+		order_= #{order,jdbcType=INTEGER}
+		where id_ = #{id,jdbcType=INTEGER}
+	</update>
+
+	<update id="updateByKey" parameterType="com.yonge.cooleshow.cms.dal.entity.HelpCenterContent">
+		update help_center_content
+		set title_ = #{title,jdbcType=VARCHAR},
+		catalog_id_ =
+		#{catalogId,jdbcType=INTEGER},
+		create_on_ =
+		#{createOn,jdbcType=TIMESTAMP},
+		modify_on_ =
+		#{modifyOn,jdbcType=TIMESTAMP},
+		status_ = #{status,jdbcType=INTEGER},
+		order_ = #{order,jdbcType=INTEGER},
+		where id_ = #{id,jdbcType=INTEGER}
+	</update>
+	
+	<update id="updateContentByCatalog" parameterType="map">
+		update help_center_content set status_=#{status} where catalog_id_=#{catalogId}
+	</update>
+</mapper>

+ 85 - 0
cooleshow-cms/src/main/resources/config/mybatis/SysConfigMapper.xml

@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!-- 这个文件是自动生成的。 不要修改此文件。所有改动将在下次重新自动生成时丢失。 -->
+<mapper namespace="com.yonge.cooleshow.cms.dal.dao.SysConfigDao">
+
+	<resultMap type="com.yonge.cooleshow.cms.dal.entity.SysConfig" id="SysConfig">
+		<result column="id_" property="id" />
+		<result column="param_name_" property="paramName" />
+		<result column="paran_value_" property="paranValue" />
+		<result column="description_" property="description" />
+		<result column="create_on_" property="createOn" />
+		<result column="modify_on_" property="modifyOn" />
+		<result column="group_" property="group" />
+	</resultMap>
+
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="SysConfig">
+		SELECT * FROM sys_config WHERE id_ = #{id}
+	</select>
+
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="SysConfig">
+		SELECT * FROM sys_config where 1=1
+		<if test="group != null">
+			and group_ = #{group}
+		</if>
+		ORDER BY id_
+	</select>
+
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.yonge.cooleshow.cms.dal.entity.SysConfig"
+		useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval 
+			AS ID FROM DUAL </selectKey> -->
+		INSERT INTO sys_config
+		(id_,param_name_,paran_value_,description_,create_on_,modify_on_,group_)
+		VALUES(#{id},#{paramName},#{paranValue},#{description},#{createOn},#{modifyOn},#{group})
+	</insert>
+
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.yonge.cooleshow.cms.dal.entity.SysConfig">
+		UPDATE sys_config
+		<set>
+			<if test="modifyOn != null">
+				modify_on_ = #{modifyOn},
+			</if>
+			<if test="paranValue != null">
+				paran_value_ = #{paranValue},
+			</if>
+			<if test="description != null">
+				description_ = #{description},
+			</if>
+			<if test="paramName != null">
+				param_name_ = #{paramName},
+			</if>
+			<if test="group != null">
+				group_ = #{group},
+			</if>
+		</set>
+		WHERE id_ = #{id}
+	</update>
+
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete">
+		DELETE FROM sys_config WHERE id_ = #{id}
+	</delete>
+
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="SysConfig" parameterType="map">
+		SELECT * FROM sys_config ORDER BY id_
+		<include refid="global.limit" />
+	</select>
+
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM sys_config
+	</select>
+	
+	<select id="findByParamName" resultMap="SysConfig">
+		SELECT * FROM sys_config WHERE param_name_ = #{paramName}
+	</select>
+    <select id="findConfigValue" resultType="java.lang.String">
+		SELECT paran_value_ FROM sys_config WHERE param_name_ = #{paramName}
+	</select>
+</mapper>

+ 309 - 0
cooleshow-cms/src/main/resources/config/mybatis/SysNewsInformationMapper.xml

@@ -0,0 +1,309 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!--
+这个文件是自动生成的。
+不要修改此文件。所有改动将在下次重新自动生成时丢失。
+-->
+<mapper namespace="com.yonge.cooleshow.cms.dal.dao.SysNewsInformationDao">
+	
+	<resultMap type="com.yonge.cooleshow.cms.dal.entity.SysNewsInformation" id="SysNewsInformation">
+		<result column="id_" property="id" />
+		<result column="title_" property="title" />
+		<result column="content_" property="content" />
+		<result column="cover_image_" property="coverImage" />
+		<result column="video_cover_image_" property="videoCoverImage" />
+		<result column="link_url_" property="linkUrl"/>
+		<result column="type_" property="type"/>
+		<result column="online_time_" property="onlineTime"/>
+		<result column="offline_time_" property="offlineTime"/>
+		<result column="sub_type_" property="subType"/>
+		<result column="status_" property="status" typeHandler="com.yonge.cooleshow.common.dal.CustomEnumTypeHandler" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+		<result column="del_flag_" property="delFlag" />
+		<result column="href_target_" property="hrefTarget" />
+		<result column="order_" property="order" />
+		<result column="memo_" property="memo" />
+		<result column="tenant_id_" property="tenantId" />
+		<result column="attribute1_" property="attribute1" />
+		<result column="attribute2_" property="attribute2" />
+		<result column="subject_id_list_" property="subjectIdList" />
+		<result column="organ_id_list_" property="organIdList" />
+		<result column="subject_name_" property="subjectName" />
+		<result column="organ_name_list_" property="organNameList" />
+	</resultMap>
+	
+	<resultMap type="com.yonge.cooleshow.cms.dto.SysNewsInformationDto" id="SysNewsInformationDto" extends="SysNewsInformation">
+		<result column="typeName" property="typeName" />
+		<result column="subTypeName" property="subTypeName" />
+	</resultMap>
+	
+	<sql id="queryCondition">
+		<where>
+			sni.del_flag_=0 
+			<if test="type != null">
+				and sni.type_ = #{type}
+			</if>
+			<if test="subType != null">
+				and sni.sub_type_ = #{subType}
+			</if>
+			<if test="tenantId != null">
+				and sni.tenant_id_ = #{tenantId}
+			</if>
+			<if test="status != null">
+				and sni.status_ = #{status, typeHandler=com.yonge.cooleshow.common.dal.CustomEnumTypeHandler}
+			</if>
+			<if test="title != null">
+				and sni.title_ like '%' #{title} '%'
+			</if>
+			<if test="search != null">
+				and sni.title_ like '%' #{search} '%'
+			</if>
+			<if test="subjectId != null">
+				and find_in_set(#{subjectId},sni.subject_id_list_)
+			</if>
+			<if test="organId != null">
+				and (find_in_set(#{organId},sni.organ_id_list_) or sni.organ_id_list_ is null)
+			</if>
+			<if test="organIdList != null">
+				and INTE_ARRAY(#{organIdList},sni.organ_id_list_)
+			</if>
+			<if test="excludeIds!=null and excludeIds.size()>0">
+				AND sni.id_ NOT IN
+				<foreach collection="excludeIds" item="excludeId" open="(" close=")" separator=",">
+					#{excludeId}
+				</foreach>
+			</if>
+			<if test="clientName != 'manage'">
+				<choose>
+					<when test="memo != null and memo != ''">
+						and sni.memo_ = #{memo}
+					</when>
+					<otherwise>
+						and (sni.memo_ is null or sni.memo_ = '')
+					</otherwise>
+				</choose>
+			</if>
+		</where>
+	</sql>
+	
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="SysNewsInformation" >
+		SELECT * FROM sys_news_information WHERE id_ = #{id} AND del_flag_=0
+	</select>
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="SysNewsInformation">
+		SELECT * FROM sys_news_information WHERE del_flag_=0 ORDER BY id_
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.yonge.cooleshow.cms.dal.entity.SysNewsInformation" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		INSERT INTO sys_news_information (id_,title_,content_,cover_image_,video_cover_image_,type_,online_time_,offline_time_,sub_type_,status_,create_time_,update_time_,link_url_,href_target_,order_,del_flag_,memo_,tenant_id_,attribute1_,attribute2_,subject_id_list_,organ_id_list_)
+		VALUES(#{id},#{title},#{content},#{coverImage},#{videoCoverImage},#{type},#{onlineTime},#{offlineTime},#{subType},#{status, typeHandler=com.yonge.cooleshow.common.dal.CustomEnumTypeHandler},now(),now(),#{linkUrl},#{hrefTarget},#{order},0,#{memo},#{tenantId},#{attribute1},#{attribute2},#{subjectIdList},#{organIdList})
+	</insert>
+	
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.yonge.cooleshow.cms.dal.entity.SysNewsInformation">
+		UPDATE sys_news_information
+		<set>
+			<if test="status != null">
+				status_ = #{status, typeHandler=com.yonge.cooleshow.common.dal.CustomEnumTypeHandler},
+			</if>
+			<if test="title != null">
+				title_ = #{title},
+			</if>
+			<if test="tenantId != null">
+				tenant_id_ = #{tenantId},
+			</if>
+			<if test="updateTime != null">
+				update_time_ = NOW(),
+			</if>
+			<if test="content != null">
+				content_ = #{content},
+			</if>
+			<if test="coverImage != null">
+				cover_image_ = #{coverImage},
+			</if>
+			<if test="videoCoverImage != null">
+				video_cover_image_ = #{videoCoverImage},
+			</if>
+			<if test="type != null">
+				type_ = #{type},
+			</if>
+				online_time_ = #{onlineTime},
+				offline_time_ = #{offlineTime},
+			<if test="subType != null">
+				sub_type_ = #{subType},
+			</if>
+			<if test="linkUrl != null">
+				link_url_ = #{linkUrl},
+			</if>
+			<if test="hrefTarget != null">
+				href_target_ = #{hrefTarget},
+			</if>
+			<if test="order != null">
+				order_ = #{order},
+			</if>
+			<if test="memo != null">
+				memo_ = #{memo},
+			</if>
+			<if test="delFlag != null">
+				del_flag_ = #{delFlag},
+			</if>
+			<if test="attribute1 != null">
+				attribute1_ = #{attribute1},
+			</if>
+			<if test="attribute2 != null">
+				attribute2_ = #{attribute2},
+			</if>
+			<if test="subjectIdList != null">
+				subject_id_list_ = #{subjectIdList},
+			</if>
+			<if test="organIdList != null">
+				organ_id_list_ = #{organIdList},
+			</if>
+		</set>
+		WHERE id_ = #{id}
+	</update>
+	
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete" >
+		DELETE FROM sys_news_information WHERE id_ = #{id} 
+	</delete>
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="SysNewsInformation" parameterType="map">
+		SELECT sni.*,GROUP_CONCAT(distinct s.name_) subject_name_,GROUP_CONCAT(distinct o.name_) organ_name_list_ FROM sys_news_information sni left join subject s on find_in_set(s.id_,sni.subject_id_list_)
+		left join organization o on find_in_set(o.id_,sni.organ_id_list_)
+		<include refid="queryCondition" />
+		group by sni.id_
+		order by sni.status_ desc,sni.order_ desc,sni.update_time_ desc
+		<include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(sni.id_) FROM sys_news_information sni
+		<include refid="queryCondition" />
+	</select>
+	
+	<select id="queryByType" resultMap="SysNewsInformation" parameterType="java.lang.Integer">
+		SELECT * FROM sys_news_information 
+		<where>
+			del_flag_=0
+			<if test="type != null">
+				and type_ = #{type}
+			</if>
+		</where>
+	</select>
+	
+	<update id="deleteWithLogical">
+		UPDATE sys_news_information SET del_flag_ = 1,update_time_ = NOW() WHERE id_ = #{id}
+	</update>
+	
+	<!-- 分页查询 -->
+	<select id="queryHomePage" resultMap="SysNewsInformation"
+		parameterType="map">
+		SELECT sni.*,GROUP_CONCAT(s.name_) subject_name_ FROM sys_news_information sni left join subject s on find_in_set(s.id_,sni.subject_id_list_) where sni.del_flag_=0
+		<if test="type != null">
+			and sni.type_ = #{type}
+		</if>
+		<if test="subType != null">
+			and sni.sub_type_ = #{subType}
+		</if>
+		<if test="status != null">
+			and sni.status_ = #{status,
+			typeHandler=com.yonge.cooleshow.common.dal.CustomEnumTypeHandler}
+		</if>
+		<if test="title != null">
+			and sni.title_ like '%' #{title} '%'
+		</if>
+		<if test="search != null">
+			and sni.title_ like '%' #{search} '%'
+		</if>
+		<if test="tenantId != null">
+			and sni.tenant_id_ = #{tenantId}
+		</if>
+		<if test="excludeIds!=null and excludeIds.size()>0">
+			AND sni.id_ NOT IN
+			<foreach collection="excludeIds" item="excludeId" open="(" close=")" separator=",">
+				#{excludeId}
+			</foreach>
+		</if>
+			<if test="subjectId != null">
+				and find_in_set(#{subjectId},sni.subject_id_list_)
+			</if>
+			<if test="organId != null">
+				and (find_in_set(#{organId},sni.organ_id_list_) or sni.organ_id_list_ is null)
+			</if>
+		<if test="clientName != 'manage'">
+			<choose>
+				<when test="memo != null and memo != ''">
+					and sni.memo_ = #{memo}
+				</when>
+				<otherwise>
+					and (sni.memo_ is null or sni.memo_ = '')
+				</otherwise>
+			</choose>
+		</if>
+		group by sni.id_
+		order by sni.status_ desc,sni.order_ desc,sni.update_time_ desc
+		<include refid="global.limit" />
+	</select>
+
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryHomeCount" resultType="int">
+		SELECT COUNT(sni.id_) FROM sys_news_information sni where sni.del_flag_=0
+		<if test="type != null">
+			and sni.type_ = #{type}
+		</if>
+		<if test="subType != null">
+			and sni.sub_type_ = #{subType}
+		</if>
+		<if test="status != null">
+			and sni.status_ = #{status,
+			typeHandler=com.yonge.cooleshow.common.dal.CustomEnumTypeHandler}
+		</if>
+		<if test="title != null">
+			and sni.title_ like '%' #{title} '%'
+		</if>
+		<if test="search != null">
+			and sni.title_ like '%' #{search} '%'
+		</if>
+		<if test="tenantId != null">
+			and sni.tenant_id_ = #{tenantId}
+		</if>
+			<if test="subjectId != null">
+				and find_in_set(#{subjectId},sni.subject_id_list_)
+			</if>
+			<if test="organId != null">
+				and (find_in_set(#{organId},sni.organ_id_list_) or sni.organ_id_list_ is null)
+			</if>
+		<if test="clientName != 'manage'">
+			<choose>
+				<when test="memo != null and memo != ''">
+					and sni.memo_ = #{memo}
+				</when>
+				<otherwise>
+					and (sni.memo_ is null or sni.memo_ = '')
+				</otherwise>
+			</choose>
+		</if>
+	</select>
+	
+	<select id="queryNeedUpdateStatusList" resultMap="SysNewsInformation" >
+		SELECT * FROM sys_news_information WHERE del_flag_ = 0 and (
+		(online_time_ is not null and now() between online_time_ and offline_time_ and status_ = 0) 
+		or (offline_time_ is not null and offline_time_ &lt;= now() and status_ = 1)
+		or (online_time_ is not null and online_time_ &gt;= now() and status_ = 1)
+		)
+	</select>
+	
+	<select id="queryById" resultMap="SysNewsInformationDto" >
+		SELECT sni.*,sntp.name_ typeName,snts.name_ subTypeName FROM sys_news_information sni 
+		left join sys_news_type sntp on sni.type_ = sntp.id_
+		left join sys_news_type snts on sni.sub_type_ = snts.id_
+		where sni.id_ = #{id}
+	</select>
+</mapper>

+ 83 - 0
cooleshow-cms/src/main/resources/config/mybatis/SysNewsTypeMapper.xml

@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!-- 这个文件是自动生成的。 不要修改此文件。所有改动将在下次重新自动生成时丢失。 -->
+<mapper namespace="com.yonge.cooleshow.cms.dal.dao.SysNewsTypeDao">
+
+	<resultMap type="com.yonge.cooleshow.cms.dal.entity.SysNewsType" id="SysNewsType">
+		<result column="id_" property="id" />
+		<result column="name_" property="name" />
+		<result column="parent_id_" property="parentId" />
+		<result column="del_flag_" property="delFlag" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+	</resultMap>
+	
+	<resultMap type="com.yonge.cooleshow.cms.dal.entity.SysNewsTypeTree" extends="SysNewsType" id="SysNewsTypeTree">
+	</resultMap>
+
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="SysNewsType">
+		SELECT * FROM
+		sys_news_type WHERE id_ = #{id}
+	</select>
+
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="SysNewsType">
+		SELECT * FROM sys_news_type ORDER
+		BY id_
+	</select>
+
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.yonge.cooleshow.cms.dal.entity.SysNewsType"
+		useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		INSERT INTO sys_news_type
+		(id_,name_,parent_id_,del_flag_,create_time_,update_time_)
+		VALUES(#{id},#{name},#{parentId},#{delFlag},#{createTime},#{updateTime})
+	</insert>
+
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.yonge.cooleshow.cms.dal.entity.SysNewsType">
+		UPDATE sys_news_type
+		<set>
+			<if test="parentId != null">
+				parent_id_ = #{parentId},
+			</if>
+			<if test="delFlag != null">
+				del_flag_ = #{delFlag},
+			</if>
+			<if test="id != null">
+				id_ = #{id},
+			</if>
+			<if test="updateTime != null">
+				update_time_ = #{updateTime},
+			</if>
+			<if test="name != null">
+				name_ = #{name},
+			</if>
+			<if test="createTime != null">
+				create_time_ = #{createTime},
+			</if>
+		</set>
+		WHERE id_ = #{id}
+	</update>
+
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete">
+		DELETE FROM sys_news_type WHERE id_ = #{id}
+	</delete>
+
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="SysNewsType" parameterType="map">
+		SELECT * FROM sys_news_type ORDER BY id_
+		<include refid="global.limit" />
+	</select>
+
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM sys_news_type
+	</select>
+	
+	<select id="queryByParentId" resultMap="SysNewsTypeTree">
+		SELECT * FROM sys_news_type where parent_id_ = #{parentId}
+	</select>
+</mapper>

+ 55 - 0
cooleshow-cms/src/main/resources/logback-spring.xml

@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration scan="true" scanPeriod="10 seconds">
+
+	<property name="LOG_HOME" value="/mdata/logs/cms-%d{yyyy-MM-dd_HH}-%i.log" />
+	<property name="CONSOLE_LOG_PATTERN"
+		value="[%X{username} %X{ip} %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36}] : %msg%n" />
+
+	<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
+		<encoder charset="UTF-8">
+			<pattern>${CONSOLE_LOG_PATTERN}</pattern>
+		</encoder>
+	</appender>
+
+	<appender name="file"
+		class="ch.qos.logback.core.rolling.RollingFileAppender">
+		<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+			<FileNamePattern>${LOG_HOME}</FileNamePattern>
+			<MaxHistory>90</MaxHistory>
+			<TimeBasedFileNamingAndTriggeringPolicy
+				class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
+				<MaxFileSize>20MB</MaxFileSize>
+			</TimeBasedFileNamingAndTriggeringPolicy>
+		</rollingPolicy>
+
+		<encoder>
+			<pattern>${CONSOLE_LOG_PATTERN}</pattern>
+		</encoder>
+	</appender>
+
+	<logger name="com.ym.mec" level="INFO" />
+
+	<!--开发环境:打印控制台 -->
+	<springProfile name="dev">
+		<root level="INFO">
+			<appender-ref ref="stdout" />
+			<appender-ref ref="file" />
+		</root>
+	</springProfile>
+	
+	<springProfile name="test">
+		<root level="INFO">
+			<appender-ref ref="stdout" />
+			<appender-ref ref="file" />
+		</root>
+	</springProfile>
+
+	<!--生产环境:输出到文件 -->
+	<springProfile name="prod">
+		<root level="WARN">
+			<appender-ref ref="stdout" />
+			<appender-ref ref="file" />
+		</root>
+	</springProfile>
+
+</configuration>

+ 0 - 38
cooleshow-cms/src/test/java/com/yonge/cooleshow/AppTest.java

@@ -1,38 +0,0 @@
-package com.yonge.cooleshow;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-/**
- * Unit test for simple App.
- */
-public class AppTest 
-    extends TestCase
-{
-    /**
-     * Create the test case
-     *
-     * @param testName name of the test case
-     */
-    public AppTest( String testName )
-    {
-        super( testName );
-    }
-
-    /**
-     * @return the suite of tests being tested
-     */
-    public static Test suite()
-    {
-        return new TestSuite( AppTest.class );
-    }
-
-    /**
-     * Rigourous Test :-)
-     */
-    public void testApp()
-    {
-        assertTrue( true );
-    }
-}