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
e8e0d019
Commit
e8e0d019
authored
May 19, 2025
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(大编辑):代码重构
1.安装告知详情接口增加返回公司类型,用来区分是监管还是企业 2.发起单位编辑单据时,去掉校验附件及变更说明校验
parent
5a574e05
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
31 additions
and
11 deletions
+31
-11
RequestChangeData.java
...eejoin/amos/boot/module/jg/api/dto/RequestChangeData.java
+7
-1
IJgInstallationNoticeService.java
...t/module/jg/api/service/IJgInstallationNoticeService.java
+2
-1
BizDataChangeController.java
...oot/module/jg/biz/controller/BizDataChangeController.java
+5
-2
JgInstallationNoticeController.java
...ule/jg/biz/controller/JgInstallationNoticeController.java
+1
-2
BizDataChangeServiceImpl.java
...mos/boot/module/jg/biz/edit/BizDataChangeServiceImpl.java
+2
-4
CommonServiceImpl.java
...os/boot/module/jg/biz/service/impl/CommonServiceImpl.java
+9
-0
JgInstallationNoticeServiceImpl.java
.../jg/biz/service/impl/JgInstallationNoticeServiceImpl.java
+5
-1
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/RequestChangeData.java
View file @
e8e0d019
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
dto
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
...
...
@@ -26,10 +28,13 @@ public class RequestChangeData extends JSONObject {
*/
public
static
final
String
changeReasonAttachmentKey
=
"changeAttachment"
;
public
void
validated
()
{
public
void
validated
(
ReginParams
reginParams
)
{
// 监管单位编辑需要上传变更说明
if
(!
reginParams
.
getCompany
().
getLevel
().
equals
(
BaseController
.
COMPANY_TYPE_COMPANY
))
{
if
(!
this
.
containsKey
(
changeReasonKey
)
||
!
this
.
containsKey
(
changeReasonAttachmentKey
))
{
throw
new
BadRequest
(
"变更说明和变更说明附件不能为空!"
);
}
}
}
}
\ No newline at end of file
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/service/IJgInstallationNoticeService.java
View file @
e8e0d019
...
...
@@ -4,6 +4,7 @@ package com.yeejoin.amos.boot.module.jg.api.service;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.yeejoin.amos.boot.biz.common.bo.CompanyBo
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice
;
...
...
@@ -26,7 +27,7 @@ public interface IJgInstallationNoticeService extends IService<JgInstallationNot
* @param sequenceNbr 主键
* @return 安装告知
*/
Map
<
String
,
Map
<
String
,
Object
>>
queryBySequenceNbr
(
Long
sequenceNbr
,
String
companyLevel
);
Map
<
String
,
Map
<
String
,
Object
>>
queryBySequenceNbr
(
Long
sequenceNbr
,
CompanyBo
company
);
/**
* 更新安装告知
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/BizDataChangeController.java
View file @
e8e0d019
...
...
@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.jg.biz.controller;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.jg.api.dto.RequestChangeData
;
import
com.yeejoin.amos.boot.module.jg.biz.edit.BizDataChangeServiceImpl
;
...
...
@@ -79,9 +80,11 @@ public class BizDataChangeController extends BaseController {
@ApiParam
(
required
=
true
,
value
=
"业务类型"
)
@PathVariable
String
bizType
,
@ApiParam
(
required
=
true
,
value
=
"设备处理器类型"
)
@RequestParam
IBizDataChangeHandleStrategy
.
ModelType
modelType
,
@RequestBody
RequestChangeData
changeData
)
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
// 基础数据校验
changeData
.
validated
();
bizDataChangeService
.
save
(
bizId
,
applyNo
,
bizType
,
modelType
,
changeData
,
getSelectedOrgInfo
()
);
changeData
.
validated
(
reginParams
);
bizDataChangeService
.
save
(
bizId
,
applyNo
,
bizType
,
modelType
,
changeData
,
reginParams
);
return
ResponseHelper
.
buildResponse
(
"success"
);
}
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/JgInstallationNoticeController.java
View file @
e8e0d019
...
...
@@ -112,8 +112,7 @@ public class JgInstallationNoticeController extends BaseController {
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个安装告知"
,
notes
=
"根据sequenceNbr查询单个安装告知"
)
public
ResponseModel
<
Map
<
String
,
Map
<
String
,
Object
>>>
selectOne
(
@RequestParam
(
"sequenceNbr"
)
Long
sequenceNbr
)
{
String
companyLevel
=
(
String
)
iJgInstallationNoticeService
.
getCompanyType
().
get
(
"companyLevel"
);
return
ResponseHelper
.
buildResponse
(
iJgInstallationNoticeService
.
queryBySequenceNbr
(
sequenceNbr
,
companyLevel
));
return
ResponseHelper
.
buildResponse
(
iJgInstallationNoticeService
.
queryBySequenceNbr
(
sequenceNbr
,
getSelectedOrgInfo
().
getCompany
()));
}
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/edit/BizDataChangeServiceImpl.java
View file @
e8e0d019
...
...
@@ -6,9 +6,8 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import
com.yeejoin.amos.boot.module.jg.api.dto.RequestChangeData
;
import
com.yeejoin.amos.boot.module.jg.biz.context.BizDataHandleStrategyContext
;
import
com.yeejoin.amos.boot.module.jg.biz.controller.BizDataChangeController
;
import
com.yeejoin.amos.boot.module.jg.biz.edit.decorator.CompanyDecorator
;
import
com.yeejoin.amos.boot.module.jg.biz.edit.decorator.PlainDecorator
;
import
com.yeejoin.amos.boot.module.jg.biz.edit.process.biz.strategy.IBizDataChangeHandleStrategy
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.FillingEditPermForCurrentUser
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -44,8 +43,7 @@ public class BizDataChangeServiceImpl {
public
Map
<
String
,
Object
>
querySubDetail
(
String
applyNo
,
String
bizId
,
String
bizType
,
BizDataChangeController
.
DetailType
type
,
ReginParams
selectedOrgInfo
)
{
IBizDataChangeHandleStrategy
handleStrategy
=
BizDataHandleStrategyContext
.
getStrategy
(
bizType
);
// 装饰器模式增强结果
CompanyDecorator
companyDecorator
=
new
CompanyDecorator
(
new
PlainDecorator
<>(),
selectedOrgInfo
);
return
companyDecorator
.
process
(
handleStrategy
.
getSubDetail
(
applyNo
,
bizId
,
type
));
return
new
FillingEditPermForCurrentUser
(
new
JSONObject
(
handleStrategy
.
getSubDetail
(
applyNo
,
bizId
,
type
)),
selectedOrgInfo
.
getCompany
()).
getData
();
}
public
IPage
<?>
getChangeLogPage
(
String
bizId
,
String
bizType
,
int
current
,
int
size
)
{
...
...
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/CommonServiceImpl.java
View file @
e8e0d019
...
...
@@ -3059,4 +3059,12 @@ public class CommonServiceImpl implements ICommonService {
return
commonMapper
.
queryUnitInfoByCreditCode
(
unitCreditCode
);
}
public
static
String
getCompanyType
(
CompanyBo
companyBo
){
if
(
companyBo
.
getLevel
().
equals
(
BaseController
.
COMPANY_TYPE_COMPANY
))
{
return
BaseController
.
COMPANY_TYPE_COMPANY
;
}
else
{
return
BaseController
.
COMPANY_TYPE_SUPERVISION
;
}
}
}
\ No newline at end of file
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/JgInstallationNoticeServiceImpl.java
View file @
e8e0d019
...
...
@@ -214,7 +214,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
@ResultFieldMapping
.
ResultFieldMap
(
sourceField
=
"installationInfo.useUnitCreditCode"
,
targetField
=
"installationInfo.useUnitSeq"
,
serviceClass
=
CommonServiceImpl
.
class
,
queryMethod
=
"queryUnitInfoByCreditCode"
),
@ResultFieldMapping
.
ResultFieldMap
(
sourceField
=
"installationInfo.propertyUnitName"
,
targetField
=
"installationInfo.propertyUnitSeq"
,
serviceClass
=
CommonServiceImpl
.
class
,
queryMethod
=
"queryUnitInfoByCreditCode"
)
})
public
Map
<
String
,
Map
<
String
,
Object
>>
queryBySequenceNbr
(
Long
sequenceNbr
,
String
companyLevel
)
{
public
Map
<
String
,
Map
<
String
,
Object
>>
queryBySequenceNbr
(
Long
sequenceNbr
,
CompanyBo
company
)
{
// 安装告知信息
JgInstallationNotice
notice
=
jgInstallationNoticeMapper
.
selectById
(
sequenceNbr
);
if
(
Objects
.
isNull
(
notice
))
{
...
...
@@ -305,6 +305,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
installationInfo
.
put
(
s
,
ObjectUtils
.
isEmpty
(
installationInfo
.
get
(
s
))
?
null
:
JSON
.
parseObject
(
installationInfo
.
get
(
s
).
toString
()));
}
}
String
companyLevel
=
CommonServiceImpl
.
getCompanyType
(
company
);
if
(
Integer
.
parseInt
(
notice
.
getNoticeStatus
())
>=
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
())
{
// 完成及作废时显示历史数据
JSONObject
hisData
=
commonService
.
queryHistoryData
(
notice
.
getSequenceNbr
());
...
...
@@ -313,6 +314,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
// todo companyLevel赋值这个不能少,控制前端页面的字段(安装负责人)显示隐藏
Map
<
String
,
Object
>
detail
=
setNewEquipData
(
companyLevel
,
installationInfo
);
this
.
fillingEquCategoryNameForHisData
(
detail
,
notice
);
new
FillingEditPermForCurrentUser
(
new
JSONObject
(
detail
),
company
).
getData
();;
return
new
HashMap
<
String
,
Map
<
String
,
Object
>>()
{{
this
.
put
(
"installationInfo"
,
detail
);
}};
...
...
@@ -320,6 +322,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
hisData
.
putAll
(
installationInfo
);
CommonServiceImpl
.
formatTime2StrDateForEquip
(
hisData
);
this
.
fillingEquCategoryNameForHisData
(
hisData
,
notice
);
new
FillingEditPermForCurrentUser
(
hisData
,
company
).
getData
();
// todo 这个不能少 控制前端页面的字段(安装负责人)显示隐藏
hisData
.
put
(
"companyLevel"
,
companyLevel
);
return
new
HashMap
<
String
,
Map
<
String
,
Object
>>()
{{
...
...
@@ -332,6 +335,7 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
Map
<
String
,
Object
>
detail
=
setNewEquipData
(
companyLevel
,
installationInfo
);
detail
.
put
(
"startLatitudeLongitude"
,
JSON
.
parseObject
(
notice
.
getStartLatitudeLongitude
()));
detail
.
put
(
"endLatitudeLongitude"
,
JSON
.
parseObject
(
notice
.
getEndLatitudeLongitude
()));
new
FillingEditPermForCurrentUser
(
new
JSONObject
(
detail
),
company
).
getData
();
return
new
HashMap
<
String
,
Map
<
String
,
Object
>>()
{{
this
.
put
(
"installationInfo"
,
detail
);
}};
...
...
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