Pre Merge pull request !38 from 想飛的鳄鱼/master

This commit is contained in:
Administrator 2018-11-22 09:23:22 +08:00
commit e3ea6d7246
103 changed files with 15203 additions and 2 deletions

194
MengYu-Trade/pom.xml Normal file
View File

@ -0,0 +1,194 @@
<?xml version="1.0"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi</artifactId>
<version>3.0</version>
</parent>
<groupId>com.cronie</groupId>
<artifactId>mengyu-trade</artifactId>
<packaging>jar</packaging>
<version>3.0</version>
<name>mengyu-trade</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<!-- spring-boot-devtools -->
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-framework</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>com.ruoyi</groupId>
<artifactId>ruoyi-admin</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.18</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.5</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.47</version>
</dependency>
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
<version>1.4.7</version>
</dependency>
<dependency> 
            <groupId>org.springframework</groupId>  
            <artifactId>spring-test</artifactId>  
            <version>4.2.4.RELEASE</version>  
<scope>test</scope>
       </dependency>
<!--
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
-->
<dependency>
   <groupId>junit</groupId>
   <artifactId>junit</artifactId>
   <version>4.11</version>
   <scope>test</scope>
  </dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
<compilerArguments>
<verbose />
<bootclasspath>${java.home}\lib\rt.jar;${java.home}\lib\jce.jar</bootclasspath>
</compilerArguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>
${project.build.directory}/lib
</outputDirectory>
</configuration>
</execution>
</executions>
<configuration>
<includeScope>system</includeScope>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.6</version>
<configuration>
<archive>
<manifest>
<mainClass>com.cronie.MengYuApplication</mainClass>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
</manifest>
<manifestEntries>
<Class-Path>./</Class-Path>
</manifestEntries>
</archive>
<excludes>
<exclude>mapper/**</exclude>
<exclude>application.yml</exclude>
<exclude>*.properties</exclude>
<exclude>public/**</exclude>
<exclude>static/**</exclude>
<exclude>templates/**</exclude>
<exclude>library/**</exclude>
<exclude>freemaker.properties</exclude>
<exclude>logback-spring.xml</exclude>
<exclude>*.jar</exclude>
<exclude>ehcache/**</exclude>
<exclude>i18n/**</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.5.4</version>
<configuration>
<appendAssemblyId>true</appendAssemblyId>
<descriptors>
<descriptor>src/main/build/package.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.5</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,19 @@
-- 菜单 SQL
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('投资品种', '3', '1', '/mengyu/goods', 'C', '0', 'mengyu:goods:view', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '投资品种菜单');
-- 按钮父菜单ID
SELECT @parentId := LAST_INSERT_ID();
-- 按钮 SQL
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('投资品种查询', @parentId, '1', '#', 'F', '0', 'mengyu:goods:list', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('投资品种新增', @parentId, '2', '#', 'F', '0', 'mengyu:goods:add', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('投资品种修改', @parentId, '3', '#', 'F', '0', 'mengyu:goods:edit', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('投资品种删除', @parentId, '4', '#', 'F', '0', 'mengyu:goods:remove', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');

View File

@ -0,0 +1,19 @@
-- 菜单 SQL
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('计划模型实例', '3', '1', '/mengyu/goodsTradeModelIns', 'C', '0', 'mengyu:goodsTradeModelIns:view', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '计划模型实例菜单');
-- 按钮父菜单ID
SELECT @parentId := LAST_INSERT_ID();
-- 按钮 SQL
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('计划模型实例查询', @parentId, '1', '#', 'F', '0', 'mengyu:goodsTradeModelIns:list', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('计划模型实例新增', @parentId, '2', '#', 'F', '0', 'mengyu:goodsTradeModelIns:add', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('计划模型实例修改', @parentId, '3', '#', 'F', '0', 'mengyu:goodsTradeModelIns:edit', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('计划模型实例删除', @parentId, '4', '#', 'F', '0', 'mengyu:goodsTradeModelIns:remove', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');

View File

@ -0,0 +1,19 @@
-- 菜单 SQL
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('交易计划操作', '3', '1', '/mengyu/goodsTradeModelInsNode', 'C', '0', 'mengyu:goodsTradeModelInsNode:view', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '交易计划操作菜单');
-- 按钮父菜单ID
SELECT @parentId := LAST_INSERT_ID();
-- 按钮 SQL
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('交易计划操作查询', @parentId, '1', '#', 'F', '0', 'mengyu:goodsTradeModelInsNode:list', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('交易计划操作新增', @parentId, '2', '#', 'F', '0', 'mengyu:goodsTradeModelInsNode:add', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('交易计划操作修改', @parentId, '3', '#', 'F', '0', 'mengyu:goodsTradeModelInsNode:edit', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('交易计划操作删除', @parentId, '4', '#', 'F', '0', 'mengyu:goodsTradeModelInsNode:remove', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');

View File

@ -0,0 +1,19 @@
-- 菜单 SQL
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('品种计划模型', '3', '1', '/mengyu/goodsTradeModel', 'C', '0', 'mengyu:goodsTradeModel:view', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '品种计划模型菜单');
-- 按钮父菜单ID
SELECT @parentId := LAST_INSERT_ID();
-- 按钮 SQL
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('品种计划模型查询', @parentId, '1', '#', 'F', '0', 'mengyu:goodsTradeModel:list', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('品种计划模型新增', @parentId, '2', '#', 'F', '0', 'mengyu:goodsTradeModel:add', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('品种计划模型修改', @parentId, '3', '#', 'F', '0', 'mengyu:goodsTradeModel:edit', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('品种计划模型删除', @parentId, '4', '#', 'F', '0', 'mengyu:goodsTradeModel:remove', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');

3870
MengYu-Trade/sql/mengyu.pdb Normal file

File diff suppressed because it is too large Load Diff

3870
MengYu-Trade/sql/mengyu.pdm Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,19 @@
-- 菜单 SQL
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('资金池交明细', '3', '1', '/mengyu/moneyPoolLog', 'C', '0', 'mengyu:moneyPoolLog:view', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '资金池交明细菜单');
-- 按钮父菜单ID
SELECT @parentId := LAST_INSERT_ID();
-- 按钮 SQL
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('资金池交明细查询', @parentId, '1', '#', 'F', '0', 'mengyu:moneyPoolLog:list', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('资金池交明细新增', @parentId, '2', '#', 'F', '0', 'mengyu:moneyPoolLog:add', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('资金池交明细修改', @parentId, '3', '#', 'F', '0', 'mengyu:moneyPoolLog:edit', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('资金池交明细删除', @parentId, '4', '#', 'F', '0', 'mengyu:moneyPoolLog:remove', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');

View File

@ -0,0 +1,19 @@
-- 菜单 SQL
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('资金池', '3', '1', '/mengyu/moneyPool', 'C', '0', 'mengyu:moneyPool:view', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '资金池菜单');
-- 按钮父菜单ID
SELECT @parentId := LAST_INSERT_ID();
-- 按钮 SQL
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('资金池查询', @parentId, '1', '#', 'F', '0', 'mengyu:moneyPool:list', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('资金池新增', @parentId, '2', '#', 'F', '0', 'mengyu:moneyPool:add', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('资金池修改', @parentId, '3', '#', 'F', '0', 'mengyu:moneyPool:edit', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('资金池删除', @parentId, '4', '#', 'F', '0', 'mengyu:moneyPool:remove', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');

View File

@ -0,0 +1,19 @@
-- 菜单 SQL
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('年度计划', '3', '1', '/mengyu/yearPlan', 'C', '0', 'mengyu:yearPlan:view', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '年度计划菜单');
-- 按钮父菜单ID
SELECT @parentId := LAST_INSERT_ID();
-- 按钮 SQL
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('年度计划查询', @parentId, '1', '#', 'F', '0', 'mengyu:yearPlan:list', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('年度计划新增', @parentId, '2', '#', 'F', '0', 'mengyu:yearPlan:add', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('年度计划修改', @parentId, '3', '#', 'F', '0', 'mengyu:yearPlan:edit', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');
insert into sys_menu (menu_name, parent_id, order_num, url,menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('年度计划删除', @parentId, '4', '#', 'F', '0', 'mengyu:yearPlan:remove', '#', 'admin', '2018-03-01', 'ry', '2018-03-01', '');

View File

@ -0,0 +1,42 @@
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3
http://maven.apache.org/xsd/assembly-1.1.3.xsd ">
<id>package</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>true</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>bin</directory>
<outputDirectory>/</outputDirectory>
</fileSet>
<fileSet>
<directory>src/main/resources</directory>
<outputDirectory>/</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.build.directory}</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>*.jar</include>
</includes>
</fileSet>
<fileSet>
<directory>${basedir.parent}/ruoyi-admin/src/main/resources</directory>
<outputDirectory>/</outputDirectory>
</fileSet>
</fileSets>
<dependencySets>
<dependencySet>
<useProjectArtifact>true</useProjectArtifact>
<outputDirectory>lib</outputDirectory>
<excludes>
<exclude>${groupId}:${artifactId}</exclude>
</excludes>
</dependencySet>
</dependencySets>
</assembly>

View File

@ -0,0 +1,27 @@
package com.cronie;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
/**
* 启动程序
*
* @author cronie
*/
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
@MapperScan(basePackages={"com.ruoyi.*.mapper","com.cronie.*.mapper"})
@ComponentScan({"com.cronie.mengyu.*","com.ruoyi.*"})
public class MengYuApplication
{
public static void main(String[] args)
{
// System.setProperty("spring.devtools.restart.enabled", "false");
SpringApplication.run(MengYuApplication.class, args);
System.out.println("(♥◠‿◠)ノ゙ mengyu启动成功 ლ(´ڡ`ლ)゙ \n" );
}
}

View File

@ -0,0 +1,18 @@
package com.cronie;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
/**
* web容器中进行部署
*
* @author ruoyi
*/
public class MengYuServletInitializer extends SpringBootServletInitializer
{
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application)
{
return application.sources(MengYuApplication.class);
}
}

View File

@ -0,0 +1,50 @@
package com.cronie.mengyu.common.constants;
public final class TradeConstants {
//1.固定板指
public final static String GOODS_FIXED_SH_PLATE_INDEX = "000001";//上证
public final static String GOODS_FIXED_SZ_PLATE_INDEX = "399001";//深证
public final static String GOODS_FIXED_ZXB_PLATE_INDEX = "399005";//中小板
public final static String GOODS_FIXED_CYB_PLATE_INDEX = "399006";//创业板
//2.商品类型
public final static String GOODS_TYPE_STOCK = "stock";
public final static String GOODS_TYPE_FUND = "fund";
//3.所属板块
public final static String GOODS_PLATE_BELONG_SH="sh" ;
public final static String GOODS_PLATE_BELONG_SZ="sz" ;
//4.数据源源
public final static String DATASOURCE_SINA_URL="http://hq.sinajs.cn/list=" ;//新浪请求地址
public final static String DATASOURCE_SINA = "Sina" ;//数据来源:新浪
public final static String DATASOURCE_SINA_MIN_UNIT_VOL = "1000000" ;//成交量单位
public final static String DATASOURCE_TENCENT_URL="http://qt.gtimg.cn/q=" ;//腾讯请求地址
public final static String DATASOURCE_TENCENT = "Tencent" ;//数据来源:腾讯
public final static String DATASOURCE_TENCENT_MIN_UNIT_VOL = "10000" ;//成交量单位
//5.计划模型状态
public final static Integer GOODS_MODEL_STATUS_VALID = 1 ;//启用
public final static Integer GOODS_MODEL_STATUS_INVALID = 0 ;//停用
//6.交易参数
public final static String GOODS_PRICE_INCREASE_RATE="goods_price_increase_rate" ;//涨副比
public final static String GOODS_VOLUMES_INCREASE_RATE="goods_volumes_increase_rate" ;//放量比
public final static String MONEY_POOL_LOSS_RATE = "money_pool_loss_rate" ;//风控比
public final static String MONEY_POOL_TRADE_NUMS= "money_pool_trade_nums" ;//计划交易次数
public final static String GOODS_TRADE_MIN_AMOUNT="goods_trade_min_amount" ;//最小建仓份额
//7.模型实例状态
public final static Integer MODEL_INS_STATUS_RUNING = 1 ;//进行中
public final static Integer MODEL_INS_STATUS_COMPLETED = 2 ;//已完成
public final static Integer MODEL_INS_STATUS_NOTSTARTED= 0 ;//已完成
//邮件提醒状态
public final static Integer MAIL_NOTICE_YES = 1;//已提醒
public final static Integer MAIL_NOTICE_NO = 0;//未提醒
}

View File

@ -0,0 +1,60 @@
package com.cronie.mengyu.common.goods;
import com.cronie.mengyu.domain.Goods;
/**
* 实时商品信息
* @author cronie
*
*/
public class ActualTimeGoods extends Goods {
private static final long serialVersionUID = 1L;
public double actualTimePrice ;//当前价格
public double actualTimeVolumes ;//当日成交量
public String refreshTime ;//刷新时间
public double yesterdayPrice;//昨天收盘价
public double todayPrice;//今天开盘价
public String dataSource ;
public double getActualTimePrice() {
return actualTimePrice;
}
public void setActualTimePrice(double actualTimePrice) {
this.actualTimePrice = actualTimePrice;
}
public double getActualTimeVolumes() {
return actualTimeVolumes;
}
public void setActualTimeVolumes(double actualTimeVolumes) {
this.actualTimeVolumes = actualTimeVolumes;
}
public String getRefreshTime() {
return refreshTime;
}
public void setRefreshTime(String refreshTime) {
this.refreshTime = refreshTime;
}
public double getYesterdayPrice() {
return yesterdayPrice;
}
public void setYesterdayPrice(double yesterdayPrice) {
this.yesterdayPrice = yesterdayPrice;
}
public double getTodayPrice() {
return todayPrice;
}
public void setTodayPrice(double todayPrice) {
this.todayPrice = todayPrice;
}
public String getDataSource() {
return dataSource;
}
public void setDataSource(String dataSource) {
this.dataSource = dataSource;
}
}

View File

@ -0,0 +1,11 @@
package com.cronie.mengyu.common.goods;
/**
*
* @author cronie
* 得到商品的实时信息
*/
public interface ILoadGoodsInfo {
ActualTimeGoods loadGoodsInfo(String code);
}

View File

@ -0,0 +1,35 @@
package com.cronie.mengyu.common.goods;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
@Component
public class LoadGoodsInfoFactory implements ApplicationContextAware{
ApplicationContext ctx = null;
@Override
public void setApplicationContext(ApplicationContext arg0) throws BeansException {
ctx = arg0 ;
}
public ILoadGoodsInfo getLoadGoodsInfoInstance() {
ILoadGoodsInfo loadGoodsInfo = null;
Long time = System.currentTimeMillis();
if(time%2==0){
loadGoodsInfo = ctx.getBean("sinaDataSource", ILoadGoodsInfo.class) ;
}else {
loadGoodsInfo = ctx.getBean("tencentDataSource", ILoadGoodsInfo.class) ;
}
return loadGoodsInfo ;
}
}

View File

@ -0,0 +1,125 @@
package com.cronie.mengyu.common.goods.impl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.alibaba.fastjson.JSONObject;
import com.cronie.mengyu.common.constants.TradeConstants;
import com.cronie.mengyu.common.goods.ActualTimeGoods;
import com.cronie.mengyu.common.goods.ILoadGoodsInfo;
import com.cronie.mengyu.common.http.HttpUtil;
public abstract class AbstractLoadGoodsInfo implements ILoadGoodsInfo {
private static final Logger logger = LoggerFactory.getLogger(AbstractLoadGoodsInfo.class);
@Override
public ActualTimeGoods loadGoodsInfo(String code) {
ActualTimeGoods goodsInfo = new ActualTimeGoods();
//解析代码
praseStockCode(code, goodsInfo);
//加载URL
String url = loadGoodsUrl(goodsInfo);
String data;
try {
data = HttpUtil.sendGet(url);
} catch (Exception e) {
e.printStackTrace();
logger.warn("查询品种【"+code+"】的信息失败。",e);
return null;
}
//解析数据
try {
praseData(data,goodsInfo);
} catch (Exception e) {
e.printStackTrace();
logger.warn("解析品种【"+code+"】的信息失败,原始数据:【"+data+"",e);
return null;
}
logger.info(JSONObject.toJSONString(goodsInfo));
return goodsInfo;
}
/**
* 解析URl
* @return String
*/
protected abstract String loadGoodsUrl(ActualTimeGoods goodsInfo);
/**
* 解析数据
* @param data
* @return
* @throws Exception
*/
protected abstract void praseData(String data,ActualTimeGoods goodsInfo) throws Exception;
/**
* @author: 王冲
* @description:解析代码 信息
* @date:2016年3月4日
*/
protected void praseStockCode(String code ,ActualTimeGoods goodsInfo){
goodsInfo.setCode(code);
//版指
if(code.equalsIgnoreCase(TradeConstants.GOODS_FIXED_SH_PLATE_INDEX)) {
goodsInfo.setPlateType(TradeConstants.GOODS_PLATE_BELONG_SH);
goodsInfo.setCodeType(TradeConstants.GOODS_TYPE_STOCK);
}else if (code.equalsIgnoreCase(TradeConstants.GOODS_FIXED_SZ_PLATE_INDEX)||
code.equalsIgnoreCase(TradeConstants.GOODS_FIXED_CYB_PLATE_INDEX)||
code.equalsIgnoreCase(TradeConstants.GOODS_FIXED_ZXB_PLATE_INDEX) ) {
goodsInfo.setPlateType(TradeConstants.GOODS_PLATE_BELONG_SZ);
goodsInfo.setCodeType(TradeConstants.GOODS_TYPE_STOCK);
}
//
else if(code.startsWith("60")) {
goodsInfo.setPlateType(TradeConstants.GOODS_PLATE_BELONG_SH);
goodsInfo.setCodeType(TradeConstants.GOODS_TYPE_STOCK);
}else if (code.startsWith("002")|| code.startsWith("300")) {
goodsInfo.setPlateType(TradeConstants.GOODS_PLATE_BELONG_SZ);
goodsInfo.setCodeType(TradeConstants.GOODS_TYPE_STOCK);
}else if (code.startsWith("510")) {
goodsInfo.setPlateType(TradeConstants.GOODS_PLATE_BELONG_SH);
goodsInfo.setCodeType(TradeConstants.GOODS_TYPE_FUND);
}else if ( code.startsWith("150")) {
goodsInfo.setPlateType(TradeConstants.GOODS_PLATE_BELONG_SZ);
goodsInfo.setCodeType(TradeConstants.GOODS_TYPE_FUND);
}
// if(stockCode.equalsIgnoreCase("000001")){
//
//
// }else if(stockCode.startsWith("60")){
// stockCodeInfo.setStockType(TYPE_STOCK);
// stockCodeInfo.setBelong("sh");
// }else if(stockCode.startsWith("000")){
// stockCodeInfo.setStockType(TYPE_STOCK);
// stockCodeInfo.setBelong("sz");
// }else if(stockCode.startsWith("300")){
// stockCodeInfo.setStockType(TYPE_STOCK);
// stockCodeInfo.setBelong("sz");
// }else if(stockCode.startsWith("399")){
// stockCodeInfo.setStockType(TYPE_STOCK);
// stockCodeInfo.setBelong("sz");
// }else if(stockCode.startsWith("150")){
// stockCodeInfo.setStockType(TYPE_FUND);
// stockCodeInfo.setBelong("sz");
// }else if(stockCode.startsWith("002")){
// stockCodeInfo.setStockType(TYPE_STOCK);
// stockCodeInfo.setBelong("sz");
// }else if(stockCode.startsWith("502")){
// stockCodeInfo.setStockType(TYPE_FUND);
// stockCodeInfo.setBelong("sh");
// }else {
// stockCodeInfo.setBelong("sh");
// stockCodeInfo.setStockType(TYPE_FUND);
// }
}
}

View File

@ -0,0 +1,71 @@
package com.cronie.mengyu.common.goods.impl;
import java.math.BigDecimal;
import java.util.Date;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import com.cronie.mengyu.common.constants.TradeConstants;
import com.cronie.mengyu.common.goods.ActualTimeGoods;
import com.ruoyi.common.utils.DateUtils;
@Component("sinaDataSource")
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class SinaLoadGoodsInfoImpl extends AbstractLoadGoodsInfo {
@Override
public String loadGoodsUrl(ActualTimeGoods goodsInfo) {
return TradeConstants.DATASOURCE_SINA_URL.concat(goodsInfo.getPlateType()).concat(goodsInfo.getCode());
}
// 0大秦铁路股票名字
// 127.55今日开盘价
// 227.25昨日收盘价
// 326.91当前价格
// 427.55今日最高价
// 526.20今日最低价
// 626.91竞买价买一报价
// 726.92竞卖价卖一报价
// 822114263成交的股票数由于股票交易以一百股为基本单位所以在使用时通常把该值除以一百
// 9589824680成交金额单位为为了一目了然通常以万元为成交金额的单位所以通常把该值除以一万
// 104695买一申请4695股即47手
// 1126.91买一报价
// 1257590买二
// 1326.90买二
// 1414700买三
// 1526.89买三
// 1614300买四
// 1726.88买四
// 1815100买五
// 1926.87买五
// 203100卖一申报3100股即31手
// 2126.92卖一报价
// (22, 23), (24, 25), (26,27), (28, 29)分别为卖二卖四的情况
// 302008-01-11日期
// 3115:05:32时间
@Override
public void praseData(String data,ActualTimeGoods goodsInfo) throws Exception{
String pureData = null;
pureData = data.substring(data.indexOf("\"")+1, data.lastIndexOf("\""));
String datas[] = pureData.split(",");
goodsInfo.setActualTimePrice(Double.parseDouble(datas[3]));
goodsInfo.setYesterdayPrice(Double.parseDouble(datas[2]));
goodsInfo.setTodayPrice(Double.parseDouble(datas[1]));
BigDecimal bd = new BigDecimal(datas[8]) ;
//(100股)*单位10000= 1000000 万手
BigDecimal _i = new BigDecimal(TradeConstants.DATASOURCE_SINA_MIN_UNIT_VOL) ;
double v = bd.divide(_i,2,BigDecimal.ROUND_HALF_UP).doubleValue();
goodsInfo.setActualTimeVolumes(v);
goodsInfo.setName(datas[0]);
goodsInfo.setDataSource(TradeConstants.DATASOURCE_SINA);
goodsInfo.setRefreshTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,new Date()));
}
}

View File

@ -0,0 +1,80 @@
package com.cronie.mengyu.common.goods.impl;
import java.math.BigDecimal;
import java.util.Date;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import com.cronie.mengyu.common.constants.TradeConstants;
import com.cronie.mengyu.common.goods.ActualTimeGoods;
import com.ruoyi.common.utils.DateUtils;
@Component("tencentDataSource")
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class TencentLoadGoodsInfoImpl extends AbstractLoadGoodsInfo {
@Override
public String loadGoodsUrl(ActualTimeGoods goodsInfo) {
return TradeConstants.DATASOURCE_TENCENT_URL.concat(goodsInfo.getPlateType()).concat(goodsInfo.getCode());
}
// 0: 未知
// 1: 名字
// 2: 代码
// 3: 当前价格
// 4: 昨收
// 5: 今开
// 6: 成交量
// 7: 外盘
// 8: 内盘
// 9: 买一
// 10: 买一量
// 11-18: 买二 买五
// 19: 卖一
// 20: 卖一量
// 21-28: 卖二 卖五
// 29: 最近逐笔成交
// 30: 时间
// 31: 涨跌
// 32: 涨跌%
// 33: 最高
// 34: 最低
// 35: 价格/成交量/成交额
// 36: 成交量
// 37: 成交额
// 38: 换手率
// 39: 市盈率
// 40:
// 41: 最高
// 42: 最低
// 43: 振幅
// 44: 流通市值
// 45: 总市值
// 46: 市净率
// 47: 涨停价
// 48: 跌停价
@Override
public void praseData(String data,ActualTimeGoods goodsInfo) throws Exception{
String pureData = null;
pureData = data.substring(data.indexOf("\"")+1, data.lastIndexOf("\""));
String datas[] = pureData.split("~");
goodsInfo.setActualTimePrice(Double.parseDouble(datas[3]));
goodsInfo.setYesterdayPrice(Double.parseDouble(datas[4]));
goodsInfo.setTodayPrice(Double.parseDouble(datas[5]));
BigDecimal bd = new BigDecimal(datas[6]) ;
//(100股)*单位10000= 1000000 万手
BigDecimal _i = new BigDecimal(TradeConstants.DATASOURCE_TENCENT_MIN_UNIT_VOL) ;
double v = bd.divide(_i,2,BigDecimal.ROUND_HALF_UP).doubleValue();
goodsInfo.setActualTimeVolumes(v);
goodsInfo.setName(datas[1]);
goodsInfo.setDataSource(TradeConstants.DATASOURCE_TENCENT);
goodsInfo.setRefreshTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,new Date()));
}
}

View File

@ -0,0 +1,395 @@
package com.cronie.mengyu.common.http;
import java.io.IOException;
import java.net.InetAddress;
import java.net.SocketTimeoutException;
import java.net.UnknownHostException;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.TimeUnit;
import org.apache.http.Header;
import org.apache.http.HttpEntity;
import org.apache.http.HttpRequest;
import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.NameValuePair;
import org.apache.http.ParseException;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.client.protocol.HttpClientContext;
import org.apache.http.config.MessageConstraints;
import org.apache.http.config.Registry;
import org.apache.http.config.RegistryBuilder;
import org.apache.http.config.SocketConfig;
import org.apache.http.conn.DnsResolver;
import org.apache.http.conn.HttpConnectionFactory;
import org.apache.http.conn.HttpHostConnectException;
import org.apache.http.conn.ManagedHttpClientConnection;
import org.apache.http.conn.routing.HttpRoute;
import org.apache.http.conn.socket.ConnectionSocketFactory;
import org.apache.http.conn.socket.PlainConnectionSocketFactory;
import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
import org.apache.http.impl.DefaultConnectionReuseStrategy;
import org.apache.http.impl.DefaultHttpResponseFactory;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.DefaultConnectionKeepAliveStrategy;
import org.apache.http.impl.client.DefaultHttpRequestRetryHandler;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.impl.conn.DefaultHttpResponseParser;
import org.apache.http.impl.conn.DefaultHttpResponseParserFactory;
import org.apache.http.impl.conn.ManagedHttpClientConnectionFactory;
import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
import org.apache.http.impl.conn.SystemDefaultDnsResolver;
import org.apache.http.impl.io.DefaultHttpRequestWriterFactory;
import org.apache.http.io.HttpMessageParser;
import org.apache.http.io.HttpMessageParserFactory;
import org.apache.http.io.HttpMessageWriterFactory;
import org.apache.http.io.SessionInputBuffer;
import org.apache.http.message.BasicLineParser;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.message.LineParser;
import org.apache.http.ssl.SSLContexts;
import org.apache.http.util.CharArrayBuffer;
import org.apache.http.util.EntityUtils;
/**
* Http
*
* @author Zhao.Hailin
*
*/
public class HttpUtil {
/** 连接池管理 */
private static volatile PoolingHttpClientConnectionManager connManager = null;
/** 配置信息 */
private static volatile Properties properties = null;
private static final String CLIENT_PROTOCOL_ERR = "客户端协议异常";
private static final String HTTP_HOST_CONNECT_ERR = "连接请求被拒绝";
private static final String SOCKET_TIMEOUT_ERR = "连接请求超时";
private static final String IO_ERR = "通信过程中发生了异常";
private static final String CLOSE_IO_ERR = "关闭连接时发生了异常";
// private static final String UNSUPPORTED_ENCODING_ERR = "不支持的编码格式";
/**
* HttpClient POST
*
* @param url URL
* @param params Map<String, Object>
* @return String
* @throws Exception
*/
public static String sendPost(String url, Map<String, Object> params) throws Exception {
HttpPost httpPost = new HttpPost(url);
List<NameValuePair> pairs = covertParams2NVPS(params);
try {
httpPost.setEntity(new UrlEncodedFormEntity(pairs, "utf-8"));
} catch (Exception e) {
throw e;
}
return getResult(httpPost, Charset.forName("utf-8"));
}
private static List<NameValuePair> covertParams2NVPS(
Map<String, Object> params) {
List<NameValuePair> pairs = new ArrayList<NameValuePair>();
for (Map.Entry<String, Object> param : params.entrySet()) {
pairs.add(new BasicNameValuePair(param.getKey(),
nullIsEmptyStr(param.getValue())));
}
return pairs;
}
/**
* application/viid+json, utf-8 编码的 POST 请求华尊 1400 专用
*
* @param url 请求 URI
* @return String JSON格式的字符串
* @throws Exception
*/
public static String sendGet(String url) throws Exception {
// add request header
Map<String, Object> headers = new HashMap<String, Object>();
headers.put("Content-Type", "application/viid+json");
headers.put("User-Identify", "51340000041205914046");
headers.put("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
headers.put("Connection", "Keep-Alive");
headers.put("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36");
return get(url, Charset.forName("utf-8"), headers);
}
/**
* GET 请求
*
* @param uri 请求 URI
* @param charset 字符集
* @param headers 请求头
* @return String 响应实体消息
* @throws Exception
*/
public static String get(String uri, Charset charset,
Map<String, Object> headers) throws Exception {
HttpGet httpGet = new HttpGet(uri);
return getResult(httpGet, charset);
}
// /**
// * 设置请求头
// *
// * @param request HttpGet/HttpPost
// * @param headers 请求头
// */
// private static void setHeader(HttpRequestBase request,
// Map<String, Object> headers) {
// if (headers != null) {
// for (Map.Entry<String, Object> entry : headers.entrySet()) {
// request.setHeader(entry.getKey(),
// nullIsEmptyStr(entry.getValue()));
// }
// }
// }
/**
* 将对象转换成 String 的表现形式如果该对象是 null则返回空字符串
*
* @param obj Object
* @return String
*/
private static String nullIsEmptyStr(Object obj) {
return obj == null ? "" : String.valueOf(obj);
}
/**
* 获取响应实体消息
*
* @param request HttpGet/HttpPost
* @param charset 字符集
* @return String 一个新分配的字符串
* @throws Exception
*/
private static String getResult(HttpRequestBase request, Charset charset) throws Exception {
HttpClientContext context = HttpClientContext.create();
CloseableHttpResponse response = null;
try {
response = getHttpClient().execute(request, context);
// 获取响应状态码
int statusCode = response.getStatusLine().getStatusCode();
if (statusCode == HttpStatus.SC_OK) {
HttpEntity entity = response.getEntity();
if (entity != null) {
// String result = new String(EntityUtils.toByteArray(entity),
// charset);
String result = EntityUtils.toString(entity,charset) ;
// String result = new String(EntityUtils.toByteArray(entity));
return result;
}
}
} catch (IOException e) {
if (e instanceof ClientProtocolException)
throw new Exception(CLIENT_PROTOCOL_ERR);
if (e instanceof HttpHostConnectException)
throw new Exception(HTTP_HOST_CONNECT_ERR);
else if (e instanceof SocketTimeoutException)
throw new Exception(SOCKET_TIMEOUT_ERR);
else
throw new Exception(IO_ERR);
} finally {
if (response != null) {
try {
response.close();
} catch (IOException e) {
throw new Exception(CLOSE_IO_ERR);
}
}
}
return null;
}
/**
* 从连接池中获取 HttpClient
*
* @return CloseableHttpClient
*/
private static CloseableHttpClient getHttpClient() {
defaultConfigure();
// 默认的请求配置
RequestConfig defaultRequestConfig = RequestConfig
.custom()
.setConnectTimeout((int) properties.get("connectTimeout"))
.setSocketTimeout((int) properties.get("socketTimeout"))
.setConnectionRequestTimeout(
(int) properties.get("connectionRequestTimeout"))
.build();
// 使用给定的自定义依赖项和配置创建 HttpClient
CloseableHttpClient httpClient = HttpClients
.custom()
.setConnectionManager(getConnManager())
.setConnectionManagerShared(false)
.evictIdleConnections((int) properties.get("maxIdleTime"),
TimeUnit.SECONDS)
.evictExpiredConnections()
.setConnectionTimeToLive(
(int) properties.get("connTimeToLive"),
TimeUnit.SECONDS)
.setDefaultRequestConfig(defaultRequestConfig)
.setConnectionReuseStrategy(
DefaultConnectionReuseStrategy.INSTANCE)
.setKeepAliveStrategy(
DefaultConnectionKeepAliveStrategy.INSTANCE)
.setRetryHandler(
new DefaultHttpRequestRetryHandler((int) properties
.get("retryCount"), false)).build();
return httpClient;
}
/**
* 配置连接池
*
* @return PoolingHttpClientConnectionManager
*/
private static PoolingHttpClientConnectionManager getConnManager() {
if (connManager == null) {
synchronized (HttpUtil.class) {
if (connManager == null) {
HttpMessageParserFactory<HttpResponse> responseParserFactory = new DefaultHttpResponseParserFactory() {
@Override
public HttpMessageParser<HttpResponse> create(
final SessionInputBuffer buffer,
final MessageConstraints constraints) {
LineParser lineParser = new BasicLineParser() {
@Override
public Header parseHeader(
final CharArrayBuffer buffer)
throws ParseException {
return super.parseHeader(buffer);
}
};
return new DefaultHttpResponseParser(buffer,
lineParser,
DefaultHttpResponseFactory.INSTANCE,
constraints) {
@Override
protected boolean reject(
final CharArrayBuffer line,
final int count) {
// 无限地忽略状态行前面的所有垃圾
return false;
}
};
}
};
HttpMessageWriterFactory<HttpRequest> requestWriterFactory = new DefaultHttpRequestWriterFactory();
// 定制初始化传出 HTTP 连接的过程
HttpConnectionFactory<HttpRoute, ManagedHttpClientConnection> connFactory = new ManagedHttpClientConnectionFactory(
requestWriterFactory, responseParserFactory);
// 使用自定义 DNS 解析器覆盖系统 DNS 解析
DnsResolver dnsResolver = new SystemDefaultDnsResolver() {
@Override
public InetAddress[] resolve(final String host)
throws UnknownHostException {
return super.resolve(host);
}
};
// 创建自定义连接套接字工厂的注册表
Registry<ConnectionSocketFactory> socketFactoryRegistry = RegistryBuilder
.<ConnectionSocketFactory> create()
.register("http",
PlainConnectionSocketFactory.INSTANCE)
.register(
"https",
new SSLConnectionSocketFactory(SSLContexts
.createSystemDefault())).build();
// 使用自定义配置创建连接管理器
connManager = new PoolingHttpClientConnectionManager(
socketFactoryRegistry, connFactory, dnsResolver);
// 套接字配置
SocketConfig socketConfig = SocketConfig.custom()
.setTcpNoDelay(true).build();
connManager.setDefaultSocketConfig(socketConfig);
connManager.setValidateAfterInactivity((int) properties
.get("validateAfterInactivity"));
connManager.setMaxTotal((int) properties.get("maxTotal"));
connManager.setDefaultMaxPerRoute((int) properties
.get("defaultMaxPerRoute"));
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
if (connManager != null) {
connManager.close();
}
}
});
}
}
}
return connManager;
}
/**
* 加载默认配置
*/
private static void defaultConfigure() {
if (properties == null) {
synchronized (HttpUtil.class) {
if (properties == null) {
properties = new Properties();
properties.put("validateAfterInactivity", 5000);
// 最大连接数
properties.put("maxTotal", 25);
// 每个路由的最大连接数
properties.put("defaultMaxPerRoute", 5);
// 连接超时时间单位毫秒
properties.put("connectTimeout", 3000);
// 等待数据超时时间单位毫秒
properties.put("socketTimeout", 1000 * 60 * 3);
// 从连接池获取连接的等待超时时间单位毫秒
properties.put("connectionRequestTimeout", 1000 * 60);
properties.put("maxIdleTime", 60);
properties.put("connTimeToLive", 60);
properties.put("retryCount", 0);
}
}
}
}
}

View File

@ -0,0 +1,149 @@
package com.cronie.mengyu.common.json;
import org.springframework.stereotype.Component;
/**
* 该类提供格式化JSON字符串的方法
* 该类的方法formatJson将JSON字符串格式化方便查看JSON数据
* <p>例如
* </p><p>JSON字符串["yht","xzj","zwy"]
* </p><p>格式化为
* </p><p>[
* </p><p> "yht",
* </p><p> "xzj",
* </p><p> "zwy"
* </p><p>]
*
* </p><p>使用算法如下
* </p><p>对输入字符串追个字符的遍历
* </p><p>1获取当前字符
* </p><p>2如果当前字符是前方括号前花括号做如下处理
* </p><p>1如果前面还有字符并且字符为打印换行和缩进字符字符串
* </p><p>2打印当前字符
* </p><p>3前方括号前花括号的后面必须换行打印换行
* </p><p>4每出现一次前方括号前花括号缩进次数增加一次打印新行缩进
* </p><p>5进行下一次循环
* </p><p>3如果当前字符是后方括号后花括号做如下处理
* </p><p>1后方括号后花括号的前面必须换行打印换行
* </p><p>2每出现一次后方括号后花括号缩进次数减少一次打印缩进
* </p><p>3打印当前字符
* </p><p>4如果当前字符后面还有字符并且字符不为打印换行
* </p><p>5继续下一次循环
* </p><p>4如果当前字符是逗号逗号后面换行并缩进不改变缩进次数
* </p><p>5打印当前字符
*
*/
@Component
public class JSONBeautifyUtils {
/**
* 单位缩进字符串
*/
private static String SPACE = " ";
/**
* 返回格式化JSON字符串
*
* @param json 未格式化的JSON字符串
* @return 格式化的JSON字符串
*/
public String formatJson(String json)
{
StringBuffer result = new StringBuffer();
int length = json.length();
int number = 0;
char key = 0;
//遍历输入字符串
for (int i = 0; i < length; i++)
{
//1获取当前字符
key = json.charAt(i);
//2如果当前字符是前方括号前花括号做如下处理
if((key == '[') || (key == '{') )
{
//1如果前面还有字符并且字符为打印换行和缩进字符字符串
if((i - 1 > 0) && (json.charAt(i - 1) == ':'))
{
result.append('\n');
result.append(indent(number));
}
//2打印当前字符
result.append(key);
//3前方括号前花括号的后面必须换行打印换行
result.append('\n');
//4每出现一次前方括号前花括号缩进次数增加一次打印新行缩进
number++;
result.append(indent(number));
//5进行下一次循环
continue;
}
//3如果当前字符是后方括号后花括号做如下处理
if((key == ']') || (key == '}') )
{
//1后方括号后花括号的前面必须换行打印换行
result.append('\n');
//2每出现一次后方括号后花括号缩进次数减少一次打印缩进
number--;
result.append(indent(number));
//3打印当前字符
result.append(key);
//4如果当前字符后面还有字符并且字符不为打印换行
if(((i + 1) < length) && (json.charAt(i + 1) != ','))
{
result.append('\n');
}
//5继续下一次循环
continue;
}
//4如果当前字符是逗号逗号后面换行并缩进不改变缩进次数
if((key == ','))
{
result.append(key);
result.append('\n');
result.append(indent(number));
continue;
}
//5打印当前字符
result.append(key);
}
return result.toString();
}
/**
* 返回指定次数的缩进字符串每一次缩进三个空格即SPACE
*
* @param number 缩进次数
* @return 指定缩进次数的字符串
*/
private String indent(int number)
{
StringBuffer result = new StringBuffer();
for(int i = 0; i < number; i++)
{
result.append(SPACE);
}
return result.toString();
}
public static void main(String[] args) {
JSONBeautifyUtils json = new JSONBeautifyUtils();
String str = "{'age':23,'aihao':['pashan','movies'],'name':{'firstName':'zhang','lastName':'san','aihao':['pashan','movies','name':{'firstName':'zhang','lastName':'san','aihao':['pashan','movies']}]}}";
String result = json.formatJson(str);
System.out.println(result);
}
}

View File

@ -0,0 +1,55 @@
package com.cronie.mengyu.config;
import java.util.Properties;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.PropertySource;
import org.springframework.mail.MailSender;
import org.springframework.mail.javamail.JavaMailSenderImpl;
import org.springframework.stereotype.Component;
@Component
@PropertySource("classpath:mail/mail.properties")
public class MailConfig {
private static final Logger logger = LoggerFactory.getLogger(MailConfig.class);
@Value("${sender.mail.host}")
String host ;
@Value("${sender.mail.port}")
String port;
@Value("${sender.mail.userName}")
String senderUserName;
@Value("${sender.mail.passWord}")
String senderPassWord;
@Value("${sender.mail.smtp.auth}")
String auth ;
@Value("${sender.mail.smtp.timeout}")
String timeOut;
/**
* 配置邮件发送器
* @return
*/
@Bean
public MailSender mailSender() {
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
mailSender.setHost(host);//指定用来发送Email的邮件服务器主机名
mailSender.setPort(Integer.parseInt(port));//默认端口标准的SMTP端口
mailSender.setUsername(senderUserName);//用户名
mailSender.setPassword(senderPassWord);//密码
Properties javaMailProperties = new Properties();
javaMailProperties.put("mail.smtp.auth", auth);
javaMailProperties.put("mail.smtp.timeout", timeOut);
mailSender.setJavaMailProperties(javaMailProperties);
logger.info("初始化163邮箱发送器完成.");
return mailSender;
}
public String getUserName() {
return senderUserName;
}
}

View File

@ -0,0 +1,106 @@
package com.cronie.mengyu.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.base.BaseEntity;
import java.util.Date;
/**
* 投资品种表 my_goods
*
* @author cronie
* @date 2018-11-15
*/
public class Goods extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 品种代码 */
private String code;
/** 品种名称 */
private String name;
/** 品种类型 (股标,基金等) */
private String codeType;
/** 行业类型(军工,证券等) */
private String industryType;
/** 板块类型(上证,深证 创业板等) */
private String plateType;
/** 创建人 */
private Integer creater;
/** 创建时间 */
private Date createTime;
public void setCode(String code)
{
this.code = code;
}
public String getCode()
{
return code;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public String getCodeType() {
return codeType;
}
public void setCodeType(String codeType) {
this.codeType = codeType;
}
public String getIndustryType() {
return industryType;
}
public void setIndustryType(String industryType) {
this.industryType = industryType;
}
public String getPlateType() {
return plateType;
}
public void setPlateType(String plateType) {
this.plateType = plateType;
}
public void setCreater(Integer creater)
{
this.creater = creater;
}
public Integer getCreater()
{
return creater;
}
public void setCreateTime(Date createTime)
{
this.createTime = createTime;
}
public Date getCreateTime()
{
return createTime;
}
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("code", getCode())
.append("name", getName())
.append("codeType", getCodeType())
.append("industryType", getIndustryType())
.append("plateType", getPlateType())
.append("creater", getCreater())
.append("createTime", getCreateTime())
.toString();
}
}

View File

@ -0,0 +1,145 @@
package com.cronie.mengyu.domain;
import java.math.BigDecimal;
import java.util.Date;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.base.BaseEntity;
/**
* 品种计划模型表 my_goods_trade_model
*
* @author cronie
* @date 2018-11-15
*/
public class GoodsTradeModel extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 模型ID */
private Integer modelId;
/** 品种代码 */
private String code;
/** 基础成交量 */
private BigDecimal basicVolumes;
/** 模型状态 (启用,停用) */
private Integer modelStatus;
/** 建仓价 */
private BigDecimal buildingPrice;
/** 平仓价 */
private BigDecimal exitPrice;
/** 止损价 */
private BigDecimal stopPrice;
/** 创建人 */
private Integer creater;
/** 创建时间 */
private Date createTime;
/** 是否已邮件提醒 */
private Integer hasMailNotice ;
public void setModelId(Integer modelId)
{
this.modelId = modelId;
}
public Integer getModelId()
{
return modelId;
}
public void setCode(String code)
{
this.code = code;
}
public Integer getHasMailNotice() {
return hasMailNotice;
}
public void setHasMailNotice(Integer hasMailNotice) {
this.hasMailNotice = hasMailNotice;
}
public String getCode()
{
return code;
}
public void setBasicVolumes(BigDecimal basicVolumes)
{
this.basicVolumes = basicVolumes;
}
public BigDecimal getBasicVolumes()
{
return basicVolumes;
}
public void setModelStatus(Integer modelStatus)
{
this.modelStatus = modelStatus;
}
public Integer getModelStatus()
{
return modelStatus;
}
public void setBuildingPrice(BigDecimal buildingPrice)
{
this.buildingPrice = buildingPrice;
}
public BigDecimal getBuildingPrice()
{
return buildingPrice;
}
public void setExitPrice(BigDecimal exitPrice)
{
this.exitPrice = exitPrice;
}
public BigDecimal getExitPrice()
{
return exitPrice;
}
public void setStopPrice(BigDecimal stopPrice)
{
this.stopPrice = stopPrice;
}
public BigDecimal getStopPrice()
{
return stopPrice;
}
public void setCreater(Integer creater)
{
this.creater = creater;
}
public Integer getCreater()
{
return creater;
}
public void setCreateTime(Date createTime)
{
this.createTime = createTime;
}
public Date getCreateTime()
{
return createTime;
}
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("modelId", getModelId())
.append("code", getCode())
.append("basicVolumes", getBasicVolumes())
.append("modelStatus", getModelStatus())
.append("buildingPrice", getBuildingPrice())
.append("exitPrice", getExitPrice())
.append("stopPrice", getStopPrice())
.append("creater", getCreater())
.append("createTime", getCreateTime())
.toString();
}
}

View File

@ -0,0 +1,94 @@
package com.cronie.mengyu.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.base.BaseEntity;
import java.util.Date;
/**
* 计划模型实例表 my_goods_trade_model_ins
*
* @author cronie
* @date 2018-11-15
*/
public class GoodsTradeModelIns extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 计划实例 ID */
private Integer insId;
/** 模型ID */
private Integer modelId;
/** 计划状态 */
private Integer insStatus;
/** 创建人 */
private Integer creater;
/** 创建时间 */
private Date createTime;
/** 是否已邮件提醒 */
private Integer hasMailNotice ;
public void setInsId(Integer insId)
{
this.insId = insId;
}
public Integer getHasMailNotice() {
return hasMailNotice;
}
public void setHasMailNotice(Integer hasMailNotice) {
this.hasMailNotice = hasMailNotice;
}
public Integer getInsId()
{
return insId;
}
public void setModelId(Integer modelId)
{
this.modelId = modelId;
}
public Integer getModelId()
{
return modelId;
}
public void setInsStatus(Integer insStatus)
{
this.insStatus = insStatus;
}
public Integer getInsStatus()
{
return insStatus;
}
public void setCreater(Integer creater)
{
this.creater = creater;
}
public Integer getCreater()
{
return creater;
}
public void setCreateTime(Date createTime)
{
this.createTime = createTime;
}
public Date getCreateTime()
{
return createTime;
}
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("insId", getInsId())
.append("modelId", getModelId())
.append("insStatus", getInsStatus())
.append("creater", getCreater())
.append("createTime", getCreateTime())
.toString();
}
}

View File

@ -0,0 +1,135 @@
package com.cronie.mengyu.domain;
import java.math.BigDecimal;
import java.util.Date;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.base.BaseEntity;
/**
* 交易计划操作表 my_goods_trade_model_ins_node
*
* @author cronie
* @date 2018-11-15
*/
public class GoodsTradeModelInsNode extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 操作流水号 */
private Integer nodeId;
/** 实例号 */
private Integer insId;
/** 交易价格 */
private BigDecimal price;
/** 成交份额 */
private BigDecimal volumes;
/** 交易时间 */
private Date tradeTime;
/** 创建人 */
private Integer creater;
/** 创建时间 */
private Date createTime;
/** 交易类型(建仓,加仓,减仓,平仓,止损) */
private Integer tradeType;
/** 交易笔记 */
private String tradeNote;
public void setNodeId(Integer nodeId)
{
this.nodeId = nodeId;
}
public Integer getNodeId()
{
return nodeId;
}
public void setInsId(Integer insId)
{
this.insId = insId;
}
public Integer getInsId()
{
return insId;
}
public void setPrice(BigDecimal price)
{
this.price = price;
}
public BigDecimal getPrice()
{
return price;
}
public void setVolumes(BigDecimal volumes)
{
this.volumes = volumes;
}
public BigDecimal getVolumes()
{
return volumes;
}
public void setTradeTime(Date tradeTime)
{
this.tradeTime = tradeTime;
}
public Date getTradeTime()
{
return tradeTime;
}
public void setCreater(Integer creater)
{
this.creater = creater;
}
public Integer getCreater()
{
return creater;
}
public void setCreateTime(Date createTime)
{
this.createTime = createTime;
}
public Date getCreateTime()
{
return createTime;
}
public void setTradeType(Integer tradeType)
{
this.tradeType = tradeType;
}
public Integer getTradeType()
{
return tradeType;
}
public void setTradeNote(String tradeNote)
{
this.tradeNote = tradeNote;
}
public String getTradeNote()
{
return tradeNote;
}
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("nodeId", getNodeId())
.append("insId", getInsId())
.append("price", getPrice())
.append("volumes", getVolumes())
.append("tradeTime", getTradeTime())
.append("creater", getCreater())
.append("createTime", getCreateTime())
.append("tradeType", getTradeType())
.append("tradeNote", getTradeNote())
.toString();
}
}

View File

@ -0,0 +1,75 @@
package com.cronie.mengyu.domain;
import java.math.BigDecimal;
import java.util.Date;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.base.BaseEntity;
/**
* 资金池表 my_money_pool
*
* @author cronie
* @date 2018-11-15
*/
public class MoneyPool extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 创建人 */
private Integer creater;
/** 创建时间 */
private Date createTime;
/** 资金池金额 单位(元) */
private BigDecimal moneyPool;
/** 资金池ID=用户ID */
private Date moneyPoolId;
public void setCreater(Integer creater)
{
this.creater = creater;
}
public Integer getCreater()
{
return creater;
}
public void setCreateTime(Date createTime)
{
this.createTime = createTime;
}
public Date getCreateTime()
{
return createTime;
}
public void setMoneyPool(BigDecimal moneyPool)
{
this.moneyPool = moneyPool;
}
public BigDecimal getMoneyPool()
{
return moneyPool;
}
public void setMoneyPoolId(Date moneyPoolId)
{
this.moneyPoolId = moneyPoolId;
}
public Date getMoneyPoolId()
{
return moneyPoolId;
}
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("creater", getCreater())
.append("createTime", getCreateTime())
.append("moneyPool", getMoneyPool())
.append("moneyPoolId", getMoneyPoolId())
.toString();
}
}

View File

@ -0,0 +1,86 @@
package com.cronie.mengyu.domain;
import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.base.BaseEntity;
/**
* 资金池交明细表 my_money_pool_log
*
* @author cronie
* @date 2018-11-15
*/
public class MoneyPoolLog extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 交易类型 (支出/收入) */
private Integer billType;
/** 交易后的资金池金额 */
private BigDecimal moneyPoolLog;
/** 交易金额 */
private BigDecimal trademMoney;
/** 资金池ID号 */
private Integer moneyPoolId;
/** 资金池流水号ID=交易ID号 */
private Integer nodeId;
public void setBillType(Integer billType)
{
this.billType = billType;
}
public Integer getBillType()
{
return billType;
}
public void setMoneyPoolLog(BigDecimal moneyPoolLog)
{
this.moneyPoolLog = moneyPoolLog;
}
public BigDecimal getMoneyPoolLog()
{
return moneyPoolLog;
}
public void setTrademMoney(BigDecimal trademMoney)
{
this.trademMoney = trademMoney;
}
public BigDecimal getTrademMoney()
{
return trademMoney;
}
public void setMoneyPoolId(Integer moneyPoolId)
{
this.moneyPoolId = moneyPoolId;
}
public Integer getMoneyPoolId()
{
return moneyPoolId;
}
public void setNodeId(Integer nodeId)
{
this.nodeId = nodeId;
}
public Integer getNodeId()
{
return nodeId;
}
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("billType", getBillType())
.append("moneyPoolLog", getMoneyPoolLog())
.append("trademMoney", getTrademMoney())
.append("moneyPoolId", getMoneyPoolId())
.append("nodeId", getNodeId())
.toString();
}
}

View File

@ -0,0 +1,99 @@
package com.cronie.mengyu.domain;
import java.math.BigDecimal;
import java.util.Date;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.base.BaseEntity;
/**
* 年度计划表 my_year_plan
*
* @author cronie
* @date 2018-11-15
*/
public class YearPlan extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 年 */
private String year;
/** 预期盈利 */
private BigDecimal profit;
/** 计划状态 */
private Integer planStatus;
/** 任务状态 */
private Integer taskStatus;
/** 创建时间 */
private Date createTime;
/** 创建人 */
private Integer creater;
public void setYear(String year)
{
this.year = year;
}
public String getYear()
{
return year;
}
public void setProfit(BigDecimal profit)
{
this.profit = profit;
}
public BigDecimal getProfit()
{
return profit;
}
public void setPlanStatus(Integer planStatus)
{
this.planStatus = planStatus;
}
public Integer getPlanStatus()
{
return planStatus;
}
public void setTaskStatus(Integer taskStatus)
{
this.taskStatus = taskStatus;
}
public Integer getTaskStatus()
{
return taskStatus;
}
public void setCreateTime(Date createTime)
{
this.createTime = createTime;
}
public Date getCreateTime()
{
return createTime;
}
public void setCreater(Integer creater)
{
this.creater = creater;
}
public Integer getCreater()
{
return creater;
}
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("year", getYear())
.append("profit", getProfit())
.append("planStatus", getPlanStatus())
.append("taskStatus", getTaskStatus())
.append("createTime", getCreateTime())
.append("creater", getCreater())
.toString();
}
}

View File

@ -0,0 +1,62 @@
package com.cronie.mengyu.mapper;
import com.cronie.mengyu.domain.Goods;
import java.util.List;
/**
* 投资品种 数据层
*
* @author cronie
* @date 2018-11-15
*/
public interface GoodsMapper
{
/**
* 查询投资品种信息
*
* @param code 投资品种ID
* @return 投资品种信息
*/
public Goods selectGoodsById(String code);
/**
* 查询投资品种列表
*
* @param goods 投资品种信息
* @return 投资品种集合
*/
public List<Goods> selectGoodsList(Goods goods);
/**
* 新增投资品种
*
* @param goods 投资品种信息
* @return 结果
*/
public int insertGoods(Goods goods);
/**
* 修改投资品种
*
* @param goods 投资品种信息
* @return 结果
*/
public int updateGoods(Goods goods);
/**
* 删除投资品种
*
* @param code 投资品种ID
* @return 结果
*/
public int deleteGoodsById(String code);
/**
* 批量删除投资品种
*
* @param codes 需要删除的数据ID
* @return 结果
*/
public int deleteGoodsByIds(String[] codes);
}

View File

@ -0,0 +1,62 @@
package com.cronie.mengyu.mapper;
import com.cronie.mengyu.domain.GoodsTradeModelIns;
import java.util.List;
/**
* 计划模型实例 数据层
*
* @author cronie
* @date 2018-11-15
*/
public interface GoodsTradeModelInsMapper
{
/**
* 查询计划模型实例信息
*
* @param insId 计划模型实例ID
* @return 计划模型实例信息
*/
public GoodsTradeModelIns selectGoodsTradeModelInsById(Integer insId);
/**
* 查询计划模型实例列表
*
* @param goodsTradeModelIns 计划模型实例信息
* @return 计划模型实例集合
*/
public List<GoodsTradeModelIns> selectGoodsTradeModelInsList(GoodsTradeModelIns goodsTradeModelIns);
/**
* 新增计划模型实例
*
* @param goodsTradeModelIns 计划模型实例信息
* @return 结果
*/
public int insertGoodsTradeModelIns(GoodsTradeModelIns goodsTradeModelIns);
/**
* 修改计划模型实例
*
* @param goodsTradeModelIns 计划模型实例信息
* @return 结果
*/
public int updateGoodsTradeModelIns(GoodsTradeModelIns goodsTradeModelIns);
/**
* 删除计划模型实例
*
* @param insId 计划模型实例ID
* @return 结果
*/
public int deleteGoodsTradeModelInsById(Integer insId);
/**
* 批量删除计划模型实例
*
* @param insIds 需要删除的数据ID
* @return 结果
*/
public int deleteGoodsTradeModelInsByIds(String[] insIds);
}

View File

@ -0,0 +1,62 @@
package com.cronie.mengyu.mapper;
import com.cronie.mengyu.domain.GoodsTradeModelInsNode;
import java.util.List;
/**
* 交易计划操作 数据层
*
* @author cronie
* @date 2018-11-15
*/
public interface GoodsTradeModelInsNodeMapper
{
/**
* 查询交易计划操作信息
*
* @param nodeId 交易计划操作ID
* @return 交易计划操作信息
*/
public GoodsTradeModelInsNode selectGoodsTradeModelInsNodeById(Integer nodeId);
/**
* 查询交易计划操作列表
*
* @param goodsTradeModelInsNode 交易计划操作信息
* @return 交易计划操作集合
*/
public List<GoodsTradeModelInsNode> selectGoodsTradeModelInsNodeList(GoodsTradeModelInsNode goodsTradeModelInsNode);
/**
* 新增交易计划操作
*
* @param goodsTradeModelInsNode 交易计划操作信息
* @return 结果
*/
public int insertGoodsTradeModelInsNode(GoodsTradeModelInsNode goodsTradeModelInsNode);
/**
* 修改交易计划操作
*
* @param goodsTradeModelInsNode 交易计划操作信息
* @return 结果
*/
public int updateGoodsTradeModelInsNode(GoodsTradeModelInsNode goodsTradeModelInsNode);
/**
* 删除交易计划操作
*
* @param nodeId 交易计划操作ID
* @return 结果
*/
public int deleteGoodsTradeModelInsNodeById(Integer nodeId);
/**
* 批量删除交易计划操作
*
* @param nodeIds 需要删除的数据ID
* @return 结果
*/
public int deleteGoodsTradeModelInsNodeByIds(String[] nodeIds);
}

View File

@ -0,0 +1,62 @@
package com.cronie.mengyu.mapper;
import com.cronie.mengyu.domain.GoodsTradeModel;
import java.util.List;
/**
* 品种计划模型 数据层
*
* @author cronie
* @date 2018-11-15
*/
public interface GoodsTradeModelMapper
{
/**
* 查询品种计划模型信息
*
* @param modelId 品种计划模型ID
* @return 品种计划模型信息
*/
public GoodsTradeModel selectGoodsTradeModelById(Integer modelId);
/**
* 查询品种计划模型列表
*
* @param goodsTradeModel 品种计划模型信息
* @return 品种计划模型集合
*/
public List<GoodsTradeModel> selectGoodsTradeModelList(GoodsTradeModel goodsTradeModel);
/**
* 新增品种计划模型
*
* @param goodsTradeModel 品种计划模型信息
* @return 结果
*/
public int insertGoodsTradeModel(GoodsTradeModel goodsTradeModel);
/**
* 修改品种计划模型
*
* @param goodsTradeModel 品种计划模型信息
* @return 结果
*/
public int updateGoodsTradeModel(GoodsTradeModel goodsTradeModel);
/**
* 删除品种计划模型
*
* @param modelId 品种计划模型ID
* @return 结果
*/
public int deleteGoodsTradeModelById(Integer modelId);
/**
* 批量删除品种计划模型
*
* @param modelIds 需要删除的数据ID
* @return 结果
*/
public int deleteGoodsTradeModelByIds(String[] modelIds);
}

View File

@ -0,0 +1,62 @@
package com.cronie.mengyu.mapper;
import com.cronie.mengyu.domain.MoneyPoolLog;
import java.util.List;
/**
* 资金池交明细 数据层
*
* @author cronie
* @date 2018-11-15
*/
public interface MoneyPoolLogMapper
{
/**
* 查询资金池交明细信息
*
* @param billType 资金池交明细ID
* @return 资金池交明细信息
*/
public MoneyPoolLog selectMoneyPoolLogById(Integer billType);
/**
* 查询资金池交明细列表
*
* @param moneyPoolLog 资金池交明细信息
* @return 资金池交明细集合
*/
public List<MoneyPoolLog> selectMoneyPoolLogList(MoneyPoolLog moneyPoolLog);
/**
* 新增资金池交明细
*
* @param moneyPoolLog 资金池交明细信息
* @return 结果
*/
public int insertMoneyPoolLog(MoneyPoolLog moneyPoolLog);
/**
* 修改资金池交明细
*
* @param moneyPoolLog 资金池交明细信息
* @return 结果
*/
public int updateMoneyPoolLog(MoneyPoolLog moneyPoolLog);
/**
* 删除资金池交明细
*
* @param billType 资金池交明细ID
* @return 结果
*/
public int deleteMoneyPoolLogById(Integer billType);
/**
* 批量删除资金池交明细
*
* @param billTypes 需要删除的数据ID
* @return 结果
*/
public int deleteMoneyPoolLogByIds(String[] billTypes);
}

View File

@ -0,0 +1,62 @@
package com.cronie.mengyu.mapper;
import com.cronie.mengyu.domain.MoneyPool;
import java.util.List;
/**
* 资金池 数据层
*
* @author cronie
* @date 2018-11-15
*/
public interface MoneyPoolMapper
{
/**
* 查询资金池信息
*
* @param creater 资金池ID
* @return 资金池信息
*/
public MoneyPool selectMoneyPoolById(Integer creater);
/**
* 查询资金池列表
*
* @param moneyPool 资金池信息
* @return 资金池集合
*/
public List<MoneyPool> selectMoneyPoolList(MoneyPool moneyPool);
/**
* 新增资金池
*
* @param moneyPool 资金池信息
* @return 结果
*/
public int insertMoneyPool(MoneyPool moneyPool);
/**
* 修改资金池
*
* @param moneyPool 资金池信息
* @return 结果
*/
public int updateMoneyPool(MoneyPool moneyPool);
/**
* 删除资金池
*
* @param creater 资金池ID
* @return 结果
*/
public int deleteMoneyPoolById(Integer creater);
/**
* 批量删除资金池
*
* @param creaters 需要删除的数据ID
* @return 结果
*/
public int deleteMoneyPoolByIds(String[] creaters);
}

View File

@ -0,0 +1,62 @@
package com.cronie.mengyu.mapper;
import com.cronie.mengyu.domain.YearPlan;
import java.util.List;
/**
* 年度计划 数据层
*
* @author cronie
* @date 2018-11-15
*/
public interface YearPlanMapper
{
/**
* 查询年度计划信息
*
* @param year 年度计划ID
* @return 年度计划信息
*/
public YearPlan selectYearPlanById(String year);
/**
* 查询年度计划列表
*
* @param yearPlan 年度计划信息
* @return 年度计划集合
*/
public List<YearPlan> selectYearPlanList(YearPlan yearPlan);
/**
* 新增年度计划
*
* @param yearPlan 年度计划信息
* @return 结果
*/
public int insertYearPlan(YearPlan yearPlan);
/**
* 修改年度计划
*
* @param yearPlan 年度计划信息
* @return 结果
*/
public int updateYearPlan(YearPlan yearPlan);
/**
* 删除年度计划
*
* @param year 年度计划ID
* @return 结果
*/
public int deleteYearPlanById(String year);
/**
* 批量删除年度计划
*
* @param years 需要删除的数据ID
* @return 结果
*/
public int deleteYearPlanByIds(String[] years);
}

View File

@ -0,0 +1,49 @@
package com.cronie.mengyu.monitor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.MailSender;
import com.cronie.mengyu.common.json.JSONBeautifyUtils;
import com.cronie.mengyu.config.MailConfig;
import com.ruoyi.system.domain.SysUser;
import com.ruoyi.system.service.ISysUserService;
public abstract class AbstractMonitor implements IMonitor {
private static final Logger logger = LoggerFactory.getLogger(AbstractMonitor.class);
@Autowired(required=true)
private ISysUserService userService;
//邮箱服务器
@Autowired
protected MailSender mailSender;
//邮箱配置
@Autowired
protected MailConfig mailConfig ;
//json美化器
@Autowired
protected JSONBeautifyUtils jsonBeautifyUtils ;
@Override
public void monitor(String loginName) {
SysUser user = userService.selectUserByLoginName(loginName);
if(user == null) {
logger.error("无用户【"+loginName+"】的信息,请检查.");
return ;
}
monitorTask(user);
}
protected abstract void monitorTask(SysUser user);
}

View File

@ -0,0 +1,11 @@
package com.cronie.mengyu.monitor;
/**
* 监控
* @author Administrator
*
*/
public interface IMonitor {
//监控
public void monitor(String loginName) ;
}

View File

@ -0,0 +1,171 @@
package com.cronie.mengyu.monitor.impl;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.PostConstruct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.stereotype.Component;
import com.alibaba.fastjson.JSONObject;
import com.cronie.mengyu.common.constants.TradeConstants;
import com.cronie.mengyu.common.goods.ActualTimeGoods;
import com.cronie.mengyu.common.goods.ILoadGoodsInfo;
import com.cronie.mengyu.common.goods.LoadGoodsInfoFactory;
import com.cronie.mengyu.domain.GoodsTradeModel;
import com.cronie.mengyu.domain.GoodsTradeModelIns;
import com.cronie.mengyu.monitor.AbstractMonitor;
import com.cronie.mengyu.service.IGoodsTradeModelInsService;
import com.cronie.mengyu.service.IGoodsTradeModelService;
import com.cronie.mengyu.service.IMoneyPoolService;
import com.ruoyi.system.domain.SysUser;
import com.ruoyi.system.service.ISysConfigService;
/**
*
* @author 监控模型实例
*
*/
@Component("monitorModelInstance")
public class MonitorModelInstanceImpl extends AbstractMonitor {
private static final Logger logger = LoggerFactory.getLogger(MonitorModelInstanceImpl.class);
//模型服务层
@Autowired
IGoodsTradeModelService goodstradeModelService ;
//模型实例服务层
@Autowired
IGoodsTradeModelInsService goodsTradeModelInsService ;
//系统参数服务层
@Autowired
ISysConfigService sysConfigService ;
//实时数据源工厂
@Autowired
LoadGoodsInfoFactory loadGoodsInfoFactory ;
//资金池服务
@Autowired
IMoneyPoolService moneyPoolService ;
/**
* 系统参数配置
*/
@PostConstruct
protected void initSysConfig() {
}
@Override
protected void monitorTask(SysUser user) {
GoodsTradeModelIns goodsTradeModelInsParamter = new GoodsTradeModelIns();
goodsTradeModelInsParamter.setCreater(user.getUserId().intValue());//查询用户
goodsTradeModelInsParamter.setInsStatus(TradeConstants.MODEL_INS_STATUS_RUNING);//计划是进行中的状态
goodsTradeModelInsParamter.setHasMailNotice(TradeConstants.MAIL_NOTICE_NO);
List<GoodsTradeModelIns> listTradeModelIns = goodsTradeModelInsService.selectGoodsTradeModelInsList(goodsTradeModelInsParamter) ;
logger.info("监控到用户【"+user.getLoginName()+"】的交易模型实例有【"+listTradeModelIns.size()+"】个。");
for(GoodsTradeModelIns planModelIns : listTradeModelIns) {
//监控模型
monitorGoodsTradeModelIns(planModelIns, user);
}
}
/**
* 监控计划模型
* @param model
* @param user
*/
protected void monitorGoodsTradeModelIns(GoodsTradeModelIns planModelIns,SysUser user) {
logger.info("开始扫描用户【"+user.getLoginName()+"】,模型【"+JSONObject.toJSONString(planModelIns)+"】....");
ILoadGoodsInfo loadGoodsInfoInterface = loadGoodsInfoFactory.getLoadGoodsInfoInstance() ;
//模型信息
GoodsTradeModel planModel = goodstradeModelService.selectGoodsTradeModelById(planModelIns.getModelId()) ;
//得到实时品种信息
ActualTimeGoods actualTimeGoods = loadGoodsInfoInterface.loadGoodsInfo(planModel.getCode()) ;
if(actualTimeGoods == null ) {
logger.error("查询的实时品种信息失败.");
return ;
}
//过滤
//1.当前价为0
if(actualTimeGoods.getActualTimePrice() == 0 ){
return ;
}
//2.如果当前价在此买入 卖出区间内则跳过验证
if(actualTimeGoods.getActualTimePrice()<planModel.getExitPrice().doubleValue() && actualTimeGoods.getActualTimePrice()>planModel.getStopPrice().doubleValue()){
return;
}
//至此说明可以平仓了
//1.设置今日不提醒邮件
planModelIns.setHasMailNotice(TradeConstants.MAIL_NOTICE_YES);
goodsTradeModelInsService.updateGoodsTradeModelIns(planModelIns) ;
//2.根据计划实例生成平仓实例
completeModelIns(actualTimeGoods, planModel,planModelIns, user);
logger.info("完成扫描用户【"+user.getLoginName()+"】,模型【"+JSONObject.toJSONString(planModel)+"】.");
}
/**
* 根据模型建仓
* @param actualTimeGoods
* @param planModel
* @param user
*/
protected void completeModelIns(final ActualTimeGoods actualTimeGoods,final GoodsTradeModel planModel,GoodsTradeModelIns planModelIns, final SysUser user) {
//止损价
double lossPrice = planModel.getStopPrice().setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue() ;
//平仓价
double exitPrice = planModel.getExitPrice().setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue() ;
//发送邮箱提醒
Map<String,Object> data = new HashMap<String,Object>();
data.put("品种名称", actualTimeGoods.getName()) ;
data.put("实际平仓价格", actualTimeGoods.getActualTimePrice()) ;
String subject = "品种名称:".concat(actualTimeGoods.getName()).concat(",").concat("平仓价格:").concat(String.valueOf(actualTimeGoods.getActualTimePrice())) ;
data.put("计划平仓价格", exitPrice) ;
data.put("止损价格", lossPrice) ;
data.put("平仓时间", actualTimeGoods.getRefreshTime()) ;
String content = JSONObject.toJSONString(data) ;
logger.info("正在向用户【"+user.getLoginName()+"("+user.getEmail()+")】发送平仓邮件.主题【"+subject+"】......");
SimpleMailMessage message = new SimpleMailMessage();//消息构造器
message.setFrom(mailConfig.getUserName());//发件人
message.setTo(user.getEmail());//收件人
message.setSubject( subject );//主题
message.setText(jsonBeautifyUtils.formatJson(content));//正文
mailSender.send(message);
logger.info("已成功发送用户【"+user.getLoginName()+"("+user.getEmail()+")】平仓邮件.主题【"+subject+"】.");
}
}

View File

@ -0,0 +1,252 @@
package com.cronie.mengyu.monitor.impl;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.PostConstruct;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.stereotype.Component;
import com.alibaba.fastjson.JSONObject;
import com.cronie.mengyu.common.constants.TradeConstants;
import com.cronie.mengyu.common.goods.ActualTimeGoods;
import com.cronie.mengyu.common.goods.ILoadGoodsInfo;
import com.cronie.mengyu.common.goods.LoadGoodsInfoFactory;
import com.cronie.mengyu.domain.GoodsTradeModel;
import com.cronie.mengyu.domain.MoneyPool;
import com.cronie.mengyu.monitor.AbstractMonitor;
import com.cronie.mengyu.service.IGoodsTradeModelService;
import com.cronie.mengyu.service.IMoneyPoolService;
import com.ruoyi.system.domain.SysUser;
import com.ruoyi.system.service.ISysConfigService;
/**
*
* @author 监控计划模型
*
*/
@Component("monitorTradeModel")
public class MonitorTradeModelImpl extends AbstractMonitor {
private static final Logger logger = LoggerFactory.getLogger(MonitorTradeModelImpl.class);
//模型服务层
@Autowired
IGoodsTradeModelService goodsTradeModelService ;
//系统参数服务层
@Autowired
ISysConfigService sysConfigService ;
//实时数据源工厂
@Autowired
LoadGoodsInfoFactory loadGoodsInfoFactory ;
//资金池服务
@Autowired
IMoneyPoolService moneyPoolService ;
//投资品种涨幅比
BigDecimal goodsPriceIncreaseRate ;
//投资品种放量比
BigDecimal goodsVolumesIncreaseRate;
//资金池风险控比(至多亏损资金池中的百分之多少钱)
BigDecimal moneyPoolLossRate;
//交易次数
BigDecimal moneyPoolTradeNums ;
//最小交易份额
Integer goodsTradeMinAmount = 100;
/**
* 系统参数配置
*/
@PostConstruct
protected void initSysConfig() {
//1.设置涨副比
String goodsPriceIncreaseRateStr = sysConfigService.selectConfigByKey(TradeConstants.GOODS_PRICE_INCREASE_RATE) ;
if(StringUtils.isBlank(goodsPriceIncreaseRateStr) || StringUtils.isEmpty(goodsPriceIncreaseRateStr)) {
logger.error("尚未配置系统参数【goods_Price_Increase_Rate】.");
}else {
goodsPriceIncreaseRate = new BigDecimal(goodsPriceIncreaseRateStr.trim());
logger.info("初始化参数:【"+TradeConstants.GOODS_PRICE_INCREASE_RATE+"】值:【"+goodsPriceIncreaseRateStr.trim()+"");
}
//2.设置放量比
String goodsVolumesIncreaseRateStr = sysConfigService.selectConfigByKey(TradeConstants.GOODS_VOLUMES_INCREASE_RATE) ;
if(StringUtils.isBlank(goodsVolumesIncreaseRateStr) || StringUtils.isEmpty(goodsVolumesIncreaseRateStr)) {
logger.error("尚未配置系统参数【goods_Volumes_Increase_Rate】.");
}else {
goodsVolumesIncreaseRate = new BigDecimal(goodsVolumesIncreaseRateStr.trim());
logger.info("初始化参数:【"+TradeConstants.GOODS_VOLUMES_INCREASE_RATE+"】值:【"+goodsVolumesIncreaseRateStr.trim()+"");
}
//3.风控比
String moneyPoolLossRateStr = sysConfigService.selectConfigByKey(TradeConstants.MONEY_POOL_LOSS_RATE) ;
if(StringUtils.isBlank(moneyPoolLossRateStr) || StringUtils.isEmpty(moneyPoolLossRateStr)) {
logger.error("尚未配置系统参数【money_Pool_Loss_Rate】.");
}else {
moneyPoolLossRate = new BigDecimal(moneyPoolLossRateStr.trim());
logger.info("初始化参数:【"+TradeConstants.MONEY_POOL_LOSS_RATE+"】值:【"+moneyPoolLossRateStr.trim()+"");
}
//4.交易次数
String moneyPoolTradeNumsStr = sysConfigService.selectConfigByKey(TradeConstants.MONEY_POOL_TRADE_NUMS) ;
if(StringUtils.isBlank(moneyPoolTradeNumsStr) || StringUtils.isEmpty(moneyPoolTradeNumsStr)) {
logger.error("尚未配置系统参数【money_Pool_Trade_Nums】.");
}else {
moneyPoolTradeNums = new BigDecimal(moneyPoolTradeNumsStr.trim());
logger.info("初始化参数:【"+TradeConstants.MONEY_POOL_TRADE_NUMS+"】值:【"+moneyPoolTradeNumsStr.trim()+"");
}
//4.交易份额
String goodsTradeMinAmountStr = sysConfigService.selectConfigByKey(TradeConstants.GOODS_TRADE_MIN_AMOUNT) ;
if(StringUtils.isBlank(goodsTradeMinAmountStr) || StringUtils.isEmpty(goodsTradeMinAmountStr)) {
logger.error("尚未配置系统参数【goods_trade_min_amount】.");
}else {
goodsTradeMinAmount = Integer.parseInt(goodsTradeMinAmountStr) ;
logger.info("初始化参数:【"+TradeConstants.GOODS_TRADE_MIN_AMOUNT+"】值:【"+goodsTradeMinAmountStr.trim()+"");
}
}
@Override
protected void monitorTask(SysUser user) {
GoodsTradeModel goodsTradeModelParamter = new GoodsTradeModel();
goodsTradeModelParamter.setCreater(user.getUserId().intValue());//查询用户
goodsTradeModelParamter.setModelStatus(TradeConstants.GOODS_MODEL_STATUS_VALID);//启用状态
goodsTradeModelParamter.setHasMailNotice(TradeConstants.MAIL_NOTICE_NO);
List<GoodsTradeModel> listTradeModel = goodsTradeModelService.selectGoodsTradeModelList(goodsTradeModelParamter) ;
logger.info("监控用户【"+user.getLoginName()+"】的交易计划模型有【"+listTradeModel.size()+"】个。");
for(GoodsTradeModel planModel : listTradeModel) {
//监控模型
monitorGoodsTradeModel(planModel, user);
}
}
/**
* 监控计划模型
* @param model
* @param user
*/
protected void monitorGoodsTradeModel(GoodsTradeModel planModel,SysUser user) {
logger.info("开始扫描用户【"+user.getLoginName()+"】,模型【"+JSONObject.toJSONString(planModel)+"】....");
ILoadGoodsInfo loadGoodsInfoInterface = loadGoodsInfoFactory.getLoadGoodsInfoInstance() ;
//得到实时品种信息
ActualTimeGoods actualTimeGoods = loadGoodsInfoInterface.loadGoodsInfo(planModel.getCode()) ;
if(actualTimeGoods == null ) {
logger.error("查询的实时品种信息失败.");
return ;
}
//过滤
//1.当前价为0
if(actualTimeGoods.getActualTimePrice() == 0 ){
return ;
}
//2.如果当前价不在此买入 卖出区间内则跳过建仓
if(actualTimeGoods.getActualTimePrice()>planModel.getExitPrice().doubleValue()||actualTimeGoods.getActualTimePrice()<planModel.getStopPrice().doubleValue()){
return;
}
//3.放量比过滤
double planVol = (planModel.getBasicVolumes().add( planModel.getBasicVolumes().multiply(goodsVolumesIncreaseRate))).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
//如果没有放量
if(actualTimeGoods.getActualTimeVolumes()<planVol){
return ;
}
//4.如果放量了 但是没有创新高
if(actualTimeGoods.getActualTimePrice() < planModel.getBuildingPrice().setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()){
return ;
}
//5.价格过滤
double planPrice = (planModel.getBuildingPrice().add( planModel.getBuildingPrice().multiply(goodsPriceIncreaseRate))).setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
//如果没有放量
if(actualTimeGoods.getActualTimePrice()<planPrice){
return ;
}
//至此说明可以建仓了
//1.将计划模的状态设置成停用状态
planModel.setModelStatus(TradeConstants.GOODS_MODEL_STATUS_INVALID);
planModel.setHasMailNotice(TradeConstants.MAIL_NOTICE_YES);
goodsTradeModelService.updateGoodsTradeModel(planModel) ;
//2.根据计划模型生成建仓实例
buildModelIns(actualTimeGoods, planModel, user);
logger.info("完成扫描用户【"+user.getLoginName()+"】,模型【"+JSONObject.toJSONString(planModel)+"】.");
}
/**
* 根据模型建仓
* @param actualTimeGoods
* @param planModel
* @param user
*/
protected void buildModelIns(final ActualTimeGoods actualTimeGoods,final GoodsTradeModel planModel, final SysUser user) {
//预期成本价
double buildPrice = planModel.getBuildingPrice().setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue() ;
//止损价
double lossPrice = planModel.getStopPrice().setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue() ;
//每次亏损金额
BigDecimal perBuildLossMoney = null;
//止损额度
double priceDifferences = actualTimeGoods.getActualTimePrice() - lossPrice;
//建仓份额
int mockAmount = 0;
//总资金
MoneyPool moneyPool = moneyPoolService.selectMoneyPoolById(user.getUserId().intValue()) ;
BigDecimal repMoney = moneyPool.getMoneyPool() ;
//计算每次亏损金额
perBuildLossMoney = repMoney.multiply(moneyPoolLossRate).divide(moneyPoolTradeNums) ;
//(repMoney*sysLossRate)/num;
//计算买入份额
mockAmount = (int) (perBuildLossMoney.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue()/priceDifferences) ;
//opt:2015-09-25 换算成MIN_AMOUNT的整数倍.
mockAmount = (mockAmount/goodsTradeMinAmount)*goodsTradeMinAmount;
if(mockAmount == 0){
mockAmount = goodsTradeMinAmount;
}
//发送邮箱提醒
Map<String,Object> data = new HashMap<String,Object>();
data.put("品种名称", actualTimeGoods.getName()) ;
data.put("建仓价格", buildPrice) ;
String subject = "品种名称:".concat(actualTimeGoods.getName()).concat(",").concat("建仓价格:").concat(String.valueOf(buildPrice)) ;
data.put("建仓份额", mockAmount) ;
data.put("建仓金额", mockAmount*buildPrice) ;
data.put("建仓时间", actualTimeGoods.getRefreshTime()) ;
String content = JSONObject.toJSONString(data) ;
logger.info("正在向用户【"+user.getLoginName()+"("+user.getEmail()+")】发送建仓邮件.主题【"+subject+"】......");
SimpleMailMessage message = new SimpleMailMessage();//消息构造器
message.setFrom(mailConfig.getUserName());//发件人
message.setTo(user.getEmail());//收件人
message.setSubject( subject );//主题
message.setText(jsonBeautifyUtils.formatJson(content));//正文
mailSender.send(message);
logger.info("已成功发送用户【"+user.getLoginName()+"("+user.getEmail()+")】建仓邮件.主题【"+subject+"】.");
}
}

View File

@ -0,0 +1,52 @@
package com.cronie.mengyu.monitor.impl;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.cronie.mengyu.common.constants.TradeConstants;
import com.cronie.mengyu.domain.GoodsTradeModelIns;
import com.cronie.mengyu.monitor.AbstractMonitor;
import com.cronie.mengyu.service.IGoodsTradeModelInsService;
import com.ruoyi.system.domain.SysUser;
/**
* 重置所有的交易模型实例邮件通知状态
* @author cronie
*
*/
@Component("resetTradeModelInsMailNotice")
public class ResetTradeModelInsMailNoticeImpl extends AbstractMonitor {
private static final Logger logger = LoggerFactory.getLogger(ResetTradeModelInsMailNoticeImpl.class);
//模型实例服务层
@Autowired
IGoodsTradeModelInsService goodsTradeModelInsService ;
@Override
protected void monitorTask(SysUser user) {
GoodsTradeModelIns goodsTradeModelInsParamter = new GoodsTradeModelIns();
goodsTradeModelInsParamter.setCreater(user.getUserId().intValue());//查询用户
goodsTradeModelInsParamter.setInsStatus(TradeConstants.MODEL_INS_STATUS_RUNING);//计划是进行中的状态
goodsTradeModelInsParamter.setHasMailNotice(TradeConstants.MAIL_NOTICE_YES);
List<GoodsTradeModelIns> listTradeModelIns = goodsTradeModelInsService.selectGoodsTradeModelInsList(goodsTradeModelInsParamter) ;
logger.info("重置用户【"+user.getLoginName()+"】的交易计划模型邮件通知有【"+listTradeModelIns.size()+"】个。");
for(GoodsTradeModelIns planModelIns : listTradeModelIns) {
planModelIns.setHasMailNotice(TradeConstants.MAIL_NOTICE_NO);//未通知状态
goodsTradeModelInsService.updateGoodsTradeModelIns(planModelIns) ;
}
logger.info("已重置完用户【"+user.getLoginName()+"】的交易计划模型实例邮件通知状态。");
}
}

View File

@ -0,0 +1,47 @@
package com.cronie.mengyu.monitor.impl;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.cronie.mengyu.common.constants.TradeConstants;
import com.cronie.mengyu.domain.GoodsTradeModel;
import com.cronie.mengyu.monitor.AbstractMonitor;
import com.cronie.mengyu.service.IGoodsTradeModelService;
import com.ruoyi.system.domain.SysUser;
/**
* 重置所有的交易模型邮件通知状态
* @author cronie
*
*/
@Component("resetTradeModelMailNotice")
public class ResetTradeModelMailNoticeImpl extends AbstractMonitor {
private static final Logger logger = LoggerFactory.getLogger(ResetTradeModelMailNoticeImpl.class);
//模型服务层
@Autowired
IGoodsTradeModelService goodsTradeModelService ;
@Override
protected void monitorTask(SysUser user) {
GoodsTradeModel goodsTradeModelParamter = new GoodsTradeModel();
goodsTradeModelParamter.setCreater(user.getUserId().intValue());//查询用户
goodsTradeModelParamter.setModelStatus(TradeConstants.GOODS_MODEL_STATUS_VALID);//启用状态
goodsTradeModelParamter.setHasMailNotice(TradeConstants.MAIL_NOTICE_YES);
List<GoodsTradeModel> listTradeModel = goodsTradeModelService.selectGoodsTradeModelList(goodsTradeModelParamter) ;
logger.info("重置用户【"+user.getLoginName()+"】的交易计划模型邮件通知有【"+listTradeModel.size()+"】个。");
for(GoodsTradeModel planModel : listTradeModel) {
planModel.setHasMailNotice(TradeConstants.MAIL_NOTICE_NO);//未通知状态
goodsTradeModelService.updateGoodsTradeModel(planModel) ;
}
logger.info("已重置完用户【"+user.getLoginName()+"】的交易计划模型邮件通知状态。");
}
}

View File

@ -0,0 +1,54 @@
package com.cronie.mengyu.service;
import com.cronie.mengyu.domain.Goods;
import java.util.List;
/**
* 投资品种 服务层
*
* @author cronie
* @date 2018-11-15
*/
public interface IGoodsService
{
/**
* 查询投资品种信息
*
* @param code 投资品种ID
* @return 投资品种信息
*/
public Goods selectGoodsById(String code);
/**
* 查询投资品种列表
*
* @param goods 投资品种信息
* @return 投资品种集合
*/
public List<Goods> selectGoodsList(Goods goods);
/**
* 新增投资品种
*
* @param goods 投资品种信息
* @return 结果
*/
public int insertGoods(Goods goods);
/**
* 修改投资品种
*
* @param goods 投资品种信息
* @return 结果
*/
public int updateGoods(Goods goods);
/**
* 删除投资品种信息
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteGoodsByIds(String ids);
}

View File

@ -0,0 +1,54 @@
package com.cronie.mengyu.service;
import com.cronie.mengyu.domain.GoodsTradeModelInsNode;
import java.util.List;
/**
* 交易计划操作 服务层
*
* @author cronie
* @date 2018-11-15
*/
public interface IGoodsTradeModelInsNodeService
{
/**
* 查询交易计划操作信息
*
* @param nodeId 交易计划操作ID
* @return 交易计划操作信息
*/
public GoodsTradeModelInsNode selectGoodsTradeModelInsNodeById(Integer nodeId);
/**
* 查询交易计划操作列表
*
* @param goodsTradeModelInsNode 交易计划操作信息
* @return 交易计划操作集合
*/
public List<GoodsTradeModelInsNode> selectGoodsTradeModelInsNodeList(GoodsTradeModelInsNode goodsTradeModelInsNode);
/**
* 新增交易计划操作
*
* @param goodsTradeModelInsNode 交易计划操作信息
* @return 结果
*/
public int insertGoodsTradeModelInsNode(GoodsTradeModelInsNode goodsTradeModelInsNode);
/**
* 修改交易计划操作
*
* @param goodsTradeModelInsNode 交易计划操作信息
* @return 结果
*/
public int updateGoodsTradeModelInsNode(GoodsTradeModelInsNode goodsTradeModelInsNode);
/**
* 删除交易计划操作信息
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteGoodsTradeModelInsNodeByIds(String ids);
}

View File

@ -0,0 +1,54 @@
package com.cronie.mengyu.service;
import com.cronie.mengyu.domain.GoodsTradeModelIns;
import java.util.List;
/**
* 计划模型实例 服务层
*
* @author cronie
* @date 2018-11-15
*/
public interface IGoodsTradeModelInsService
{
/**
* 查询计划模型实例信息
*
* @param insId 计划模型实例ID
* @return 计划模型实例信息
*/
public GoodsTradeModelIns selectGoodsTradeModelInsById(Integer insId);
/**
* 查询计划模型实例列表
*
* @param goodsTradeModelIns 计划模型实例信息
* @return 计划模型实例集合
*/
public List<GoodsTradeModelIns> selectGoodsTradeModelInsList(GoodsTradeModelIns goodsTradeModelIns);
/**
* 新增计划模型实例
*
* @param goodsTradeModelIns 计划模型实例信息
* @return 结果
*/
public int insertGoodsTradeModelIns(GoodsTradeModelIns goodsTradeModelIns);
/**
* 修改计划模型实例
*
* @param goodsTradeModelIns 计划模型实例信息
* @return 结果
*/
public int updateGoodsTradeModelIns(GoodsTradeModelIns goodsTradeModelIns);
/**
* 删除计划模型实例信息
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteGoodsTradeModelInsByIds(String ids);
}

View File

@ -0,0 +1,54 @@
package com.cronie.mengyu.service;
import com.cronie.mengyu.domain.GoodsTradeModel;
import java.util.List;
/**
* 品种计划模型 服务层
*
* @author cronie
* @date 2018-11-15
*/
public interface IGoodsTradeModelService
{
/**
* 查询品种计划模型信息
*
* @param modelId 品种计划模型ID
* @return 品种计划模型信息
*/
public GoodsTradeModel selectGoodsTradeModelById(Integer modelId);
/**
* 查询品种计划模型列表
*
* @param goodsTradeModel 品种计划模型信息
* @return 品种计划模型集合
*/
public List<GoodsTradeModel> selectGoodsTradeModelList(GoodsTradeModel goodsTradeModel);
/**
* 新增品种计划模型
*
* @param goodsTradeModel 品种计划模型信息
* @return 结果
*/
public int insertGoodsTradeModel(GoodsTradeModel goodsTradeModel);
/**
* 修改品种计划模型
*
* @param goodsTradeModel 品种计划模型信息
* @return 结果
*/
public int updateGoodsTradeModel(GoodsTradeModel goodsTradeModel);
/**
* 删除品种计划模型信息
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteGoodsTradeModelByIds(String ids);
}

View File

@ -0,0 +1,54 @@
package com.cronie.mengyu.service;
import com.cronie.mengyu.domain.MoneyPoolLog;
import java.util.List;
/**
* 资金池交明细 服务层
*
* @author cronie
* @date 2018-11-15
*/
public interface IMoneyPoolLogService
{
/**
* 查询资金池交明细信息
*
* @param billType 资金池交明细ID
* @return 资金池交明细信息
*/
public MoneyPoolLog selectMoneyPoolLogById(Integer billType);
/**
* 查询资金池交明细列表
*
* @param moneyPoolLog 资金池交明细信息
* @return 资金池交明细集合
*/
public List<MoneyPoolLog> selectMoneyPoolLogList(MoneyPoolLog moneyPoolLog);
/**
* 新增资金池交明细
*
* @param moneyPoolLog 资金池交明细信息
* @return 结果
*/
public int insertMoneyPoolLog(MoneyPoolLog moneyPoolLog);
/**
* 修改资金池交明细
*
* @param moneyPoolLog 资金池交明细信息
* @return 结果
*/
public int updateMoneyPoolLog(MoneyPoolLog moneyPoolLog);
/**
* 删除资金池交明细信息
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteMoneyPoolLogByIds(String ids);
}

View File

@ -0,0 +1,54 @@
package com.cronie.mengyu.service;
import com.cronie.mengyu.domain.MoneyPool;
import java.util.List;
/**
* 资金池 服务层
*
* @author cronie
* @date 2018-11-15
*/
public interface IMoneyPoolService
{
/**
* 查询资金池信息
*
* @param creater 资金池ID
* @return 资金池信息
*/
public MoneyPool selectMoneyPoolById(Integer creater);
/**
* 查询资金池列表
*
* @param moneyPool 资金池信息
* @return 资金池集合
*/
public List<MoneyPool> selectMoneyPoolList(MoneyPool moneyPool);
/**
* 新增资金池
*
* @param moneyPool 资金池信息
* @return 结果
*/
public int insertMoneyPool(MoneyPool moneyPool);
/**
* 修改资金池
*
* @param moneyPool 资金池信息
* @return 结果
*/
public int updateMoneyPool(MoneyPool moneyPool);
/**
* 删除资金池信息
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteMoneyPoolByIds(String ids);
}

View File

@ -0,0 +1,54 @@
package com.cronie.mengyu.service;
import com.cronie.mengyu.domain.YearPlan;
import java.util.List;
/**
* 年度计划 服务层
*
* @author cronie
* @date 2018-11-15
*/
public interface IYearPlanService
{
/**
* 查询年度计划信息
*
* @param year 年度计划ID
* @return 年度计划信息
*/
public YearPlan selectYearPlanById(String year);
/**
* 查询年度计划列表
*
* @param yearPlan 年度计划信息
* @return 年度计划集合
*/
public List<YearPlan> selectYearPlanList(YearPlan yearPlan);
/**
* 新增年度计划
*
* @param yearPlan 年度计划信息
* @return 结果
*/
public int insertYearPlan(YearPlan yearPlan);
/**
* 修改年度计划
*
* @param yearPlan 年度计划信息
* @return 结果
*/
public int updateYearPlan(YearPlan yearPlan);
/**
* 删除年度计划信息
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteYearPlanByIds(String ids);
}

View File

@ -0,0 +1,85 @@
package com.cronie.mengyu.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cronie.mengyu.domain.Goods;
import com.cronie.mengyu.mapper.GoodsMapper;
import com.cronie.mengyu.service.IGoodsService;
import com.ruoyi.common.support.Convert;
/**
* 投资品种 服务层实现
*
* @author cronie
* @date 2018-11-15
*/
@Service
public class GoodsServiceImpl implements IGoodsService
{
@Autowired
private GoodsMapper goodsMapper;
/**
* 查询投资品种信息
*
* @param code 投资品种ID
* @return 投资品种信息
*/
@Override
public Goods selectGoodsById(String code)
{
return goodsMapper.selectGoodsById(code);
}
/**
* 查询投资品种列表
*
* @param goods 投资品种信息
* @return 投资品种集合
*/
@Override
public List<Goods> selectGoodsList(Goods goods)
{
return goodsMapper.selectGoodsList(goods);
}
/**
* 新增投资品种
*
* @param goods 投资品种信息
* @return 结果
*/
@Override
public int insertGoods(Goods goods)
{
return goodsMapper.insertGoods(goods);
}
/**
* 修改投资品种
*
* @param goods 投资品种信息
* @return 结果
*/
@Override
public int updateGoods(Goods goods)
{
return goodsMapper.updateGoods(goods);
}
/**
* 删除投资品种对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteGoodsByIds(String ids)
{
return goodsMapper.deleteGoodsByIds(Convert.toStrArray(ids));
}
}

View File

@ -0,0 +1,85 @@
package com.cronie.mengyu.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cronie.mengyu.domain.GoodsTradeModelInsNode;
import com.cronie.mengyu.mapper.GoodsTradeModelInsNodeMapper;
import com.cronie.mengyu.service.IGoodsTradeModelInsNodeService;
import com.ruoyi.common.support.Convert;
/**
* 交易计划操作 服务层实现
*
* @author cronie
* @date 2018-11-15
*/
@Service
public class GoodsTradeModelInsNodeServiceImpl implements IGoodsTradeModelInsNodeService
{
@Autowired
private GoodsTradeModelInsNodeMapper goodsTradeModelInsNodeMapper;
/**
* 查询交易计划操作信息
*
* @param nodeId 交易计划操作ID
* @return 交易计划操作信息
*/
@Override
public GoodsTradeModelInsNode selectGoodsTradeModelInsNodeById(Integer nodeId)
{
return goodsTradeModelInsNodeMapper.selectGoodsTradeModelInsNodeById(nodeId);
}
/**
* 查询交易计划操作列表
*
* @param goodsTradeModelInsNode 交易计划操作信息
* @return 交易计划操作集合
*/
@Override
public List<GoodsTradeModelInsNode> selectGoodsTradeModelInsNodeList(GoodsTradeModelInsNode goodsTradeModelInsNode)
{
return goodsTradeModelInsNodeMapper.selectGoodsTradeModelInsNodeList(goodsTradeModelInsNode);
}
/**
* 新增交易计划操作
*
* @param goodsTradeModelInsNode 交易计划操作信息
* @return 结果
*/
@Override
public int insertGoodsTradeModelInsNode(GoodsTradeModelInsNode goodsTradeModelInsNode)
{
return goodsTradeModelInsNodeMapper.insertGoodsTradeModelInsNode(goodsTradeModelInsNode);
}
/**
* 修改交易计划操作
*
* @param goodsTradeModelInsNode 交易计划操作信息
* @return 结果
*/
@Override
public int updateGoodsTradeModelInsNode(GoodsTradeModelInsNode goodsTradeModelInsNode)
{
return goodsTradeModelInsNodeMapper.updateGoodsTradeModelInsNode(goodsTradeModelInsNode);
}
/**
* 删除交易计划操作对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteGoodsTradeModelInsNodeByIds(String ids)
{
return goodsTradeModelInsNodeMapper.deleteGoodsTradeModelInsNodeByIds(Convert.toStrArray(ids));
}
}

View File

@ -0,0 +1,83 @@
package com.cronie.mengyu.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cronie.mengyu.mapper.GoodsTradeModelInsMapper;
import com.cronie.mengyu.domain.GoodsTradeModelIns;
import com.cronie.mengyu.service.IGoodsTradeModelInsService;
import com.ruoyi.common.support.Convert;
/**
* 计划模型实例 服务层实现
*
* @author cronie
* @date 2018-11-15
*/
@Service
public class GoodsTradeModelInsServiceImpl implements IGoodsTradeModelInsService
{
@Autowired
private GoodsTradeModelInsMapper goodsTradeModelInsMapper;
/**
* 查询计划模型实例信息
*
* @param insId 计划模型实例ID
* @return 计划模型实例信息
*/
@Override
public GoodsTradeModelIns selectGoodsTradeModelInsById(Integer insId)
{
return goodsTradeModelInsMapper.selectGoodsTradeModelInsById(insId);
}
/**
* 查询计划模型实例列表
*
* @param goodsTradeModelIns 计划模型实例信息
* @return 计划模型实例集合
*/
@Override
public List<GoodsTradeModelIns> selectGoodsTradeModelInsList(GoodsTradeModelIns goodsTradeModelIns)
{
return goodsTradeModelInsMapper.selectGoodsTradeModelInsList(goodsTradeModelIns);
}
/**
* 新增计划模型实例
*
* @param goodsTradeModelIns 计划模型实例信息
* @return 结果
*/
@Override
public int insertGoodsTradeModelIns(GoodsTradeModelIns goodsTradeModelIns)
{
return goodsTradeModelInsMapper.insertGoodsTradeModelIns(goodsTradeModelIns);
}
/**
* 修改计划模型实例
*
* @param goodsTradeModelIns 计划模型实例信息
* @return 结果
*/
@Override
public int updateGoodsTradeModelIns(GoodsTradeModelIns goodsTradeModelIns)
{
return goodsTradeModelInsMapper.updateGoodsTradeModelIns(goodsTradeModelIns);
}
/**
* 删除计划模型实例对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteGoodsTradeModelInsByIds(String ids)
{
return goodsTradeModelInsMapper.deleteGoodsTradeModelInsByIds(Convert.toStrArray(ids));
}
}

View File

@ -0,0 +1,83 @@
package com.cronie.mengyu.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cronie.mengyu.mapper.GoodsTradeModelMapper;
import com.cronie.mengyu.domain.GoodsTradeModel;
import com.cronie.mengyu.service.IGoodsTradeModelService;
import com.ruoyi.common.support.Convert;
/**
* 品种计划模型 服务层实现
*
* @author cronie
* @date 2018-11-15
*/
@Service
public class GoodsTradeModelServiceImpl implements IGoodsTradeModelService
{
@Autowired
private GoodsTradeModelMapper goodsTradeModelMapper;
/**
* 查询品种计划模型信息
*
* @param modelId 品种计划模型ID
* @return 品种计划模型信息
*/
@Override
public GoodsTradeModel selectGoodsTradeModelById(Integer modelId)
{
return goodsTradeModelMapper.selectGoodsTradeModelById(modelId);
}
/**
* 查询品种计划模型列表
*
* @param goodsTradeModel 品种计划模型信息
* @return 品种计划模型集合
*/
@Override
public List<GoodsTradeModel> selectGoodsTradeModelList(GoodsTradeModel goodsTradeModel)
{
return goodsTradeModelMapper.selectGoodsTradeModelList(goodsTradeModel);
}
/**
* 新增品种计划模型
*
* @param goodsTradeModel 品种计划模型信息
* @return 结果
*/
@Override
public int insertGoodsTradeModel(GoodsTradeModel goodsTradeModel)
{
return goodsTradeModelMapper.insertGoodsTradeModel(goodsTradeModel);
}
/**
* 修改品种计划模型
*
* @param goodsTradeModel 品种计划模型信息
* @return 结果
*/
@Override
public int updateGoodsTradeModel(GoodsTradeModel goodsTradeModel)
{
return goodsTradeModelMapper.updateGoodsTradeModel(goodsTradeModel);
}
/**
* 删除品种计划模型对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteGoodsTradeModelByIds(String ids)
{
return goodsTradeModelMapper.deleteGoodsTradeModelByIds(Convert.toStrArray(ids));
}
}

View File

@ -0,0 +1,83 @@
package com.cronie.mengyu.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cronie.mengyu.mapper.MoneyPoolLogMapper;
import com.cronie.mengyu.domain.MoneyPoolLog;
import com.cronie.mengyu.service.IMoneyPoolLogService;
import com.ruoyi.common.support.Convert;
/**
* 资金池交明细 服务层实现
*
* @author cronie
* @date 2018-11-15
*/
@Service
public class MoneyPoolLogServiceImpl implements IMoneyPoolLogService
{
@Autowired
private MoneyPoolLogMapper moneyPoolLogMapper;
/**
* 查询资金池交明细信息
*
* @param billType 资金池交明细ID
* @return 资金池交明细信息
*/
@Override
public MoneyPoolLog selectMoneyPoolLogById(Integer billType)
{
return moneyPoolLogMapper.selectMoneyPoolLogById(billType);
}
/**
* 查询资金池交明细列表
*
* @param moneyPoolLog 资金池交明细信息
* @return 资金池交明细集合
*/
@Override
public List<MoneyPoolLog> selectMoneyPoolLogList(MoneyPoolLog moneyPoolLog)
{
return moneyPoolLogMapper.selectMoneyPoolLogList(moneyPoolLog);
}
/**
* 新增资金池交明细
*
* @param moneyPoolLog 资金池交明细信息
* @return 结果
*/
@Override
public int insertMoneyPoolLog(MoneyPoolLog moneyPoolLog)
{
return moneyPoolLogMapper.insertMoneyPoolLog(moneyPoolLog);
}
/**
* 修改资金池交明细
*
* @param moneyPoolLog 资金池交明细信息
* @return 结果
*/
@Override
public int updateMoneyPoolLog(MoneyPoolLog moneyPoolLog)
{
return moneyPoolLogMapper.updateMoneyPoolLog(moneyPoolLog);
}
/**
* 删除资金池交明细对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteMoneyPoolLogByIds(String ids)
{
return moneyPoolLogMapper.deleteMoneyPoolLogByIds(Convert.toStrArray(ids));
}
}

View File

@ -0,0 +1,83 @@
package com.cronie.mengyu.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cronie.mengyu.mapper.MoneyPoolMapper;
import com.cronie.mengyu.domain.MoneyPool;
import com.cronie.mengyu.service.IMoneyPoolService;
import com.ruoyi.common.support.Convert;
/**
* 资金池 服务层实现
*
* @author cronie
* @date 2018-11-15
*/
@Service
public class MoneyPoolServiceImpl implements IMoneyPoolService
{
@Autowired
private MoneyPoolMapper moneyPoolMapper;
/**
* 查询资金池信息
*
* @param creater 资金池ID
* @return 资金池信息
*/
@Override
public MoneyPool selectMoneyPoolById(Integer creater)
{
return moneyPoolMapper.selectMoneyPoolById(creater);
}
/**
* 查询资金池列表
*
* @param moneyPool 资金池信息
* @return 资金池集合
*/
@Override
public List<MoneyPool> selectMoneyPoolList(MoneyPool moneyPool)
{
return moneyPoolMapper.selectMoneyPoolList(moneyPool);
}
/**
* 新增资金池
*
* @param moneyPool 资金池信息
* @return 结果
*/
@Override
public int insertMoneyPool(MoneyPool moneyPool)
{
return moneyPoolMapper.insertMoneyPool(moneyPool);
}
/**
* 修改资金池
*
* @param moneyPool 资金池信息
* @return 结果
*/
@Override
public int updateMoneyPool(MoneyPool moneyPool)
{
return moneyPoolMapper.updateMoneyPool(moneyPool);
}
/**
* 删除资金池对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteMoneyPoolByIds(String ids)
{
return moneyPoolMapper.deleteMoneyPoolByIds(Convert.toStrArray(ids));
}
}

View File

@ -0,0 +1,83 @@
package com.cronie.mengyu.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.cronie.mengyu.mapper.YearPlanMapper;
import com.cronie.mengyu.domain.YearPlan;
import com.cronie.mengyu.service.IYearPlanService;
import com.ruoyi.common.support.Convert;
/**
* 年度计划 服务层实现
*
* @author cronie
* @date 2018-11-15
*/
@Service
public class YearPlanServiceImpl implements IYearPlanService
{
@Autowired
private YearPlanMapper yearPlanMapper;
/**
* 查询年度计划信息
*
* @param year 年度计划ID
* @return 年度计划信息
*/
@Override
public YearPlan selectYearPlanById(String year)
{
return yearPlanMapper.selectYearPlanById(year);
}
/**
* 查询年度计划列表
*
* @param yearPlan 年度计划信息
* @return 年度计划集合
*/
@Override
public List<YearPlan> selectYearPlanList(YearPlan yearPlan)
{
return yearPlanMapper.selectYearPlanList(yearPlan);
}
/**
* 新增年度计划
*
* @param yearPlan 年度计划信息
* @return 结果
*/
@Override
public int insertYearPlan(YearPlan yearPlan)
{
return yearPlanMapper.insertYearPlan(yearPlan);
}
/**
* 修改年度计划
*
* @param yearPlan 年度计划信息
* @return 结果
*/
@Override
public int updateYearPlan(YearPlan yearPlan)
{
return yearPlanMapper.updateYearPlan(yearPlan);
}
/**
* 删除年度计划对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteYearPlanByIds(String ids)
{
return yearPlanMapper.deleteYearPlanByIds(Convert.toStrArray(ids));
}
}

View File

@ -0,0 +1,117 @@
package com.cronie.mengyu.web.controller;
import java.util.Date;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
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.ResponseBody;
import com.cronie.mengyu.domain.Goods;
import com.cronie.mengyu.service.IGoodsService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.base.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.framework.web.base.BaseController;
import com.ruoyi.framework.web.page.TableDataInfo;
/**
* 投资品种 信息操作处理
*
* @author cronie
* @date 2018-11-15
*/
@Controller
@RequestMapping("/mengyu/goods")
public class GoodsController extends BaseController
{
private String prefix = "mengyu/goods";
@Autowired
private IGoodsService goodsService;
@RequiresPermissions("mengyu:goods:view")
@GetMapping()
public String goods()
{
return prefix + "/goods";
}
/**
* 查询投资品种列表
*/
@RequiresPermissions("mengyu:goods:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(Goods goods)
{
startPage();
List<Goods> list = goodsService.selectGoodsList(goods);
return getDataTable(list);
}
/**
* 新增投资品种
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存投资品种
*/
@RequiresPermissions("mengyu:goods:add")
@Log(title = "投资品种", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(Goods goods)
{
goods.setCreater(getUserId().intValue());
goods.setCreateTime(new Date());
return toAjax(goodsService.insertGoods(goods));
}
/**
* 修改投资品种
*/
@GetMapping("/edit/{code}")
public String edit(@PathVariable("code") String code, ModelMap mmap)
{
Goods goods = goodsService.selectGoodsById(code);
mmap.put("goods", goods);
return prefix + "/edit";
}
/**
* 修改保存投资品种
*/
@RequiresPermissions("mengyu:goods:edit")
@Log(title = "投资品种", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(Goods goods)
{
return toAjax(goodsService.updateGoods(goods));
}
/**
* 删除投资品种
*/
@RequiresPermissions("mengyu:goods:remove")
@Log(title = "投资品种", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(goodsService.deleteGoodsByIds(ids));
}
}

View File

@ -0,0 +1,117 @@
package com.cronie.mengyu.web.controller;
import java.util.Date;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
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.ResponseBody;
import com.cronie.mengyu.domain.GoodsTradeModel;
import com.cronie.mengyu.service.IGoodsTradeModelService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.base.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.framework.web.base.BaseController;
import com.ruoyi.framework.web.page.TableDataInfo;
/**
* 品种计划模型 信息操作处理
*
* @author cronie
* @date 2018-11-15
*/
@Controller
@RequestMapping("/mengyu/goodsTradeModel")
public class GoodsTradeModelController extends BaseController
{
private String prefix = "mengyu/goodsTradeModel";
@Autowired
private IGoodsTradeModelService goodsTradeModelService;
@RequiresPermissions("mengyu:goodsTradeModel:view")
@GetMapping()
public String goodsTradeModel()
{
return prefix + "/goodsTradeModel";
}
/**
* 查询品种计划模型列表
*/
@RequiresPermissions("mengyu:goodsTradeModel:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(GoodsTradeModel goodsTradeModel)
{
startPage();
List<GoodsTradeModel> list = goodsTradeModelService.selectGoodsTradeModelList(goodsTradeModel);
return getDataTable(list);
}
/**
* 新增品种计划模型
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存品种计划模型
*/
@RequiresPermissions("mengyu:goodsTradeModel:add")
@Log(title = "品种计划模型", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(GoodsTradeModel goodsTradeModel)
{
goodsTradeModel.setCreater(getUserId().intValue());
goodsTradeModel.setCreateTime(new Date());
return toAjax(goodsTradeModelService.insertGoodsTradeModel(goodsTradeModel));
}
/**
* 修改品种计划模型
*/
@GetMapping("/edit/{modelId}")
public String edit(@PathVariable("modelId") Integer modelId, ModelMap mmap)
{
GoodsTradeModel goodsTradeModel = goodsTradeModelService.selectGoodsTradeModelById(modelId);
mmap.put("goodsTradeModel", goodsTradeModel);
return prefix + "/edit";
}
/**
* 修改保存品种计划模型
*/
@RequiresPermissions("mengyu:goodsTradeModel:edit")
@Log(title = "品种计划模型", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(GoodsTradeModel goodsTradeModel)
{
return toAjax(goodsTradeModelService.updateGoodsTradeModel(goodsTradeModel));
}
/**
* 删除品种计划模型
*/
@RequiresPermissions("mengyu:goodsTradeModel:remove")
@Log(title = "品种计划模型", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(goodsTradeModelService.deleteGoodsTradeModelByIds(ids));
}
}

View File

@ -0,0 +1,117 @@
package com.cronie.mengyu.web.controller;
import java.util.Date;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
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.ResponseBody;
import com.cronie.mengyu.domain.GoodsTradeModelIns;
import com.cronie.mengyu.service.IGoodsTradeModelInsService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.base.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.framework.web.base.BaseController;
import com.ruoyi.framework.web.page.TableDataInfo;
/**
* 计划模型实例 信息操作处理
*
* @author cronie
* @date 2018-11-15
*/
@Controller
@RequestMapping("/mengyu/goodsTradeModelIns")
public class GoodsTradeModelInsController extends BaseController
{
private String prefix = "mengyu/goodsTradeModelIns";
@Autowired
private IGoodsTradeModelInsService goodsTradeModelInsService;
@RequiresPermissions("mengyu:goodsTradeModelIns:view")
@GetMapping()
public String goodsTradeModelIns()
{
return prefix + "/goodsTradeModelIns";
}
/**
* 查询计划模型实例列表
*/
@RequiresPermissions("mengyu:goodsTradeModelIns:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(GoodsTradeModelIns goodsTradeModelIns)
{
startPage();
List<GoodsTradeModelIns> list = goodsTradeModelInsService.selectGoodsTradeModelInsList(goodsTradeModelIns);
return getDataTable(list);
}
/**
* 新增计划模型实例
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存计划模型实例
*/
@RequiresPermissions("mengyu:goodsTradeModelIns:add")
@Log(title = "计划模型实例", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(GoodsTradeModelIns goodsTradeModelIns)
{
goodsTradeModelIns.setCreater(getUserId().intValue());
goodsTradeModelIns.setCreateTime(new Date());
return toAjax(goodsTradeModelInsService.insertGoodsTradeModelIns(goodsTradeModelIns));
}
/**
* 修改计划模型实例
*/
@GetMapping("/edit/{insId}")
public String edit(@PathVariable("insId") Integer insId, ModelMap mmap)
{
GoodsTradeModelIns goodsTradeModelIns = goodsTradeModelInsService.selectGoodsTradeModelInsById(insId);
mmap.put("goodsTradeModelIns", goodsTradeModelIns);
return prefix + "/edit";
}
/**
* 修改保存计划模型实例
*/
@RequiresPermissions("mengyu:goodsTradeModelIns:edit")
@Log(title = "计划模型实例", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(GoodsTradeModelIns goodsTradeModelIns)
{
return toAjax(goodsTradeModelInsService.updateGoodsTradeModelIns(goodsTradeModelIns));
}
/**
* 删除计划模型实例
*/
@RequiresPermissions("mengyu:goodsTradeModelIns:remove")
@Log(title = "计划模型实例", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(goodsTradeModelInsService.deleteGoodsTradeModelInsByIds(ids));
}
}

View File

@ -0,0 +1,117 @@
package com.cronie.mengyu.web.controller;
import java.util.Date;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
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.ResponseBody;
import com.cronie.mengyu.domain.GoodsTradeModelInsNode;
import com.cronie.mengyu.service.IGoodsTradeModelInsNodeService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.base.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.framework.web.base.BaseController;
import com.ruoyi.framework.web.page.TableDataInfo;
/**
* 交易计划操作 信息操作处理
*
* @author cronie
* @date 2018-11-15
*/
@Controller
@RequestMapping("/mengyu/goodsTradeModelInsNode")
public class GoodsTradeModelInsNodeController extends BaseController
{
private String prefix = "mengyu/goodsTradeModelInsNode";
@Autowired
private IGoodsTradeModelInsNodeService goodsTradeModelInsNodeService;
@RequiresPermissions("mengyu:goodsTradeModelInsNode:view")
@GetMapping()
public String goodsTradeModelInsNode()
{
return prefix + "/goodsTradeModelInsNode";
}
/**
* 查询交易计划操作列表
*/
@RequiresPermissions("mengyu:goodsTradeModelInsNode:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(GoodsTradeModelInsNode goodsTradeModelInsNode)
{
startPage();
List<GoodsTradeModelInsNode> list = goodsTradeModelInsNodeService.selectGoodsTradeModelInsNodeList(goodsTradeModelInsNode);
return getDataTable(list);
}
/**
* 新增交易计划操作
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存交易计划操作
*/
@RequiresPermissions("mengyu:goodsTradeModelInsNode:add")
@Log(title = "交易计划操作", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(GoodsTradeModelInsNode goodsTradeModelInsNode)
{
goodsTradeModelInsNode.setCreater(getUserId().intValue());
goodsTradeModelInsNode.setCreateTime(new Date());
return toAjax(goodsTradeModelInsNodeService.insertGoodsTradeModelInsNode(goodsTradeModelInsNode));
}
/**
* 修改交易计划操作
*/
@GetMapping("/edit/{nodeId}")
public String edit(@PathVariable("nodeId") Integer nodeId, ModelMap mmap)
{
GoodsTradeModelInsNode goodsTradeModelInsNode = goodsTradeModelInsNodeService.selectGoodsTradeModelInsNodeById(nodeId);
mmap.put("goodsTradeModelInsNode", goodsTradeModelInsNode);
return prefix + "/edit";
}
/**
* 修改保存交易计划操作
*/
@RequiresPermissions("mengyu:goodsTradeModelInsNode:edit")
@Log(title = "交易计划操作", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(GoodsTradeModelInsNode goodsTradeModelInsNode)
{
return toAjax(goodsTradeModelInsNodeService.updateGoodsTradeModelInsNode(goodsTradeModelInsNode));
}
/**
* 删除交易计划操作
*/
@RequiresPermissions("mengyu:goodsTradeModelInsNode:remove")
@Log(title = "交易计划操作", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(goodsTradeModelInsNodeService.deleteGoodsTradeModelInsNodeByIds(ids));
}
}

View File

@ -0,0 +1,117 @@
package com.cronie.mengyu.web.controller;
import java.util.Date;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
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.ResponseBody;
import com.cronie.mengyu.domain.MoneyPool;
import com.cronie.mengyu.service.IMoneyPoolService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.base.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.framework.web.base.BaseController;
import com.ruoyi.framework.web.page.TableDataInfo;
/**
* 资金池 信息操作处理
*
* @author cronie
* @date 2018-11-15
*/
@Controller
@RequestMapping("/mengyu/moneyPool")
public class MoneyPoolController extends BaseController
{
private String prefix = "mengyu/moneyPool";
@Autowired
private IMoneyPoolService moneyPoolService;
@RequiresPermissions("mengyu:moneyPool:view")
@GetMapping()
public String moneyPool()
{
return prefix + "/moneyPool";
}
/**
* 查询资金池列表
*/
@RequiresPermissions("mengyu:moneyPool:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(MoneyPool moneyPool)
{
startPage();
List<MoneyPool> list = moneyPoolService.selectMoneyPoolList(moneyPool);
return getDataTable(list);
}
/**
* 新增资金池
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存资金池
*/
@RequiresPermissions("mengyu:moneyPool:add")
@Log(title = "资金池", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(MoneyPool moneyPool)
{
moneyPool.setCreater(getUserId().intValue());
moneyPool.setCreateTime(new Date());
return toAjax(moneyPoolService.insertMoneyPool(moneyPool));
}
/**
* 修改资金池
*/
@GetMapping("/edit/{creater}")
public String edit(@PathVariable("creater") Integer creater, ModelMap mmap)
{
MoneyPool moneyPool = moneyPoolService.selectMoneyPoolById(creater);
mmap.put("moneyPool", moneyPool);
return prefix + "/edit";
}
/**
* 修改保存资金池
*/
@RequiresPermissions("mengyu:moneyPool:edit")
@Log(title = "资金池", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(MoneyPool moneyPool)
{
return toAjax(moneyPoolService.updateMoneyPool(moneyPool));
}
/**
* 删除资金池
*/
@RequiresPermissions("mengyu:moneyPool:remove")
@Log(title = "资金池", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(moneyPoolService.deleteMoneyPoolByIds(ids));
}
}

View File

@ -0,0 +1,116 @@
package com.cronie.mengyu.web.controller;
import java.util.Date;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
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.ResponseBody;
import com.cronie.mengyu.domain.MoneyPoolLog;
import com.cronie.mengyu.service.IMoneyPoolLogService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.base.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.framework.web.base.BaseController;
import com.ruoyi.framework.web.page.TableDataInfo;
/**
* 资金池交明细 信息操作处理
*
* @author cronie
* @date 2018-11-15
*/
@Controller
@RequestMapping("/mengyu/moneyPoolLog")
public class MoneyPoolLogController extends BaseController
{
private String prefix = "mengyu/moneyPoolLog";
@Autowired
private IMoneyPoolLogService moneyPoolLogService;
@RequiresPermissions("mengyu:moneyPoolLog:view")
@GetMapping()
public String moneyPoolLog()
{
return prefix + "/moneyPoolLog";
}
/**
* 查询资金池交明细列表
*/
@RequiresPermissions("mengyu:moneyPoolLog:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(MoneyPoolLog moneyPoolLog)
{
startPage();
List<MoneyPoolLog> list = moneyPoolLogService.selectMoneyPoolLogList(moneyPoolLog);
return getDataTable(list);
}
/**
* 新增资金池交明细
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存资金池交明细
*/
@RequiresPermissions("mengyu:moneyPoolLog:add")
@Log(title = "资金池交明细", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(MoneyPoolLog moneyPoolLog)
{
moneyPoolLog.setCreateTime(new Date());
return toAjax(moneyPoolLogService.insertMoneyPoolLog(moneyPoolLog));
}
/**
* 修改资金池交明细
*/
@GetMapping("/edit/{billType}")
public String edit(@PathVariable("billType") Integer billType, ModelMap mmap)
{
MoneyPoolLog moneyPoolLog = moneyPoolLogService.selectMoneyPoolLogById(billType);
mmap.put("moneyPoolLog", moneyPoolLog);
return prefix + "/edit";
}
/**
* 修改保存资金池交明细
*/
@RequiresPermissions("mengyu:moneyPoolLog:edit")
@Log(title = "资金池交明细", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(MoneyPoolLog moneyPoolLog)
{
return toAjax(moneyPoolLogService.updateMoneyPoolLog(moneyPoolLog));
}
/**
* 删除资金池交明细
*/
@RequiresPermissions("mengyu:moneyPoolLog:remove")
@Log(title = "资金池交明细", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(moneyPoolLogService.deleteMoneyPoolLogByIds(ids));
}
}

View File

@ -0,0 +1,43 @@
package com.cronie.mengyu.web.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import com.cronie.mengyu.common.goods.ActualTimeGoods;
import com.cronie.mengyu.common.goods.LoadGoodsInfoFactory;
import com.cronie.mengyu.common.goods.ILoadGoodsInfo;
import com.ruoyi.framework.web.base.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@Api(value = "MengYu常用接口", description = "MengYu常用接口")
@Controller
@RequestMapping("/trade/common")
public class TradeCommonController extends BaseController {
@Autowired
LoadGoodsInfoFactory loadGoodsInfoFactory ;
/**
* 查询商品实时信息
*/
@ApiOperation(value = "实时查询品种代码基本信息", notes = "实时查询品种代码基本信息", httpMethod = "GET")
@ResponseBody
@RequestMapping("/loadGoodsInfo")
public ActualTimeGoods loadGoodsInfo(
@ApiParam(value = "品种代码,必填项") @RequestParam(value = "code", required = true, defaultValue = "000001")
String code)
{
ILoadGoodsInfo loadGoodsInfoInterface = loadGoodsInfoFactory.getLoadGoodsInfoInstance() ;
ActualTimeGoods goodsInfo = loadGoodsInfoInterface.loadGoodsInfo(code) ;
return goodsInfo;
}
}

View File

@ -0,0 +1,117 @@
package com.cronie.mengyu.web.controller;
import java.util.Date;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
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.ResponseBody;
import com.cronie.mengyu.domain.YearPlan;
import com.cronie.mengyu.service.IYearPlanService;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.base.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.framework.web.base.BaseController;
import com.ruoyi.framework.web.page.TableDataInfo;
/**
* 年度计划 信息操作处理
*
* @author cronie
* @date 2018-11-15
*/
@Controller
@RequestMapping("/mengyu/yearPlan")
public class YearPlanController extends BaseController
{
private String prefix = "mengyu/yearPlan";
@Autowired
private IYearPlanService yearPlanService;
@RequiresPermissions("mengyu:yearPlan:view")
@GetMapping()
public String yearPlan()
{
return prefix + "/yearPlan";
}
/**
* 查询年度计划列表
*/
@RequiresPermissions("mengyu:yearPlan:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(YearPlan yearPlan)
{
startPage();
List<YearPlan> list = yearPlanService.selectYearPlanList(yearPlan);
return getDataTable(list);
}
/**
* 新增年度计划
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存年度计划
*/
@RequiresPermissions("mengyu:yearPlan:add")
@Log(title = "年度计划", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(YearPlan yearPlan)
{
yearPlan.setCreater(getUserId().intValue());
yearPlan.setCreateTime(new Date());
return toAjax(yearPlanService.insertYearPlan(yearPlan));
}
/**
* 修改年度计划
*/
@GetMapping("/edit/{year}")
public String edit(@PathVariable("year") String year, ModelMap mmap)
{
YearPlan yearPlan = yearPlanService.selectYearPlanById(year);
mmap.put("yearPlan", yearPlan);
return prefix + "/edit";
}
/**
* 修改保存年度计划
*/
@RequiresPermissions("mengyu:yearPlan:edit")
@Log(title = "年度计划", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(YearPlan yearPlan)
{
return toAjax(yearPlanService.updateYearPlan(yearPlan));
}
/**
* 删除年度计划
*/
@RequiresPermissions("mengyu:yearPlan:remove")
@Log(title = "年度计划", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(yearPlanService.deleteYearPlanByIds(ids));
}
}

View File

@ -0,0 +1,48 @@
# 数据源配置
spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driverClassName: com.mysql.jdbc.Driver
druid:
# 主库数据源
master:
url: jdbc:mysql://localhost:3306/mengyu?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true
username: root
password: longshine
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: false
url:
username:
password:
# 初始连接数
initial-size: 10
# 最大连接池数量
max-active: 100
# 最小连接池数量
min-idle: 10
# 配置获取连接等待超时的时间
max-wait: 60000
# 打开PSCache并且指定每个连接上PSCache的大小
pool-prepared-statements: true
max-pool-prepared-statement-per-connection-size: 20
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
min-evictable-idle-time-millis: 300000
validation-query: SELECT 1 FROM DUAL
test-while-idle: true
test-on-borrow: false
test-on-return: false
stat-view-servlet:
enabled: true
url-pattern: /monitor/druid/*
filter:
stat:
log-slow-sql: true
slow-sql-millis: 1000
merge-sql: false
wall:
config:
multi-statement-allow: true

View File

@ -0,0 +1,134 @@
# 项目相关配置
ruoyi:
# 名称
name: cronie
# 版本
version: 3.0.0
# 版权年份
copyrightYear: 2018
# 文件上传路径
profile: D:/profile/
# 获取ip地址开关
addressEnabled: true
# 开发环境配置
server:
# 服务端口
port: 80
servlet:
# 项目contextPath
context-path: /
tomcat:
# tomcat的URI编码
uri-encoding: UTF-8
# tomcat最大线程数默认为200
max-threads: 800
# Tomcat启动初始化的线程数默认值25
min-spare-threads: 30
# 日志配置
logging:
level:
com.ruoyi: debug
org.springframework: WARN
org.spring.springboot.dao: debug
# 用户配置
user:
password:
# 密码错误{maxRetryCount}次锁定10分钟
maxRetryCount: 5
# Spring配置
spring:
# 模板引擎
thymeleaf:
mode: HTML
encoding: utf-8
# 禁用缓存
cache: false
# 资源信息
messages:
# 国际化资源文件路径
basename: i18n/messages
jackson:
time-zone: GMT+8
date-format: yyyy-MM-dd HH:mm:ss
profiles:
active: druid
# 文件上传
servlet:
multipart:
max-file-size: 30MB
max-request-size: 30MB
# 服务模块
devtools:
restart:
# 热部署开关
enabled: true
# MyBatis
mybatis:
# 搜索指定包别名
typeAliasesPackage: com.ruoyi,com.cronie.mengyu
# 配置mapper的扫描找到所有的mapper.xml映射文件
mapperLocations: classpath*:mapper/**/*Mapper.xml
# 加载全局的配置文件
configLocation: classpath:mapper/mybatis-config.xml
# PageHelper分页插件
pagehelper:
helperDialect: mysql
reasonable: true
supportMethodsArguments: true
params: count=countSql
# Shiro
shiro:
user:
# 登录地址
loginUrl: /login
# 权限认证失败地址
unauthorizedUrl: /unauth
# 首页地址
indexUrl: /index
# 验证码开关
captchaEnabled: true
# 验证码类型 math 数组计算 char 字符
captchaType: math
cookie:
# 设置Cookie的域名 默认空,即当前访问的域名
domain:
# 设置cookie的有效访问路径
path: /
# 设置HttpOnly属性
httpOnly: true
# 设置Cookie的过期时间天为单位
maxAge: 30
session:
# Session超时时间默认30分钟
expireTime: 30
# 同步session到数据库的周期默认1分钟
dbSyncPeriod: 1
# 相隔多久检查一次session的有效性默认就是10分钟
validationInterval: 10
# 防止XSS攻击
xss:
# 过滤开关
enabled: true
# 排除链接(多个用逗号分隔)
excludes: /system/notice/*
# 匹配链接
urlPatterns: /system/*,/monitor/*,/tool/*
# 代码生成
gen:
# 作者
author: cronie
# 默认生成包路径 module 需改成自己的模块名称 如 system monitor tool
packageName: com.cronie.mengyu
# 自动去除表前缀默认是true
autoRemovePre: true
# 表前缀(类名不会包含表前缀)
tablePrefix: sys_

View File

@ -0,0 +1,24 @@
Application Version: ${ruoyi.version}
Spring Boot Version: ${spring-boot.version}
////////////////////////////////////////////////////////////////////
// _ooOoo_ //
// o8888888o //
// 88" . "88 //
// (| ^_^ |) //
// O\ = /O //
// ____/`---'\____ //
// .' \\| |// `. //
// / \\||| : |||// \ //
// / _||||| -:- |||||- \ //
// | | \\\ - /// | | //
// | \_| ''\---/'' | | //
// \ .-\__ `-` ___/-. / //
// ___`. .' /--.--\ `. . ___ //
// ."" '< `.___\_<|>_/___.' >'"". //
// | | : `- \`.;`\ _ /`;.`/ - ` : | | //
// \ \ `-. \_ __\ /__ _/ .-` / / //
// ========`-.____`-.___\_____/___.-`____.-'======== //
// `=---=' //
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //
// 佛祖保佑 永不宕机 永无BUG //
////////////////////////////////////////////////////////////////////

View File

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property name="log.path" value="/home/ruoyi/logs" />
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
<!-- 控制台输出 -->
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 系统日志输出 -->
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-info.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 按天回滚 daily -->
<fileNamePattern>${log.path}/sys-info.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>INFO</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-error.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/sys-error.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 用户访问日志输出 -->
<appender name="sys-user" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.path}/sys-user.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 按天回滚 daily -->
<fileNamePattern>${log.path}/sys-user.%d{yyyy-MM-dd}.log</fileNamePattern>
<!-- 日志最大的历史 60天 -->
<maxHistory>60</maxHistory>
</rollingPolicy>
<encoder>
<pattern>${log.pattern}</pattern>
</encoder>
</appender>
<!-- 显示形成的sql、使用的参数、结果集 -->
<!--
<logger name="java.sql" level="debug" />
<logger name="org.springframework.jdbc" level="debug" />
-->
<logger name="com.ruoyi" level="info" />
<root level="info">
<appender-ref ref="console" />
</root>
<!--系统操作日志-->
<root level="info">
<appender-ref ref="file_info" />
<appender-ref ref="file_error" />
</root>
<!--系统用户操作日志-->
<logger name="sys-user" level="info">
<appender-ref ref="sys-user"/>
</logger>
</configuration>

View File

@ -0,0 +1,6 @@
sender.mail.host=smtp.163.com
sender.mail.port=25
sender.mail.userName=jonw000@163.com
sender.mail.passWord=102204308
sender.mail.smtp.auth=true
sender.mail.smtp.timeout=25000

View File

@ -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.cronie.mengyu.mapper.GoodsMapper">
<resultMap type="Goods" id="GoodsResult">
<result property="code" column="code" />
<result property="name" column="name" />
<result property="codeType" column="code_type" />
<result property="industryType" column="industry_type" />
<result property="plateType" column="plate_type" />
<result property="creater" column="creater" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectGoodsVo">
select code, name, code_type, industry_type, plate_type, creater, create_time from my_goods
</sql>
<select id="selectGoodsList" parameterType="Goods" resultMap="GoodsResult">
<include refid="selectGoodsVo"/>
<where>
<if test="code != null and code != '' "> and code = #{code}</if>
<if test="name != null and name != '' "> and name = #{name}</if>
<if test="codeType != null "> and code_type = #{codeType}</if>
<if test="industryType != null "> and industry_type = #{industryType}</if>
<if test="plateType != null "> and plate_type = #{plateType}</if>
<if test="creater != null "> and creater = #{creater}</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
</where>
</select>
<select id="selectGoodsById" parameterType="String" resultMap="GoodsResult">
<include refid="selectGoodsVo"/>
where code = #{code}
</select>
<insert id="insertGoods" parameterType="Goods">
insert into my_goods
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="code != null and code != '' ">code,</if>
<if test="name != null and name != '' ">name,</if>
<if test="codeType != null ">code_type,</if>
<if test="industryType != null ">industry_type,</if>
<if test="plateType != null ">plate_type,</if>
<if test="creater != null ">creater,</if>
<if test="createTime != null ">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="code != null and code != '' ">#{code},</if>
<if test="name != null and name != '' ">#{name},</if>
<if test="codeType != null ">#{codeType},</if>
<if test="industryType != null ">#{industryType},</if>
<if test="plateType != null ">#{plateType},</if>
<if test="creater != null ">#{creater},</if>
<if test="createTime != null ">#{createTime},</if>
</trim>
</insert>
<update id="updateGoods" parameterType="Goods">
update my_goods
<trim prefix="SET" suffixOverrides=",">
<if test="name != null and name != '' ">name = #{name},</if>
<if test="codeType != null ">code_type = #{codeType},</if>
<if test="industryType != null ">industry_type = #{industryType},</if>
<if test="plateType != null ">plate_type = #{plateType},</if>
<if test="creater != null ">creater = #{creater},</if>
<if test="createTime != null ">create_time = #{createTime},</if>
</trim>
where code = #{code}
</update>
<delete id="deleteGoodsById" parameterType="String">
delete from my_goods where code = #{code}
</delete>
<delete id="deleteGoodsByIds" parameterType="String">
delete from my_goods where code in
<foreach item="code" collection="array" open="(" separator="," close=")">
#{code}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,80 @@
<?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.cronie.mengyu.mapper.GoodsTradeModelInsMapper">
<resultMap type="GoodsTradeModelIns" id="GoodsTradeModelInsResult">
<result property="insId" column="ins_id" />
<result property="modelId" column="model_id" />
<result property="insStatus" column="ins_status" />
<result property="creater" column="creater" />
<result property="createTime" column="create_time" />
<result property="hasMailNotice" column="has_mail_notice" />
</resultMap>
<sql id="selectGoodsTradeModelInsVo">
select ins_id, model_id, ins_status, creater, create_time,has_mail_notice from my_goods_trade_model_ins
</sql>
<select id="selectGoodsTradeModelInsList" parameterType="GoodsTradeModelIns" resultMap="GoodsTradeModelInsResult">
<include refid="selectGoodsTradeModelInsVo"/>
<where>
<if test="insId != null "> and ins_id = #{insId}</if>
<if test="modelId != null "> and model_id = #{modelId}</if>
<if test="insStatus != null "> and ins_status = #{insStatus}</if>
<if test="creater != null "> and creater = #{creater}</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="hasMailNotice != null "> and has_mail_notice = #{hasMailNotice}</if>
</where>
</select>
<select id="selectGoodsTradeModelInsById" parameterType="Integer" resultMap="GoodsTradeModelInsResult">
<include refid="selectGoodsTradeModelInsVo"/>
where ins_id = #{insId}
</select>
<insert id="insertGoodsTradeModelIns" parameterType="GoodsTradeModelIns">
insert into my_goods_trade_model_ins
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="insId != null ">ins_id,</if>
<if test="modelId != null ">model_id,</if>
<if test="insStatus != null ">ins_status,</if>
<if test="creater != null ">creater,</if>
<if test="createTime != null ">create_time,</if>
<if test="hasMailNotice != null "> #{hasMailNotice},</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="insId != null ">#{insId},</if>
<if test="modelId != null ">#{modelId},</if>
<if test="insStatus != null ">#{insStatus},</if>
<if test="creater != null ">#{creater},</if>
<if test="createTime != null ">#{createTime},</if>
<if test="hasMailNotice != null ">#{hasMailNotice},</if>
</trim>
</insert>
<update id="updateGoodsTradeModelIns" parameterType="GoodsTradeModelIns">
update my_goods_trade_model_ins
<trim prefix="SET" suffixOverrides=",">
<if test="modelId != null ">model_id = #{modelId},</if>
<if test="insStatus != null ">ins_status = #{insStatus},</if>
<if test="creater != null ">creater = #{creater},</if>
<if test="createTime != null ">create_time = #{createTime},</if>
<if test="hasMailNotice != null ">has_mail_notice = #{hasMailNotice},</if>
</trim>
where ins_id = #{insId}
</update>
<delete id="deleteGoodsTradeModelInsById" parameterType="Integer">
delete from my_goods_trade_model_ins where ins_id = #{insId}
</delete>
<delete id="deleteGoodsTradeModelInsByIds" parameterType="String">
delete from my_goods_trade_model_ins where ins_id in
<foreach item="insId" collection="array" open="(" separator="," close=")">
#{insId}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,95 @@
<?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.cronie.mengyu.mapper.GoodsTradeModelInsNodeMapper">
<resultMap type="GoodsTradeModelInsNode" id="GoodsTradeModelInsNodeResult">
<result property="nodeId" column="node_id" />
<result property="insId" column="ins_id" />
<result property="price" column="price" />
<result property="volumes" column="volumes" />
<result property="tradeTime" column="trade_time" />
<result property="creater" column="creater" />
<result property="createTime" column="create_time" />
<result property="tradeType" column="trade_type" />
<result property="tradeNote" column="trade_note" />
</resultMap>
<sql id="selectGoodsTradeModelInsNodeVo">
select node_id, ins_id, price, volumes, trade_time, creater, create_time, trade_type, trade_note from my_goods_trade_model_ins_node
</sql>
<select id="selectGoodsTradeModelInsNodeList" parameterType="GoodsTradeModelInsNode" resultMap="GoodsTradeModelInsNodeResult">
<include refid="selectGoodsTradeModelInsNodeVo"/>
<where>
<if test="nodeId != null "> and node_id = #{nodeId}</if>
<if test="insId != null "> and ins_id = #{insId}</if>
<if test="price != null "> and price = #{price}</if>
<if test="volumes != null "> and volumes = #{volumes}</if>
<if test="tradeTime != null "> and trade_time = #{tradeTime}</if>
<if test="creater != null "> and creater = #{creater}</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="tradeType != null "> and trade_type = #{tradeType}</if>
<if test="tradeNote != null and tradeNote != '' "> and trade_note = #{tradeNote}</if>
</where>
</select>
<select id="selectGoodsTradeModelInsNodeById" parameterType="Integer" resultMap="GoodsTradeModelInsNodeResult">
<include refid="selectGoodsTradeModelInsNodeVo"/>
where node_id = #{nodeId}
</select>
<insert id="insertGoodsTradeModelInsNode" parameterType="GoodsTradeModelInsNode">
insert into my_goods_trade_model_ins_node
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="nodeId != null ">node_id,</if>
<if test="insId != null ">ins_id,</if>
<if test="price != null ">price,</if>
<if test="volumes != null ">volumes,</if>
<if test="tradeTime != null ">trade_time,</if>
<if test="creater != null ">creater,</if>
<if test="createTime != null ">create_time,</if>
<if test="tradeType != null ">trade_type,</if>
<if test="tradeNote != null and tradeNote != '' ">trade_note,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="nodeId != null ">#{nodeId},</if>
<if test="insId != null ">#{insId},</if>
<if test="price != null ">#{price},</if>
<if test="volumes != null ">#{volumes},</if>
<if test="tradeTime != null ">#{tradeTime},</if>
<if test="creater != null ">#{creater},</if>
<if test="createTime != null ">#{createTime},</if>
<if test="tradeType != null ">#{tradeType},</if>
<if test="tradeNote != null and tradeNote != '' ">#{tradeNote},</if>
</trim>
</insert>
<update id="updateGoodsTradeModelInsNode" parameterType="GoodsTradeModelInsNode">
update my_goods_trade_model_ins_node
<trim prefix="SET" suffixOverrides=",">
<if test="insId != null ">ins_id = #{insId},</if>
<if test="price != null ">price = #{price},</if>
<if test="volumes != null ">volumes = #{volumes},</if>
<if test="tradeTime != null ">trade_time = #{tradeTime},</if>
<if test="creater != null ">creater = #{creater},</if>
<if test="createTime != null ">create_time = #{createTime},</if>
<if test="tradeType != null ">trade_type = #{tradeType},</if>
<if test="tradeNote != null and tradeNote != '' ">trade_note = #{tradeNote},</if>
</trim>
where node_id = #{nodeId}
</update>
<delete id="deleteGoodsTradeModelInsNodeById" parameterType="Integer">
delete from my_goods_trade_model_ins_node where node_id = #{nodeId}
</delete>
<delete id="deleteGoodsTradeModelInsNodeByIds" parameterType="String">
delete from my_goods_trade_model_ins_node where node_id in
<foreach item="nodeId" collection="array" open="(" separator="," close=")">
#{nodeId}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,100 @@
<?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.cronie.mengyu.mapper.GoodsTradeModelMapper">
<resultMap type="GoodsTradeModel" id="GoodsTradeModelResult">
<result property="modelId" column="model_id" />
<result property="code" column="code" />
<result property="basicVolumes" column="basic_volumes" />
<result property="modelStatus" column="model_status" />
<result property="buildingPrice" column="building_price" />
<result property="exitPrice" column="exit_price" />
<result property="stopPrice" column="stop_price" />
<result property="creater" column="creater" />
<result property="createTime" column="create_time" />
<result property="hasMailNotice" column="has_mail_notice" />
</resultMap>
<sql id="selectGoodsTradeModelVo">
select model_id, code, basic_volumes, model_status, building_price, exit_price, stop_price, creater, create_time,has_mail_notice from my_goods_trade_model
</sql>
<select id="selectGoodsTradeModelList" parameterType="GoodsTradeModel" resultMap="GoodsTradeModelResult">
<include refid="selectGoodsTradeModelVo"/>
<where>
<if test="modelId != null "> and model_id = #{modelId}</if>
<if test="code != null and code != '' "> and code = #{code}</if>
<if test="basicVolumes != null "> and basic_volumes = #{basicVolumes}</if>
<if test="modelStatus != null "> and model_status = #{modelStatus}</if>
<if test="buildingPrice != null "> and building_price = #{buildingPrice}</if>
<if test="exitPrice != null "> and exit_price = #{exitPrice}</if>
<if test="stopPrice != null "> and stop_price = #{stopPrice}</if>
<if test="creater != null "> and creater = #{creater}</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="hasMailNotice != null "> and has_mail_notice = #{hasMailNotice}</if>
</where>
</select>
<select id="selectGoodsTradeModelById" parameterType="Integer" resultMap="GoodsTradeModelResult">
<include refid="selectGoodsTradeModelVo"/>
where model_id = #{modelId}
</select>
<insert id="insertGoodsTradeModel" parameterType="GoodsTradeModel">
insert into my_goods_trade_model
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="modelId != null ">model_id,</if>
<if test="code != null and code != '' ">code,</if>
<if test="basicVolumes != null ">basic_volumes,</if>
<if test="modelStatus != null ">model_status,</if>
<if test="buildingPrice != null ">building_price,</if>
<if test="exitPrice != null ">exit_price,</if>
<if test="stopPrice != null ">stop_price,</if>
<if test="creater != null ">creater,</if>
<if test="createTime != null ">create_time,</if>
<if test="hasMailNotice != null "> #{hasMailNotice},</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="modelId != null ">#{modelId},</if>
<if test="code != null and code != '' ">#{code},</if>
<if test="basicVolumes != null ">#{basicVolumes},</if>
<if test="modelStatus != null ">#{modelStatus},</if>
<if test="buildingPrice != null ">#{buildingPrice},</if>
<if test="exitPrice != null ">#{exitPrice},</if>
<if test="stopPrice != null ">#{stopPrice},</if>
<if test="creater != null ">#{creater},</if>
<if test="createTime != null ">#{createTime},</if>
<if test="hasMailNotice != null "> #{hasMailNotice},</if>
</trim>
</insert>
<update id="updateGoodsTradeModel" parameterType="GoodsTradeModel">
update my_goods_trade_model
<trim prefix="SET" suffixOverrides=",">
<if test="code != null and code != '' ">code = #{code},</if>
<if test="basicVolumes != null ">basic_volumes = #{basicVolumes},</if>
<if test="modelStatus != null ">model_status = #{modelStatus},</if>
<if test="buildingPrice != null ">building_price = #{buildingPrice},</if>
<if test="exitPrice != null ">exit_price = #{exitPrice},</if>
<if test="stopPrice != null ">stop_price = #{stopPrice},</if>
<if test="creater != null ">creater = #{creater},</if>
<if test="createTime != null ">create_time = #{createTime},</if>
<if test="hasMailNotice != null ">has_mail_notice = #{hasMailNotice},</if>
</trim>
where model_id = #{modelId}
</update>
<delete id="deleteGoodsTradeModelById" parameterType="Integer">
delete from my_goods_trade_model where model_id = #{modelId}
</delete>
<delete id="deleteGoodsTradeModelByIds" parameterType="String">
delete from my_goods_trade_model where model_id in
<foreach item="modelId" collection="array" open="(" separator="," close=")">
#{modelId}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,75 @@
<?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.cronie.mengyu.mapper.MoneyPoolLogMapper">
<resultMap type="MoneyPoolLog" id="MoneyPoolLogResult">
<result property="billType" column="bill_type" />
<result property="moneyPoolLog" column="money_pool_log" />
<result property="trademMoney" column="tradem_money" />
<result property="moneyPoolId" column="money_pool_id" />
<result property="nodeId" column="node_id" />
</resultMap>
<sql id="selectMoneyPoolLogVo">
select bill_type, money_pool_log, tradem_money, money_pool_id, node_id from my_money_pool_log
</sql>
<select id="selectMoneyPoolLogList" parameterType="MoneyPoolLog" resultMap="MoneyPoolLogResult">
<include refid="selectMoneyPoolLogVo"/>
<where>
<if test="billType != null "> and bill_type = #{billType}</if>
<if test="moneyPoolLog != null "> and money_pool_log = #{moneyPoolLog}</if>
<if test="trademMoney != null "> and tradem_money = #{trademMoney}</if>
<if test="moneyPoolId != null "> and money_pool_id = #{moneyPoolId}</if>
<if test="nodeId != null "> and node_id = #{nodeId}</if>
</where>
</select>
<select id="selectMoneyPoolLogById" parameterType="Integer" resultMap="MoneyPoolLogResult">
<include refid="selectMoneyPoolLogVo"/>
where bill_type = #{billType}
</select>
<insert id="insertMoneyPoolLog" parameterType="MoneyPoolLog">
insert into my_money_pool_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="billType != null ">bill_type,</if>
<if test="moneyPoolLog != null ">money_pool_log,</if>
<if test="trademMoney != null ">tradem_money,</if>
<if test="moneyPoolId != null ">money_pool_id,</if>
<if test="nodeId != null ">node_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="billType != null ">#{billType},</if>
<if test="moneyPoolLog != null ">#{moneyPoolLog},</if>
<if test="trademMoney != null ">#{trademMoney},</if>
<if test="moneyPoolId != null ">#{moneyPoolId},</if>
<if test="nodeId != null ">#{nodeId},</if>
</trim>
</insert>
<update id="updateMoneyPoolLog" parameterType="MoneyPoolLog">
update my_money_pool_log
<trim prefix="SET" suffixOverrides=",">
<if test="moneyPoolLog != null ">money_pool_log = #{moneyPoolLog},</if>
<if test="trademMoney != null ">tradem_money = #{trademMoney},</if>
<if test="moneyPoolId != null ">money_pool_id = #{moneyPoolId},</if>
<if test="nodeId != null ">node_id = #{nodeId},</if>
</trim>
where bill_type = #{billType}
</update>
<delete id="deleteMoneyPoolLogById" parameterType="Integer">
delete from my_money_pool_log where bill_type = #{billType}
</delete>
<delete id="deleteMoneyPoolLogByIds" parameterType="String">
delete from my_money_pool_log where bill_type in
<foreach item="billType" collection="array" open="(" separator="," close=")">
#{billType}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,70 @@
<?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.cronie.mengyu.mapper.MoneyPoolMapper">
<resultMap type="MoneyPool" id="MoneyPoolResult">
<result property="creater" column="creater" />
<result property="createTime" column="create_time" />
<result property="moneyPool" column="money_pool" />
<result property="moneyPoolId" column="money_pool_id" />
</resultMap>
<sql id="selectMoneyPoolVo">
select creater, create_time, money_pool, money_pool_id from my_money_pool
</sql>
<select id="selectMoneyPoolList" parameterType="MoneyPool" resultMap="MoneyPoolResult">
<include refid="selectMoneyPoolVo"/>
<where>
<if test="creater != null "> and creater = #{creater}</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="moneyPool != null "> and money_pool = #{moneyPool}</if>
<if test="moneyPoolId != null "> and money_pool_id = #{moneyPoolId}</if>
</where>
</select>
<select id="selectMoneyPoolById" parameterType="Integer" resultMap="MoneyPoolResult">
<include refid="selectMoneyPoolVo"/>
where creater = #{creater}
</select>
<insert id="insertMoneyPool" parameterType="MoneyPool">
insert into my_money_pool
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="creater != null ">creater,</if>
<if test="createTime != null ">create_time,</if>
<if test="moneyPool != null ">money_pool,</if>
<if test="moneyPoolId != null ">money_pool_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="creater != null ">#{creater},</if>
<if test="createTime != null ">#{createTime},</if>
<if test="moneyPool != null ">#{moneyPool},</if>
<if test="moneyPoolId != null ">#{moneyPoolId},</if>
</trim>
</insert>
<update id="updateMoneyPool" parameterType="MoneyPool">
update my_money_pool
<trim prefix="SET" suffixOverrides=",">
<if test="createTime != null ">create_time = #{createTime},</if>
<if test="moneyPool != null ">money_pool = #{moneyPool},</if>
<if test="moneyPoolId != null ">money_pool_id = #{moneyPoolId},</if>
</trim>
where creater = #{creater}
</update>
<delete id="deleteMoneyPoolById" parameterType="Integer">
delete from my_money_pool where creater = #{creater}
</delete>
<delete id="deleteMoneyPoolByIds" parameterType="String">
delete from my_money_pool where creater in
<foreach item="creater" collection="array" open="(" separator="," close=")">
#{creater}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,80 @@
<?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.cronie.mengyu.mapper.YearPlanMapper">
<resultMap type="YearPlan" id="YearPlanResult">
<result property="year" column="year" />
<result property="profit" column="profit" />
<result property="planStatus" column="plan_status" />
<result property="taskStatus" column="task_status" />
<result property="createTime" column="create_time" />
<result property="creater" column="creater" />
</resultMap>
<sql id="selectYearPlanVo">
select year, profit, plan_status, task_status, create_time, creater from my_year_plan
</sql>
<select id="selectYearPlanList" parameterType="YearPlan" resultMap="YearPlanResult">
<include refid="selectYearPlanVo"/>
<where>
<if test="year != null and year != '' "> and year = #{year}</if>
<if test="profit != null "> and profit = #{profit}</if>
<if test="planStatus != null "> and plan_status = #{planStatus}</if>
<if test="taskStatus != null "> and task_status = #{taskStatus}</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<if test="creater != null "> and creater = #{creater}</if>
</where>
</select>
<select id="selectYearPlanById" parameterType="String" resultMap="YearPlanResult">
<include refid="selectYearPlanVo"/>
where year = #{year}
</select>
<insert id="insertYearPlan" parameterType="YearPlan">
insert into my_year_plan
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="year != null and year != '' ">year,</if>
<if test="profit != null ">profit,</if>
<if test="planStatus != null ">plan_status,</if>
<if test="taskStatus != null ">task_status,</if>
<if test="createTime != null ">create_time,</if>
<if test="creater != null ">creater,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="year != null and year != '' ">#{year},</if>
<if test="profit != null ">#{profit},</if>
<if test="planStatus != null ">#{planStatus},</if>
<if test="taskStatus != null ">#{taskStatus},</if>
<if test="createTime != null ">#{createTime},</if>
<if test="creater != null ">#{creater},</if>
</trim>
</insert>
<update id="updateYearPlan" parameterType="YearPlan">
update my_year_plan
<trim prefix="SET" suffixOverrides=",">
<if test="profit != null ">profit = #{profit},</if>
<if test="planStatus != null ">plan_status = #{planStatus},</if>
<if test="taskStatus != null ">task_status = #{taskStatus},</if>
<if test="createTime != null ">create_time = #{createTime},</if>
<if test="creater != null ">creater = #{creater},</if>
</trim>
where year = #{year}
</update>
<delete id="deleteYearPlanById" parameterType="String">
delete from my_year_plan where year = #{year}
</delete>
<delete id="deleteYearPlanByIds" parameterType="String">
delete from my_year_plan where year in
<foreach item="year" collection="array" open="(" separator="," close=")">
#{year}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,64 @@
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-goods-add">
<div class="form-group">
<label class="col-sm-3 control-label">品种名称:</label>
<div class="col-sm-8">
<input id="name" name="name" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">品种类型 (股标,基金等):</label>
<div class="col-sm-8">
<input id="codeType" name="codeType" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">行业类型(军工,证券等):</label>
<div class="col-sm-8">
<input id="industryType" name="industryType" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">板块类型(上证,深证 创业板等):</label>
<div class="col-sm-8">
<input id="plateType" name="plateType" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">创建人:</label>
<div class="col-sm-8">
<input id="creater" name="creater" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">创建时间:</label>
<div class="col-sm-8">
<input id="createTime" name="createTime" class="form-control" type="text">
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
var prefix = ctx + "mengyu/goods"
$("#form-goods-add").validate({
rules:{
xxxx:{
required:true,
},
}
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-goods-add').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,65 @@
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-goods-edit" th:object="${goods}">
<input id="code" name="code" th:field="*{code}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">品种名称:</label>
<div class="col-sm-8">
<input id="name" name="name" th:field="*{name}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">品种类型 (股标,基金等):</label>
<div class="col-sm-8">
<input id="codeType" name="codeType" th:field="*{codeType}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">行业类型(军工,证券等):</label>
<div class="col-sm-8">
<input id="industryType" name="industryType" th:field="*{industryType}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">板块类型(上证,深证 创业板等):</label>
<div class="col-sm-8">
<input id="plateType" name="plateType" th:field="*{plateType}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">创建人:</label>
<div class="col-sm-8">
<input id="creater" name="creater" th:field="*{creater}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">创建时间:</label>
<div class="col-sm-8">
<input id="createTime" name="createTime" th:field="*{createTime}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
var prefix = ctx + "mengyu/goods"
$("#form-goods-edit").validate({
rules:{
xxxx:{
required:true,
},
}
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-goods-edit').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,82 @@
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="container-div">
<div class="btn-group-sm hidden-xs" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="mengyu:goods:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="mengyu:goods:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="mengyu:goods:remove">
<i class="fa fa-remove"></i> 删除
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('mengyu:goods:edit')}]];
var removeFlag = [[${@permission.hasPermi('mengyu:goods:remove')}]];
var prefix = ctx + "mengyu/goods";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
modalName: "投资品种",
columns: [{
checkbox: true
},
{
field : 'code',
title : '品种代码'
},
{
field : 'name',
title : '品种名称'
},
{
field : 'codeType',
title : '品种类型 (股标,基金等)'
},
{
field : 'industryType',
title : '行业类型(军工,证券等)'
},
{
field : 'plateType',
title : '板块类型(上证,深证 创业板等)'
},
{
field : 'creater',
title : '创建人'
},
{
field : 'createTime',
title : '创建时间'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.code + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.code + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>

View File

@ -0,0 +1,76 @@
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-goodsTradeModel-add">
<div class="form-group">
<label class="col-sm-3 control-label">品种代码:</label>
<div class="col-sm-8">
<input id="code" name="code" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">基础成交量:</label>
<div class="col-sm-8">
<input id="basicVolumes" name="basicVolumes" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">模型状态 (启用,停用):</label>
<div class="col-sm-8">
<input id="modelStatus" name="modelStatus" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">建仓价:</label>
<div class="col-sm-8">
<input id="buildingPrice" name="buildingPrice" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">平仓价:</label>
<div class="col-sm-8">
<input id="exitPrice" name="exitPrice" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">止损价:</label>
<div class="col-sm-8">
<input id="stopPrice" name="stopPrice" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">创建人:</label>
<div class="col-sm-8">
<input id="creater" name="creater" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">创建时间:</label>
<div class="col-sm-8">
<input id="createTime" name="createTime" class="form-control" type="text">
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
var prefix = ctx + "mengyu/goodsTradeModel"
$("#form-goodsTradeModel-add").validate({
rules:{
xxxx:{
required:true,
},
}
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-goodsTradeModel-add').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,77 @@
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-goodsTradeModel-edit" th:object="${goodsTradeModel}">
<input id="modelId" name="modelId" th:field="*{modelId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">品种代码:</label>
<div class="col-sm-8">
<input id="code" name="code" th:field="*{code}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">基础成交量:</label>
<div class="col-sm-8">
<input id="basicVolumes" name="basicVolumes" th:field="*{basicVolumes}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">模型状态 (启用,停用):</label>
<div class="col-sm-8">
<input id="modelStatus" name="modelStatus" th:field="*{modelStatus}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">建仓价:</label>
<div class="col-sm-8">
<input id="buildingPrice" name="buildingPrice" th:field="*{buildingPrice}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">平仓价:</label>
<div class="col-sm-8">
<input id="exitPrice" name="exitPrice" th:field="*{exitPrice}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">止损价:</label>
<div class="col-sm-8">
<input id="stopPrice" name="stopPrice" th:field="*{stopPrice}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">创建人:</label>
<div class="col-sm-8">
<input id="creater" name="creater" th:field="*{creater}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">创建时间:</label>
<div class="col-sm-8">
<input id="createTime" name="createTime" th:field="*{createTime}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
var prefix = ctx + "mengyu/goodsTradeModel"
$("#form-goodsTradeModel-edit").validate({
rules:{
xxxx:{
required:true,
},
}
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-goodsTradeModel-edit').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,90 @@
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="container-div">
<div class="btn-group-sm hidden-xs" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="mengyu:goodsTradeModel:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="mengyu:goodsTradeModel:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="mengyu:goodsTradeModel:remove">
<i class="fa fa-remove"></i> 删除
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('mengyu:goodsTradeModel:edit')}]];
var removeFlag = [[${@permission.hasPermi('mengyu:goodsTradeModel:remove')}]];
var prefix = ctx + "mengyu/goodsTradeModel";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
modalName: "品种计划模型",
columns: [{
checkbox: true
},
{
field : 'modelId',
title : '模型ID'
},
{
field : 'code',
title : '品种代码'
},
{
field : 'basicVolumes',
title : '基础成交量'
},
{
field : 'modelStatus',
title : '模型状态 (启用,停用)'
},
{
field : 'buildingPrice',
title : '建仓价'
},
{
field : 'exitPrice',
title : '平仓价'
},
{
field : 'stopPrice',
title : '止损价'
},
{
field : 'creater',
title : '创建人'
},
{
field : 'createTime',
title : '创建时间'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.modelId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.modelId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>

View File

@ -0,0 +1,52 @@
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-goodsTradeModelIns-add">
<div class="form-group">
<label class="col-sm-3 control-label">模型ID</label>
<div class="col-sm-8">
<input id="modelId" name="modelId" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">计划状态:</label>
<div class="col-sm-8">
<input id="insStatus" name="insStatus" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">创建人:</label>
<div class="col-sm-8">
<input id="creater" name="creater" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">创建时间:</label>
<div class="col-sm-8">
<input id="createTime" name="createTime" class="form-control" type="text">
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
var prefix = ctx + "mengyu/goodsTradeModelIns"
$("#form-goodsTradeModelIns-add").validate({
rules:{
xxxx:{
required:true,
},
}
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-goodsTradeModelIns-add').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,53 @@
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-goodsTradeModelIns-edit" th:object="${goodsTradeModelIns}">
<input id="insId" name="insId" th:field="*{insId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">模型ID</label>
<div class="col-sm-8">
<input id="modelId" name="modelId" th:field="*{modelId}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">计划状态:</label>
<div class="col-sm-8">
<input id="insStatus" name="insStatus" th:field="*{insStatus}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">创建人:</label>
<div class="col-sm-8">
<input id="creater" name="creater" th:field="*{creater}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">创建时间:</label>
<div class="col-sm-8">
<input id="createTime" name="createTime" th:field="*{createTime}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
var prefix = ctx + "mengyu/goodsTradeModelIns"
$("#form-goodsTradeModelIns-edit").validate({
rules:{
xxxx:{
required:true,
},
}
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-goodsTradeModelIns-edit').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,74 @@
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="container-div">
<div class="btn-group-sm hidden-xs" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="mengyu:goodsTradeModelIns:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="mengyu:goodsTradeModelIns:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="mengyu:goodsTradeModelIns:remove">
<i class="fa fa-remove"></i> 删除
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('mengyu:goodsTradeModelIns:edit')}]];
var removeFlag = [[${@permission.hasPermi('mengyu:goodsTradeModelIns:remove')}]];
var prefix = ctx + "mengyu/goodsTradeModelIns";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
modalName: "计划模型实例",
columns: [{
checkbox: true
},
{
field : 'insId',
title : '计划实例 ID'
},
{
field : 'modelId',
title : '模型ID'
},
{
field : 'insStatus',
title : '计划状态'
},
{
field : 'creater',
title : '创建人'
},
{
field : 'createTime',
title : '创建时间'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.insId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.insId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>

View File

@ -0,0 +1,76 @@
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-goodsTradeModelInsNode-add">
<div class="form-group">
<label class="col-sm-3 control-label">实例号:</label>
<div class="col-sm-8">
<input id="insId" name="insId" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">交易价格:</label>
<div class="col-sm-8">
<input id="price" name="price" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">成交份额:</label>
<div class="col-sm-8">
<input id="volumes" name="volumes" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">交易时间:</label>
<div class="col-sm-8">
<input id="tradeTime" name="tradeTime" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">创建人:</label>
<div class="col-sm-8">
<input id="creater" name="creater" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">创建时间:</label>
<div class="col-sm-8">
<input id="createTime" name="createTime" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">交易类型(建仓,加仓,减仓,平仓,止损):</label>
<div class="col-sm-8">
<input id="tradeType" name="tradeType" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">交易笔记:</label>
<div class="col-sm-8">
<input id="tradeNote" name="tradeNote" class="form-control" type="text">
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
var prefix = ctx + "mengyu/goodsTradeModelInsNode"
$("#form-goodsTradeModelInsNode-add").validate({
rules:{
xxxx:{
required:true,
},
}
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-goodsTradeModelInsNode-add').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,77 @@
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-goodsTradeModelInsNode-edit" th:object="${goodsTradeModelInsNode}">
<input id="nodeId" name="nodeId" th:field="*{nodeId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">实例号:</label>
<div class="col-sm-8">
<input id="insId" name="insId" th:field="*{insId}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">交易价格:</label>
<div class="col-sm-8">
<input id="price" name="price" th:field="*{price}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">成交份额:</label>
<div class="col-sm-8">
<input id="volumes" name="volumes" th:field="*{volumes}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">交易时间:</label>
<div class="col-sm-8">
<input id="tradeTime" name="tradeTime" th:field="*{tradeTime}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">创建人:</label>
<div class="col-sm-8">
<input id="creater" name="creater" th:field="*{creater}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">创建时间:</label>
<div class="col-sm-8">
<input id="createTime" name="createTime" th:field="*{createTime}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">交易类型(建仓,加仓,减仓,平仓,止损):</label>
<div class="col-sm-8">
<input id="tradeType" name="tradeType" th:field="*{tradeType}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">交易笔记:</label>
<div class="col-sm-8">
<input id="tradeNote" name="tradeNote" th:field="*{tradeNote}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
var prefix = ctx + "mengyu/goodsTradeModelInsNode"
$("#form-goodsTradeModelInsNode-edit").validate({
rules:{
xxxx:{
required:true,
},
}
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-goodsTradeModelInsNode-edit').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,90 @@
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="container-div">
<div class="btn-group-sm hidden-xs" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="mengyu:goodsTradeModelInsNode:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="mengyu:goodsTradeModelInsNode:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="mengyu:goodsTradeModelInsNode:remove">
<i class="fa fa-remove"></i> 删除
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('mengyu:goodsTradeModelInsNode:edit')}]];
var removeFlag = [[${@permission.hasPermi('mengyu:goodsTradeModelInsNode:remove')}]];
var prefix = ctx + "mengyu/goodsTradeModelInsNode";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
modalName: "交易计划操作",
columns: [{
checkbox: true
},
{
field : 'nodeId',
title : '操作流水号'
},
{
field : 'insId',
title : '实例号'
},
{
field : 'price',
title : '交易价格'
},
{
field : 'volumes',
title : '成交份额'
},
{
field : 'tradeTime',
title : '交易时间'
},
{
field : 'creater',
title : '创建人'
},
{
field : 'createTime',
title : '创建时间'
},
{
field : 'tradeType',
title : '交易类型(建仓,加仓,减仓,平仓,止损)'
},
{
field : 'tradeNote',
title : '交易笔记'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.nodeId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.nodeId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>

View File

@ -0,0 +1,46 @@
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-moneyPool-add">
<div class="form-group">
<label class="col-sm-3 control-label">创建时间:</label>
<div class="col-sm-8">
<input id="createTime" name="createTime" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">资金池金额 单位(元):</label>
<div class="col-sm-8">
<input id="moneyPool" name="moneyPool" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">资金池ID=用户ID</label>
<div class="col-sm-8">
<input id="moneyPoolId" name="moneyPoolId" class="form-control" type="text">
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
var prefix = ctx + "mengyu/moneyPool"
$("#form-moneyPool-add").validate({
rules:{
xxxx:{
required:true,
},
}
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-moneyPool-add').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,47 @@
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-moneyPool-edit" th:object="${moneyPool}">
<input id="creater" name="creater" th:field="*{creater}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">创建时间:</label>
<div class="col-sm-8">
<input id="createTime" name="createTime" th:field="*{createTime}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">资金池金额 单位(元):</label>
<div class="col-sm-8">
<input id="moneyPool" name="moneyPool" th:field="*{moneyPool}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">资金池ID=用户ID</label>
<div class="col-sm-8">
<input id="moneyPoolId" name="moneyPoolId" th:field="*{moneyPoolId}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
var prefix = ctx + "mengyu/moneyPool"
$("#form-moneyPool-edit").validate({
rules:{
xxxx:{
required:true,
},
}
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-moneyPool-edit').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,70 @@
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="container-div">
<div class="btn-group-sm hidden-xs" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="mengyu:moneyPool:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="mengyu:moneyPool:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="mengyu:moneyPool:remove">
<i class="fa fa-remove"></i> 删除
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('mengyu:moneyPool:edit')}]];
var removeFlag = [[${@permission.hasPermi('mengyu:moneyPool:remove')}]];
var prefix = ctx + "mengyu/moneyPool";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
modalName: "资金池",
columns: [{
checkbox: true
},
{
field : 'creater',
title : '创建人'
},
{
field : 'createTime',
title : '创建时间'
},
{
field : 'moneyPool',
title : '资金池金额 单位(元)'
},
{
field : 'moneyPoolId',
title : '资金池ID=用户ID'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.creater + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.creater + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>

View File

@ -0,0 +1,52 @@
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-moneyPoolLog-add">
<div class="form-group">
<label class="col-sm-3 control-label">交易后的资金池金额:</label>
<div class="col-sm-8">
<input id="moneyPoolLog" name="moneyPoolLog" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">交易金额:</label>
<div class="col-sm-8">
<input id="trademMoney" name="trademMoney" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">资金池ID号</label>
<div class="col-sm-8">
<input id="moneyPoolId" name="moneyPoolId" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">资金池流水号ID=交易ID号</label>
<div class="col-sm-8">
<input id="nodeId" name="nodeId" class="form-control" type="text">
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
var prefix = ctx + "mengyu/moneyPoolLog"
$("#form-moneyPoolLog-add").validate({
rules:{
xxxx:{
required:true,
},
}
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-moneyPoolLog-add').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,53 @@
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-moneyPoolLog-edit" th:object="${moneyPoolLog}">
<input id="billType" name="billType" th:field="*{billType}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">交易后的资金池金额:</label>
<div class="col-sm-8">
<input id="moneyPoolLog" name="moneyPoolLog" th:field="*{moneyPoolLog}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">交易金额:</label>
<div class="col-sm-8">
<input id="trademMoney" name="trademMoney" th:field="*{trademMoney}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">资金池ID号</label>
<div class="col-sm-8">
<input id="moneyPoolId" name="moneyPoolId" th:field="*{moneyPoolId}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">资金池流水号ID=交易ID号</label>
<div class="col-sm-8">
<input id="nodeId" name="nodeId" th:field="*{nodeId}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
var prefix = ctx + "mengyu/moneyPoolLog"
$("#form-moneyPoolLog-edit").validate({
rules:{
xxxx:{
required:true,
},
}
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-moneyPoolLog-edit').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,74 @@
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="container-div">
<div class="btn-group-sm hidden-xs" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="mengyu:moneyPoolLog:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="mengyu:moneyPoolLog:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="mengyu:moneyPoolLog:remove">
<i class="fa fa-remove"></i> 删除
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('mengyu:moneyPoolLog:edit')}]];
var removeFlag = [[${@permission.hasPermi('mengyu:moneyPoolLog:remove')}]];
var prefix = ctx + "mengyu/moneyPoolLog";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
modalName: "资金池交明细",
columns: [{
checkbox: true
},
{
field : 'billType',
title : '交易类型 (支出/收入)'
},
{
field : 'moneyPoolLog',
title : '交易后的资金池金额'
},
{
field : 'trademMoney',
title : '交易金额'
},
{
field : 'moneyPoolId',
title : '资金池ID号'
},
{
field : 'nodeId',
title : '资金池流水号ID=交易ID号'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.billType + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.billType + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>

View File

@ -0,0 +1,58 @@
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-yearPlan-add">
<div class="form-group">
<label class="col-sm-3 control-label">预期盈利:</label>
<div class="col-sm-8">
<input id="profit" name="profit" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">计划状态:</label>
<div class="col-sm-8">
<input id="planStatus" name="planStatus" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">任务状态:</label>
<div class="col-sm-8">
<input id="taskStatus" name="taskStatus" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">创建时间:</label>
<div class="col-sm-8">
<input id="createTime" name="createTime" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">创建人:</label>
<div class="col-sm-8">
<input id="creater" name="creater" class="form-control" type="text">
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
var prefix = ctx + "mengyu/yearPlan"
$("#form-yearPlan-add").validate({
rules:{
xxxx:{
required:true,
},
}
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-yearPlan-add').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,59 @@
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-yearPlan-edit" th:object="${yearPlan}">
<input id="year" name="year" th:field="*{year}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">预期盈利:</label>
<div class="col-sm-8">
<input id="profit" name="profit" th:field="*{profit}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">计划状态:</label>
<div class="col-sm-8">
<input id="planStatus" name="planStatus" th:field="*{planStatus}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">任务状态:</label>
<div class="col-sm-8">
<input id="taskStatus" name="taskStatus" th:field="*{taskStatus}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">创建时间:</label>
<div class="col-sm-8">
<input id="createTime" name="createTime" th:field="*{createTime}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">创建人:</label>
<div class="col-sm-8">
<input id="creater" name="creater" th:field="*{creater}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
var prefix = ctx + "mengyu/yearPlan"
$("#form-yearPlan-edit").validate({
rules:{
xxxx:{
required:true,
},
}
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-yearPlan-edit').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,78 @@
<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="container-div">
<div class="btn-group-sm hidden-xs" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="mengyu:yearPlan:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="mengyu:yearPlan:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="mengyu:yearPlan:remove">
<i class="fa fa-remove"></i> 删除
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" data-mobile-responsive="true"></table>
</div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('mengyu:yearPlan:edit')}]];
var removeFlag = [[${@permission.hasPermi('mengyu:yearPlan:remove')}]];
var prefix = ctx + "mengyu/yearPlan";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
modalName: "年度计划",
columns: [{
checkbox: true
},
{
field : 'year',
title : '年'
},
{
field : 'profit',
title : '预期盈利'
},
{
field : 'planStatus',
title : '计划状态'
},
{
field : 'taskStatus',
title : '任务状态'
},
{
field : 'createTime',
title : '创建时间'
},
{
field : 'creater',
title : '创建人'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.year + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.year + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>

View File

@ -0,0 +1,36 @@
package com.cronie.mengyu.common.goods.impl;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import com.alibaba.fastjson.JSONObject;
import com.cronie.mengyu.common.goods.ActualTimeGoods;
import com.cronie.mengyu.common.goods.ILoadGoodsInfo;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes={ SinaLoadGoodsInfoImpl.class})
@WebAppConfiguration
public class SinaLoadGoodsInfoImplTest {
private static final Logger logger = LoggerFactory.getLogger(SinaLoadGoodsInfoImplTest.class);
@Autowired
@Qualifier("sinaDataSource")
ILoadGoodsInfo loadGoodsInfo ;
@Test
public void loadGoodsInfo() {
ActualTimeGoods goodsInfo = loadGoodsInfo.loadGoodsInfo("000001") ;
logger.info(JSONObject.toJSONString(goodsInfo));
assertEquals("上证指数", goodsInfo.getName());
}
}

View File

@ -0,0 +1,36 @@
package com.cronie.mengyu.common.goods.impl;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import com.alibaba.fastjson.JSONObject;
import com.cronie.mengyu.common.goods.ActualTimeGoods;
import com.cronie.mengyu.common.goods.ILoadGoodsInfo;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes={ TencentLoadGoodsInfoImpl.class})
@WebAppConfiguration
public class TencentLoadGoodsInfoImplTest {
private static final Logger logger = LoggerFactory.getLogger(TencentLoadGoodsInfoImplTest.class);
@Autowired
@Qualifier("tencentDataSource")
ILoadGoodsInfo loadGoodsInfo ;
@Test
public void loadGoodsInfo() {
ActualTimeGoods goodsInfo = loadGoodsInfo.loadGoodsInfo("000001") ;
logger.info(JSONObject.toJSONString(goodsInfo));
assertEquals("上证指数", goodsInfo.getName());
}
}

Some files were not shown because too many files have changed in this diff Show More