Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
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
fangxinjiang
yifu-mvp
Commits
5bc7c1e3
Commit
5bc7c1e3
authored
Dec 08, 2022
by
李灿灿
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:操作变更记录
parent
c6215801
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
222 additions
and
0 deletions
+222
-0
TBusinessOperate.java
...loud/plus/v1/yifu/insurances/entity/TBusinessOperate.java
+59
-0
TBusinessOperateMapper.java
.../insurances/mapper/insurances/TBusinessOperateMapper.java
+19
-0
TBusinessOperateService.java
...insurances/service/insurance/TBusinessOperateService.java
+34
-0
TBusinessOperateServiceImpl.java
...s/service/insurance/impl/TBusinessOperateServiceImpl.java
+83
-0
TBusinessOperateMapper.xml
...in/resources/mapper/insurances/TBusinessOperateMapper.xml
+27
-0
No files found.
yifu-insurances/yifu-insurances-api/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/entity/TBusinessOperate.java
0 → 100644
View file @
5bc7c1e3
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
insurances
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
/**
* @author licancan
* @description 业务操作记录表 t_business_operate
* @date 2022-12-08 10:20:16
*/
@TableName
(
value
=
"t_business_operate"
)
@Data
@Schema
(
description
=
"业务操作记录表"
)
public
class
TBusinessOperate
extends
BaseEntity
{
/**
* 主键
*/
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
@Schema
(
description
=
"主键"
)
private
String
id
;
/**
* 业务表id
*/
@Schema
(
description
=
"业务表id"
)
private
String
businessId
;
/**
* 原来的信息
*/
@Schema
(
description
=
"原来的信息"
)
private
String
oldInfo
;
/**
* 新的信息
*/
@Schema
(
description
=
"新的信息"
)
private
String
newInfo
;
/**
* 操作描述
*/
@Schema
(
description
=
"操作描述:差异的信息(属性名称,逗号隔开)"
)
private
String
differenceInfo
;
/**
* 备注
*/
@Schema
(
description
=
"备注"
)
private
String
remark
;
@TableField
(
exist
=
false
)
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/mapper/insurances/TBusinessOperateMapper.java
0 → 100644
View file @
5bc7c1e3
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
insurances
.
mapper
.
insurances
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.TBusinessOperate
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* @author licancan
* @description 针对表【t_business_operate(业务操作记录表)】的数据库操作Mapper
* @date 2022-12-08 10:20:16
*/
@Mapper
public
interface
TBusinessOperateMapper
extends
BaseMapper
<
TBusinessOperate
>
{
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/insurance/TBusinessOperateService.java
0 → 100644
View file @
5bc7c1e3
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
insurances
.
service
.
insurance
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.TBusinessOperate
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
java.util.List
;
/**
* @author licancan
* @description 针对表【t_business_operate(业务操作记录表)】的数据库操作Service
* @date 2022-12-08 10:20:16
*/
public
interface
TBusinessOperateService
extends
IService
<
TBusinessOperate
>
{
/**
* 保存修改记录
*
* @author licancan
* @param businessId 业务表主键
* @param oldInfo 老的实体类
* @param newInfo 新的实体类
* @param remark 备注
* @return {@link TBusinessOperate}
*/
<
T
>
TBusinessOperate
saveModificationRecord
(
String
businessId
,
T
oldInfo
,
T
newInfo
,
String
remark
);
/**
* 根据业务主键获取操作记录
*
* @author licancan
* @param businessId
* @return {@link List<TBusinessOperate>}
*/
List
<
TBusinessOperate
>
getOperateListByBusinessId
(
String
businessId
);
}
yifu-insurances/yifu-insurances-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/insurances/service/insurance/impl/TBusinessOperateServiceImpl.java
0 → 100644
View file @
5bc7c1e3
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
insurances
.
service
.
insurance
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.serializer.SerializerFeature
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.equator.HrEquator
;
import
com.yifu.cloud.plus.v1.yifu.insurances.entity.TBusinessOperate
;
import
com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TBusinessOperateMapper
;
import
com.yifu.cloud.plus.v1.yifu.insurances.service.insurance.TBusinessOperateService
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
static
com
.
alibaba
.
fastjson
.
serializer
.
SerializerFeature
.*;
/**
* @author licancan
* @description 针对表【t_business_operate(业务操作记录表)】的数据库操作Service实现
* @date 2022-12-08 10:20:16
*/
@Service
public
class
TBusinessOperateServiceImpl
extends
ServiceImpl
<
TBusinessOperateMapper
,
TBusinessOperate
>
implements
TBusinessOperateService
{
/**
* 保存修改记录
*
* @param businessId 业务表主键
* @param oldInfo 老的实体类
* @param newInfo 新的实体类
* @param remark 备注
* @return {@link TBusinessOperate}
* @author licancan
*/
@Override
public
<
T
>
TBusinessOperate
saveModificationRecord
(
String
businessId
,
T
oldInfo
,
T
newInfo
,
String
remark
)
{
try
{
//比较记录不影响业务逻辑,用try套住
//比较差异
String
differenceKey
=
HrEquator
.
comparisonValue
(
oldInfo
,
newInfo
);
//如果有差异保存差异
if
(!
Common
.
isEmpty
(
differenceKey
)){
TBusinessOperate
operate
=
new
TBusinessOperate
();
operate
.
setBusinessId
(
businessId
);
operate
.
setCreateTime
(
LocalDateTime
.
now
());
operate
.
setOldInfo
(
JSON
.
toJSONString
(
oldInfo
,
features
));
operate
.
setNewInfo
(
JSON
.
toJSONString
(
newInfo
,
features
));
operate
.
setDifferenceInfo
(
differenceKey
);
operate
.
setRemark
(
remark
);
baseMapper
.
insert
(
operate
);
return
operate
;
}
}
catch
(
Exception
e
){
log
.
error
(
JSON
.
toJSON
(
oldInfo
)+
"插入修改记录报错>>>"
,
e
);
}
return
null
;
}
/**
* 根据业务主键获取操作记录
*
* @param businessId
* @return {@link List <TBusinessOperate>}
* @author licancan
*/
@Override
public
List
<
TBusinessOperate
>
getOperateListByBusinessId
(
String
businessId
)
{
List
<
TBusinessOperate
>
list
=
this
.
baseMapper
.
selectList
(
Wrappers
.<
TBusinessOperate
>
query
().
lambda
()
.
eq
(
TBusinessOperate:
:
getBusinessId
,
businessId
));
return
list
;
}
private
SerializerFeature
[]
features
=
new
SerializerFeature
[]
{
WriteMapNullValue
,
WriteNullNumberAsZero
,
WriteNullListAsEmpty
,
WriteNullStringAsEmpty
,
WriteDateUseDateFormat
};
}
yifu-insurances/yifu-insurances-biz/src/main/resources/mapper/insurances/TBusinessOperateMapper.xml
0 → 100644
View file @
5bc7c1e3
<?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.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances.TBusinessOperateMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.yifu.cloud.plus.v1.yifu.insurances.entity.TBusinessOperate"
>
<id
property=
"id"
column=
"ID"
jdbcType=
"VARCHAR"
/>
<result
property=
"businessId"
column=
"BUSINESS_ID"
jdbcType=
"VARCHAR"
/>
<result
property=
"oldInfo"
column=
"OLD_INFO"
jdbcType=
"VARCHAR"
/>
<result
property=
"newInfo"
column=
"NEW_INFO"
jdbcType=
"VARCHAR"
/>
<result
property=
"differenceInfo"
column=
"DIFFERENCE_INFO"
jdbcType=
"VARCHAR"
/>
<result
property=
"remark"
column=
"REMARK"
jdbcType=
"VARCHAR"
/>
<result
property=
"createBy"
column=
"CREATE_BY"
jdbcType=
"VARCHAR"
/>
<result
property=
"createName"
column=
"CREATE_NAME"
jdbcType=
"VARCHAR"
/>
<result
property=
"createTime"
column=
"CREATE_TIME"
jdbcType=
"TIMESTAMP"
/>
<result
property=
"updateBy"
column=
"UPDATE_BY"
jdbcType=
"VARCHAR"
/>
<result
property=
"updateTime"
column=
"UPDATE_TIME"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
ID,BUSINESS_ID,OPERATE_DESC,
REMARK,CREATE_BY,CREATE_NAME,
CREATE_TIME,UPDATE_BY,
UPDATE_TIME
</sql>
</mapper>
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