Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
487f93b9
Commit
487f93b9
authored
Mar 17, 2025
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.西安数据编辑接口
parent
54049fde
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
140 additions
and
134 deletions
+140
-134
EquipUseInfoChangeDataDto.java
...mos/boot/module/jg/api/dto/EquipUseInfoChangeDataDto.java
+11
-1
ChangeItemFactory.java
...in/amos/boot/module/jg/biz/factory/ChangeItemFactory.java
+2
-2
BatchDataChangeProcessStrategy.java
...e/jg/biz/service/impl/BatchDataChangeProcessStrategy.java
+0
-2
CommonEquipDataProcessService.java
...le/jg/biz/service/impl/CommonEquipDataProcessService.java
+0
-0
EquipChangeDataUpdateService.java
...ule/jg/biz/service/impl/EquipChangeDataUpdateService.java
+28
-13
SingleDataChangeProcessStrategy.java
.../jg/biz/service/impl/SingleDataChangeProcessStrategy.java
+6
-116
SingleManageEquipEditHandleImpl.java
.../jg/biz/service/impl/SingleManageEquipEditHandleImpl.java
+93
-0
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/dto/
UseRegister
ChangeDataDto.java
→
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/dto/
EquipUseInfo
ChangeDataDto.java
View file @
487f93b9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
dto
;
import
com.yeejoin.amos.boot.biz.common.annotation.FieldDisplayDefine
;
import
com.yeejoin.amos.boot.biz.common.annotation.Group
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
@EqualsAndHashCode
(
callSuper
=
true
)
@Data
public
class
UseRegisterChangeDataDto
extends
BaseChangeDataDto
{
@Group
(
value
=
"equip_use_info"
)
public
class
EquipUseInfoChangeDataDto
extends
BaseChangeDataDto
{
@FieldDisplayDefine
(
value
=
"使用单位统一信用代码"
)
private
String
useUnitCreditCode
;
@FieldDisplayDefine
(
value
=
"使用单位名称"
)
private
String
useUnitName
;
@FieldDisplayDefine
(
value
=
"单位内部编号"
)
private
String
useInnerCode
;
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/factory/ChangeItemFactory.java
View file @
487f93b9
...
...
@@ -10,8 +10,8 @@ public class ChangeItemFactory {
private
static
final
Map
<
String
,
Class
<?
extends
BaseChangeDataDto
>>
ITEM_FACTORY
=
new
HashMap
<>();
static
{
// 使用
登记
信息
ITEM_FACTORY
.
put
(
"
biz_use_register_info"
,
UseRegister
ChangeDataDto
.
class
);
// 使用信息
ITEM_FACTORY
.
put
(
"
equip_use_info"
,
EquipUseInfo
ChangeDataDto
.
class
);
// 设备-注册登记信息
ITEM_FACTORY
.
put
(
"equip_register_info"
,
EquipRegisterChangeDataDto
.
class
);
// 设备-制造信息
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/BatchDataChangeProcessStrategy.java
View file @
487f93b9
...
...
@@ -8,11 +8,9 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.utils.NameUtils
;
import
com.yeejoin.amos.boot.module.jg.api.dto.*
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistration
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgUseRegistrationEq
;
import
com.yeejoin.amos.boot.module.jg.api.enums.CylinderTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper
;
import
com.yeejoin.amos.boot.module.jg.api.service.IBizDataChangeHandleStrategy
;
import
com.yeejoin.amos.boot.module.jg.biz.service.IChangeDataProcessStrategy
;
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/CommonEquipDataProcessService.java
View file @
487f93b9
This diff is collapsed.
Click to expand it.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/EquipChangeDataUpdateService.java
View file @
487f93b9
...
...
@@ -9,15 +9,13 @@ import com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto;
import
com.yeejoin.amos.boot.module.jg.api.dto.*
;
import
com.yeejoin.amos.boot.module.jg.api.enums.CylinderTypeEnum
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.EquipmentCategory
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgDesignInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgFactoryInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.IdxBizJgRegisterInfo
;
import
com.yeejoin.amos.boot.module.ymt.api.entity.*
;
import
com.yeejoin.amos.boot.module.ymt.api.enums.EquCodeTypeEnum
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.EquipmentCategoryMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgDesignInfoMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgFactoryInfoMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgRegisterInfoMapper
;
import
lombok.RequiredArgsConstructor
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
...
...
@@ -28,6 +26,7 @@ import java.util.Optional;
import
java.util.stream.Collectors
;
@Service
@RequiredArgsConstructor
public
class
EquipChangeDataUpdateService
{
private
final
ESEquipmentCategory
esEquipmentCategory
;
...
...
@@ -42,14 +41,7 @@ public class EquipChangeDataUpdateService {
private
final
EquipmentCategoryMapper
equipmentCategoryMapper
;
public
EquipChangeDataUpdateService
(
ESEquipmentCategory
esEquipmentCategory
,
IdxBizJgDesignInfoMapper
idxBizJgDesignInfoMapper
,
IdxBizJgFactoryInfoMapper
jgFactoryInfoMapper
,
IdxBizJgRegisterInfoMapper
idxBizJgRegisterInfoMapper
,
CommonMapper
commonMapper
,
EquipmentCategoryMapper
equipmentCategoryMapper
)
{
this
.
esEquipmentCategory
=
esEquipmentCategory
;
this
.
idxBizJgDesignInfoMapper
=
idxBizJgDesignInfoMapper
;
this
.
jgFactoryInfoMapper
=
jgFactoryInfoMapper
;
this
.
idxBizJgRegisterInfoMapper
=
idxBizJgRegisterInfoMapper
;
this
.
commonMapper
=
commonMapper
;
this
.
equipmentCategoryMapper
=
equipmentCategoryMapper
;
}
private
final
IdxBizJgUseInfoServiceImpl
idxBizJgUseInfoService
;
public
void
updateRegisterChangeData
(
String
record
,
EquipRegisterChangeDataDto
registerChangeDataDto
)
{
LambdaUpdateWrapper
<
IdxBizJgRegisterInfo
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
...
...
@@ -116,6 +108,7 @@ public class EquipChangeDataUpdateService {
}
}
private
void
updateRegisterEsData
(
String
record
,
EquipRegisterChangeDataDto
registerChangeDataDto
)
{
// es 数据更新
Optional
<
ESEquipmentCategoryDto
>
optional
=
esEquipmentCategory
.
findById
(
record
);
...
...
@@ -165,7 +158,7 @@ public class EquipChangeDataUpdateService {
public
void
checkFactoryChangeData
(
String
record
,
EquipFactoryChangeDataDto
equipFactoryChangeDataDto
,
String
equList
,
String
equCategory
,
String
equDefine
)
{
// 气瓶时检验出厂编号-普通气瓶,车用气瓶不再此范围内
if
(
CylinderTypeEnum
.
CYLINDER
.
getCode
().
equals
(
equCategory
))
{
if
(
CylinderTypeEnum
.
CYLINDER
.
getCode
().
equals
(
equCategory
)
&&
StringUtils
.
isNotEmpty
(
equipFactoryChangeDataDto
.
getFactoryNum
())
)
{
boolean
isUsed
=
this
.
checkFactoryNumUnique
(
equipFactoryChangeDataDto
.
getFactoryNum
(),
record
,
equipFactoryChangeDataDto
.
getProduceUnitCreditCode
());
if
(
isUsed
)
{
throw
new
BadRequest
(
"出厂编号/产品编码在该企业中已存在!"
);
...
...
@@ -211,4 +204,26 @@ public class EquipChangeDataUpdateService {
updateWrapper
.
set
(
IdxBizJgDesignInfo:
:
getRecDate
,
new
Date
());
idxBizJgDesignInfoMapper
.
update
(
null
,
updateWrapper
);
}
public
void
updateUseInfoChangeData
(
String
record
,
EquipUseInfoChangeDataDto
equipUseInfoChangeDataDto
)
{
LambdaUpdateWrapper
<
IdxBizJgUseInfo
>
updateWrapper
=
new
LambdaUpdateWrapper
<>();
updateWrapper
.
eq
(
IdxBizJgUseInfo:
:
getRecord
,
record
);
updateWrapper
.
set
(
IdxBizJgUseInfo:
:
getUseUnitCreditCode
,
equipUseInfoChangeDataDto
.
getUseUnitCreditCode
());
updateWrapper
.
set
(
IdxBizJgUseInfo:
:
getUseUnitName
,
equipUseInfoChangeDataDto
.
getUseUnitName
());
updateWrapper
.
set
(
IdxBizJgUseInfo:
:
getUseInnerCode
,
equipUseInfoChangeDataDto
.
getUseInnerCode
());
idxBizJgUseInfoService
.
update
(
updateWrapper
);
this
.
updateUseInfoEsData
(
record
,
equipUseInfoChangeDataDto
);
}
private
void
updateUseInfoEsData
(
String
record
,
EquipUseInfoChangeDataDto
equipUseInfoChangeDataDto
)
{
// es 数据更新
Optional
<
ESEquipmentCategoryDto
>
optional
=
esEquipmentCategory
.
findById
(
record
);
if
(
optional
.
isPresent
())
{
ESEquipmentCategoryDto
esEquipmentCategoryDto
=
optional
.
get
();
esEquipmentCategoryDto
.
setUSE_UNIT_CREDIT_CODE
(
equipUseInfoChangeDataDto
.
getUseUnitCreditCode
());
esEquipmentCategoryDto
.
setUSC_UNIT_NAME
(
equipUseInfoChangeDataDto
.
getUseUnitName
());
esEquipmentCategoryDto
.
setUSE_INNER_CODE
(
equipUseInfoChangeDataDto
.
getUseInnerCode
());
esEquipmentCategory
.
save
(
esEquipmentCategoryDto
);
}
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/SingleDataChangeProcessStrategy.java
View file @
487f93b9
This diff is collapsed.
Click to expand it.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/SingleManageEquipEditHandleImpl.java
0 → 100644
View file @
487f93b9
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
com.yeejoin.amos.boot.module.jg.api.dto.*
;
import
com.yeejoin.amos.boot.module.jg.api.service.IBizDataChangeHandleStrategy
;
import
com.yeejoin.amos.boot.module.jg.biz.event.ChangeDataEvent
;
import
com.yeejoin.amos.boot.module.jg.biz.event.publisher.EventPublisher
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
@Component
@RequiredArgsConstructor
public
class
SingleManageEquipEditHandleImpl
implements
IBizDataChangeHandleStrategy
{
private
final
CommonEquipDataProcessService
commonEquipDataProcessService
;
private
final
EventPublisher
publisher
;
@Override
public
String
canHandleBizType
()
{
return
"singleManageEquipEdit"
;
}
@Override
public
Map
<
String
,
?>
getDetail
(
String
applyNo
,
ModelType
model
,
String
bizId
)
{
return
this
.
getDetailByBizId
(
bizId
);
}
public
Map
<
String
,
Object
>
getDetailByBizId
(
String
record
)
{
Map
<
String
,
Object
>
re
=
new
HashMap
<>();
// 注册信息(基本信息)构建
EquipRegisterChangeDataDto
equipRegisterChangeDataDto
=
commonEquipDataProcessService
.
buildRegisterInfo
(
record
);
// 制造信息构建
EquipFactoryChangeDataDto
factoryChangeDataDto
=
commonEquipDataProcessService
.
buildFactoryInfo
(
record
);
// 设计信息构建
EquipDesignChangeDataDto
designChangeDataDto
=
commonEquipDataProcessService
.
buildDesignInfo
(
record
);
// 使用信息
EquipUseInfoChangeDataDto
equipUseInfoChangeDataDto
=
commonEquipDataProcessService
.
buildUseInfo
(
record
);
re
.
putAll
(
BeanUtil
.
beanToMap
(
equipRegisterChangeDataDto
));
re
.
putAll
(
BeanUtil
.
beanToMap
(
factoryChangeDataDto
));
re
.
putAll
(
BeanUtil
.
beanToMap
(
designChangeDataDto
));
re
.
putAll
(
BeanUtil
.
beanToMap
(
equipUseInfoChangeDataDto
));
commonEquipDataProcessService
.
castJsonFields
(
re
);
return
commonEquipDataProcessService
.
cast2UnderCase
(
re
);
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
doSave
(
String
record
,
ModelType
model
,
Map
<
String
,
Object
>
changeData
)
{
List
<
ChangeDataDto
>
allChangeColumns
=
this
.
update
(
record
,
changeData
);
// 记录流水
if
(!
allChangeColumns
.
isEmpty
())
{
// 更新历史的JSON的数据
this
.
buildLogData
(
allChangeColumns
);
// 异步记录日志
publisher
.
publish
(
new
ChangeDataEvent
(
this
,
allChangeColumns
,
RequestContext
.
cloneRequestContext
()));
}
}
private
List
<
ChangeDataDto
>
update
(
String
record
,
Map
<
String
,
Object
>
changeData
)
{
List
<
ChangeDataDto
>
allChangeColumns
=
new
ArrayList
<>();
// 新数据解析
EquipRegisterChangeDataDto
registerChangeDataDto
=
commonEquipDataProcessService
.
castMap2Bean
(
changeData
,
EquipRegisterChangeDataDto
.
class
);
EquipFactoryChangeDataDto
factoryChangeDataDto
=
commonEquipDataProcessService
.
castMap2Bean
(
changeData
,
EquipFactoryChangeDataDto
.
class
);
EquipDesignChangeDataDto
designChangeDataDto
=
commonEquipDataProcessService
.
castMap2Bean
(
changeData
,
EquipDesignChangeDataDto
.
class
);
EquipUseInfoChangeDataDto
useInfoChangeDataDto
=
commonEquipDataProcessService
.
castMap2Bean
(
changeData
,
EquipUseInfoChangeDataDto
.
class
);
commonEquipDataProcessService
.
buildChangeFields
(
record
,
designChangeDataDto
,
factoryChangeDataDto
,
registerChangeDataDto
,
useInfoChangeDataDto
,
allChangeColumns
);
// 前置校验
commonEquipDataProcessService
.
checkValidField
(
record
,
registerChangeDataDto
,
registerChangeDataDto
.
getEquList
(),
registerChangeDataDto
.
getEquCategory
(),
registerChangeDataDto
.
getEquDefine
());
commonEquipDataProcessService
.
checkValidField
(
record
,
factoryChangeDataDto
,
registerChangeDataDto
.
getEquList
(),
registerChangeDataDto
.
getEquCategory
(),
registerChangeDataDto
.
getEquDefine
());
commonEquipDataProcessService
.
checkValidField
(
record
,
designChangeDataDto
,
registerChangeDataDto
.
getEquList
(),
registerChangeDataDto
.
getEquCategory
(),
registerChangeDataDto
.
getEquDefine
());
// 设备制造、设计、注册、使用信息业务处理落库
commonEquipDataProcessService
.
dealBizDataForEquip
(
record
,
registerChangeDataDto
);
commonEquipDataProcessService
.
dealBizDataForEquip
(
record
,
factoryChangeDataDto
);
commonEquipDataProcessService
.
dealBizDataForEquip
(
record
,
designChangeDataDto
);
commonEquipDataProcessService
.
dealBizDataForEquip
(
record
,
useInfoChangeDataDto
);
return
allChangeColumns
;
}
private
void
buildLogData
(
List
<
ChangeDataDto
>
allChangeColumns
)
{
allChangeColumns
.
forEach
(
column
->
{
column
.
setBizType
(
"监管端编辑设备信息"
);
});
}
}
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