Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
90659c33
Commit
90659c33
authored
Mar 25, 2025
by
hezhuozhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加业务错误日志
parent
8f528e1c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
431 additions
and
86 deletions
+431
-86
ExceptionLogDto.java
...eejoin/amos/boot/module/hygf/api/dto/ExceptionLogDto.java
+39
-0
ExceptionLog.java
...eejoin/amos/boot/module/hygf/api/entity/ExceptionLog.java
+60
-0
ExceptionLogMapper.java
.../amos/boot/module/hygf/api/mapper/ExceptionLogMapper.java
+7
-0
IExceptionLogService.java
...os/boot/module/hygf/api/service/IExceptionLogService.java
+7
-0
AcceptanceCheckAuditingController.java
...ygf/biz/controller/AcceptanceCheckAuditingController.java
+21
-6
AcceptanceCheckController.java
...module/hygf/biz/controller/AcceptanceCheckController.java
+66
-24
BasicGridAcceptanceController.java
...le/hygf/biz/controller/BasicGridAcceptanceController.java
+77
-31
BasicGridAuditingController.java
...dule/hygf/biz/controller/BasicGridAuditingController.java
+30
-17
BasicGridRecordController.java
...module/hygf/biz/controller/BasicGridRecordController.java
+20
-6
WorkOrderController.java
.../boot/module/hygf/biz/controller/WorkOrderController.java
+0
-0
ExceptionLogServiceImpl.java
...module/hygf/biz/service/impl/ExceptionLogServiceImpl.java
+93
-0
application-kingbase8.properties
...f-biz/src/main/resources/application-kingbase8.properties
+11
-2
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/dto/ExceptionLogDto.java
0 → 100644
View file @
90659c33
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
dto
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.yeejoin.amos.boot.biz.common.dto.BaseDto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.util.Date
;
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"ExceptionLogDto"
,
description
=
"异常日志Dto层"
)
public
class
ExceptionLogDto
extends
BaseDto
{
/**
* 请求信息
*/
@ApiModelProperty
(
value
=
"请求信息"
)
private
String
request
;
/**
* 请求体
*/
@ApiModelProperty
(
value
=
"请求体"
)
private
String
reqBody
;
/**
* 错误日志
*/
@ApiModelProperty
(
value
=
"错误日志"
)
private
String
errorLog
;
/**
* 制单日期
*/
@ApiModelProperty
(
value
=
"业务类型"
)
private
String
businessType
;
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/entity/ExceptionLog.java
0 → 100644
View file @
90659c33
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.util.Date
;
import
java.util.List
;
/**
* 异常日志
*
* @author hzz
* @date 2025-03-25
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"hygf_exception_log"
)
@ApiModel
(
value
=
"ExceptionLog"
,
description
=
"异常日志"
)
public
class
ExceptionLog
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 请求信息
*/
@ApiModelProperty
(
value
=
"请求信息"
)
@TableField
(
"request"
)
private
String
request
;
/**
* 请求体
*/
@ApiModelProperty
(
value
=
"请求体"
)
@TableField
(
"req_body"
)
private
String
reqBody
;
/**
* 错误日志
*/
@ApiModelProperty
(
value
=
"错误日志"
)
@TableField
(
"error_log"
)
private
Object
errorLog
;
/**
* 制单日期
*/
@ApiModelProperty
(
value
=
"业务类型"
)
@TableField
(
"business_type"
)
private
String
businessType
;
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/mapper/ExceptionLogMapper.java
0 → 100644
View file @
90659c33
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.ExceptionLog
;
public
interface
ExceptionLogMapper
extends
BaseMapper
<
ExceptionLog
>
{
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/service/IExceptionLogService.java
0 → 100644
View file @
90659c33
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
service
;
import
javax.servlet.http.HttpServletRequest
;
public
interface
IExceptionLogService
{
void
addLog
(
String
businessType
,
String
reqBody
,
Exception
e
,
HttpServletRequest
request
);
}
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/AcceptanceCheckAuditingController.java
View file @
90659c33
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
controller
;
import
com.yeejoin.amos.boot.module.hygf.biz.service.impl.ExceptionLogServiceImpl
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
...
...
@@ -31,6 +32,9 @@ public class AcceptanceCheckAuditingController extends BaseController {
@Autowired
AcceptanceCheckAuditingServiceImpl
acceptanceCheckAuditingServiceImpl
;
@Autowired
ExceptionLogServiceImpl
exceptionLogService
;
/**
* 新增并网审核表
*
...
...
@@ -39,9 +43,15 @@ public class AcceptanceCheckAuditingController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增并网审核表"
,
notes
=
"新增并网审核表"
)
public
ResponseModel
<
AcceptanceCheckAuditingDto
>
save
(
@RequestBody
AcceptanceCheckAuditingDto
model
)
{
model
=
acceptanceCheckAuditingServiceImpl
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
public
ResponseModel
<
AcceptanceCheckAuditingDto
>
save
(
HttpServletRequest
request
,
@RequestBody
AcceptanceCheckAuditingDto
model
)
{
try
{
model
=
acceptanceCheckAuditingServiceImpl
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
}
catch
(
Exception
e
){
exceptionLogService
.
addLog
(
"新增并网审核表"
,
null
,
e
,
request
);
return
exceptionLogService
.
errorResponseModel
(
null
,
request
,
e
);
}
}
/**
...
...
@@ -53,9 +63,14 @@ public class AcceptanceCheckAuditingController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新并网审核表"
,
notes
=
"根据sequenceNbr更新并网审核表"
)
public
ResponseModel
<
AcceptanceCheckAuditingDto
>
updateBySequenceNbrAcceptanceCheckAuditing
(
@RequestBody
AcceptanceCheckAuditingDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
acceptanceCheckAuditingServiceImpl
.
updateWithModel
(
model
));
public
ResponseModel
<
AcceptanceCheckAuditingDto
>
updateBySequenceNbrAcceptanceCheckAuditing
(
HttpServletRequest
request
,
@RequestBody
AcceptanceCheckAuditingDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
try
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
acceptanceCheckAuditingServiceImpl
.
updateWithModel
(
model
));
}
catch
(
Exception
e
){
exceptionLogService
.
addLog
(
"根据sequenceNbr更新并网审核表"
,
null
,
e
,
request
);
return
exceptionLogService
.
errorResponseModel
(
null
,
request
,
e
);
}
}
/**
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/AcceptanceCheckController.java
View file @
90659c33
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.module.hygf.api.config.UserLimits
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.BasicGridRecordDto
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.AcceptanceCheck
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.HygfRectificationOrder
;
import
com.yeejoin.amos.boot.module.hygf.biz.service.impl.ExceptionLogServiceImpl
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -42,6 +43,8 @@ public class AcceptanceCheckController extends BaseController {
@Autowired
AcceptanceCheckServiceImpl
acceptanceCheckServiceImpl
;
@Autowired
ExceptionLogServiceImpl
exceptionLogService
;
@Value
(
"${admin.tourong.roleId}"
)
...
...
@@ -65,11 +68,16 @@ public class AcceptanceCheckController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save/commit"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增并网验收节点"
,
notes
=
"新增并网验收节点"
)
public
ResponseModel
<
AcceptanceCheck
>
save
(
@RequestBody
Map
<
String
,
Object
>
model
)
{
String
realName
=
getSelectedOrgInfo
().
getUserModel
().
getRealName
();
model
.
put
(
"realName"
,
realName
);
return
ResponseHelper
.
buildResponse
(
acceptanceCheckServiceImpl
.
saveAndCommit
(
model
));
public
ResponseModel
<
AcceptanceCheck
>
save
(
HttpServletRequest
request
,
@RequestBody
Map
<
String
,
Object
>
model
)
{
try
{
String
realName
=
getSelectedOrgInfo
().
getUserModel
().
getRealName
();
model
.
put
(
"realName"
,
realName
);
return
ResponseHelper
.
buildResponse
(
acceptanceCheckServiceImpl
.
saveAndCommit
(
model
));
}
catch
(
Exception
e
){
exceptionLogService
.
addLog
(
"新增验收节点"
,
JSON
.
toJSONString
(
model
),
e
,
request
);
return
exceptionLogService
.
errorResponseModel
(
new
AcceptanceCheck
(),
request
,
e
);
}
}
/**
...
...
@@ -81,9 +89,14 @@ public class AcceptanceCheckController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新并网验收节点"
,
notes
=
"根据sequenceNbr更新并网验收节点"
)
public
ResponseModel
<
AcceptanceCheckDto
>
updateBySequenceNbrAcceptanceCheck
(
@RequestBody
AcceptanceCheckDto
model
,
@ApiParam
(
value
=
"主键"
,
example
=
"1805040753609568257"
)
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
acceptanceCheckServiceImpl
.
updateWithModel
(
model
));
public
ResponseModel
<
AcceptanceCheckDto
>
updateBySequenceNbrAcceptanceCheck
(
HttpServletRequest
request
,
@RequestBody
AcceptanceCheckDto
model
,
@ApiParam
(
value
=
"主键"
,
example
=
"1805040753609568257"
)
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
try
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
acceptanceCheckServiceImpl
.
updateWithModel
(
model
));
}
catch
(
Exception
e
){
exceptionLogService
.
addLog
(
"根据sequenceNbr更新验收节点"
,
JSON
.
toJSONString
(
model
),
e
,
request
);
return
exceptionLogService
.
errorResponseModel
(
new
AcceptanceCheckDto
(),
request
,
e
);
}
}
/**
...
...
@@ -130,28 +143,41 @@ public class AcceptanceCheckController extends BaseController {
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"验收-经销商管理"
,
notes
=
"验收经销商管理"
)
@PostMapping
(
value
=
"/completeAdminAudit"
)
@Transactional
public
ResponseModel
completeAdminAudit
(
@RequestBody
Map
<
String
,
String
>
kv
)
{
acceptanceCheckServiceImpl
.
completeAdminAudit
(
kv
);
return
ResponseHelper
.
buildResponse
(
null
);
public
ResponseModel
completeAdminAudit
(
HttpServletRequest
request
,
@RequestBody
Map
<
String
,
String
>
kv
)
{
try
{
acceptanceCheckServiceImpl
.
completeAdminAudit
(
kv
);
return
ResponseHelper
.
buildResponse
(
null
);
}
catch
(
Exception
e
){
exceptionLogService
.
addLog
(
"验收-经销商管理"
,
JSON
.
toJSONString
(
kv
),
e
,
request
);
return
exceptionLogService
.
errorResponseModel
(
null
,
request
,
e
);
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"验收管理审核"
,
notes
=
"验收管理审核"
)
@PostMapping
(
value
=
"/completeAudit"
)
@Transactional
public
ResponseModel
completeAudit
(
@RequestBody
Map
<
String
,
String
>
kv
)
{
return
acceptanceCheckServiceImpl
.
completeAudit
(
kv
);
public
ResponseModel
completeAudit
(
HttpServletRequest
request
,
@RequestBody
Map
<
String
,
String
>
kv
)
{
try
{
return
acceptanceCheckServiceImpl
.
completeAudit
(
kv
);
}
catch
(
Exception
e
){
exceptionLogService
.
addLog
(
"验收管理审核"
,
JSON
.
toJSONString
(
kv
),
e
,
request
);
return
exceptionLogService
.
errorResponseModel
(
null
,
request
,
e
);
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"整改单下发"
,
notes
=
"整改单下发"
)
@PostMapping
(
value
=
"/addRectification"
)
@Transactional
public
ResponseModel
addRectification
(
@RequestBody
HygfRectificationOrder
hygfReplenishment
)
{
public
ResponseModel
addRectification
(
HttpServletRequest
request
,
@RequestBody
HygfRectificationOrder
hygfReplenishment
)
{
return
acceptanceCheckServiceImpl
.
addRectification
(
hygfReplenishment
);
try
{
return
acceptanceCheckServiceImpl
.
addRectification
(
hygfReplenishment
);
}
catch
(
Exception
e
){
exceptionLogService
.
addLog
(
"整改单下发"
,
JSON
.
toJSONString
(
hygfReplenishment
),
e
,
request
);
return
exceptionLogService
.
errorResponseModel
(
null
,
request
,
e
);
}
}
...
...
@@ -159,30 +185,46 @@ public class AcceptanceCheckController extends BaseController {
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"整改单添加信息"
,
notes
=
"整改单添加信息"
)
@PostMapping
(
value
=
"/nextTaskExcute"
)
@Transactional
public
ResponseModel
nextTaskExcute
(
@RequestBody
HygfRectificationOrder
hygfReplenishment
)
{
public
ResponseModel
nextTaskExcute
(
HttpServletRequest
request
,
@RequestBody
HygfRectificationOrder
hygfReplenishment
)
{
return
acceptanceCheckServiceImpl
.
nextTaskExcute
(
hygfReplenishment
);
try
{
return
acceptanceCheckServiceImpl
.
nextTaskExcute
(
hygfReplenishment
);
}
catch
(
Exception
e
){
exceptionLogService
.
addLog
(
"整改单添加信息"
,
JSON
.
toJSONString
(
hygfReplenishment
),
e
,
request
);
return
exceptionLogService
.
errorResponseModel
(
null
,
request
,
e
);
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"整改单审核"
,
notes
=
"整改单审核"
)
@PostMapping
(
value
=
"/nextTaskAduit"
)
@Transactional
public
ResponseModel
nextTaskAduit
(
@RequestBody
HygfRectificationOrder
hygfReplenishment
)
{
public
ResponseModel
nextTaskAduit
(
HttpServletRequest
request
,
@RequestBody
HygfRectificationOrder
hygfReplenishment
)
{
return
acceptanceCheckServiceImpl
.
nextTaskAduit
(
hygfReplenishment
);
try
{
return
acceptanceCheckServiceImpl
.
nextTaskAduit
(
hygfReplenishment
);
}
catch
(
Exception
e
){
exceptionLogService
.
addLog
(
"整改单审核"
,
JSON
.
toJSONString
(
hygfReplenishment
),
e
,
request
);
return
exceptionLogService
.
errorResponseModel
(
null
,
request
,
e
);
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"整改单作废"
,
notes
=
"整改单作废"
)
@PutMapping
(
value
=
"/rollback"
)
@Transactional
public
ResponseModel
rollback
(
@ApiParam
(
value
=
"主键"
,
example
=
"1805040753609568257"
)
@RequestParam
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
public
ResponseModel
rollback
(
HttpServletRequest
request
,
@ApiParam
(
value
=
"主键"
,
example
=
"1805040753609568257"
)
@RequestParam
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
try
{
return
acceptanceCheckServiceImpl
.
rollback
(
sequenceNbr
);
return
acceptanceCheckServiceImpl
.
rollback
(
sequenceNbr
);
}
catch
(
Exception
e
){
exceptionLogService
.
addLog
(
"整改单作废"
,
null
,
e
,
request
);
return
exceptionLogService
.
errorResponseModel
(
null
,
request
,
e
);
}
}
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/BasicGridAcceptanceController.java
View file @
90659c33
This diff is collapsed.
Click to expand it.
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/BasicGridAuditingController.java
View file @
90659c33
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.util.List
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.BasicGridAuditingDto
;
import
com.yeejoin.amos.boot.module.hygf.biz.service.impl.BasicGridAuditingServiceImpl
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
com.yeejoin.amos.boot.module.hygf.biz.service.impl.ExceptionLogServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.BasicGridAuditingDto
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
/**
* 并网审核表
...
...
@@ -30,6 +31,8 @@ public class BasicGridAuditingController extends BaseController {
@Autowired
BasicGridAuditingServiceImpl
basicGridAuditingServiceImpl
;
@Autowired
ExceptionLogServiceImpl
exceptionLogService
;
/**
* 新增并网审核表
...
...
@@ -39,9 +42,14 @@ public class BasicGridAuditingController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增并网审核表"
,
notes
=
"新增并网审核表"
)
public
ResponseModel
<
BasicGridAuditingDto
>
save
(
@RequestBody
BasicGridAuditingDto
model
)
{
model
=
basicGridAuditingServiceImpl
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
public
ResponseModel
<
BasicGridAuditingDto
>
save
(
HttpServletRequest
request
,
@RequestBody
BasicGridAuditingDto
model
)
{
try
{
model
=
basicGridAuditingServiceImpl
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
}
catch
(
Exception
e
){
exceptionLogService
.
addLog
(
"新增并网审核表"
,
JSON
.
toJSONString
(
model
),
e
,
request
);
return
exceptionLogService
.
errorResponseModel
(
new
BasicGridAuditingDto
(),
request
,
e
);
}
}
/**
...
...
@@ -53,9 +61,14 @@ public class BasicGridAuditingController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新并网审核表"
,
notes
=
"根据sequenceNbr更新并网审核表"
)
public
ResponseModel
<
BasicGridAuditingDto
>
updateBySequenceNbrBasicGridAuditing
(
@RequestBody
BasicGridAuditingDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
basicGridAuditingServiceImpl
.
updateWithModel
(
model
));
public
ResponseModel
<
BasicGridAuditingDto
>
updateBySequenceNbrBasicGridAuditing
(
HttpServletRequest
request
,
@RequestBody
BasicGridAuditingDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
try
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
basicGridAuditingServiceImpl
.
updateWithModel
(
model
));
}
catch
(
Exception
e
){
exceptionLogService
.
addLog
(
"根据sequenceNbr更新并网审核表"
,
JSON
.
toJSONString
(
model
),
e
,
request
);
return
exceptionLogService
.
errorResponseModel
(
new
BasicGridAuditingDto
(),
request
,
e
);
}
}
/**
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/BasicGridRecordController.java
View file @
90659c33
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.yeejoin.amos.boot.module.hygf.biz.service.impl.ExceptionLogServiceImpl
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
...
...
@@ -30,6 +32,8 @@ public class BasicGridRecordController extends BaseController {
@Autowired
BasicGridRecordServiceImpl
basicGridRecordServiceImpl
;
@Autowired
ExceptionLogServiceImpl
exceptionLogService
;
/**
* 新增并网验收节点
...
...
@@ -39,9 +43,14 @@ public class BasicGridRecordController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增并网验收节点"
,
notes
=
"新增并网验收节点"
)
public
ResponseModel
<
BasicGridRecordDto
>
save
(
@RequestBody
BasicGridRecordDto
model
)
{
model
=
basicGridRecordServiceImpl
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
public
ResponseModel
<
BasicGridRecordDto
>
save
(
HttpServletRequest
request
,
@RequestBody
BasicGridRecordDto
model
)
{
try
{
model
=
basicGridRecordServiceImpl
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
}
catch
(
Exception
e
){
exceptionLogService
.
addLog
(
"新增并网验收节点"
,
JSON
.
toJSONString
(
model
),
e
,
request
);
return
exceptionLogService
.
errorResponseModel
(
new
BasicGridRecordDto
(),
request
,
e
);
}
}
/**
...
...
@@ -53,9 +62,14 @@ public class BasicGridRecordController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新并网验收节点"
,
notes
=
"根据sequenceNbr更新并网验收节点"
)
public
ResponseModel
<
BasicGridRecordDto
>
updateBySequenceNbrBasicGridRecord
(
@RequestBody
BasicGridRecordDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
basicGridRecordServiceImpl
.
updateWithModel
(
model
));
public
ResponseModel
<
BasicGridRecordDto
>
updateBySequenceNbrBasicGridRecord
(
HttpServletRequest
request
,
@RequestBody
BasicGridRecordDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
try
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
basicGridRecordServiceImpl
.
updateWithModel
(
model
));
}
catch
(
Exception
e
){
exceptionLogService
.
addLog
(
"根据sequenceNbr更新并网验收节点"
,
JSON
.
toJSONString
(
model
),
e
,
request
);
return
exceptionLogService
.
errorResponseModel
(
new
BasicGridRecordDto
(),
request
,
e
);
}
}
/**
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/WorkOrderController.java
View file @
90659c33
This diff is collapsed.
Click to expand it.
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/ExceptionLogServiceImpl.java
0 → 100644
View file @
90659c33
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
service
.
impl
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.ExceptionLogDto
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.ConstructionRecords
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.ExceptionLog
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.ExceptionLogMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.service.IExceptionLogService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.stereotype.Service
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Date
;
import
java.util.Enumeration
;
@Service
@Slf4j
public
class
ExceptionLogServiceImpl
extends
BaseService
<
ExceptionLogDto
,
ExceptionLog
,
ExceptionLogMapper
>
implements
IExceptionLogService
{
@Override
public
void
addLog
(
String
businessType
,
String
reqBody
,
Exception
exception
,
HttpServletRequest
request
)
{
try
{
ExceptionLog
exceptionLog
=
new
ExceptionLog
();
exceptionLog
.
setRecDate
(
new
Date
());
log
.
error
(
exception
.
getMessage
(),
exception
);
exceptionLog
.
setErrorLog
(
getStackTraceAsString
(
exception
));
exceptionLog
.
setRequest
(
getRequestInfo
(
request
));
exceptionLog
.
setBusinessType
(
businessType
);
exceptionLog
.
setReqBody
(
reqBody
);
this
.
save
(
exceptionLog
);
}
catch
(
Exception
e
){
log
.
error
(
e
.
getMessage
(),
e
);
}
}
// 将异常堆栈转换为字符串
private
static
String
getStackTraceAsString
(
Exception
e
)
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
e
).
append
(
"\n"
);
for
(
StackTraceElement
element
:
e
.
getStackTrace
())
{
sb
.
append
(
element
.
toString
()).
append
(
"\n"
);
}
return
sb
.
toString
();
}
private
String
getRequestInfo
(
HttpServletRequest
request
)
{
StringBuilder
sb
=
new
StringBuilder
();
// 拼接请求方法 (GET, POST等)
sb
.
append
(
"Method: "
).
append
(
request
.
getMethod
()).
append
(
"\n"
);
// 拼接请求URL
sb
.
append
(
"Request URL: "
).
append
(
request
.
getRequestURL
()).
append
(
"\n"
);
// 拼接查询参数
sb
.
append
(
"Query Parameters: \n"
);
Enumeration
<
String
>
paramNames
=
request
.
getParameterNames
();
while
(
paramNames
.
hasMoreElements
())
{
String
paramName
=
paramNames
.
nextElement
();
sb
.
append
(
paramName
).
append
(
"="
).
append
(
request
.
getParameter
(
paramName
)).
append
(
"\n"
);
}
// 拼接请求头
sb
.
append
(
"Headers: \n"
);
Enumeration
<
String
>
headerNames
=
request
.
getHeaderNames
();
while
(
headerNames
.
hasMoreElements
())
{
String
headerName
=
headerNames
.
nextElement
();
sb
.
append
(
headerName
).
append
(
": "
).
append
(
request
.
getHeader
(
headerName
)).
append
(
"\n"
);
}
// 拼接客户端IP地址
sb
.
append
(
"Client IP: "
).
append
(
request
.
getRemoteAddr
()).
append
(
"\n"
);
return
sb
.
toString
();
}
public
<
T
>
ResponseModel
<
T
>
errorResponseModel
(
T
t
,
HttpServletRequest
request
,
Exception
e
){
ResponseModel
<
T
>
response
=
new
ResponseModel
<>();
response
.
setStatus
(
HttpStatus
.
INTERNAL_SERVER_ERROR
.
value
());
response
.
setTraceId
(
RequestContext
.
getTraceId
());
response
.
setPath
(
request
.
getServletPath
());
response
.
setDevMessage
(
e
.
getMessage
());
response
.
setMessage
(
e
.
getMessage
());
return
response
;
}
}
\ No newline at end of file
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/resources/application-kingbase8.properties
View file @
90659c33
...
...
@@ -273,4 +273,13 @@ hygf.icbc.apigwPublicKey=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCMpjaWjngB4E3ATh+
hygf.icbc.outVendorId
=
gxjr
hygf.icbc.projectId
=
PJ140014023565102203
hygf.sms.maintenanceCode
=
SMS_HYGF_0005
hygf.sms.repaymentCode
=
SMS_HYGF_0006
\ No newline at end of file
hygf.sms.repaymentCode
=
SMS_HYGF_0006
icbc.Withhold.projectId
=
PJ140014023565102203
icbc.Withhold.corpCis
=
211590000183323
icbc.Withhold.partner.identification
=
JO004
icbc.Withhold.outVendorId
=
gxjr
icbc.Withhold.sftpUserName
=
jrgf
icbc.Withhold.sftpPort
=
8001
icbc.Withhold.sftpIp
=
gw.open.icbc.com.cn
withholdStatusCron
=
0,30 8-23 * * * ?
withholdReceiptFileCron
=
0 0 23 * * ?
\ 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