Commit d32bbad9 by wangyuanfeng

提交

parents
.gradle
/build/
!gradle/wrapper/gradle-wrapper.jar
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
/out/
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
\ No newline at end of file
buildscript {
ext {
springBootVersion = '2.1.1.RELEASE'
}
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
apply plugin: 'java'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
group = 'com.itfuture'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
repositories {
mavenCentral()
}
ext {
druidVersion = '1.1.5'
pagehelperVersion = '4.1.0'
}
dependencies {
compile 'org.springframework.boot:spring-boot-starter-web'
compile 'org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.2'
compile 'mysql:mysql-connector-java'
compile 'org.springframework.boot:spring-boot-starter-test'
compile 'ma.glasnost.orika:orika-core:1.5.2'
compile 'io.springfox:springfox-swagger2:2.7.0'
compile 'io.springfox:springfox-swagger-ui:2.7.0'
compile 'org.projectlombok:lombok:1.16.18'
compile "com.alibaba:druid:$druidVersion"
compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.8.10'
compile 'com.github.pagehelper:pagehelper:4.1.0'
compile 'cn.hutool:hutool-all:4.3.2'
}
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
#!/usr/bin/env sh
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi
exec "$JAVACMD" "$@"
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
rootProject.name = 'chain-service'
package com.itfuture.chainservice;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@MapperScan("com.itfuture.chainservice.repository")
@SpringBootApplication
public class ChainServiceApplication {
public static void main(String[] args) {
SpringApplication.run(ChainServiceApplication.class, args);
}
}
package com.itfuture.chainservice.common.config.page;
import com.itfuture.chainservice.common.utils.page.PageResultFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @author naihe
* @date 2019/1/14 9:24 AM
* @desc 公共模块自动配置类
*/
@Configuration
@ConditionalOnClass({ PageResultFactory.class })
public class PageConfig {
@Bean
@ConditionalOnMissingBean(PageResultFactory.class)
@ConditionalOnProperty(name = "king.page.enabled", matchIfMissing = true)
public PageResultFactory authorResolver() {
PageResultFactory pageResultFactory = new PageResultFactory();
return pageResultFactory;
}
}
package com.itfuture.chainservice.common.config.request;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* @author naihe
* @date 2019/1/15 8:42 AM
* @desc 请求路径
*/
@Component
@Data
@ConfigurationProperties(prefix = "request.url")
public class RequestUrlProperties {
private String OrderRequestUrl; // 订单请求路径
private String ContractRequestUrl; // 订单请求路径
private String SupplierRequestUrl; // 供应商请求路径
}
package com.itfuture.chainservice.common.config.swagger;
import lombok.Data;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import springfox.documentation.swagger2.web.Swagger2Controller;
@Data
@Configuration
@EnableSwagger2
@ConfigurationProperties(prefix = "king.swagger")
@ConditionalOnProperty(name = "king.swagger.enabled", havingValue = "true")
@ConditionalOnClass(value = Swagger2Controller.class)
public class SwaggerConfig {
private String basePackage = "com.itfuture.chainservice.controller";
private String title = "他很懒什么都没有留下";
private String description = "他很懒什么都没有留下";
private String version = "V1.0";
@Bean
public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors.basePackage(basePackage))
.paths(PathSelectors.any())
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title(title)
.description(description)
.version(version)
.build();
}
}
package com.itfuture.chainservice.common.utils.mapper;
import ma.glasnost.orika.MapperFactory;
import ma.glasnost.orika.impl.DefaultMapperFactory;
import ma.glasnost.orika.metadata.ClassMapBuilder;
import java.util.Collections;
import java.util.List;
import java.util.Map;
/**
* @author naihe
* @date 2019/1/11 3:01 PM
* @desc 属性映射工具
*/
public final class MapperUtils {
private MapperUtils() { }
/**
* 构建一个Mapper工厂
*/
private static final MapperFactory MAPPER_FACTORY = new DefaultMapperFactory.Builder().build();
/**
* 将s属性映射到R的具体实例上
* @param s 已有的Bean,源Bean
* @param rClass
* @param <S> sourceBean
* @param <R> ReturnBean
* @return R的实例
*/
public static <S, R> R mapperBean(S s, Class<R> rClass) {
return MAPPER_FACTORY.getMapperFacade().map(s, rClass);
}
/**
* 将s属性映射到R的具体实例上,如果转换的属性名不一样,可以传入Map进行说明
* @param s 已有的Bean,源Bean
* @param rClass
* @param <S> sourceBean
* @param <R> ReturnBean
* @return R的实例
*/
public static <S, R> R mapperBean(S s, Class<R> rClass, Map<String, String> diffFieldMap) {
ClassMapBuilder<?, R> classMap = MAPPER_FACTORY.classMap(s.getClass(), rClass);
diffFieldMap.forEach(classMap::field);
classMap.byDefault()
.register();
return MAPPER_FACTORY.getMapperFacade().map(s, rClass);
}
/**
* 将s的集合射成R的集合
* @param sList 已有的Bean的集合
* @param rClass 要转换的类型
* @param <S> sourceBean
* @param <R> ReturnBean
* @return R的实例
*/
public static <S, R> List<R> mapperList(List<S> sList, Class<R> rClass) {
return MAPPER_FACTORY.getMapperFacade().mapAsList(sList, rClass);
}
/**
* 将s的集合射成R的集合,不同的属性通过Map<String, String> 传入
* @param sList 已有的Bean的集合
* @param rClass 要转换的类型
* @param <S> sourceBean
* @param <R> ReturnBean
* @return R的实例
*/
public static <S, R> List<R> mapperList(List<S> sList, Class<R> rClass, Map<String, String> diffFieldMap) {
if (sList.isEmpty()) {
return Collections.emptyList();
}
ClassMapBuilder<?, R> classMap = MAPPER_FACTORY.classMap(sList.get(0).getClass(), rClass);
diffFieldMap.forEach(classMap::field);
classMap.byDefault()
.register();
return MAPPER_FACTORY.getMapperFacade().mapAsList(sList, rClass);
}
}
package com.itfuture.chainservice.common.utils.page;
/**
* @author naihe
* @date 2019/1/14 8:54 AM
* @desc 分页请求参数封装
*/
public class PageParam {
public static final int PAGE_SIZE = 10;
public PageParam() {
this.c = PAGE_SIZE;
}
public PageParam(Integer p, Integer c) {
this.setP(p);
this.setC(c);
}
//当前页
private Integer p = 1;
//每页容量
private Integer c;
public Integer getP() {
return p;
}
public void setP(Integer p) {
if (p != null && p > 0) {
this.p = p;
}
}
public Integer getC() {
return c;
}
public void setC(Integer c) {
if (c != null) {
this.c = c;
}
}
}
package com.itfuture.chainservice.common.utils.page;
import lombok.Data;
import java.util.List;
/**
* @author naihe
* @date 2019/1/14 8:55 AM
* @desc 分页结果集
*/
@Data
public class PageResult<T> {
private PageResult() { }
//当前页
private Integer page;
//总数量
private long count;
//分页数据
private List<T> list;
public PageResult(int page, long count, List<T> list) {
this.page = page;
this.count = count;
this.list = list;
}
}
package com.itfuture.chainservice.common.utils.page;
import com.itfuture.chainservice.common.utils.mapper.MapperUtils;
import java.util.List;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* @author naihe
* @date 2019/1/14 8:57 AM
* @desc PageResul工厂
*/
public class PageResultFactory {
public <T> PageResult createPageResult(int page, int count, List<T> data) {
return new PageResult<T>(page, count, data);
}
public <E> PageResult<E> convert(PageResult pageResult, Class<E> dtoClass) {
List<E> dtoList = MapperUtils.mapperList(pageResult.getList(), dtoClass);
//+1是因为hibernate分页从0开始
return new PageResult<E>(pageResult.getPage() + 1, pageResult.getCount(), dtoList);
}
public <T, E> PageResult<E> convert(PageResult<T> pageResult, Function<T, E> function) {
return new PageResult<E>(pageResult.getPage(), pageResult.getCount(),
pageResult.getList().stream().map(function).collect(Collectors.toList()));
}
}
package com.itfuture.chainservice.common.utils.rsautil;
import javax.crypto.Cipher;
import java.security.*;
import java.util.Base64;
/**
* @author naihe
* @date 2019/1/13 8:34 PM
* @desc rsa加密工具类
*/
public class RsaUtil {
public static void main(String[] args) throws Exception {
String data="青青子衿,悠悠我心。但为君故,沉吟至今。";
//1.构建公私钥匙对
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA");
KeyPair keyPair = keyPairGenerator.generateKeyPair();
//2.获取钥匙对中的公钥
PublicKey publicKey = keyPair.getPublic();
//3.获取钥匙对中的私钥
PrivateKey privateKey = keyPair.getPrivate();
//4.对待加密的数据进行加密
Cipher cipher = Cipher.getInstance("RSA");
cipher.init(Cipher.ENCRYPT_MODE,publicKey);
byte[] bytesEncrypt = cipher.doFinal(data.getBytes());//产生的是乱码,需要用Base64进行转码
//5.Base64编码
byte[] encodeBase64 = Base64.getEncoder().encode(bytesEncrypt);
System.out.println("加密后的数据:"+new String(encodeBase64));
//6.在解密时,先对用Base64编码的信息进行解码
byte[] bytesDecode = Base64.getDecoder().decode(encodeBase64);
//7.解密
Cipher cipher2=Cipher.getInstance("RSA");
cipher2.init(Cipher.DECRYPT_MODE,privateKey);
byte[] bytesDecrypt = cipher2.doFinal(bytesDecode);
System.out.println("解密后的数据:"+new String(bytesDecrypt));
}
}
package com.itfuture.chainservice.common.utils.webservice;
import cn.hutool.http.webservice.SoapRequest;
import java.nio.charset.Charset;
import java.util.Map;
/**
* @author naihe
* @date 2019/1/15 8:55 AM
* @desc webService工具
*/
public class WebServiceUtil {
public static String RequestWebService(String path, String method, Map<String,String> map){
SoapRequest request = new SoapRequest(path,"");
request.setCharset(Charset.defaultCharset());
request.setParams(map);
map.forEach((k,z)->{
});
request.setXmlns("http://schemas.xmlsoap.org/soap/envelope/");
request.setMethod(method);
String xmlResponse = request.execute();
return xmlResponse;
}
}
package com.itfuture.chainservice.controller.contract;
import io.swagger.annotations.Api;
import lombok.Data;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author naihe
* @date 2019/1/14 5:39 PM
* @desc 合同接口
*/
@Api("合同接口")
@RestController
@RequestMapping("/contract")
public class ContractController {
}
package com.itfuture.chainservice.controller.order;
import com.itfuture.chainservice.common.utils.page.PageParam;
import com.itfuture.chainservice.common.utils.page.PageResult;
import com.itfuture.chainservice.service.order.OrderService;
import com.itfuture.chainservice.service.order.request.OrderListRequest;
import com.itfuture.chainservice.service.order.response.OrderListResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* @author naihe
* @date 2019/1/11 3:14 PM
* @desc 合同明细接口
*/
@Api(value = "合同明细接口")
@RestController
@RequestMapping("/order")
public class OrderController {
@Resource
OrderService orderService;
@ApiOperation("测试")
@GetMapping(value = "/{id}")
public String queryOrderById(@PathVariable("id") Integer id){
return "SUCCESS";
}
@ApiOperation("分页查询订单列表")
@PostMapping("/list")
public PageResult<OrderListResponse> queryOrderListDTO(@ModelAttribute PageParam pageParam, OrderListRequest orderListRequest){
return orderService.queryOrderListDTO(pageParam,orderListRequest);
}
}
package com.itfuture.chainservice.controller.supplier;
import com.itfuture.chainservice.common.utils.page.PageParam;
import com.itfuture.chainservice.common.utils.page.PageResult;
import com.itfuture.chainservice.repository.Supplier.SupplierMapper;
import com.itfuture.chainservice.service.supplier.SupplierService;
import com.itfuture.chainservice.service.supplier.request.SupplierListRequest;
import com.itfuture.chainservice.service.supplier.response.SupplierListResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @author naihe
* @date 2019/1/14 8:06 PM
* @desc
*/
@Api("供应商接口")
@RestController
@RequestMapping("/supplier")
public class SupplierController {
@Resource
SupplierService supplierService;
@ApiOperation("查询供应商列表")
@RequestMapping("/list")
public PageResult<SupplierListResponse> querySupplierList(@ModelAttribute PageParam pageParam,
@RequestBody SupplierListRequest supplierListRequest){
return supplierService.querySupplierList(pageParam,supplierListRequest);
}
}
package com.itfuture.chainservice.repository.Supplier;
import org.apache.ibatis.annotations.Mapper;
/**
* @author naihe
* @date 2019/1/14 8:04 PM
* @desc 供应商
*/
@Mapper
public interface SupplierMapper {
}
package com.itfuture.chainservice.repository.Supplier.entity;
import lombok.Data;
import java.time.LocalDateTime;
/**
* @author naihe
* @date 2019/1/14 8:16 PM
* @desc
*/
@Data
public class SupplierEntity {
private Integer id; // 主键ID
private String supplier; // 供应商名称
private String contact; // 联系人
private String contactNumber; // 联系人电话
private String constructionArea; // 区域
private String regionalCompany; // 区域公司名称
private String accumulatedOrdersAmount; // 过往一年累计订单数量
private String accumulatedAmount; // 过往一年累计付款
private String paymentType; // 结算方式(现金、商承、银承、供应链)
private String qualification; // 供应商资质
private String settlementAmount; // 已结算金额
private String unsettledAmount; // 未施工金额
private LocalDateTime createTime; // 创建时间
private LocalDateTime modifyTIme; // 修改时间
}
package com.itfuture.chainservice.repository.contract;
import org.apache.ibatis.annotations.Mapper;
/**
* @author naihe
* @date 2019/1/14 5:46 PM
* @desc
*/
@Mapper
public interface ContractMapper {
}
package com.itfuture.chainservice.repository.contract.entity;
import lombok.Data;
import java.time.LocalDateTime;
/**
* @author naihe
* @date 2019/1/14 7:46 PM
* @desc
*/
@Data
public class ContractEntity {
private Integer id; //主键ID
private String contractNo; // 合同编号
private String contractName; //合同名称
private String contractType; //合同类别
private String contractNature; //合同性质
private String firstParty; //甲方单位
private String secondParty; //乙方单位
private String projectCategory; //工程类别
private String paymentType; // 支付方式
private String validContractAmount; //有效合同金额
private String taxAmount; //进项税额
private String unifiedSocialCreditCode; //统一社会信用代码
private String validContractAmount2; //有效合同金额(不含增值税)
private String taxRate; //税率
private String secondPartyName; //乙方账户名称
private String secondPartyAccount; //乙方银行账号
private String secondPartyBankName; //乙方开户银行
private String signDate; //签约日期
private String progressPaymentRatio; //进度款支付比例
private String contractAmount; //合同金额
private LocalDateTime createTime; // 创建时间
private LocalDateTime modifyTime; // 修改时间
}
package com.itfuture.chainservice.repository.order;
import org.apache.ibatis.annotations.Mapper;
/**
* @author naihe
* @date 2019/1/14 9:27 AM
* @desc
*/
@Mapper
public interface OrderMapper {
}
package com.itfuture.chainservice.repository.order.entity;
import lombok.Data;
import java.time.LocalDateTime;
/**
* @author naihe
* @date 2019/1/14 9:28 AM
* @desc 订单实体
*/
@Data
public class OrderEntity {
private Integer id; // 主键ID
private String purchasingOrganization; //采购组织
private String orderNo; // 订单编号
private String orderNumber; // 订单流水号
private String orderTypeCode; // 订单类型编码
private String orderData; // 订单日期
private String contractFiles; // 合同档案
private String serviceStream; // 业务流程
private String sumCount; // 总数量
private String priceTaxSum; // 价税合计
private String Supplier; // 供应商
private String isProvide; // 是否甲供材
private String project; //项目
private String DeliveryAddress; // 送货地址
private String orderPK; // 请购单头PK
private String arriveData; // 计划到货日期
private String materialCode; // 物料编号
private String materialVersion; // 物料版本
private String materialName; // 物料名称
private String unit; // 单位
private String Number; // 数量
private String warehousingCount; // 可入库数量
private LocalDateTime createTime; // 创建时间
private LocalDateTime modifyTime; // 修改时间
}
package com.itfuture.chainservice.service.contract;
/**
* @author naihe
* @date 2019/1/14 5:42 PM
* @desc
*/
public interface ContractService {
}
package com.itfuture.chainservice.service.contract.impl;
import com.itfuture.chainservice.common.config.request.RequestUrlProperties;
import com.itfuture.chainservice.common.utils.webservice.WebServiceUtil;
import com.itfuture.chainservice.repository.contract.ContractMapper;
import com.itfuture.chainservice.service.contract.ContractService;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
/**
* @author naihe
* @date 2019/1/14 5:48 PM
* @desc
*/
@Service
public class ContractServiceImpl implements ContractService {
@Resource
ContractMapper contractMapper;
@Resource
RequestUrlProperties requestUrlProperties;
/**
* 定时请求合同接口
*/
public void timingRequestMethod(){
String s = WebServiceUtil.RequestWebService(requestUrlProperties.getContractRequestUrl(), "",new HashMap<>());
}
}
package com.itfuture.chainservice.service.order;
import com.itfuture.chainservice.common.utils.page.PageParam;
import com.itfuture.chainservice.common.utils.page.PageResult;
import com.itfuture.chainservice.service.order.request.OrderListRequest;
import com.itfuture.chainservice.service.order.response.OrderListResponse;
/**
* @author naihe
* @date 2019/1/14 9:09 AM
* @desc
*/
public interface OrderService {
PageResult<OrderListResponse> queryOrderListDTO(PageParam pageParam, OrderListRequest orderListRequest);
}
package com.itfuture.chainservice.service.order.impl;
import com.itfuture.chainservice.common.utils.page.PageParam;
import com.itfuture.chainservice.common.utils.page.PageResult;
import com.itfuture.chainservice.service.order.OrderService;
import com.itfuture.chainservice.service.order.request.OrderListRequest;
import com.itfuture.chainservice.service.order.response.OrderListResponse;
import org.springframework.stereotype.Service;
/**
* @author naihe
* @date 2019/1/14 9:10 AM
* @desc 订单业务逻辑
*/
@Service
public class OrderServiceImpl implements OrderService {
/**
* 分页查询订单列表
* @param pageParam
* @param orderListRequest
* @return
*/
@Override
public PageResult<OrderListResponse> queryOrderListDTO(PageParam pageParam, OrderListRequest orderListRequest) {
return null;
}
}
package com.itfuture.chainservice.service.order.request;
import lombok.Data;
/**
* @author naihe
* @date 2019/1/14 9:11 AM
* @desc
*/
@Data
public class OrderListRequest {
private String id;
}
package com.itfuture.chainservice.service.order.response;
import lombok.Data;
/**
* @author naihe
* @date 2019/1/14 9:20 AM
* @desc 查询订单列表返回体
*/
@Data
public class OrderListResponse {
}
package com.itfuture.chainservice.service.supplier;
import com.itfuture.chainservice.common.utils.page.PageParam;
import com.itfuture.chainservice.common.utils.page.PageResult;
import com.itfuture.chainservice.service.supplier.request.SupplierListRequest;
import com.itfuture.chainservice.service.supplier.response.SupplierListResponse;
import lombok.Data;
/**
* @author naihe
* @date 2019/1/14 8:00 PM
* @desc
*/
public interface SupplierService {
PageResult<SupplierListResponse> querySupplierList(PageParam pageParam, SupplierListRequest supplierListRequest);
}
package com.itfuture.chainservice.service.supplier.impl;
import com.itfuture.chainservice.common.utils.page.PageParam;
import com.itfuture.chainservice.common.utils.page.PageResult;
import com.itfuture.chainservice.repository.Supplier.SupplierMapper;
import com.itfuture.chainservice.service.supplier.SupplierService;
import com.itfuture.chainservice.service.supplier.request.SupplierListRequest;
import com.itfuture.chainservice.service.supplier.response.SupplierListResponse;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* @author naihe
* @date 2019/1/14 8:02 PM
* @desc 供应商业务
*/
@Service
public class SupplierServiceImpl implements SupplierService {
@Resource
SupplierMapper supplierMapper;
/**
* 查询分页列表
* @param pageParam
* @param supplierListRequest
* @return
*/
@Override
public PageResult<SupplierListResponse> querySupplierList(PageParam pageParam, SupplierListRequest supplierListRequest) {
return null;
}
}
package com.itfuture.chainservice.service.supplier.request;
import lombok.Data;
/**
* @author naihe
* @date 2019/1/14 8:13 PM
* @desc
*/
@Data
public class SupplierListRequest {
}
package com.itfuture.chainservice.service.supplier.response;
import lombok.Data;
/**
* @author naihe
* @date 2019/1/14 8:13 PM
* @desc
*/
@Data
public class SupplierListResponse {
}
server:
port: 8099
spring:
#=================================数据库配置开始===================
#jpa配置
jpa:
show-sql: true
hibernate:
ddl-auto: none
#数据源配置
datasource:
#执行的建表语句
schema: classpath:schema.sql
#执行的sql语句
data: classpath:data.sql
#主配置
url: jdbc:mysql://rm-wz94y97i14y971999to.mysql.rds.aliyuncs.com/operation?useUnicode=true&characterEncoding=utf-8&useSSL=false
username: root
password: Maxrocky5721
driver-class-name: com.mysql.cj.jdbc.Driver
#其它配置
platform: mysql
type: com.alibaba.druid.pool.DruidDataSource
initialSize: 5
minIdle: 5
maxActive: 300
maxWait: 60000
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 30000
validationQuery: select 'x'
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxPoolPreparedStatementPerConnectionSize: 20
filters: stat,wall,slf4j
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
#=================================数据库配置结束===================
#配置数据库下划线
mybatis:
configuration:
map-underscore-to-camel-case: true
#=========swagger配置=============
#自定义配置
king:
#controller/service/repository的日志打印功能
log:
#是否启用
enabled: true
#swagger程序文档功能
swagger:
#是否启用
enabled: true
#controller包位置
base-package: com.itfuture.chainservice.controller
title: 上链准备平台后台管理接口文档
description: 主要包含同步数据,同步状态相关接口
version: V1.0
#=========数据请求路径配置=======
request:
url:
OrderRequestUrl:
ContractRequestUrl:
SupplierRequestUrl:
\ No newline at end of file
select * from link_type;
\ No newline at end of file
-- 2017年12月9日
-- 活动详情表
CREATE TABLE IF NOT EXISTS`activity` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`title` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '活动名称',
`content` longtext COLLATE utf8mb4_unicode_ci COMMENT '活动正文内容',
`address` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '活动地点',
`contact_tel` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '联系电话',
`max_enrolment` int(11) DEFAULT NULL COMMENT '最大报名人数',
`cover_url` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '封面图url',
`activity_status` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '活动状态 ,报名中ENROLLING 报名结束ENROLLED 进行中ONGOING,已结束ENDED',
`activity_end_time` datetime DEFAULT NULL COMMENT '活动结束时间',
`registe_end_time` datetime DEFAULT NULL COMMENT '报名截止时间',
`create_time` datetime DEFAULT NULL COMMENT '活动开始时间',
`modify_time` datetime DEFAULT NULL COMMENT '修改时间',
`reserve` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备用字段',
`remark` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '备注',
`block_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL ,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
\ No newline at end of file
package com.itfuture.chainservice;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class ChainServiceApplicationTests {
@Test
public void contextLoads() {
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment