Initial commit

This commit is contained in:
易焱
2019-07-30 18:14:32 +08:00
commit daa60cf523
1624 changed files with 90832 additions and 0 deletions
+124
View File
@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="Spring" name="Spring">
<configuration />
</facet>
<facet type="web" name="Web">
<configuration>
<webroots />
<sourceRoots>
<root url="file://$MODULE_DIR$/src/main/java" />
<root url="file://$MODULE_DIR$/src/main/resources" />
</sourceRoots>
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="common" />
<orderEntry type="module" module-name="system" />
<orderEntry type="module" module-name="excel" />
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:4.0.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi:4.0.0" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.11" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:4.0.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:3.0.1" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-compress:1.18" level="project" />
<orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.04" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.1.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.1.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.1.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" />
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.11.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.11.2" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.26" level="project" />
<orderEntry type="library" name="Maven: javax.annotation:javax.annotation-api:1.3.2" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.yaml:snakeyaml:1.23" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.1.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.9.8" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.9.0" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.9.8" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.8" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.8" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.8" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.1.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.17" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-el:9.0.17" level="project" />
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.17" level="project" />
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.0.16.Final" level="project" />
<orderEntry type="library" name="Maven: javax.validation:validation-api:2.0.1.Final" level="project" />
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.3.2.Final" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.4.0" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.1.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.1.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.1.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.1.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.1.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.1.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-data-jpa:2.1.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.1.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.9.2" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.1.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.2.0" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.1.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: javax.transaction:javax.transaction-api:1.3" level="project" />
<orderEntry type="library" name="Maven: javax.xml.bind:jaxb-api:2.3.1" level="project" />
<orderEntry type="library" name="Maven: javax.activation:javax.activation-api:1.2.0" level="project" />
<orderEntry type="library" name="Maven: org.hibernate:hibernate-core:5.3.9.Final" level="project" />
<orderEntry type="library" name="Maven: javax.persistence:javax.persistence-api:2.2" level="project" />
<orderEntry type="library" name="Maven: org.javassist:javassist:3.23.1-GA" level="project" />
<orderEntry type="library" name="Maven: net.bytebuddy:byte-buddy:1.9.12" level="project" />
<orderEntry type="library" name="Maven: antlr:antlr:2.7.7" level="project" />
<orderEntry type="library" name="Maven: org.jboss:jandex:2.0.5.Final" level="project" />
<orderEntry type="library" name="Maven: org.dom4j:dom4j:2.1.1" level="project" />
<orderEntry type="library" name="Maven: org.hibernate.common:hibernate-commons-annotations:5.0.4.Final" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-jpa:2.1.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.data:spring-data-commons:2.1.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-orm:5.1.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.1.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-aspects:5.1.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-configuration-processor:2.1.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-cache:2.1.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.1.6.RELEASE" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.springframework.boot:spring-boot-devtools:2.1.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.1.4.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.1.4.RELEASE" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:2.1.4.RELEASE" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:2.1.4.RELEASE" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:2.1.4.RELEASE" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: com.jayway.jsonpath:json-path:2.4.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:json-smart:2.3" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:1.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.ow2.asm:asm:5.0.4" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:3.11.1" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:2.23.4" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy-agent:1.9.12" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.6" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-library:1.3" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.5.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.1.6.RELEASE" level="project" />
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.1.6.RELEASE" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:5.1.6.RELEASE" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.xmlunit:xmlunit-core:2.6.2" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: mysql:mysql-connector-java:5.1.46" level="project" />
<orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.2" level="project" />
<orderEntry type="library" name="Maven: net.sf.ehcache:ehcache:2.10.5" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.26" level="project" />
<orderEntry type="library" name="Maven: org.jsoup:jsoup:1.11.3" level="project" />
</component>
</module>
+36
View File
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.cwhelp.modules</groupId>
<artifactId>business</artifactId>
<packaging>jar</packaging>
<name>业务</name>
<parent>
<groupId>com.cwhelp</groupId>
<artifactId>modules</artifactId>
<version>2.0.1</version>
</parent>
<dependencies>
<dependency>
<groupId>com.cwhelp</groupId>
<artifactId>common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.cwhelp.modules</groupId>
<artifactId>system</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.cwhelp.component</groupId>
<artifactId>excel</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>
@@ -0,0 +1,73 @@
package com.cwhelp.modules.business.domain;
import com.cwhelp.common.enums.StatusEnum;
import com.cwhelp.common.utils.StatusUtil;
import com.cwhelp.modules.system.domain.User;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
/**
* @author yan.y
* @date 2019/07/29
*/
@Data
@Entity
@Table(name="bss_dept")
@EntityListeners(AuditingEntityListener.class)
@Where(clause = StatusUtil.notDelete)
public class BssDept implements Serializable {
// 主键ID
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
private Long id;
private String name;
// 描述
private String description;
// 平台ID
//@Column(name = "platform_id")
//private Long platformId;
@ManyToOne(fetch=FetchType.LAZY)
@NotFound(action=NotFoundAction.IGNORE)
@JoinColumn(name="platform_id")
@JsonIgnore
private BssPlatform bssPlatform;
// 备注
private String remark;
// 创建时间
@CreatedDate
private Date createDate;
// 更新时间
@LastModifiedDate
private Date updateDate;
// 创建者
@CreatedBy
@ManyToOne(fetch=FetchType.LAZY)
@NotFound(action=NotFoundAction.IGNORE)
@JoinColumn(name="create_by")
@JsonIgnore
private User createBy;
// 更新者
@LastModifiedBy
@ManyToOne(fetch=FetchType.LAZY)
@NotFound(action=NotFoundAction.IGNORE)
@JoinColumn(name="update_by")
@JsonIgnore
private User updateBy;
// 数据状态
private Byte status = StatusEnum.OK.getCode();
}
@@ -0,0 +1,73 @@
package com.cwhelp.modules.business.domain;
import com.cwhelp.common.enums.StatusEnum;
import com.cwhelp.common.utils.StatusUtil;
import com.cwhelp.modules.system.domain.User;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
import org.hibernate.annotations.Where;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
/**
* @author yan.y
* @date 2019/07/28
*/
@Data
@Entity
@Table(name="bss_platform")
@EntityListeners(AuditingEntityListener.class)
@Where(clause = StatusUtil.notDelete)
public class BssPlatform implements Serializable {
// 主键ID
@Id
@GeneratedValue(strategy= GenerationType.IDENTITY)
private Long id;
private String name;
// 联系人
private String contact;
// 联系人电话
@Column(name = "contact_tel")
private String contactTel;
// 联系人身份证号码
@Column(name = "contact_card")
private String contactCard;
// 邮箱
private String email;
// 类型
private Integer type;
// 备注
private String remark;
// 创建时间
@CreatedDate
private Date createDate;
// 更新时间
@LastModifiedDate
private Date updateDate;
// 创建者
@CreatedBy
@ManyToOne(fetch= FetchType.LAZY)
@NotFound(action=NotFoundAction.IGNORE)
@JoinColumn(name="create_by")
@JsonIgnore
private User createBy;
// 更新者
@LastModifiedBy
@ManyToOne(fetch=FetchType.LAZY)
@NotFound(action=NotFoundAction.IGNORE)
@JoinColumn(name="update_by")
@JsonIgnore
private User updateBy;
// 数据状态
private Byte status = StatusEnum.OK.getCode();
}
@@ -0,0 +1,12 @@
package com.cwhelp.modules.business.repository;
import com.cwhelp.modules.business.domain.BssDept;
import com.cwhelp.modules.system.repository.BaseRepository;
/**
* @author yan.y
* @date 2019/07/29
*/
public interface BssDeptRepository extends BaseRepository<BssDept, Long> {
}
@@ -0,0 +1,12 @@
package com.cwhelp.modules.business.repository;
import com.cwhelp.modules.business.domain.BssPlatform;
import com.cwhelp.modules.system.repository.BaseRepository;
/**
* @author yan.y
* @date 2019/07/28
*/
public interface BssPlatformRepository extends BaseRepository<BssPlatform, Long> {
}
@@ -0,0 +1,41 @@
package com.cwhelp.modules.business.service;
import com.cwhelp.common.enums.StatusEnum;
import com.cwhelp.modules.business.domain.BssDept;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* @author yan.y
* @date 2019/07/29
*/
public interface BssDeptService {
/**
* 获取分页列表数据
* @param example 查询实例
* @return 返回分页数据
*/
Page<BssDept> getPageList(Example<BssDept> example);
/**
* 根据ID查询数据
* @param id 主键ID
*/
BssDept getById(Long id);
/**
* 保存数据
* @param bssDept 实体对象
*/
BssDept save(BssDept bssDept);
/**
* 状态(启用,冻结,删除)/批量状态处理
*/
@Transactional
Boolean updateStatus(StatusEnum statusEnum, List<Long> idList);
}
@@ -0,0 +1,50 @@
package com.cwhelp.modules.business.service;
import com.cwhelp.common.enums.StatusEnum;
import com.cwhelp.modules.business.domain.BssPlatform;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Sort;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* @author yan.y
* @date 2019/07/28
*/
public interface BssPlatformService {
/**
* 获取分页列表数据
* @param example 查询实例
* @return 返回分页数据
*/
Page<BssPlatform> getPageList(Example<BssPlatform> example);
/**
* 根据ID查询数据
* @param id 主键ID
*/
BssPlatform getById(Long id);
/**
* 保存数据
* @param bssPlatform 实体对象
*/
BssPlatform save(BssPlatform bssPlatform);
/**
* 状态(启用,冻结,删除)/批量状态处理
*/
@Transactional
Boolean updateStatus(StatusEnum statusEnum, List<Long> idList);
/**
* 获取平台列表数据
* @param example 查询实例
* @param sort 排序对象
*/
List<BssPlatform> getListByExample(Example<BssPlatform> example, Sort sort);
}
@@ -0,0 +1,66 @@
package com.cwhelp.modules.business.service.impl;
import com.cwhelp.common.data.PageSort;
import com.cwhelp.common.enums.StatusEnum;
import com.cwhelp.modules.business.domain.BssDept;
import com.cwhelp.modules.business.repository.BssDeptRepository;
import com.cwhelp.modules.business.service.BssDeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* @author yan.y
* @date 2019/07/29
*/
@Service
public class BssDeptServiceImpl implements BssDeptService {
@Autowired
private BssDeptRepository bssDeptRepository;
/**
* 根据ID查询数据
* @param id 主键ID
*/
@Override
@Transactional
public BssDept getById(Long id) {
return bssDeptRepository.findById(id).orElse(null);
}
/**
* 获取分页列表数据
* @param example 查询实例
* @return 返回分页数据
*/
@Override
public Page<BssDept> getPageList(Example<BssDept> example) {
// 创建分页对象
PageRequest page = PageSort.pageRequest();
return bssDeptRepository.findAll(example, page);
}
/**
* 保存数据
* @param bssDept 实体对象
*/
@Override
public BssDept save(BssDept bssDept) {
return bssDeptRepository.save(bssDept);
}
/**
* 状态(启用,冻结,删除)/批量状态处理
*/
@Override
@Transactional
public Boolean updateStatus(StatusEnum statusEnum, List<Long> idList) {
return bssDeptRepository.updateStatus(statusEnum.getCode(), idList) > 0;
}
}
@@ -0,0 +1,78 @@
package com.cwhelp.modules.business.service.impl;
import com.cwhelp.common.data.PageSort;
import com.cwhelp.common.enums.StatusEnum;
import com.cwhelp.modules.business.domain.BssPlatform;
import com.cwhelp.modules.business.repository.BssPlatformRepository;
import com.cwhelp.modules.business.service.BssPlatformService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* @author yan.y
* @date 2019/07/28
*/
@Service
public class BssPlatformServiceImpl implements BssPlatformService {
@Autowired
private BssPlatformRepository bssPlatformRepository;
/**
* 根据ID查询数据
* @param id 主键ID
*/
@Override
@Transactional
public BssPlatform getById(Long id) {
return bssPlatformRepository.findById(id).orElse(null);
}
/**
* 获取分页列表数据
* @param example 查询实例
* @return 返回分页数据
*/
@Override
public Page<BssPlatform> getPageList(Example<BssPlatform> example) {
// 创建分页对象
PageRequest page = PageSort.pageRequest();
return bssPlatformRepository.findAll(example, page);
}
/**
* 保存数据
* @param bssPlatform 实体对象
*/
@Override
public BssPlatform save(BssPlatform bssPlatform) {
return bssPlatformRepository.save(bssPlatform);
}
/**
* 状态(启用,冻结,删除)/批量状态处理
*/
@Override
@Transactional
public Boolean updateStatus(StatusEnum statusEnum, List<Long> idList) {
return bssPlatformRepository.updateStatus(statusEnum.getCode(), idList) > 0;
}
/**
* 获取部门列表数据
* @param example 查询实例
* @param sort 排序对象
*/
@Override
public List<BssPlatform> getListByExample(Example<BssPlatform> example, Sort sort) {
return bssPlatformRepository.findAll(example, sort);
}
}