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
ef238c0a
Commit
ef238c0a
authored
Feb 11, 2022
by
kongfm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新报错提示
parent
117e47c4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
78 additions
and
4 deletions
+78
-4
IEquipmentInformService.java
...t/module/tzs/flc/api/service/IEquipmentInformService.java
+2
-1
CommonResponseUtil.java
...amos/boot/module/common/biz/utils/CommonResponseUtil.java
+59
-0
EquipmentInformController.java
...ule/tzs/flc/biz/controller/EquipmentInformController.java
+7
-2
EquipmentInformServiceImpl.java
.../tzs/flc/biz/service/impl/EquipmentInformServiceImpl.java
+1
-0
UnitInfoServiceImpl.java
.../module/tzs/flc/biz/service/impl/UnitInfoServiceImpl.java
+9
-1
No files found.
amos-boot-module/amos-boot-module-api/amos-boot-module-tzs-api/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/api/service/IEquipmentInformService.java
View file @
ef238c0a
...
@@ -4,6 +4,7 @@ package com.yeejoin.amos.boot.module.tzs.flc.api.service;
...
@@ -4,6 +4,7 @@ package com.yeejoin.amos.boot.module.tzs.flc.api.service;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentInformDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.EquipmentInformDto
;
import
org.typroject.tyboot.core.foundation.exception.BaseException
;
import
java.util.List
;
import
java.util.List
;
...
@@ -41,7 +42,7 @@ public interface IEquipmentInformService {
...
@@ -41,7 +42,7 @@ public interface IEquipmentInformService {
Boolean
acceptInform
(
Long
sequenceNbr
);
Boolean
acceptInform
(
Long
sequenceNbr
);
EquipmentInformDto
updateEquipmentInform
(
EquipmentInformDto
model
,
ReginParams
userInfo
);
EquipmentInformDto
updateEquipmentInform
(
EquipmentInformDto
model
,
ReginParams
userInfo
)
throws
BaseException
;
EquipmentInformDto
queryDtoBySeq
(
Long
sequenceNbr
);
EquipmentInformDto
queryDtoBySeq
(
Long
sequenceNbr
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-common-biz/src/main/java/com/yeejoin/amos/boot/module/common/biz/utils/CommonResponseUtil.java
0 → 100644
View file @
ef238c0a
package
com
.
yeejoin
.
amos
.
boot
.
module
.
common
.
biz
.
utils
;
import
org.springframework.http.HttpStatus
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
public
class
CommonResponseUtil
{
public
static
ResponseModel
success
()
{
ResponseModel
res
=
new
ResponseModel
();
res
.
setDevMessage
(
"SUCCESS"
);
res
.
setStatus
(
HttpStatus
.
OK
.
value
());
return
res
;
}
public
static
ResponseModel
success
(
Object
obj
)
{
ResponseModel
res
=
new
ResponseModel
();
res
.
setResult
(
obj
);
res
.
setDevMessage
(
"SUCCESS"
);
res
.
setStatus
(
HttpStatus
.
OK
.
value
());
return
res
;
}
public
static
ResponseModel
success
(
Object
obj
,
String
message
)
{
ResponseModel
res
=
new
ResponseModel
();
res
.
setResult
(
obj
);
res
.
setDevMessage
(
message
);
res
.
setStatus
(
HttpStatus
.
OK
.
value
());
return
res
;
}
public
static
ResponseModel
failure
()
{
ResponseModel
res
=
new
ResponseModel
();
res
.
setDevMessage
(
"FAILURE"
);
res
.
setStatus
(
HttpStatus
.
INTERNAL_SERVER_ERROR
.
value
());
return
res
;
}
public
static
ResponseModel
failure
(
String
message
)
{
ResponseModel
res
=
new
ResponseModel
();
res
.
setDevMessage
(
"FAILURE"
);
res
.
setMessage
(
message
);
res
.
setStatus
(
HttpStatus
.
INTERNAL_SERVER_ERROR
.
value
());
return
res
;
}
public
static
ResponseModel
failure
(
Object
obj
,
String
message
)
{
ResponseModel
res
=
new
ResponseModel
();
res
.
setResult
(
obj
);
res
.
setDevMessage
(
"FAILURE"
);
res
.
setStatus
(
HttpStatus
.
INTERNAL_SERVER_ERROR
.
value
());
return
res
;
}
}
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/controller/EquipmentInformController.java
View file @
ef238c0a
...
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
...
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService
;
import
com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService
;
import
com.yeejoin.amos.boot.module.common.biz.utils.CommonResponseUtil
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto
;
import
com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto
;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils
;
import
com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.InformEquipmentDto
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.dto.InformEquipmentDto
;
...
@@ -95,11 +96,15 @@ public class EquipmentInformController extends BaseController {
...
@@ -95,11 +96,15 @@ public class EquipmentInformController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/submit"
)
@PostMapping
(
value
=
"/submit"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"提交设备告知单"
,
notes
=
"提交设备告知单"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"提交设备告知单"
,
notes
=
"提交设备告知单"
)
public
ResponseModel
<
EquipmentInformDto
>
submit
(
@RequestBody
EquipmentInformDto
model
)
{
public
ResponseModel
submit
(
@RequestBody
EquipmentInformDto
model
)
{
if
(
ValidationUtil
.
isEmpty
(
model
.
getSequenceNbr
()))
{
if
(
ValidationUtil
.
isEmpty
(
model
.
getSequenceNbr
()))
{
throw
new
BadRequest
(
"参数校验失败."
);
throw
new
BadRequest
(
"参数校验失败."
);
}
}
return
ResponseHelper
.
buildResponse
(
equipmentInformServiceImpl
.
updateEquipmentInform
(
model
,
getSelectedOrgInfo
()));
try
{
return
CommonResponseUtil
.
success
(
equipmentInformServiceImpl
.
updateEquipmentInform
(
model
,
getSelectedOrgInfo
()));
}
catch
(
Exception
e
)
{
return
CommonResponseUtil
.
failure
(
e
.
getMessage
());
}
}
}
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/service/impl/EquipmentInformServiceImpl.java
View file @
ef238c0a
...
@@ -44,6 +44,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -44,6 +44,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
org.typroject.tyboot.core.foundation.exception.BaseException
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-tzs-biz/src/main/java/com/yeejoin/amos/boot/module/tzs/flc/biz/service/impl/UnitInfoServiceImpl.java
View file @
ef238c0a
...
@@ -19,6 +19,7 @@ import com.yeejoin.amos.boot.module.tzs.flc.api.entity.UnitInfo;
...
@@ -19,6 +19,7 @@ import com.yeejoin.amos.boot.module.tzs.flc.api.entity.UnitInfo;
import
com.yeejoin.amos.boot.module.tzs.flc.api.entity.UnitInfoChange
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.entity.UnitInfoChange
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.mapper.UnitInfoMapper
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.mapper.UnitInfoMapper
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.service.IUnitInfoService
;
import
com.yeejoin.amos.boot.module.tzs.flc.api.service.IUnitInfoService
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
...
@@ -306,7 +307,14 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto, UnitInfo, Unit
...
@@ -306,7 +307,14 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto, UnitInfo, Unit
orgRoles
.
put
(
companyInfo
.
getSequenceNbr
(),
userRoleList
);
orgRoles
.
put
(
companyInfo
.
getSequenceNbr
(),
userRoleList
);
agencyUserModel
.
setOrgRoles
(
orgRoles
);
agencyUserModel
.
setOrgRoles
(
orgRoles
);
agencyUserModel
.
setOrgRoleSeqs
(
roleSeqsMap
);
agencyUserModel
.
setOrgRoleSeqs
(
roleSeqsMap
);
FeignClientResult
<
AgencyUserModel
>
userResult
=
Privilege
.
agencyUserClient
.
create
(
agencyUserModel
);
FeignClientResult
<
AgencyUserModel
>
userResult
=
null
;
try
{
userResult
=
Privilege
.
agencyUserClient
.
create
(
agencyUserModel
);
}
catch
(
InnerInvokException
e
)
{
// 删除已经创建的 企业信息
Privilege
.
companyClient
.
deleteCompany
(
companyInfo
.
getSequenceNbr
()
+
""
);
throw
new
BadRequest
(
"注册失败"
);
}
if
(
userResult
==
null
||
userResult
.
getResult
()
==
null
)
{
if
(
userResult
==
null
||
userResult
.
getResult
()
==
null
)
{
throw
new
BadRequest
(
"注册失败"
);
throw
new
BadRequest
(
"注册失败"
);
...
...
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