Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-store
Overview
Overview
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
base_platform_enterprise
gic-store
Commits
8e179978
Commit
8e179978
authored
Jan 13, 2021
by
guojuxing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
门店选择器日志增删改查
parent
7d30aebe
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
1169 additions
and
0 deletions
+1169
-0
StoreWidgetLogDTO.java
...pi/src/main/java/com/gic/store/dto/StoreWidgetLogDTO.java
+261
-0
StoreWidgetLogSaveDTO.java
...rc/main/java/com/gic/store/dto/StoreWidgetLogSaveDTO.java
+154
-0
StoreWidgetLogApiService.java
.../java/com/gic/store/service/StoreWidgetLogApiService.java
+47
-0
TabStoreWidgetLogMapper.java
...ava/com/gic/store/dao/mapper/TabStoreWidgetLogMapper.java
+65
-0
TabStoreWidgetLog.java
...src/main/java/com/gic/store/entity/TabStoreWidgetLog.java
+237
-0
StoreWidgetLogService.java
...ain/java/com/gic/store/service/StoreWidgetLogService.java
+45
-0
StoreWidgetLogServiceImpl.java
...com/gic/store/service/impl/StoreWidgetLogServiceImpl.java
+61
-0
StoreWidgetLogApiServiceImpl.java
...tore/service/outer/impl/StoreWidgetLogApiServiceImpl.java
+103
-0
dubbo-gic-store-service.xml
...re-service/src/main/resources/dubbo-gic-store-service.xml
+2
-0
TabStoreWidgetLogMapper.xml
...ice/src/main/resources/mapper/TabStoreWidgetLogMapper.xml
+192
-0
dubbo-gic-store-web.xml
gic-store-web/src/main/resources/dubbo-gic-store-web.xml
+2
-0
No files found.
gic-store-api/src/main/java/com/gic/store/dto/StoreWidgetLogDTO.java
0 → 100644
View file @
8e179978
package
com
.
gic
.
store
.
dto
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 门店选择器日志
* @ClassName:
* @Description:
* @author guojuxing
* @date 2021/1/13 2:53 PM
*/
public
class
StoreWidgetLogDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
3257815009475998918L
;
/**
* id
*/
private
Integer
storeWidgetLogId
;
/**
* 门店选择器ID,关联字段
*/
private
Integer
storeWidgetId
;
/**
* 商户ID
*/
private
Integer
enterpriseId
;
/**
* 更新前的筛选条件/权限范围
*/
private
String
searchParamBefore
;
/**
* 更新后的筛选条件/权限范围
*/
private
String
searchParamAfter
;
/**
* 更新前的筛选条件/权限范围 解析内容冗余
*/
private
String
searchParamTextBefore
;
/**
* 更新后的筛选条件/权限范围 解析内容冗余
*/
private
String
searchParamTextAfter
;
/**
* 1:变更权限范围 2:编辑筛选条件
*/
private
Integer
logType
;
/**
* 1:创建 2:操作
*/
private
Integer
operationType
;
/**
* 操作人ID user_id
*/
private
Integer
operationId
;
/**
* 操作人名称 冗余
*/
private
String
operationName
;
/**
* 操作人职位 1:CRM经理、2:商城运营经理、3:IT经理。冗余
*/
private
Integer
operationPosition
;
/**
* 操作人职位 1:CRM经理、2:商城运营经理、3:IT经理。冗余
*/
private
String
operationPositionText
;
/**
*
*/
private
Integer
deleteFlag
;
/**
*
*/
private
Date
createTime
;
/**
*
*/
private
Date
updateTime
;
public
Integer
getStoreWidgetLogId
()
{
return
storeWidgetLogId
;
}
public
StoreWidgetLogDTO
setStoreWidgetLogId
(
Integer
storeWidgetLogId
)
{
this
.
storeWidgetLogId
=
storeWidgetLogId
;
return
this
;
}
public
Integer
getStoreWidgetId
()
{
return
storeWidgetId
;
}
public
StoreWidgetLogDTO
setStoreWidgetId
(
Integer
storeWidgetId
)
{
this
.
storeWidgetId
=
storeWidgetId
;
return
this
;
}
public
Integer
getEnterpriseId
()
{
return
enterpriseId
;
}
public
StoreWidgetLogDTO
setEnterpriseId
(
Integer
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
return
this
;
}
public
String
getSearchParamBefore
()
{
return
searchParamBefore
;
}
public
StoreWidgetLogDTO
setSearchParamBefore
(
String
searchParamBefore
)
{
this
.
searchParamBefore
=
searchParamBefore
;
return
this
;
}
public
String
getSearchParamAfter
()
{
return
searchParamAfter
;
}
public
StoreWidgetLogDTO
setSearchParamAfter
(
String
searchParamAfter
)
{
this
.
searchParamAfter
=
searchParamAfter
;
return
this
;
}
public
String
getSearchParamTextBefore
()
{
return
searchParamTextBefore
;
}
public
StoreWidgetLogDTO
setSearchParamTextBefore
(
String
searchParamTextBefore
)
{
this
.
searchParamTextBefore
=
searchParamTextBefore
;
return
this
;
}
public
String
getSearchParamTextAfter
()
{
return
searchParamTextAfter
;
}
public
StoreWidgetLogDTO
setSearchParamTextAfter
(
String
searchParamTextAfter
)
{
this
.
searchParamTextAfter
=
searchParamTextAfter
;
return
this
;
}
public
Integer
getLogType
()
{
return
logType
;
}
public
StoreWidgetLogDTO
setLogType
(
Integer
logType
)
{
this
.
logType
=
logType
;
return
this
;
}
public
Integer
getOperationType
()
{
return
operationType
;
}
public
StoreWidgetLogDTO
setOperationType
(
Integer
operationType
)
{
this
.
operationType
=
operationType
;
return
this
;
}
public
Integer
getOperationId
()
{
return
operationId
;
}
public
StoreWidgetLogDTO
setOperationId
(
Integer
operationId
)
{
this
.
operationId
=
operationId
;
return
this
;
}
public
String
getOperationName
()
{
return
operationName
;
}
public
StoreWidgetLogDTO
setOperationName
(
String
operationName
)
{
this
.
operationName
=
operationName
;
return
this
;
}
public
Integer
getOperationPosition
()
{
return
operationPosition
;
}
public
StoreWidgetLogDTO
setOperationPosition
(
Integer
operationPosition
)
{
this
.
operationPosition
=
operationPosition
;
return
this
;
}
public
String
getOperationPositionText
()
{
return
operationPositionText
;
}
public
StoreWidgetLogDTO
setOperationPositionText
(
String
operationPositionText
)
{
this
.
operationPositionText
=
operationPositionText
;
return
this
;
}
public
Integer
getDeleteFlag
()
{
return
deleteFlag
;
}
public
StoreWidgetLogDTO
setDeleteFlag
(
Integer
deleteFlag
)
{
this
.
deleteFlag
=
deleteFlag
;
return
this
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
StoreWidgetLogDTO
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
return
this
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
StoreWidgetLogDTO
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
return
this
;
}
@Override
public
String
toString
()
{
return
"StoreWidgetLogDTO{"
+
"storeWidgetLogId="
+
storeWidgetLogId
+
", storeWidgetId="
+
storeWidgetId
+
", enterpriseId="
+
enterpriseId
+
", searchParamBefore='"
+
searchParamBefore
+
'\''
+
", searchParamAfter='"
+
searchParamAfter
+
'\''
+
", searchParamTextBefore='"
+
searchParamTextBefore
+
'\''
+
", searchParamTextAfter='"
+
searchParamTextAfter
+
'\''
+
", logType="
+
logType
+
", operationType="
+
operationType
+
", operationId="
+
operationId
+
", operationName='"
+
operationName
+
'\''
+
", operationPosition="
+
operationPosition
+
", operationPositionText='"
+
operationPositionText
+
'\''
+
", deleteFlag="
+
deleteFlag
+
", createTime="
+
createTime
+
", updateTime="
+
updateTime
+
'}'
;
}
}
gic-store-api/src/main/java/com/gic/store/dto/StoreWidgetLogSaveDTO.java
0 → 100644
View file @
8e179978
package
com
.
gic
.
store
.
dto
;
import
java.io.Serializable
;
/**
* 门店选择器日志新增参数
* @ClassName:
* @Description:
* @author guojuxing
* @date 2021/1/13 2:59 PM
*/
public
class
StoreWidgetLogSaveDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
8936879207952326564L
;
/**
* 门店选择器ID,关联字段
*/
private
Integer
storeWidgetId
;
/**
* 商户ID
*/
private
Integer
enterpriseId
;
/**
* 更新前的筛选条件/权限范围
*/
private
String
searchParamBefore
;
/**
* 更新后的筛选条件/权限范围
*/
private
String
searchParamAfter
;
/**
* 更新前的筛选条件/权限范围 解析内容冗余
*/
private
String
searchParamTextBefore
;
/**
* 更新后的筛选条件/权限范围 解析内容冗余
*/
private
String
searchParamTextAfter
;
/**
* 1:变更权限范围 2:编辑筛选条件
*/
private
Integer
logType
;
/**
* 操作人ID user_id
*/
private
Integer
operationId
;
/**
* 1:创建 2:操作
*/
private
Integer
operationType
;
public
Integer
getStoreWidgetId
()
{
return
storeWidgetId
;
}
public
StoreWidgetLogSaveDTO
setStoreWidgetId
(
Integer
storeWidgetId
)
{
this
.
storeWidgetId
=
storeWidgetId
;
return
this
;
}
public
Integer
getEnterpriseId
()
{
return
enterpriseId
;
}
public
StoreWidgetLogSaveDTO
setEnterpriseId
(
Integer
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
return
this
;
}
public
String
getSearchParamBefore
()
{
return
searchParamBefore
;
}
public
StoreWidgetLogSaveDTO
setSearchParamBefore
(
String
searchParamBefore
)
{
this
.
searchParamBefore
=
searchParamBefore
;
return
this
;
}
public
String
getSearchParamAfter
()
{
return
searchParamAfter
;
}
public
StoreWidgetLogSaveDTO
setSearchParamAfter
(
String
searchParamAfter
)
{
this
.
searchParamAfter
=
searchParamAfter
;
return
this
;
}
public
String
getSearchParamTextBefore
()
{
return
searchParamTextBefore
;
}
public
StoreWidgetLogSaveDTO
setSearchParamTextBefore
(
String
searchParamTextBefore
)
{
this
.
searchParamTextBefore
=
searchParamTextBefore
;
return
this
;
}
public
String
getSearchParamTextAfter
()
{
return
searchParamTextAfter
;
}
public
StoreWidgetLogSaveDTO
setSearchParamTextAfter
(
String
searchParamTextAfter
)
{
this
.
searchParamTextAfter
=
searchParamTextAfter
;
return
this
;
}
public
Integer
getOperationId
()
{
return
operationId
;
}
public
StoreWidgetLogSaveDTO
setOperationId
(
Integer
operationId
)
{
this
.
operationId
=
operationId
;
return
this
;
}
public
Integer
getLogType
()
{
return
logType
;
}
public
StoreWidgetLogSaveDTO
setLogType
(
Integer
logType
)
{
this
.
logType
=
logType
;
return
this
;
}
public
Integer
getOperationType
()
{
return
operationType
;
}
public
StoreWidgetLogSaveDTO
setOperationType
(
Integer
operationType
)
{
this
.
operationType
=
operationType
;
return
this
;
}
@Override
public
String
toString
()
{
return
"StoreWidgetLogSaveDTO{"
+
"storeWidgetId="
+
storeWidgetId
+
", enterpriseId="
+
enterpriseId
+
", searchParamBefore='"
+
searchParamBefore
+
'\''
+
", searchParamAfter='"
+
searchParamAfter
+
'\''
+
", searchParamTextBefore='"
+
searchParamTextBefore
+
'\''
+
", searchParamTextAfter='"
+
searchParamTextAfter
+
'\''
+
", logType="
+
logType
+
", operationId="
+
operationId
+
", operationType="
+
operationType
+
'}'
;
}
}
gic-store-api/src/main/java/com/gic/store/service/StoreWidgetLogApiService.java
0 → 100644
View file @
8e179978
package
com
.
gic
.
store
.
service
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.store.dto.StoreWidgetLogDTO
;
import
com.gic.store.dto.StoreWidgetLogSaveDTO
;
/**
* 门店选择器操作日志
* @ClassName:
* @Description:
* @author guojuxing
* @date 2021/1/13 2:55 PM
*/
public
interface
StoreWidgetLogApiService
{
/**
* 新增门店选择器操作日志
* @param storeWidgetLog
* @return
*/
ServiceResponse
<
Integer
>
saveStoreWidgetLog
(
StoreWidgetLogSaveDTO
storeWidgetLog
);
/**
* 修改关联字段,因为门店选择器的ID总是新增指向最新,不维护旧数据.为了保持日志关联,需要更新关联字段
* @param oldStoreWidgetId
* @param newStoreWidgetId
* @return
*/
ServiceResponse
<
Void
>
tmpUpdateByStoreWidgetId
(
Integer
oldStoreWidgetId
,
Integer
newStoreWidgetId
);
/**
* 分页查询门店选择器操作日志
* @param storeWidgetId 门店选择器ID
* @param pageNum
* @param pageSize
* @return
*/
ServiceResponse
<
Page
<
StoreWidgetLogDTO
>>
pageStoreWidgetLog
(
Integer
storeWidgetId
,
Integer
pageNum
,
Integer
pageSize
);
/**
* 查询门店选择器最新的操作人信息
* @param storeWidgetId 门店选择器ID
* @return
*/
ServiceResponse
<
StoreWidgetLogDTO
>
getLastOperationInfo
(
Integer
storeWidgetId
);
}
gic-store-service/src/main/java/com/gic/store/dao/mapper/TabStoreWidgetLogMapper.java
0 → 100644
View file @
8e179978
package
com
.
gic
.
store
.
dao
.
mapper
;
import
com.gic.store.entity.TabStoreWidgetLog
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 门店选择器日志
* @ClassName:
* @Description:
* @author guojuxing
* @date 2021/1/13 3:36 PM
*/
public
interface
TabStoreWidgetLogMapper
{
/**
* 插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int
insert
(
TabStoreWidgetLog
record
);
/**
* 动态插入一条记录
*
* @param record 实体对象
* @return 更新条目数
*/
int
insertSelective
(
TabStoreWidgetLog
record
);
/**
* 根据主键查询
*
* @param storeWidgetLogId 主键
* @return 实体对象
*/
TabStoreWidgetLog
selectByPrimaryKey
(
Integer
storeWidgetLogId
);
/**
* 修改关联字段,因为门店选择器的ID总是新增指向最新,不维护旧数据.为了保持日志关联,需要更新关联字段
* @param oldStoreWidgetId
* @param newStoreWidgetId
* @return
*/
int
tmpUpdateByStoreWidgetId
(
@Param
(
"oldStoreWidgetId"
)
Integer
oldStoreWidgetId
,
@Param
(
"newStoreWidgetId"
)
Integer
newStoreWidgetId
);
/**
* 分页查询
* @param storeWidgetId
* @return
*/
List
<
TabStoreWidgetLog
>
pageStoreWidgetLog
(
@Param
(
"storeWidgetId"
)
Integer
storeWidgetId
);
/**
* 查询门店选择器最新的操作人信息
* @param storeWidgetId
* @return
*/
TabStoreWidgetLog
getLastOperationInfo
(
@Param
(
"storeWidgetId"
)
Integer
storeWidgetId
);
}
\ No newline at end of file
gic-store-service/src/main/java/com/gic/store/entity/TabStoreWidgetLog.java
0 → 100644
View file @
8e179978
package
com
.
gic
.
store
.
entity
;
import
java.util.Date
;
/**
* 门店选择器日志
* @ClassName:
* @Description:
* @author guojuxing
* @date 2021/1/13 2:53 PM
*/
public
class
TabStoreWidgetLog
{
/**
* id
*/
private
Integer
storeWidgetLogId
;
/**
* 门店选择器ID,关联字段
*/
private
Integer
storeWidgetId
;
/**
* 商户ID
*/
private
Integer
enterpriseId
;
/**
* 更新前的筛选条件/权限范围
*/
private
String
searchParamBefore
;
/**
* 更新后的筛选条件/权限范围
*/
private
String
searchParamAfter
;
/**
* 更新前的筛选条件/权限范围 解析内容冗余
*/
private
String
searchParamTextBefore
;
/**
* 更新后的筛选条件/权限范围 解析内容冗余
*/
private
String
searchParamTextAfter
;
/**
* 1:变更权限范围 2:编辑筛选条件
*/
private
Integer
logType
;
/**
* 1:创建 2:操作
*/
private
Integer
operationType
;
/**
* 操作人ID user_id
*/
private
Integer
operationId
;
/**
* 操作人名称 冗余
*/
private
String
operationName
;
/**
* 操作人职位 1:CRM经理、2:商城运营经理、3:IT经理。冗余
*/
private
Integer
operationPosition
;
/**
* 操作人职位 1:CRM经理、2:商城运营经理、3:IT经理。冗余
*/
private
String
operationPositionText
;
/**
*
*/
private
Integer
deleteFlag
;
/**
*
*/
private
Date
createTime
;
/**
*
*/
private
Date
updateTime
;
public
Integer
getStoreWidgetLogId
()
{
return
storeWidgetLogId
;
}
public
TabStoreWidgetLog
setStoreWidgetLogId
(
Integer
storeWidgetLogId
)
{
this
.
storeWidgetLogId
=
storeWidgetLogId
;
return
this
;
}
public
Integer
getStoreWidgetId
()
{
return
storeWidgetId
;
}
public
TabStoreWidgetLog
setStoreWidgetId
(
Integer
storeWidgetId
)
{
this
.
storeWidgetId
=
storeWidgetId
;
return
this
;
}
public
Integer
getEnterpriseId
()
{
return
enterpriseId
;
}
public
TabStoreWidgetLog
setEnterpriseId
(
Integer
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
return
this
;
}
public
String
getSearchParamBefore
()
{
return
searchParamBefore
;
}
public
TabStoreWidgetLog
setSearchParamBefore
(
String
searchParamBefore
)
{
this
.
searchParamBefore
=
searchParamBefore
;
return
this
;
}
public
String
getSearchParamAfter
()
{
return
searchParamAfter
;
}
public
TabStoreWidgetLog
setSearchParamAfter
(
String
searchParamAfter
)
{
this
.
searchParamAfter
=
searchParamAfter
;
return
this
;
}
public
String
getSearchParamTextBefore
()
{
return
searchParamTextBefore
;
}
public
TabStoreWidgetLog
setSearchParamTextBefore
(
String
searchParamTextBefore
)
{
this
.
searchParamTextBefore
=
searchParamTextBefore
;
return
this
;
}
public
String
getSearchParamTextAfter
()
{
return
searchParamTextAfter
;
}
public
TabStoreWidgetLog
setSearchParamTextAfter
(
String
searchParamTextAfter
)
{
this
.
searchParamTextAfter
=
searchParamTextAfter
;
return
this
;
}
public
Integer
getLogType
()
{
return
logType
;
}
public
TabStoreWidgetLog
setLogType
(
Integer
logType
)
{
this
.
logType
=
logType
;
return
this
;
}
public
Integer
getOperationType
()
{
return
operationType
;
}
public
TabStoreWidgetLog
setOperationType
(
Integer
operationType
)
{
this
.
operationType
=
operationType
;
return
this
;
}
public
Integer
getOperationId
()
{
return
operationId
;
}
public
TabStoreWidgetLog
setOperationId
(
Integer
operationId
)
{
this
.
operationId
=
operationId
;
return
this
;
}
public
String
getOperationName
()
{
return
operationName
;
}
public
TabStoreWidgetLog
setOperationName
(
String
operationName
)
{
this
.
operationName
=
operationName
;
return
this
;
}
public
Integer
getOperationPosition
()
{
return
operationPosition
;
}
public
TabStoreWidgetLog
setOperationPosition
(
Integer
operationPosition
)
{
this
.
operationPosition
=
operationPosition
;
return
this
;
}
public
String
getOperationPositionText
()
{
return
operationPositionText
;
}
public
TabStoreWidgetLog
setOperationPositionText
(
String
operationPositionText
)
{
this
.
operationPositionText
=
operationPositionText
;
return
this
;
}
public
Integer
getDeleteFlag
()
{
return
deleteFlag
;
}
public
TabStoreWidgetLog
setDeleteFlag
(
Integer
deleteFlag
)
{
this
.
deleteFlag
=
deleteFlag
;
return
this
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
TabStoreWidgetLog
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
return
this
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
TabStoreWidgetLog
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
return
this
;
}
}
\ No newline at end of file
gic-store-service/src/main/java/com/gic/store/service/StoreWidgetLogService.java
0 → 100644
View file @
8e179978
package
com
.
gic
.
store
.
service
;
import
com.gic.store.dto.StoreWidgetLogDTO
;
import
com.gic.store.entity.TabStoreWidgetLog
;
import
com.github.pagehelper.Page
;
/**
* 门店选择器操作日志
* @ClassName:
* @Description:
* @author guojuxing
* @date 2021/1/13 3:20 PM
*/
public
interface
StoreWidgetLogService
{
/**
* 新增操作日志
* @param storeWidgetLog
* @return
*/
Integer
saveStoreWidgetLog
(
StoreWidgetLogDTO
storeWidgetLog
);
/**
* 修改关联字段,因为门店选择器的ID总是新增指向最新,不维护旧数据.为了保持日志关联,需要更新关联字段
* @param oldStoreWidgetId
* @param newStoreWidgetId
* @return
*/
int
tmpUpdateByStoreWidgetId
(
Integer
oldStoreWidgetId
,
Integer
newStoreWidgetId
);
/**
* 分页查询
* @param storeWidgetId
* @param pageNum
* @param pageSize
* @return
*/
Page
<
TabStoreWidgetLog
>
pageStoreWidgetLog
(
Integer
storeWidgetId
,
Integer
pageNum
,
Integer
pageSize
);
/**
* 查询门店选择器最新的操作人信息
* @param storeWidgetId
* @return
*/
TabStoreWidgetLog
getLastOperationInfo
(
Integer
storeWidgetId
);
}
gic-store-service/src/main/java/com/gic/store/service/impl/StoreWidgetLogServiceImpl.java
0 → 100644
View file @
8e179978
package
com
.
gic
.
store
.
service
.
impl
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.store.dao.mapper.TabStoreWidgetLogMapper
;
import
com.gic.store.dto.StoreWidgetLogDTO
;
import
com.gic.store.entity.TabStoreWidgetLog
;
import
com.gic.store.service.StoreWidgetLogService
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.PageHelper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.List
;
/**
* 门店选择器日志接口
* @ClassName:
* @Description:
* @author guojuxing
* @date 2021/1/13 3:26 PM
*/
@Service
(
"storeWidgetLogService"
)
public
class
StoreWidgetLogServiceImpl
implements
StoreWidgetLogService
{
@Autowired
private
TabStoreWidgetLogMapper
tabStoreWidgetLogMapper
;
@Override
public
Integer
saveStoreWidgetLog
(
StoreWidgetLogDTO
storeWidgetLog
)
{
TabStoreWidgetLog
record
=
EntityUtil
.
changeEntityNew
(
TabStoreWidgetLog
.
class
,
storeWidgetLog
);
Date
now
=
new
Date
();
record
.
setCreateTime
(
now
)
.
setUpdateTime
(
now
)
.
setDeleteFlag
(
0
);
tabStoreWidgetLogMapper
.
insert
(
record
);
return
record
.
getStoreWidgetLogId
();
}
@Override
public
int
tmpUpdateByStoreWidgetId
(
Integer
oldStoreWidgetId
,
Integer
newStoreWidgetId
)
{
return
tabStoreWidgetLogMapper
.
tmpUpdateByStoreWidgetId
(
oldStoreWidgetId
,
newStoreWidgetId
);
}
@Override
public
Page
<
TabStoreWidgetLog
>
pageStoreWidgetLog
(
Integer
storeWidgetId
,
Integer
pageNum
,
Integer
pageSize
)
{
if
(
pageNum
==
null
)
{
pageNum
=
1
;
}
if
(
pageSize
==
null
)
{
pageSize
=
20
;
}
PageHelper
.
startPage
(
pageNum
,
pageSize
);
List
<
TabStoreWidgetLog
>
list
=
tabStoreWidgetLogMapper
.
pageStoreWidgetLog
(
storeWidgetId
);
return
(
Page
<
TabStoreWidgetLog
>)
list
;
}
@Override
public
TabStoreWidgetLog
getLastOperationInfo
(
Integer
storeWidgetId
)
{
return
tabStoreWidgetLogMapper
.
getLastOperationInfo
(
storeWidgetId
);
}
}
gic-store-service/src/main/java/com/gic/store/service/outer/impl/StoreWidgetLogApiServiceImpl.java
0 → 100644
View file @
8e179978
package
com
.
gic
.
store
.
service
.
outer
.
impl
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.auth.dto.UserDTO
;
import
com.gic.auth.service.UserApiService
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.PageHelperUtils
;
import
com.gic.enterprise.error.ErrorCode
;
import
com.gic.store.dto.StoreWidgetLogDTO
;
import
com.gic.store.dto.StoreWidgetLogSaveDTO
;
import
com.gic.store.entity.TabStoreWidgetLog
;
import
com.gic.store.service.StoreWidgetLogApiService
;
import
com.gic.store.service.StoreWidgetLogService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
/**
* 门店选择器操作日志
* @ClassName:
* @Description:
* @author guojuxing
* @date 2021/1/13 3:19 PM
*/
@Service
(
"storeWidgetLogApiService"
)
public
class
StoreWidgetLogApiServiceImpl
implements
StoreWidgetLogApiService
{
@Autowired
private
StoreWidgetLogService
storeWidgetLogService
;
@Autowired
private
UserApiService
userApiService
;
@Override
public
ServiceResponse
<
Integer
>
saveStoreWidgetLog
(
StoreWidgetLogSaveDTO
storeWidgetLog
)
{
//valid param
if
(
storeWidgetLog
.
getStoreWidgetId
()
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"门店选择器ID不能为空"
);
}
if
(
storeWidgetLog
.
getOperationId
()
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"操作人不能为空"
);
}
if
(
storeWidgetLog
.
getLogType
()
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"日志类型不能为空"
);
}
if
(
storeWidgetLog
.
getOperationType
()
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
PARAMETER_ERROR
.
getCode
(),
"操作类型不能为空"
);
}
StoreWidgetLogDTO
storeWidgetLogDTO
=
EntityUtil
.
changeEntityNew
(
StoreWidgetLogDTO
.
class
,
storeWidgetLog
);
//插入操作人的部分冗余字段数据
ServiceResponse
<
UserDTO
>
userResponse
=
userApiService
.
getUserInfoById
(
storeWidgetLog
.
getOperationId
());
if
(
userResponse
.
isSuccess
())
{
UserDTO
userDTO
=
userResponse
.
getResult
();
storeWidgetLogDTO
.
setOperationName
(
userDTO
.
getUserName
())
.
setOperationPosition
(
userDTO
.
getUserPosition
())
.
setOperationPositionText
(
getUserPositionText
(
userDTO
.
getUserPosition
()));
Integer
id
=
storeWidgetLogService
.
saveStoreWidgetLog
(
storeWidgetLogDTO
);
return
ServiceResponse
.
success
(
id
);
}
return
ServiceResponse
.
failure
(
userResponse
.
getCode
(),
userResponse
.
getMessage
());
}
@Override
public
ServiceResponse
<
Void
>
tmpUpdateByStoreWidgetId
(
Integer
oldStoreWidgetId
,
Integer
newStoreWidgetId
)
{
int
updateNum
=
storeWidgetLogService
.
tmpUpdateByStoreWidgetId
(
oldStoreWidgetId
,
newStoreWidgetId
);
if
(
updateNum
>
0
)
{
return
ServiceResponse
.
success
();
}
return
ServiceResponse
.
failure
(
ErrorCode
.
OPERATION_FAILED
.
getCode
(),
"无数据变更"
);
}
@Override
public
ServiceResponse
<
Page
<
StoreWidgetLogDTO
>>
pageStoreWidgetLog
(
Integer
storeWidgetId
,
Integer
pageNum
,
Integer
pageSize
)
{
return
ServiceResponse
.
success
(
PageHelperUtils
.
changePageHelperToCurrentPage
(
storeWidgetLogService
.
pageStoreWidgetLog
(
storeWidgetId
,
pageNum
,
pageSize
),
StoreWidgetLogDTO
.
class
));
}
@Override
public
ServiceResponse
<
StoreWidgetLogDTO
>
getLastOperationInfo
(
Integer
storeWidgetId
)
{
TabStoreWidgetLog
record
=
storeWidgetLogService
.
getLastOperationInfo
(
storeWidgetId
);
if
(
record
==
null
)
{
return
ServiceResponse
.
failure
(
ErrorCode
.
NOTEXISTS
.
getCode
(),
"无数据"
);
}
return
ServiceResponse
.
success
(
EntityUtil
.
changeEntityNew
(
StoreWidgetLogDTO
.
class
,
record
));
}
private
String
getUserPositionText
(
Integer
userPosition
)
{
if
(
userPosition
==
null
)
{
return
"--"
;
}
switch
(
userPosition
)
{
case
1
:
return
"CRM经理"
;
case
2
:
return
"商城运营经理"
;
case
3
:
return
"IT经理"
;
default
:
return
"--"
;
}
}
}
gic-store-service/src/main/resources/dubbo-gic-store-service.xml
View file @
8e179978
...
...
@@ -65,9 +65,11 @@
<dubbo:service
interface=
"com.gic.store.service.StoreOpenApiService"
ref=
"storeOpenApiService"
timeout=
"6000"
/>
<dubbo:service
interface=
"com.gic.store.service.DictApiService"
ref=
"dictApiService"
timeout=
"6000"
/>
<dubbo:service
interface=
"com.gic.store.service.StoreTransferApiService"
ref=
"storeTransferApiService"
timeout=
"6000"
/>
<dubbo:service
interface=
"com.gic.store.service.StoreWidgetLogApiService"
ref=
"storeWidgetLogApiService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.weimob.api.service.WeimobStoreSiteApiService"
id=
"weimobStoreSiteApiService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.enterprise.service.WmStoreSyncLogApiService"
id=
"wmStoreSyncLogApiService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.spark.api.service.SparkJobApiService"
id=
"sparkJobApiService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.member.config.api.service.CardAscriptionConfigService"
id=
"cardAscriptionConfigService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.auth.service.UserApiService"
id=
"userApiService"
timeout=
"6000"
/>
</beans>
gic-store-service/src/main/resources/mapper/TabStoreWidgetLogMapper.xml
0 → 100644
View file @
8e179978
<?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.gic.store.dao.mapper.TabStoreWidgetLogMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.gic.store.entity.TabStoreWidgetLog"
>
<id
column=
"store_widget_log_id"
jdbcType=
"INTEGER"
property=
"storeWidgetLogId"
/>
<result
column=
"store_widget_id"
jdbcType=
"INTEGER"
property=
"storeWidgetId"
/>
<result
column=
"enterprise_id"
jdbcType=
"INTEGER"
property=
"enterpriseId"
/>
<result
column=
"search_param_before"
jdbcType=
"VARCHAR"
property=
"searchParamBefore"
/>
<result
column=
"search_param_after"
jdbcType=
"VARCHAR"
property=
"searchParamAfter"
/>
<result
column=
"log_type"
jdbcType=
"INTEGER"
property=
"logType"
/>
<result
column=
"operation_type"
jdbcType=
"INTEGER"
property=
"operationType"
/>
<result
column=
"operation_id"
jdbcType=
"INTEGER"
property=
"operationId"
/>
<result
column=
"operation_name"
jdbcType=
"VARCHAR"
property=
"operationName"
/>
<result
column=
"operation_position"
jdbcType=
"INTEGER"
property=
"operationPosition"
/>
<result
column=
"operation_position_text"
jdbcType=
"VARCHAR"
property=
"operationPositionText"
/>
<result
column=
"delete_flag"
jdbcType=
"INTEGER"
property=
"deleteFlag"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
</resultMap>
<resultMap
extends=
"BaseResultMap"
id=
"ResultMapWithBLOBs"
type=
"com.gic.store.entity.TabStoreWidgetLog"
>
<result
column=
"search_param_text_before"
jdbcType=
"LONGVARCHAR"
property=
"searchParamTextBefore"
/>
<result
column=
"search_param_text_after"
jdbcType=
"LONGVARCHAR"
property=
"searchParamTextAfter"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
store_widget_log_id, store_widget_id, enterprise_id, search_param_before, search_param_after,
log_type, operation_type, operation_id, operation_name, operation_position, operation_position_text,
delete_flag, create_time, update_time
</sql>
<sql
id=
"Blob_Column_List"
>
search_param_text_before, search_param_text_after
</sql>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Integer"
resultMap=
"ResultMapWithBLOBs"
>
select
<include
refid=
"Base_Column_List"
/>
,
<include
refid=
"Blob_Column_List"
/>
from tab_store_widget_log
where store_widget_log_id = #{storeWidgetLogId,jdbcType=INTEGER}
</select>
<insert
id=
"insert"
parameterType=
"com.gic.store.entity.TabStoreWidgetLog"
keyProperty=
"storeWidgetLogId"
useGeneratedKeys=
"true"
>
insert into tab_store_widget_log (store_widget_log_id, store_widget_id,
enterprise_id, search_param_before, search_param_after,
log_type, operation_type, operation_id,
operation_name, operation_position, operation_position_text,
delete_flag, create_time, update_time,
search_param_text_before, search_param_text_after
)
values (#{storeWidgetLogId,jdbcType=INTEGER}, #{storeWidgetId,jdbcType=INTEGER},
#{enterpriseId,jdbcType=INTEGER}, #{searchParamBefore,jdbcType=VARCHAR}, #{searchParamAfter,jdbcType=VARCHAR},
#{logType,jdbcType=INTEGER}, #{operationType,jdbcType=INTEGER}, #{operationId,jdbcType=INTEGER},
#{operationName,jdbcType=VARCHAR}, #{operationPosition,jdbcType=INTEGER}, #{operationPositionText,jdbcType=VARCHAR},
#{deleteFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{searchParamTextBefore,jdbcType=LONGVARCHAR}, #{searchParamTextAfter,jdbcType=LONGVARCHAR}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.store.entity.TabStoreWidgetLog"
>
insert into tab_store_widget_log
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"storeWidgetLogId != null"
>
store_widget_log_id,
</if>
<if
test=
"storeWidgetId != null"
>
store_widget_id,
</if>
<if
test=
"enterpriseId != null"
>
enterprise_id,
</if>
<if
test=
"searchParamBefore != null"
>
search_param_before,
</if>
<if
test=
"searchParamAfter != null"
>
search_param_after,
</if>
<if
test=
"logType != null"
>
log_type,
</if>
<if
test=
"operationType != null"
>
operation_type,
</if>
<if
test=
"operationId != null"
>
operation_id,
</if>
<if
test=
"operationName != null"
>
operation_name,
</if>
<if
test=
"operationPosition != null"
>
operation_position,
</if>
<if
test=
"operationPositionText != null"
>
operation_position_text,
</if>
<if
test=
"deleteFlag != null"
>
delete_flag,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
<if
test=
"searchParamTextBefore != null"
>
search_param_text_before,
</if>
<if
test=
"searchParamTextAfter != null"
>
search_param_text_after,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"storeWidgetLogId != null"
>
#{storeWidgetLogId,jdbcType=INTEGER},
</if>
<if
test=
"storeWidgetId != null"
>
#{storeWidgetId,jdbcType=INTEGER},
</if>
<if
test=
"enterpriseId != null"
>
#{enterpriseId,jdbcType=INTEGER},
</if>
<if
test=
"searchParamBefore != null"
>
#{searchParamBefore,jdbcType=VARCHAR},
</if>
<if
test=
"searchParamAfter != null"
>
#{searchParamAfter,jdbcType=VARCHAR},
</if>
<if
test=
"logType != null"
>
#{logType,jdbcType=INTEGER},
</if>
<if
test=
"operationType != null"
>
#{operationType,jdbcType=INTEGER},
</if>
<if
test=
"operationId != null"
>
#{operationId,jdbcType=INTEGER},
</if>
<if
test=
"operationName != null"
>
#{operationName,jdbcType=VARCHAR},
</if>
<if
test=
"operationPosition != null"
>
#{operationPosition,jdbcType=INTEGER},
</if>
<if
test=
"operationPositionText != null"
>
#{operationPositionText,jdbcType=VARCHAR},
</if>
<if
test=
"deleteFlag != null"
>
#{deleteFlag,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"searchParamTextBefore != null"
>
#{searchParamTextBefore,jdbcType=LONGVARCHAR},
</if>
<if
test=
"searchParamTextAfter != null"
>
#{searchParamTextAfter,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<update
id=
"tmpUpdateByStoreWidgetId"
>
update tab_store_widget_log set store_widget_id = #{newStoreWidgetId}
where store_widget_id = #{oldStoreWidgetId}
and delete_flag = 0
</update>
<select
id=
"pageStoreWidgetLog"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
,
<include
refid=
"Blob_Column_List"
/>
from tab_store_widget_log
where store_widget_id = #{storeWidgetId}
and delete_flag = 0
order by create_time desc
</select>
<select
id=
"getLastOperationInfo"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
,
<include
refid=
"Blob_Column_List"
/>
from tab_store_widget_log
where store_widget_id = #{storeWidgetId}
and delete_flag = 0
order by create_time desc
limit 1
</select>
</mapper>
\ No newline at end of file
gic-store-web/src/main/resources/dubbo-gic-store-web.xml
View file @
8e179978
...
...
@@ -65,5 +65,6 @@
<dubbo:reference
interface=
"com.gic.store.service.DictApiService"
id=
"dictApiService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.member.api.service.BatchOperationApiService"
id=
"batchOperationApiService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.member.api.service.UserOwnerApiService"
id=
"userOwnerApiService"
timeout=
"6000"
/>
<dubbo:reference
interface=
"com.gic.store.service.StoreWidgetLogApiService"
id=
"storeWidgetLogApiService"
timeout=
"6000"
/>
</beans>
\ 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