Commit 998382ec authored by machengbo's avatar machengbo

commit

parent 5df3f0c7
...@@ -74,10 +74,10 @@ ...@@ -74,10 +74,10 @@
</dependency> </dependency>
<!-- spring boot 和mybatis --> <!-- spring boot 和mybatis -->
<!--<dependency> <dependency>
<groupId>org.mybatis.spring.boot</groupId> <groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId> <artifactId>mybatis-spring-boot-starter</artifactId>
</dependency>--> </dependency>
<!-- mybatis plus --> <!-- mybatis plus -->
<dependency> <dependency>
......
//package com.jz.dm.mall.config; package com.jz.dm.mall.config;
//
//import com.alibaba.druid.pool.DruidDataSource; import com.alibaba.druid.pool.DruidDataSource;
//import org.apache.ibatis.session.SqlSessionFactory; import org.apache.ibatis.session.SqlSessionFactory;
//import org.mybatis.spring.SqlSessionFactoryBean; import org.mybatis.spring.SqlSessionFactoryBean;
//import org.mybatis.spring.annotation.MapperScan; import org.mybatis.spring.annotation.MapperScan;
//import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
//import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
//import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Primary;
//import org.springframework.core.io.support.PathMatchingResourcePatternResolver; import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
//import org.springframework.jdbc.datasource.DataSourceTransactionManager; import org.springframework.jdbc.datasource.DataSourceTransactionManager;
//
//import javax.sql.DataSource; import javax.sql.DataSource;
//import java.sql.SQLException; import java.sql.SQLException;
//
///** /**
// * @ProjectName zhaxinle * @ProjectName zhaxinle
// * @Author: zeroJun * @Author: zeroJun
// * @Date: 2018/8/16 16:49 * @Date: 2018/8/16 16:49
// * @Description: 主数据源配置类 * @Description: 主数据源配置类
// */ */
//@Configuration @Configuration
//// 前缀为primary.datasource.druid的配置信息 // 前缀为primary.datasource.druid的配置信息
//@ConfigurationProperties(prefix = "spring.datasource") @ConfigurationProperties(prefix = "spring.datasource")
//@MapperScan(basePackages = DatabaseConfig.PACKAGE, sqlSessionFactoryRef = "sqlSessionFactory") @MapperScan(basePackages = DatabaseConfig.PACKAGE, sqlSessionFactoryRef = "sqlSessionFactory")
//public class DatabaseConfig { public class DatabaseConfig {
//
// /** /**
// * dao层的包路径 * dao层的包路径
// */ */
// static final String PACKAGE = "com.jz.dm.mall.moduls.mapper"; static final String PACKAGE = "com.jz.dm.mall.moduls.mapper";
//
// /** /**
// * mapper文件的相对路径 * mapper文件的相对路径
// */ */
// private static final String MAPPER_LOCATION = "classpath:mapperconf/*.xml"; private static final String MAPPER_LOCATION = "classpath:mapperconf/*.xml";
//
// private String filters; private String filters;
// private String url; private String url;
// private String username; private String username;
// private String password; private String password;
// private String driverClassName; private String driverClassName;
// private int initialSize; private int initialSize;
// private int minIdle; private int minIdle;
// private int maxActive; private int maxActive;
// private long maxWait; private long maxWait;
// private long timeBetweenEvictionRunsMillis; private long timeBetweenEvictionRunsMillis;
// private long minEvictableIdleTimeMillis; private long minEvictableIdleTimeMillis;
// private String validationQuery; private String validationQuery;
// private boolean testWhileIdle; private boolean testWhileIdle;
// private boolean testOnBorrow; private boolean testOnBorrow;
// private boolean testOnReturn; private boolean testOnReturn;
// private boolean poolPreparedStatements; private boolean poolPreparedStatements;
// private int maxPoolPreparedStatementPerConnectionSize; private int maxPoolPreparedStatementPerConnectionSize;
//
// // 主数据源使用@Primary注解进行标识 // 主数据源使用@Primary注解进行标识
// //@Primary //@Primary
// @Bean(name = "dataSource") @Bean(name = "dataSource")
// public DataSource dataSource() throws SQLException { public DataSource dataSource() throws SQLException {
// DruidDataSource druid = new DruidDataSource(); DruidDataSource druid = new DruidDataSource();
// // 监控统计拦截的filters // 监控统计拦截的filters
// druid.setFilters(filters); druid.setFilters(filters);
//
// // 配置基本属性 // 配置基本属性
// druid.setDriverClassName(driverClassName); druid.setDriverClassName(driverClassName);
// druid.setUsername(username); druid.setUsername(username);
// druid.setPassword(password); druid.setPassword(password);
// druid.setUrl(url); druid.setUrl(url);
//
// //初始化时建立物理连接的个数 //初始化时建立物理连接的个数
// druid.setInitialSize(initialSize); druid.setInitialSize(initialSize);
// //最大连接池数量 //最大连接池数量
// druid.setMaxActive(maxActive); druid.setMaxActive(maxActive);
// //最小连接池数量 //最小连接池数量
// druid.setMinIdle(minIdle); druid.setMinIdle(minIdle);
// //获取连接时最大等待时间,单位毫秒。 //获取连接时最大等待时间,单位毫秒。
// druid.setMaxWait(maxWait); druid.setMaxWait(maxWait);
// //间隔多久进行一次检测,检测需要关闭的空闲连接 //间隔多久进行一次检测,检测需要关闭的空闲连接
// druid.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis); druid.setTimeBetweenEvictionRunsMillis(timeBetweenEvictionRunsMillis);
// //一个连接在池中最小生存的时间 //一个连接在池中最小生存的时间
// druid.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis); druid.setMinEvictableIdleTimeMillis(minEvictableIdleTimeMillis);
// //用来检测连接是否有效的sql //用来检测连接是否有效的sql
// druid.setValidationQuery(validationQuery); druid.setValidationQuery(validationQuery);
// //建议配置为true,不影响性能,并且保证安全性。 //建议配置为true,不影响性能,并且保证安全性。
// druid.setTestWhileIdle(testWhileIdle); druid.setTestWhileIdle(testWhileIdle);
// //申请连接时执行validationQuery检测连接是否有效 //申请连接时执行validationQuery检测连接是否有效
// druid.setTestOnBorrow(testOnBorrow); druid.setTestOnBorrow(testOnBorrow);
// druid.setTestOnReturn(testOnReturn); druid.setTestOnReturn(testOnReturn);
// //是否缓存preparedStatement,也就是PSCache,oracle设为true,mysql设为false。分库分表较多推荐设置为false //是否缓存preparedStatement,也就是PSCache,oracle设为true,mysql设为false。分库分表较多推荐设置为false
// druid.setPoolPreparedStatements(poolPreparedStatements); druid.setPoolPreparedStatements(poolPreparedStatements);
// // 打开PSCache时,指定每个连接上PSCache的大小 // 打开PSCache时,指定每个连接上PSCache的大小
// druid.setMaxPoolPreparedStatementPerConnectionSize(maxPoolPreparedStatementPerConnectionSize); druid.setMaxPoolPreparedStatementPerConnectionSize(maxPoolPreparedStatementPerConnectionSize);
//
// return druid; return druid;
// } }
//
// // 创建该数据源的事务管理 // 创建该数据源的事务管理
// @Primary @Primary
// @Bean(name = "transactionManager") @Bean(name = "transactionManager")
// public DataSourceTransactionManager transactionManager() throws SQLException { public DataSourceTransactionManager transactionManager() throws SQLException {
// return new DataSourceTransactionManager(dataSource()); return new DataSourceTransactionManager(dataSource());
// } }
//
// // 创建Mybatis的连接会话工厂实例 // 创建Mybatis的连接会话工厂实例
// @Primary @Primary
// @Bean(name = "sqlSessionFactory") @Bean(name = "sqlSessionFactory")
// public SqlSessionFactory sqlSessionFactory(@Qualifier("dataSource") DataSource dataSource) throws Exception { public SqlSessionFactory sqlSessionFactory(@Qualifier("dataSource") DataSource dataSource) throws Exception {
// final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean(); final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean();
// sessionFactory.setDataSource(dataSource); // 设置数据源bean sessionFactory.setDataSource(dataSource); // 设置数据源bean
// sessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver() sessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver()
// .getResources(DatabaseConfig.MAPPER_LOCATION)); // 设置mapper文件路径 .getResources(DatabaseConfig.MAPPER_LOCATION)); // 设置mapper文件路径
//
// return sessionFactory.getObject(); return sessionFactory.getObject();
// } }
//
// public String getFilters() { public String getFilters() {
// return filters; return filters;
// } }
//
// public void setFilters(String filters) { public void setFilters(String filters) {
// this.filters = filters; this.filters = filters;
// } }
//
// public String getUrl() { public String getUrl() {
// return url; return url;
// } }
//
// public void setUrl(String url) { public void setUrl(String url) {
// this.url = url; this.url = url;
// } }
//
// public String getUsername() { public String getUsername() {
// return username; return username;
// } }
//
// public void setUsername(String username) { public void setUsername(String username) {
// this.username = username; this.username = username;
// } }
//
// public String getPassword() { public String getPassword() {
// return password; return password;
// } }
//
// public void setPassword(String password) { public void setPassword(String password) {
// this.password = password; this.password = password;
// } }
//
// public String getDriverClassName() { public String getDriverClassName() {
// return driverClassName; return driverClassName;
// } }
//
// public void setDriverClassName(String driverClassName) { public void setDriverClassName(String driverClassName) {
// this.driverClassName = driverClassName; this.driverClassName = driverClassName;
// } }
//
// public int getInitialSize() { public int getInitialSize() {
// return initialSize; return initialSize;
// } }
//
// public void setInitialSize(int initialSize) { public void setInitialSize(int initialSize) {
// this.initialSize = initialSize; this.initialSize = initialSize;
// } }
//
// public int getMinIdle() { public int getMinIdle() {
// return minIdle; return minIdle;
// } }
//
// public void setMinIdle(int minIdle) { public void setMinIdle(int minIdle) {
// this.minIdle = minIdle; this.minIdle = minIdle;
// } }
//
// public int getMaxActive() { public int getMaxActive() {
// return maxActive; return maxActive;
// } }
//
// public void setMaxActive(int maxActive) { public void setMaxActive(int maxActive) {
// this.maxActive = maxActive; this.maxActive = maxActive;
// } }
//
// public long getMaxWait() { public long getMaxWait() {
// return maxWait; return maxWait;
// } }
//
// public void setMaxWait(long maxWait) { public void setMaxWait(long maxWait) {
// this.maxWait = maxWait; this.maxWait = maxWait;
// } }
//
// public long getTimeBetweenEvictionRunsMillis() { public long getTimeBetweenEvictionRunsMillis() {
// return timeBetweenEvictionRunsMillis; return timeBetweenEvictionRunsMillis;
// } }
//
// public void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis) { public void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis) {
// this.timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis; this.timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis;
// } }
//
// public long getMinEvictableIdleTimeMillis() { public long getMinEvictableIdleTimeMillis() {
// return minEvictableIdleTimeMillis; return minEvictableIdleTimeMillis;
// } }
//
// public void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis) { public void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis) {
// this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis; this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis;
// } }
//
// public String getValidationQuery() { public String getValidationQuery() {
// return validationQuery; return validationQuery;
// } }
//
// public void setValidationQuery(String validationQuery) { public void setValidationQuery(String validationQuery) {
// this.validationQuery = validationQuery; this.validationQuery = validationQuery;
// } }
//
// public boolean isTestWhileIdle() { public boolean isTestWhileIdle() {
// return testWhileIdle; return testWhileIdle;
// } }
//
// public void setTestWhileIdle(boolean testWhileIdle) { public void setTestWhileIdle(boolean testWhileIdle) {
// this.testWhileIdle = testWhileIdle; this.testWhileIdle = testWhileIdle;
// } }
//
// public boolean isTestOnBorrow() { public boolean isTestOnBorrow() {
// return testOnBorrow; return testOnBorrow;
// } }
//
// public void setTestOnBorrow(boolean testOnBorrow) { public void setTestOnBorrow(boolean testOnBorrow) {
// this.testOnBorrow = testOnBorrow; this.testOnBorrow = testOnBorrow;
// } }
//
// public boolean isTestOnReturn() { public boolean isTestOnReturn() {
// return testOnReturn; return testOnReturn;
// } }
//
// public void setTestOnReturn(boolean testOnReturn) { public void setTestOnReturn(boolean testOnReturn) {
// this.testOnReturn = testOnReturn; this.testOnReturn = testOnReturn;
// } }
//
// public boolean isPoolPreparedStatements() { public boolean isPoolPreparedStatements() {
// return poolPreparedStatements; return poolPreparedStatements;
// } }
//
// public void setPoolPreparedStatements(boolean poolPreparedStatements) { public void setPoolPreparedStatements(boolean poolPreparedStatements) {
// this.poolPreparedStatements = poolPreparedStatements; this.poolPreparedStatements = poolPreparedStatements;
// } }
//
// public int getMaxPoolPreparedStatementPerConnectionSize() { public int getMaxPoolPreparedStatementPerConnectionSize() {
// return maxPoolPreparedStatementPerConnectionSize; return maxPoolPreparedStatementPerConnectionSize;
// } }
//
// public void setMaxPoolPreparedStatementPerConnectionSize(int maxPoolPreparedStatementPerConnectionSize) { public void setMaxPoolPreparedStatementPerConnectionSize(int maxPoolPreparedStatementPerConnectionSize) {
// this.maxPoolPreparedStatementPerConnectionSize = maxPoolPreparedStatementPerConnectionSize; this.maxPoolPreparedStatementPerConnectionSize = maxPoolPreparedStatementPerConnectionSize;
// } }
//
//} }
\ No newline at end of file \ No newline at end of file
...@@ -2,7 +2,7 @@ package com.jz.dm.mall.moduls.controller.finance; ...@@ -2,7 +2,7 @@ package com.jz.dm.mall.moduls.controller.finance;
import com.jz.common.base.BaseController; import com.jz.common.base.BaseController;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.mall.moduls.controller.order.bean.OrderDto; import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCustomerAssetsDto;
import com.jz.dm.mall.moduls.service.FinanceTradeFlowService; import com.jz.dm.mall.moduls.service.FinanceTradeFlowService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -12,6 +12,8 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -12,6 +12,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
/** /**
* 企业客户交易流水(TFinanceTradeFlow)表控制层 * 企业客户交易流水(TFinanceTradeFlow)表控制层
...@@ -33,11 +35,19 @@ public class FinanceTradeFlowController extends BaseController { ...@@ -33,11 +35,19 @@ public class FinanceTradeFlowController extends BaseController {
* 充值----获取企业账户余额 * 充值----获取企业账户余额
* *
* @author Bellamy * @author Bellamy
* @since 2020-12-03
*/ */
@GetMapping(value = "/getAccountMoney") @GetMapping(value = "/getAccountMoney")
@ApiOperation(value = "充值----获取账户余额", notes = "获取账户余额") @ApiOperation(value = "充值----获取账户余额", notes = "获取账户余额,只有已审核(认证)企业才可以充值")
public Result<OrderDto> getAccountMoney(HttpServletRequest req) throws Exception { public Result<FinanceCustomerAssetsDto> getAccountMoney(HttpServletRequest requset) throws Exception {
return new Result<>(); Result<FinanceCustomerAssetsDto> result = new Result<>();
//requset.getSession().getAttribute(""); //从session中获取商城用户的 id,和企业资产账户id
Map map = new HashMap();
map.put("assetsId", 1); //企业资产账户id
map.put("departmentId", 1); //企业ID
FinanceCustomerAssetsDto dto = financeTradeFlowService.queryAccountMoneyByMap(map);
result.setResult(dto);
return result;
} }
} }
\ No newline at end of file
package com.jz.dm.mall.moduls.mapper; package com.jz.dm.mall.moduls.mapper;
import com.jz.common.base.BaseMapper; import com.jz.common.base.BaseMapper;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCustomerAssetsDto;
import com.jz.dm.mall.moduls.entity.FinanceTradeFlow; import com.jz.dm.mall.moduls.entity.FinanceTradeFlow;
import java.util.Map;
/** /**
* 企业客户交易流水(TFinanceTradeFlow)表数据库访问层 * 企业客户交易流水(TFinanceTradeFlow)表数据库访问层
* *
...@@ -13,4 +16,5 @@ import com.jz.dm.mall.moduls.entity.FinanceTradeFlow; ...@@ -13,4 +16,5 @@ import com.jz.dm.mall.moduls.entity.FinanceTradeFlow;
public interface FinanceTradeFlowDao extends BaseMapper<FinanceTradeFlow> { public interface FinanceTradeFlowDao extends BaseMapper<FinanceTradeFlow> {
FinanceCustomerAssetsDto queryAccountMoneyByMap(Map map) throws Exception ;
} }
\ No newline at end of file
package com.jz.dm.mall.moduls.service; package com.jz.dm.mall.moduls.service;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCustomerAssetsDto;
import java.util.Map;
/** /**
* 企业客户交易流水(TFinanceTradeFlow)表服务接口 * 企业客户交易流水(TFinanceTradeFlow)表服务接口
* *
...@@ -9,4 +13,5 @@ package com.jz.dm.mall.moduls.service; ...@@ -9,4 +13,5 @@ package com.jz.dm.mall.moduls.service;
public interface FinanceTradeFlowService { public interface FinanceTradeFlowService {
FinanceCustomerAssetsDto queryAccountMoneyByMap(Map map) throws Exception ;
} }
\ No newline at end of file
package com.jz.dm.mall.moduls.service.impl; package com.jz.dm.mall.moduls.service.impl;
import com.jz.dm.mall.moduls.controller.finance.bean.FinanceCustomerAssetsDto;
import com.jz.dm.mall.moduls.mapper.FinanceTradeFlowDao; import com.jz.dm.mall.moduls.mapper.FinanceTradeFlowDao;
import com.jz.dm.mall.moduls.service.FinanceTradeFlowService; import com.jz.dm.mall.moduls.service.FinanceTradeFlowService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Map;
/** /**
* 企业客户交易流水(TFinanceTradeFlow)表服务实现类 * 企业客户交易流水(TFinanceTradeFlow)表服务实现类
* *
...@@ -13,7 +16,12 @@ import org.springframework.stereotype.Service; ...@@ -13,7 +16,12 @@ import org.springframework.stereotype.Service;
*/ */
@Service("financeTradeFlowService") @Service("financeTradeFlowService")
public class FinanceTradeFlowServiceImpl implements FinanceTradeFlowService { public class FinanceTradeFlowServiceImpl implements FinanceTradeFlowService {
@Autowired @Autowired
private FinanceTradeFlowDao tFinanceTradeFlowDao; private FinanceTradeFlowDao financeTradeFlowDao;
@Override
public FinanceCustomerAssetsDto queryAccountMoneyByMap(Map map) throws Exception {
return financeTradeFlowDao.queryAccountMoneyByMap(map);
}
} }
\ No newline at end of file
...@@ -2,18 +2,18 @@ ...@@ -2,18 +2,18 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.jz.dm.mall.moduls.mapper.FinanceCustomerAssetsDao"> <mapper namespace="com.jz.dm.mall.moduls.mapper.FinanceCustomerAssetsDao">
<!-- <resultMap type="com.jz.manage.moduls.entity.FinanceCustomerAssets" id="TFinanceCustomerAssetsMap">--> <resultMap type="com.jz.dm.mall.moduls.entity.FinanceCustomerAssets" id="TFinanceCustomerAssetsMap">
<!-- <result property="assetsId" column="assets_id" jdbcType="INTEGER"/>--> <result property="assetsId" column="assets_id" jdbcType="INTEGER"/>
<!-- <result property="departmentId" column="department_id" jdbcType="INTEGER"/>--> <result property="departmentId" column="department_id" jdbcType="INTEGER"/>
<!-- <result property="useMoney" column="use_money" jdbcType="NUMERIC"/>--> <result property="useMoney" column="use_money" jdbcType="NUMERIC"/>
<!-- <result property="frozenMoney" column="frozen_money" jdbcType="NUMERIC"/>--> <result property="frozenMoney" column="frozen_money" jdbcType="NUMERIC"/>
<!-- <result property="totalMoney" column="total_money" jdbcType="NUMERIC"/>--> <result property="totalMoney" column="total_money" jdbcType="NUMERIC"/>
<!-- <result property="creTime" column="cre_time" jdbcType="TIMESTAMP"/>--> <result property="creTime" column="cre_time" jdbcType="TIMESTAMP"/>
<!-- <result property="crePerson" column="cre_person" jdbcType="VARCHAR"/>--> <result property="crePerson" column="cre_person" jdbcType="VARCHAR"/>
<!-- <result property="uptTime" column="upt_time" jdbcType="TIMESTAMP"/>--> <result property="uptTime" column="upt_time" jdbcType="TIMESTAMP"/>
<!-- <result property="uptPerson" column="upt_person" jdbcType="VARCHAR"/>--> <result property="uptPerson" column="upt_person" jdbcType="VARCHAR"/>
<!-- <result property="delFlag" column="del_flag" jdbcType="VARCHAR"/>--> <result property="delFlag" column="del_flag" jdbcType="VARCHAR"/>
<!-- </resultMap>--> </resultMap>
<!--查询单个--> <!--查询单个-->
<select id="queryById" resultMap="TFinanceCustomerAssetsMap"> <select id="queryById" resultMap="TFinanceCustomerAssetsMap">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment