Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-trialdrive-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 85311712
authored
May 27, 2021
by
刘宇峰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
围栏编辑流程
1 parent
acdf1313
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
218 additions
and
44 deletions
src/main/java/cn/com/glsx/admin/common/enums/ResultEnum.java
src/main/java/cn/com/glsx/admin/modules/controller/ElectricFenceController.java
src/main/java/cn/com/glsx/admin/modules/mapper/ElectricFenceSnsCopyMapper.java
src/main/java/cn/com/glsx/admin/modules/model/param/ElectricFenceBO.java
src/main/java/cn/com/glsx/admin/modules/service/ApprovalService.java
src/main/java/cn/com/glsx/admin/modules/service/ElectricFenceService.java
src/main/resources/mapper/ElectricFenceSnsCopyMapper.xml
src/main/java/cn/com/glsx/admin/common/enums/ResultEnum.java
View file @
8531171
...
@@ -20,6 +20,7 @@ public enum ResultEnum {
...
@@ -20,6 +20,7 @@ public enum ResultEnum {
*/
*/
APPROVAL_ALREADY_EXISTS
(
12110001
,
"该业务审批单已经存在"
),
APPROVAL_ALREADY_EXISTS
(
12110001
,
"该业务审批单已经存在"
),
APPROVAL_NOT_EXISTS
(
12110002
,
"该业务id未查到审批单"
),
APPROVAL_NOT_EXISTS
(
12110002
,
"该业务id未查到审批单"
),
APPROVAL_BIZ_HANDLE_ERROR
(
12110003
,
"审核业务处理异常"
),
/**
/**
* 试驾车辆管理相关业务异常错误码,错误信息 1212开头
* 试驾车辆管理相关业务异常错误码,错误信息 1212开头
...
...
src/main/java/cn/com/glsx/admin/modules/controller/ElectricFenceController.java
View file @
8531171
...
@@ -56,7 +56,7 @@ public class ElectricFenceController {
...
@@ -56,7 +56,7 @@ public class ElectricFenceController {
@ApiOperation
(
value
=
"新增围栏"
)
@ApiOperation
(
value
=
"新增围栏"
)
public
R
add
(
@RequestBody
@Validated
ElectricFenceBO
fenceBO
)
throws
Exception
{
public
R
add
(
@RequestBody
@Validated
ElectricFenceBO
fenceBO
)
throws
Exception
{
fenceBO
.
setBizFenceType
(
12
);
fenceBO
.
setBizFenceType
(
12
);
electricFenceService
.
addFence
(
fenceBO
);
electricFenceService
.
addFence
Handler
(
fenceBO
);
return
R
.
ok
();
return
R
.
ok
();
}
}
...
@@ -71,7 +71,7 @@ public class ElectricFenceController {
...
@@ -71,7 +71,7 @@ public class ElectricFenceController {
@ApiOperation
(
value
=
"编辑围栏"
)
@ApiOperation
(
value
=
"编辑围栏"
)
public
R
edit
(
@RequestBody
@Validated
ElectricFenceBO
fenceBO
)
throws
Exception
{
public
R
edit
(
@RequestBody
@Validated
ElectricFenceBO
fenceBO
)
throws
Exception
{
fenceBO
.
setBizFenceType
(
12
);
fenceBO
.
setBizFenceType
(
12
);
electricFenceService
.
updateFence
(
fenceBO
);
electricFenceService
.
editFenceHandler
(
fenceBO
);
return
R
.
ok
();
return
R
.
ok
();
}
}
...
...
src/main/java/cn/com/glsx/admin/modules/mapper/ElectricFenceSnsCopyMapper.java
View file @
8531171
...
@@ -14,4 +14,12 @@ public interface ElectricFenceSnsCopyMapper extends CommonBaseMapper<ElectricFen
...
@@ -14,4 +14,12 @@ public interface ElectricFenceSnsCopyMapper extends CommonBaseMapper<ElectricFen
@Select
(
"select * from t_electric_fence_sns_copy where fence_id=#{fenceId} and source=1"
)
@Select
(
"select * from t_electric_fence_sns_copy where fence_id=#{fenceId} and source=1"
)
List
<
ElectricFenceSnsCopy
>
selectByFenceId
(
@Param
(
"fenceId"
)
Long
fenceId
);
List
<
ElectricFenceSnsCopy
>
selectByFenceId
(
@Param
(
"fenceId"
)
Long
fenceId
);
/**
* 逻辑删除
*
* @param fenceId
* @return
*/
int
logicDeleteByFenceId
(
@Param
(
"fenceId"
)
Long
fenceId
);
}
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/admin/modules/model/param/ElectricFenceBO.java
View file @
8531171
...
@@ -4,6 +4,7 @@ import cn.com.glsx.admin.modules.model.ElectricFenceSnsModel;
...
@@ -4,6 +4,7 @@ import cn.com.glsx.admin.modules.model.ElectricFenceSnsModel;
import
lombok.Data
;
import
lombok.Data
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
...
@@ -21,6 +22,7 @@ public class ElectricFenceBO {
...
@@ -21,6 +22,7 @@ public class ElectricFenceBO {
/**
/**
* 特约店id(特约店账号)
* 特约店id(特约店账号)
*/
*/
@NotNull
private
Long
shopId
;
private
Long
shopId
;
/**
/**
...
...
src/main/java/cn/com/glsx/admin/modules/service/ApprovalService.java
View file @
8531171
package
cn
.
com
.
glsx
.
admin
.
modules
.
service
;
package
cn
.
com
.
glsx
.
admin
.
modules
.
service
;
import
cn.com.glsx.admin.common.constants.ConstantsApproval
;
import
cn.com.glsx.admin.common.enums.ApprovalStatusEnum
;
import
cn.com.glsx.admin.common.enums.ApprovalStatusEnum
;
import
cn.com.glsx.admin.common.enums.ResultEnum
;
import
cn.com.glsx.admin.common.enums.ResultEnum
;
import
cn.com.glsx.admin.common.exception.AdminException
;
import
cn.com.glsx.admin.common.exception.AdminException
;
...
@@ -14,20 +15,15 @@ import cn.com.glsx.admin.modules.model.param.ApprovalSearch;
...
@@ -14,20 +15,15 @@ import cn.com.glsx.admin.modules.model.param.ApprovalSearch;
import
cn.com.glsx.admin.modules.model.param.FenceApproSearch
;
import
cn.com.glsx.admin.modules.model.param.FenceApproSearch
;
import
cn.com.glsx.admin.modules.model.param.VehicleApproSearch
;
import
cn.com.glsx.admin.modules.model.param.VehicleApproSearch
;
import
cn.com.glsx.auth.utils.ShieldContextHolder
;
import
cn.com.glsx.auth.utils.ShieldContextHolder
;
import
cn.com.glsx.usercenter.api.dto.response.Organization
;
import
cn.com.glsx.usercenter.api.feign.OrganizationService
;
import
cn.com.glsx.usercenter.api.feign.OrganizationService
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.glsx.plat.core.web.R
;
import
com.google.gson.reflect.TypeToken
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
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
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.lang.reflect.Type
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
...
@@ -48,10 +44,10 @@ public class ApprovalService {
...
@@ -48,10 +44,10 @@ public class ApprovalService {
private
ApprovalHistoryService
approvalHistoryService
;
private
ApprovalHistoryService
approvalHistoryService
;
@Autowired
@Autowired
private
Organiza
tionService
organization
Service
;
private
Organiza
Service
organiza
Service
;
@Autowired
@Autowired
private
OrganizaService
organiza
Service
;
private
ElectricFenceService
electricFence
Service
;
/**
/**
* 保存审批信息
* 保存审批信息
...
@@ -112,6 +108,13 @@ public class ApprovalService {
...
@@ -112,6 +108,13 @@ public class ApprovalService {
approvalData
.
setRemark
(
approvalBo
.
getRemark
());
approvalData
.
setRemark
(
approvalBo
.
getRemark
());
approvalData
.
setStatus
(
approvalBo
.
getStatus
());
approvalData
.
setStatus
(
approvalBo
.
getStatus
());
approvalMapper
.
updateByPrimaryKeyWithVersion
(
approvalData
);
approvalMapper
.
updateByPrimaryKeyWithVersion
(
approvalData
);
//业务处理
if
(
approvalData
.
getBizType
()
==
ConstantsApproval
.
VEL_FENCE_APPROVAL
)
{
electricFenceService
.
approvaledHandler
(
approvalData
);
}
else
if
(
approvalData
.
getBizType
()
==
ConstantsApproval
.
VEL_DOC_APPROVAL
)
{
}
}
}
// 2.保存审批流程历史
// 2.保存审批流程历史
saveApprovalHistory
(
approvalBo
,
approvalBo
.
getId
());
saveApprovalHistory
(
approvalBo
,
approvalBo
.
getId
());
...
...
src/main/java/cn/com/glsx/admin/modules/service/ElectricFenceService.java
View file @
8531171
...
@@ -2,11 +2,11 @@ package cn.com.glsx.admin.modules.service;
...
@@ -2,11 +2,11 @@ package cn.com.glsx.admin.modules.service;
import
cn.com.glsx.admin.common.constants.ConstantsApproval
;
import
cn.com.glsx.admin.common.constants.ConstantsApproval
;
import
cn.com.glsx.admin.common.constants.ConstantsElectricFence
;
import
cn.com.glsx.admin.common.constants.ConstantsElectricFence
;
import
cn.com.glsx.admin.common.enums.ApprovalStatusEnum
;
import
cn.com.glsx.admin.common.enums.ResultEnum
;
import
cn.com.glsx.admin.common.exception.AdminException
;
import
cn.com.glsx.admin.modules.component.EFenceComponent
;
import
cn.com.glsx.admin.modules.component.EFenceComponent
;
import
cn.com.glsx.admin.modules.entity.ElectricFence
;
import
cn.com.glsx.admin.modules.entity.*
;
import
cn.com.glsx.admin.modules.entity.ElectricFenceCopy
;
import
cn.com.glsx.admin.modules.entity.ElectricFenceSns
;
import
cn.com.glsx.admin.modules.entity.ElectricFenceSnsCopy
;
import
cn.com.glsx.admin.modules.mapper.ElectricFenceCopyMapper
;
import
cn.com.glsx.admin.modules.mapper.ElectricFenceCopyMapper
;
import
cn.com.glsx.admin.modules.mapper.ElectricFenceMapper
;
import
cn.com.glsx.admin.modules.mapper.ElectricFenceMapper
;
import
cn.com.glsx.admin.modules.mapper.ElectricFenceSnsCopyMapper
;
import
cn.com.glsx.admin.modules.mapper.ElectricFenceSnsCopyMapper
;
...
@@ -24,6 +24,7 @@ import cn.com.glsx.usercenter.api.dto.response.Organization;
...
@@ -24,6 +24,7 @@ import cn.com.glsx.usercenter.api.dto.response.Organization;
import
cn.com.glsx.usercenter.api.dto.response.User
;
import
cn.com.glsx.usercenter.api.dto.response.User
;
import
cn.com.glsx.usercenter.api.feign.OrganizationService
;
import
cn.com.glsx.usercenter.api.feign.OrganizationService
;
import
cn.com.glsx.usercenter.api.feign.UserService
;
import
cn.com.glsx.usercenter.api.feign.UserService
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
...
@@ -115,6 +116,83 @@ public class ElectricFenceService {
...
@@ -115,6 +116,83 @@ public class ElectricFenceService {
}
}
/**
/**
* 新增围栏处理
*
* @param fenceBO
* @throws Exception
*/
public
void
addFenceHandler
(
ElectricFenceBO
fenceBO
)
throws
Exception
{
// 2021/5/24 围栏审核 特约店用户修改才提交
List
<
Long
>
shopOrgIds
=
trialDriveShopService
.
getShopOrgIds
();
boolean
submitFlag
=
shopOrgIds
.
contains
(
ShieldContextHolder
.
getDepartmentId
());
if
(
submitFlag
)
{
ElectricFenceCopy
fenceCopy
=
addFenceCopy
(
fenceBO
);
//提交审核记录
ApprovalBo
approvalBo
=
new
ApprovalBo
(
ConstantsApproval
.
VEL_FENCE_APPROVAL
,
fenceCopy
.
getId
());
approvalService
.
saveApproval
(
approvalBo
);
}
else
{
ElectricFence
fence
=
addFence
(
fenceBO
);
//向大数据推送新增围栏信息(kafka)
// eFenceComponent.addElectricFence(fence);
}
}
/**
* 编辑围栏处理
*
* @param fenceBO
* @throws Exception
*/
public
void
editFenceHandler
(
ElectricFenceBO
fenceBO
)
throws
Exception
{
// 2021/5/24 围栏审核 特约店用户修改才提交
List
<
Long
>
shopOrgIds
=
trialDriveShopService
.
getShopOrgIds
();
boolean
submitFlag
=
shopOrgIds
.
contains
(
ShieldContextHolder
.
getDepartmentId
());
if
(
submitFlag
)
{
ElectricFenceCopy
fenceCopy
=
updateFenceCopy
(
fenceBO
);
//提交审核记录
ApprovalBo
approvalBo
=
new
ApprovalBo
(
ConstantsApproval
.
VEL_FENCE_APPROVAL
,
fenceCopy
.
getFenceId
());
approvalService
.
saveApproval
(
approvalBo
);
}
else
{
ElectricFence
fence
=
updateFence
(
fenceBO
);
//向大数据推送围栏更新(kafka)
//eFenceComponent.updateElectricFence(fence);
}
}
/**
* 审批回调处理
*
* @param approvalData
*/
public
void
approvaledHandler
(
Approval
approvalData
)
{
if
(
ApprovalStatusEnum
.
APPROVAL_STATUS_PROCESSED
.
getCode
().
equals
(
approvalData
.
getStatus
()))
{
// TODO: 2021/5/27 将副本刷新到主数据
ElectricFence
fence
=
null
;
ElectricFenceCopy
fenceCopy
=
electricFenceCopyMapper
.
selectByFenceId
(
approvalData
.
getBizId
());
//如果副本存在并且围栏id为空,为新增围栏审核
boolean
addFlag
=
ObjectUtil
.
isNotNull
(
fenceCopy
)
&&
ObjectUtil
.
isNull
(
fenceCopy
.
getFenceId
());
if
(
addFlag
)
{
refreshElectricFenceCopy2ElectricFence
(
fenceCopy
,
null
);
}
else
{
fence
=
electricFenceMapper
.
selectById
(
approvalData
.
getBizId
());
refreshElectricFenceCopy2ElectricFence
(
fenceCopy
,
fence
);
}
}
else
if
(
ApprovalStatusEnum
.
APPROVAL_STATUS_REJECT
.
getCode
().
equals
(
approvalData
.
getStatus
()))
{
}
}
/**
* 新增围栏
* 新增围栏
*
*
* @param fenceBO
* @param fenceBO
...
@@ -142,24 +220,96 @@ public class ElectricFenceService {
...
@@ -142,24 +220,96 @@ public class ElectricFenceService {
if
(
CollectionUtils
.
isNotEmpty
(
snsList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
snsList
))
{
electricFenceSnsMapper
.
insertList
(
snsList
);
electricFenceSnsMapper
.
insertList
(
snsList
);
}
}
return
fence
;
}
//3.向大数据推送新增围栏信息(kafka)
/**
if
(
insertCnt
>
0
)
{
* 新增围栏
// eFenceComponent.addElectricFence(fence);
*
* @param fenceBO
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ElectricFenceCopy
addFenceCopy
(
ElectricFenceBO
fenceBO
)
throws
Exception
{
//1.新增围栏信息
ElectricFenceCopy
fenceCopy
=
new
ElectricFenceCopy
();
BeanUtils
.
copyProperties
(
fenceBO
,
fenceCopy
);
//设置定位信息类型为gps类型 默认都是创建gps类型围栏
fenceCopy
.
setLocationType
(
1
);
fenceCopy
.
setRecord
(
"操作时间:"
+
DateUtils
.
formatNormal
(
new
Date
())
+
" 操作人:"
+
ShieldContextHolder
.
getAccount
()
+
"("
+
ShieldContextHolder
.
getUserId
()
+
")"
+
"<br/>"
);
if
(
fenceBO
.
getShopId
()
!=
null
)
{
fenceCopy
.
setCreatedBy
(
fenceBO
.
getShopId
());
}
else
{
fenceCopy
.
setCreatedBy
(
ShieldContextHolder
.
getUserId
());
}
}
fenceCopy
.
setCreatedDate
(
new
Date
());
int
insertCnt
=
electricFenceCopyMapper
.
insertUseGeneratedKeys
(
fenceCopy
);
return
fence
;
//2、关联设备
List
<
ElectricFenceSnsCopy
>
snsList
=
linkDeviceCopy
(
fenceCopy
,
fenceBO
.
getSnList
());
if
(
CollectionUtils
.
isNotEmpty
(
snsList
))
{
electricFenceSnsCopyMapper
.
insertList
(
snsList
);
}
return
fenceCopy
;
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
updateFence
(
ElectricFenceBO
fenceBO
)
throws
Exception
{
public
ElectricFence
updateFence
(
ElectricFenceBO
fenceBO
)
throws
Exception
{
//1.更新围栏信息
//1.更新围栏信息
ElectricFence
localFence
=
electricFenceMapper
.
selectById
(
fenceBO
.
getId
());
ElectricFence
localFence
=
electricFenceMapper
.
selectById
(
fenceBO
.
getId
());
electricFenceSnsMapper
.
logicDeleteByFenceId
(
fenceBO
.
getId
());
electricFenceSnsMapper
.
logicDeleteByFenceId
(
fenceBO
.
getId
());
ElectricFence
fence
=
new
ElectricFence
();
BeanUtils
.
copyProperties
(
fenceBO
,
fence
);
if
(
fenceBO
.
getShapeType
()
!=
null
)
{
//围栏形状类型 1.圆形(默认) 2.矩形 3.多边形 4.行政区域
fence
.
setShapeType
(
fenceBO
.
getShapeType
());
fence
.
setRadius
(
null
);
fence
.
setAreaCode
(
null
);
fence
.
setAreaText
(
null
);
if
(
fenceBO
.
getShapeType
()
==
ConstantsElectricFence
.
SHAPE_TYPE_CIRCLE
)
{
fence
.
setRadius
(
fenceBO
.
getRadius
());
}
else
if
(
fenceBO
.
getShapeType
()
==
ConstantsElectricFence
.
SHAPE_TYPE_POLYGON
)
{
//do nothing
}
else
if
(
fenceBO
.
getShapeType
()
==
ConstantsElectricFence
.
SHAPE_TYPE_ADMINISTRATIVE
)
{
fence
.
setAreaCode
(
fenceBO
.
getAreaCode
());
fence
.
setAreaText
(
fence
.
getAreaText
());
}
}
//业务围栏类型 12试驾围栏,13特约店围栏(12,13直接和大数据那边类型对应)
fence
.
setBizFenceType
(
fenceBO
.
getBizFenceType
());
fence
.
setLocationType
(
1
);
fence
.
setRecord
(
localFence
.
getRecord
()
+
"操作时间:"
+
DateUtils
.
formatNormal
(
new
Date
())
+
" 操作人:"
+
ShieldContextHolder
.
getAccount
()
+
"("
+
ShieldContextHolder
.
getUserId
()
+
")"
+
"<br/>"
);
fence
.
setStartTime
(
fenceBO
.
getStartTime
());
fence
.
setEndTime
(
fenceBO
.
getEndTime
());
fence
.
setUpdatedDate
(
new
Date
());
fence
.
setUpdatedBy
(
ShieldContextHolder
.
getUserId
());
int
updateCnt
=
electricFenceMapper
.
updateByPrimaryKey
(
fence
);
//2、关联设备
List
<
ElectricFenceSns
>
snsList
=
linkDevice
(
fence
,
fenceBO
.
getSnList
());
if
(
CollectionUtils
.
isNotEmpty
(
snsList
))
{
electricFenceSnsMapper
.
insertList
(
snsList
);
}
return
fence
;
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ElectricFenceCopy
updateFenceCopy
(
ElectricFenceBO
fenceBO
)
throws
Exception
{
//1.更新围栏信息
ElectricFence
localFence
=
electricFenceMapper
.
selectById
(
fenceBO
.
getId
());
electricFenceSnsCopyMapper
.
logicDeleteByFenceId
(
fenceBO
.
getId
());
ElectricFenceCopy
fenceCopy
=
new
ElectricFenceCopy
();
ElectricFenceCopy
fenceCopy
=
new
ElectricFenceCopy
();
BeanUtils
.
copyProperties
(
fenceBO
,
fenceCopy
);
BeanUtils
.
copyProperties
(
fenceBO
,
fenceCopy
);
fenceCopy
.
setFenceId
(
localFence
.
getId
());
if
(
fenceBO
.
getShapeType
()
!=
null
)
{
if
(
fenceBO
.
getShapeType
()
!=
null
)
{
//围栏形状类型 1.圆形(默认) 2.矩形 3.多边形 4.行政区域
//围栏形状类型 1.圆形(默认) 2.矩形 3.多边形 4.行政区域
...
@@ -196,22 +346,11 @@ public class ElectricFenceService {
...
@@ -196,22 +346,11 @@ public class ElectricFenceService {
}
}
//2、关联设备
//2、关联设备
List
<
ElectricFenceSnsCopy
>
snsList
=
copyLinkDevice
(
fenceCopy
,
fenceBO
.
getSnList
());
List
<
ElectricFenceSnsCopy
>
snsList
=
linkDeviceCopy
(
fenceCopy
,
fenceBO
.
getSnList
());
if
(
CollectionUtils
.
isNotEmpty
(
snsList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
snsList
))
{
electricFenceSnsCopyMapper
.
insertList
(
snsList
);
electricFenceSnsCopyMapper
.
insertList
(
snsList
);
}
}
return
fenceCopy
;
//3.更新围栏 向大数据推送围栏更新(kafka),改成审核通过再同步
// if (updateCnt > 1) {
// eFenceComponent.updateElectricFence(fence);
// }
// 2021/5/24 围栏审核 特约店用户修改才提交
List
<
Long
>
shopOrgIds
=
trialDriveShopService
.
getShopOrgIds
();
if
(
shopOrgIds
.
contains
(
ShieldContextHolder
.
getDepartmentId
()))
{
ApprovalBo
approvalBo
=
new
ApprovalBo
(
ConstantsApproval
.
VEL_FENCE_APPROVAL
,
fenceCopy
.
getFenceId
());
approvalService
.
saveApproval
(
approvalBo
);
}
}
}
public
List
<
ElectricFenceSns
>
linkDevice
(
ElectricFence
fence
,
List
<
ElectricFenceSnsModel
>
snList
)
{
public
List
<
ElectricFenceSns
>
linkDevice
(
ElectricFence
fence
,
List
<
ElectricFenceSnsModel
>
snList
)
{
...
@@ -235,7 +374,7 @@ public class ElectricFenceService {
...
@@ -235,7 +374,7 @@ public class ElectricFenceService {
* @param snList
* @param snList
* @return
* @return
*/
*/
public
List
<
ElectricFenceSnsCopy
>
copyLinkDevice
(
ElectricFenceCopy
fenceCopy
,
List
<
ElectricFenceSnsModel
>
snList
)
{
public
List
<
ElectricFenceSnsCopy
>
linkDeviceCopy
(
ElectricFenceCopy
fenceCopy
,
List
<
ElectricFenceSnsModel
>
snList
)
{
List
<
ElectricFenceSnsCopy
>
snsList
=
Lists
.
newArrayList
();
List
<
ElectricFenceSnsCopy
>
snsList
=
Lists
.
newArrayList
();
snList
.
forEach
(
efsm
->
{
snList
.
forEach
(
efsm
->
{
ElectricFenceSnsCopy
fenceSnsCopy
=
new
ElectricFenceSnsCopy
();
ElectricFenceSnsCopy
fenceSnsCopy
=
new
ElectricFenceSnsCopy
();
...
@@ -249,6 +388,21 @@ public class ElectricFenceService {
...
@@ -249,6 +388,21 @@ public class ElectricFenceService {
return
snsList
;
return
snsList
;
}
}
public
ElectricFence
refreshElectricFenceCopy2ElectricFence
(
ElectricFenceCopy
fenceCopy
,
ElectricFence
fence
)
{
if
(
ObjectUtil
.
isNull
(
fenceCopy
))
{
throw
new
AdminException
(
ResultEnum
.
APPROVAL_BIZ_HANDLE_ERROR
);
}
if
(
ObjectUtil
.
isNull
(
fence
))
{
fence
=
new
ElectricFence
();
}
// TODO: 2021/5/27
BeanUtils
.
copyProperties
(
fenceCopy
,
fence
);
return
fence
;
}
public
ElectricFenceDetailsDTO
getInfoById
(
Long
fenceId
)
{
public
ElectricFenceDetailsDTO
getInfoById
(
Long
fenceId
)
{
ElectricFenceDetailsDTO
detailsDTO
=
null
;
ElectricFenceDetailsDTO
detailsDTO
=
null
;
...
...
src/main/resources/mapper/ElectricFenceSnsCopyMapper.xml
View file @
8531171
...
@@ -5,18 +5,18 @@
...
@@ -5,18 +5,18 @@
<!--
<!--
WARNING - @mbg.generated
WARNING - @mbg.generated
-->
-->
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"fence_id"
jdbcType=
"INTEGER"
property=
"fenceId"
/>
<result
column=
"fence_id"
jdbcType=
"INTEGER"
property=
"fenceId"
/>
<result
column=
"sn"
jdbcType=
"VARCHAR"
property=
"sn"
/>
<result
column=
"sn"
jdbcType=
"VARCHAR"
property=
"sn"
/>
<result
column=
"name"
jdbcType=
"VARCHAR"
property=
"name"
/>
<result
column=
"name"
jdbcType=
"VARCHAR"
property=
"name"
/>
<result
column=
"vin"
jdbcType=
"VARCHAR"
property=
"vin"
/>
<result
column=
"vin"
jdbcType=
"VARCHAR"
property=
"vin"
/>
<result
column=
"user_tel"
jdbcType=
"VARCHAR"
property=
"userTel"
/>
<result
column=
"user_tel"
jdbcType=
"VARCHAR"
property=
"userTel"
/>
<result
column=
"source"
jdbcType=
"TINYINT"
property=
"source"
/>
<result
column=
"source"
jdbcType=
"TINYINT"
property=
"source"
/>
<result
column=
"del_flag"
jdbcType=
"TINYINT"
property=
"delFlag"
/>
<result
column=
"del_flag"
jdbcType=
"TINYINT"
property=
"delFlag"
/>
<result
column=
"created_date"
jdbcType=
"TIMESTAMP"
property=
"createdDate"
/>
<result
column=
"created_date"
jdbcType=
"TIMESTAMP"
property=
"createdDate"
/>
<result
column=
"created_by"
jdbcType=
"INTEGER"
property=
"createdBy"
/>
<result
column=
"created_by"
jdbcType=
"INTEGER"
property=
"createdBy"
/>
<result
column=
"updated_date"
jdbcType=
"TIMESTAMP"
property=
"updatedDate"
/>
<result
column=
"updated_date"
jdbcType=
"TIMESTAMP"
property=
"updatedDate"
/>
<result
column=
"updated_by"
jdbcType=
"INTEGER"
property=
"updatedBy"
/>
<result
column=
"updated_by"
jdbcType=
"INTEGER"
property=
"updatedBy"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
<!--
<!--
...
@@ -25,4 +25,10 @@
...
@@ -25,4 +25,10 @@
id, fence_id, sn, `name`, vin, user_tel, `source`, del_flag, created_date, created_by,
id, fence_id, sn, `name`, vin, user_tel, `source`, del_flag, created_date, created_by,
updated_date, updated_by
updated_date, updated_by
</sql>
</sql>
<update
id=
"logicDeleteByFenceId"
>
update t_electric_fence_sns_copy
set del_flag = -1
where fence_id = #{fenceId}
</update>
</mapper>
</mapper>
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
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 post a comment