Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dm_project
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
姚本章
dm_project
Commits
80eaacfa
Commit
80eaacfa
authored
Dec 03, 2020
by
ysongq
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dm_dev' of
http://gitlab.ioubuy.cn/yaobenzhang/dm_project
into dm_dev
parents
7f7bda24
f3e14f54
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
1150 additions
and
320 deletions
+1150
-320
ApiGatewayApplication.java
...ateway/src/main/java/com/jz/dm/ApiGatewayApplication.java
+2
-1
application-prod.yml
jz-dm-apigateway/src/main/resources/application-prod.yml
+51
-0
application-test.yml
jz-dm-apigateway/src/main/resources/application-test.yml
+0
-29
application.yml
jz-dm-apigateway/src/main/resources/application.yml
+29
-14
ResultCode.java
...mmon/src/main/java/com/jz/common/constant/ResultCode.java
+72
-0
ResultMsg.java
...ommon/src/main/java/com/jz/common/constant/ResultMsg.java
+518
-0
ResponseException.java
.../main/java/com/jz/common/exception/ResponseException.java
+66
-0
pom.xml
jz-dm-mall/pom.xml
+2
-2
DatabaseConfig.java
...l/src/main/java/com/jz/dm/mall/config/DatabaseConfig.java
+254
-254
FinanceTradeFlowController.java
...moduls/controller/finance/FinanceTradeFlowController.java
+14
-4
FinanceCustomerAssetsDto.java
...uls/controller/finance/bean/FinanceCustomerAssetsDto.java
+88
-0
FinanceTradeFlowDao.java
...ava/com/jz/dm/mall/moduls/mapper/FinanceTradeFlowDao.java
+4
-0
FinanceTradeFlowService.java
...om/jz/dm/mall/moduls/service/FinanceTradeFlowService.java
+5
-0
CompanyAuthServiceImpl.java
...z/dm/mall/moduls/service/impl/CompanyAuthServiceImpl.java
+4
-3
FinanceTradeFlowServiceImpl.java
...mall/moduls/service/impl/FinanceTradeFlowServiceImpl.java
+9
-1
FinanceCustomerAssetsDao.xml
...rc/main/resources/mapperconf/FinanceCustomerAssetsDao.xml
+12
-12
FinanceTradeFlowDao.xml
...all/src/main/resources/mapperconf/FinanceTradeFlowDao.xml
+20
-0
No files found.
jz-dm-apigateway/src/main/java/com/jz/dm/ApiGatewayApplication.java
View file @
80eaacfa
...
@@ -3,6 +3,7 @@ package com.jz.dm;
...
@@ -3,6 +3,7 @@ package com.jz.dm;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
/**
/**
...
@@ -16,7 +17,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
...
@@ -16,7 +17,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
* @Description:
* @Description:
**/
**/
@SpringBootApplication
@SpringBootApplication
//
@ComponentScan(basePackages = {"com.jz"})
@ComponentScan
(
basePackages
=
{
"com.jz"
})
@MapperScan
(
"com.jz.dm.mapper"
)
@MapperScan
(
"com.jz.dm.mapper"
)
@EnableTransactionManagement
@EnableTransactionManagement
public
class
ApiGatewayApplication
{
public
class
ApiGatewayApplication
{
...
...
jz-dm-apigateway/src/main/resources/application-prod.yml
0 → 100644
View file @
80eaacfa
#数据源
spring
:
security
:
basic
:
enabled
:
false
datasource
:
url
:
jdbc:mysql://rm-wz9n399q2avsy3k6m4o.mysql.rds.aliyuncs.com:3306/wj-mkt-project?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
username
:
root
password
:
I%ou$buy!ok
driver-class-name
:
com.mysql.jdbc.Driver
druid
:
# 初始化时建立物理连接的个数。初始化发生在显示调用init方法,或者第一次getConnection时
initialSize
:
1
# 最小连接池数量
minIdle
:
1
# 最大连接池数量
maxActive
:
10
# 配置获取连接等待超时的时间
maxWait
:
10000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis
:
60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis
:
300000
# 验证连接有效与否的SQL,不同的数据配置不同
validationQuery
:
select 1
# 建议配置为true,不影响性能,并且保证安全性。
# 申请连接的时候检测,如果空闲时间大于
# timeBetweenEvictionRunsMillis,
# 执行validationQuery检测连接是否有效。
testWhileIdle
:
true
# 申请连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能。
# 这里建议配置为TRUE,防止取到的连接不可用
testOnBorrow
:
true
# 归还连接时执行validationQuery检测连接是否有效,做了这个配置会降低性能
testOnReturn
:
false
# 是否缓存preparedStatement,也就是PSCache。
# PSCache对支持游标的数据库性能提升巨大,比如说oracle。
# 在mysql5.5以下的版本中没有PSCache功能,建议关闭掉。
# 作者在5.5版本中使用PSCache,通过监控界面发现PSCache有缓存命中率记录,
# 该应该是支持PSCache。
# 打开PSCache,并且指定每个连接上PSCache的大小
poolPreparedStatements
:
true
maxPoolPreparedStatementPerConnectionSize
:
20
# 属性类型是字符串,通过别名的方式配置扩展插件,
# 常用的插件有:
# 监控统计用的filter:stat
# 日志用的filter:log4j
# 防御sql注入的filter:wall
filters
:
stat
# ====================MybatisPlus====================
jz-dm-apigateway/src/main/resources/application-test.yml
View file @
80eaacfa
...
@@ -49,32 +49,3 @@ spring:
...
@@ -49,32 +49,3 @@ spring:
filters
:
stat
filters
:
stat
# ====================MybatisPlus====================
# ====================MybatisPlus====================
mybatis-plus
:
# 如果是放在src/main/java目录下 classpath:/com/yourpackage/*/mapper/*Mapper.xml
# 如果是放在resource目录 classpath:/mapper/*Mapper.xml
mapper-locations
:
classpath*:com/frame/**/**.xml,classpath*:mapping/**/**.xml
#实体扫描,多个package用逗号或者分号分隔
typeAliasesPackage
:
com.frame.**.entity,com.frame.**.dto
global-config
:
#刷新mapper 调试神器
db-config
:
#主键类型 0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
id-type
:
UUID
#字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
field-strategy
:
2
#驼峰下划线转换
column-underline
:
false
#数据库大写下划线转换
# capital-mode: true
#逻辑删除配置
logic-delete-value
:
1
logic-not-delete-value
:
0
refresh
:
true
configuration
:
#配置返回数据库(column下划线命名&&返回java实体是驼峰命名),自动匹配无需as(没开启这个,SQL需要写as: select user_id as userId)
map-underscore-to-camel-case
:
true
cache-enabled
:
false
#配置JdbcTypeForNull, oracle数据库必须配置
jdbc-type-for-null
:
'
null'
log-impl
:
org.apache.ibatis.logging.stdout.StdOutImpl
database-id
:
mysql
\ No newline at end of file
jz-dm-apigateway/src/main/resources/application.yml
View file @
80eaacfa
...
@@ -19,19 +19,34 @@ spring:
...
@@ -19,19 +19,34 @@ spring:
active
:
test
#默认使用的配置文件
active
:
test
#默认使用的配置文件
#MyBatis
mybatis-plus
:
#mybatis-plus:
# 如果是放在src/main/java目录下 classpath:/com/yourpackage/*/mapper/*Mapper.xml
# mapper-locations: classpath:/mapper/**/*.xml
# 如果是放在resource目录 classpath:/mapper/*Mapper.xml
# typeAliasesPackage: com.jz.common.entity
mapper-locations
:
classpath*:com/frame/**/**.xml,classpath*:mapping/**/**.xml
# #type-handlers-package: com.btcpay.commons.typehandler
#实体扫描,多个package用逗号或者分号分隔
# global-config:
typeAliasesPackage
:
com.frame.**.entity,com.frame.**.dto
# id-type: 1
global-config
:
# field-strategy: 2
#刷新mapper 调试神器
# db-column-underline: true
db-config
:
# refresh-mapper: true
#主键类型 0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
# configuration:
id-type
:
UUID
# map-underscore-to-camel-case: true
#字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
# cache-enabled: false
field-strategy
:
2
# #log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
#驼峰下划线转换
column-underline
:
false
#数据库大写下划线转换
# capital-mode: true
#逻辑删除配置
logic-delete-value
:
1
logic-not-delete-value
:
0
refresh
:
true
configuration
:
#配置返回数据库(column下划线命名&&返回java实体是驼峰命名),自动匹配无需as(没开启这个,SQL需要写as: select user_id as userId)
map-underscore-to-camel-case
:
true
cache-enabled
:
false
#配置JdbcTypeForNull, oracle数据库必须配置
jdbc-type-for-null
:
'
null'
log-impl
:
org.apache.ibatis.logging.stdout.StdOutImpl
database-id
:
mysql
jz-dm-common/src/main/java/com/jz/common/constant/ResultCode.java
0 → 100644
View file @
80eaacfa
package
com
.
jz
.
common
.
constant
;
import
com.alibaba.fastjson.JSON
;
/**
* @author ZC
* @PACKAGE_NAME: com.fbpay.broker.common
* @PROJECT_NAME: fbp-parent
* @NAME: ResultCode
* @USER: Administrator
* @DATE: 2020/5/24/10:39
* @DAY_NAME_SHORT: 周日
* @Description: 返回状态吗枚举类
**/
public
enum
ResultCode
{
/** 执行成功 */
SUCCESS
(
200
,
ResultMsg
.
SUCCESS
),
/** 执行失败 */
FAILURE
(
300
,
ResultMsg
.
DATA_NOT_FOUND
),
/** 未授权的访问 */
UNAUTHORIZED
(
401
,
ResultMsg
.
UNAUTHORIZED
),
/** 授权过期 */
INVALID_TOKEN
(
402
,
ResultMsg
.
INVALID_TOKEN
),
/** 禁止访问 */
FORBIDOM
(
403
,
ResultMsg
.
FORBIDOM
);
private
int
code
;
/**
* 提示信息
*/
private
ResultMsg
msg
;
private
ResultCode
(
int
code
,
ResultMsg
msg
)
{
this
.
code
=
code
;
this
.
msg
=
msg
;
}
/**
* 通过业务代码获取业务操作枚举
* @param code 业务代码
* @return 业务枚举
*/
public
static
ResultCode
getResultStatusEnum
(
int
code
)
{
for
(
ResultCode
item
:
ResultCode
.
values
())
{
if
(
item
.
code
==
code
)
{
return
item
;
}
}
return
null
;
}
@Override
public
String
toString
()
{
return
JSON
.
toJSONString
(
this
);
}
public
int
getCode
()
{
return
code
;
}
public
ResultMsg
getMsg
()
{
return
this
.
msg
;
}
public
void
setMsg
(
ResultMsg
msg
)
{
this
.
msg
=
msg
;
}
}
jz-dm-common/src/main/java/com/jz/common/constant/ResultMsg.java
0 → 100644
View file @
80eaacfa
This diff is collapsed.
Click to expand it.
jz-dm-common/src/main/java/com/jz/common/exception/ResponseException.java
0 → 100644
View file @
80eaacfa
package
com
.
jz
.
common
.
exception
;
import
com.jz.common.constant.ResultCode
;
import
com.jz.common.constant.ResultMsg
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
/**
* @date 业务异常 父类。在restful 接口层使用切面捕获,统一封装输出。
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
ResponseException
extends
RuntimeException
{
private
static
final
long
serialVersionUID
=
-
721489076559710085L
;
/**
* 错误代码
*/
protected
ResultCode
code
;
/**
* 错误信息
*/
protected
String
message
;
private
Throwable
cause
;
public
static
ResponseException
of_error
(
ResultMsg
errorMsg
)
{
return
ResponseException
.
of
(
ResultCode
.
FAILURE
,
errorMsg
.
getMsg
());
}
public
static
ResponseException
of_error
(
String
errorMsg
)
{
return
ResponseException
.
of
(
ResultCode
.
FAILURE
,
errorMsg
);
}
public
static
ResponseException
of
(
ResultCode
code
)
{
ResponseException
ufaceException
=
new
ResponseException
();
ufaceException
.
setCode
(
code
);
ufaceException
.
setMessage
(
code
.
getMsg
().
getMsg
());
return
ufaceException
;
}
public
static
ResponseException
of
(
ResultCode
code
,
String
message
)
{
ResponseException
ufaceException
=
new
ResponseException
();
ufaceException
.
setCode
(
code
);
ufaceException
.
setMessage
(
message
);
return
ufaceException
;
}
public
static
ResponseException
ofDetail
(
ResultCode
code
,
Object
...
params
)
{
String
message
=
String
.
format
(
code
.
getMsg
().
getMsg
(),
params
);
ResponseException
ufaceException
=
new
ResponseException
();
ufaceException
.
setCode
(
code
);
ufaceException
.
setMessage
(
message
);
return
ufaceException
;
}
public
static
ResponseException
of
(
ResultCode
code
,
Throwable
cause
)
{
ResponseException
ufaceException
=
new
ResponseException
();
ufaceException
.
setCode
(
code
);
ufaceException
.
setCause
(
cause
);
ufaceException
.
setMessage
(
"todo need get from db/properties"
);
return
ufaceException
;
}
}
jz-dm-mall/pom.xml
View file @
80eaacfa
...
@@ -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>
...
...
jz-dm-mall/src/main/java/com/jz/dm/mall/config/DatabaseConfig.java
View file @
80eaacfa
This diff is collapsed.
Click to expand it.
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/controller/finance/FinanceTradeFlowController.java
View file @
80eaacfa
...
@@ -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.Order
Dto
;
import
com.jz.dm.mall.moduls.controller.
finance.bean.FinanceCustomerAssets
Dto
;
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
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/controller/finance/bean/FinanceCustomerAssetsDto.java
0 → 100644
View file @
80eaacfa
package
com
.
jz
.
dm
.
mall
.
moduls
.
controller
.
finance
.
bean
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
/**
* 商城企业客户资产(TFinanceCustomerAssets)实体类
*
* @author Bellamy
* @since 2020-12-01 10:41:38
*/
@ApiModel
public
class
FinanceCustomerAssetsDto
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
86484762300825431L
;
/**
* 资产id
*/
@TableId
(
value
=
"assets_id"
,
type
=
IdType
.
AUTO
)
@ApiModelProperty
(
value
=
"资产id"
)
private
Long
assetsId
;
/**
* 企业id
*/
@ApiModelProperty
(
value
=
"企业id"
)
private
Long
departmentId
;
/**
* 可用金额
*/
@ApiModelProperty
(
value
=
"可用金额"
)
private
BigDecimal
useMoney
;
/**
* 冻结金额
*/
@ApiModelProperty
(
value
=
"冻结金额"
)
private
BigDecimal
frozenMoney
;
/**
* 总金额
*/
@ApiModelProperty
(
value
=
"总金额"
)
private
BigDecimal
totalMoney
;
public
Long
getAssetsId
()
{
return
assetsId
;
}
public
void
setAssetsId
(
Long
assetsId
)
{
this
.
assetsId
=
assetsId
;
}
public
Long
getDepartmentId
()
{
return
departmentId
;
}
public
void
setDepartmentId
(
Long
departmentId
)
{
this
.
departmentId
=
departmentId
;
}
public
BigDecimal
getUseMoney
()
{
return
useMoney
;
}
public
void
setUseMoney
(
BigDecimal
useMoney
)
{
this
.
useMoney
=
useMoney
;
}
public
BigDecimal
getFrozenMoney
()
{
return
frozenMoney
;
}
public
void
setFrozenMoney
(
BigDecimal
frozenMoney
)
{
this
.
frozenMoney
=
frozenMoney
;
}
public
BigDecimal
getTotalMoney
()
{
return
totalMoney
;
}
public
void
setTotalMoney
(
BigDecimal
totalMoney
)
{
this
.
totalMoney
=
totalMoney
;
}
}
\ No newline at end of file
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/mapper/FinanceTradeFlowDao.java
View file @
80eaacfa
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
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/service/FinanceTradeFlowService.java
View file @
80eaacfa
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
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/service/impl/CompanyAuthServiceImpl.java
View file @
80eaacfa
package
com
.
jz
.
dm
.
mall
.
moduls
.
service
.
impl
;
package
com
.
jz
.
dm
.
mall
.
moduls
.
service
.
impl
;
import
com.jz.common.entity.Department
;
import
com.jz.common.entity.Department
;
import
com.jz.common.exception.ResponseException
;
import
com.jz.dm.mall.moduls.entity.FinanceCustomerAssets
;
import
com.jz.dm.mall.moduls.entity.FinanceCustomerAssets
;
import
com.jz.dm.mall.moduls.entity.MallCustomer
;
import
com.jz.dm.mall.moduls.entity.MallCustomer
;
import
com.jz.common.utils.Result
;
import
com.jz.common.utils.Result
;
...
@@ -104,7 +105,7 @@ public class CompanyAuthServiceImpl implements CompanyAuthService {
...
@@ -104,7 +105,7 @@ public class CompanyAuthServiceImpl implements CompanyAuthService {
departmentInset
.
setCrePerson
(
req
.
getLoginName
());
departmentInset
.
setCrePerson
(
req
.
getLoginName
());
BeanUtils
.
copyProperties
(
req
,
departmentInset
);
BeanUtils
.
copyProperties
(
req
,
departmentInset
);
if
(
departmentDao
.
insert
(
departmentInset
)
!=
1
){
if
(
departmentDao
.
insert
(
departmentInset
)
!=
1
){
throw
new
RuntimeException
(
"保存企业信息失败"
);
throw
ResponseException
.
of_error
(
"保存企业信息失败"
);
}
}
//初始化用户资产表
//初始化用户资产表
FinanceCustomerAssets
finance
=
new
FinanceCustomerAssets
();
FinanceCustomerAssets
finance
=
new
FinanceCustomerAssets
();
...
@@ -112,7 +113,7 @@ public class CompanyAuthServiceImpl implements CompanyAuthService {
...
@@ -112,7 +113,7 @@ public class CompanyAuthServiceImpl implements CompanyAuthService {
finance
.
setCreTime
(
new
Date
());
finance
.
setCreTime
(
new
Date
());
finance
.
setCrePerson
(
req
.
getLoginName
());
finance
.
setCrePerson
(
req
.
getLoginName
());
if
(
financeCustomerAssetsDao
.
insert
(
finance
)
!=
1
){
if
(
financeCustomerAssetsDao
.
insert
(
finance
)
!=
1
){
throw
new
RuntimeException
(
"初始化用户资产失败"
);
throw
ResponseException
.
of_error
(
"初始化用户资产失败"
);
}
}
//更新用户企业信息
//更新用户企业信息
MallCustomer
mallCustomer
=
new
MallCustomer
();
MallCustomer
mallCustomer
=
new
MallCustomer
();
...
@@ -121,7 +122,7 @@ public class CompanyAuthServiceImpl implements CompanyAuthService {
...
@@ -121,7 +122,7 @@ public class CompanyAuthServiceImpl implements CompanyAuthService {
mallCustomer
.
setUptTime
(
new
Date
());
mallCustomer
.
setUptTime
(
new
Date
());
// mallCustomer.setUptPerson(req.getLoginName());
// mallCustomer.setUptPerson(req.getLoginName());
if
(
mallCustomerDao
.
updateById
(
mallCustomer
)
!=
1
){
if
(
mallCustomerDao
.
updateById
(
mallCustomer
)
!=
1
){
throw
new
RuntimeException
(
"更新用户企业信息失败"
);
throw
ResponseException
.
of_error
(
"更新用户企业信息失败"
);
}
}
}
}
}
}
jz-dm-mall/src/main/java/com/jz/dm/mall/moduls/service/impl/FinanceTradeFlowServiceImpl.java
View file @
80eaacfa
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
tF
inanceTradeFlowDao
;
private
FinanceTradeFlowDao
f
inanceTradeFlowDao
;
@Override
public
FinanceCustomerAssetsDto
queryAccountMoneyByMap
(
Map
map
)
throws
Exception
{
return
financeTradeFlowDao
.
queryAccountMoneyByMap
(
map
);
}
}
}
\ No newline at end of file
jz-dm-mall/src/main/resources/mapperconf/FinanceCustomerAssetsDao.xml
View file @
80eaacfa
...
@@ -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"
>
...
...
jz-dm-mall/src/main/resources/mapperconf/FinanceTradeFlowDao.xml
0 → 100644
View file @
80eaacfa
<?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.jz.dm.mall.moduls.mapper.FinanceTradeFlowDao"
>
<!--商城 充值 只有已审核(认证)企业-->
<select
id=
"queryAccountMoneyByMap"
resultType=
"com.jz.dm.mall.moduls.controller.finance.bean.FinanceCustomerAssetsDto"
parameterType=
"map"
>
select
assets_id as assetsId,
department_id as departmentId,
use_money as useMoney,
frozen_money as frozenMoney,
total_money as totalMoney
from t_finance_customer_assets t
left join t_department t1 on t.department_id=t1.department_id and t1.audit_status='02'
where 1=1
<if
test=
"assetsId != null"
>
and assets_id = #{assetsId}
</if>
<if
test=
"departmentId != null"
>
and department_id = #{departmentId}
</if>
</select>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment