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
2052b3f1
Commit
2052b3f1
authored
Jun 17, 2024
by
wujiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改日志打印
parent
b8c40195
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
695 additions
and
407 deletions
+695
-407
GlobalExceptionHandler.java
...s/boot/module/hygf/api/config/GlobalExceptionHandler.java
+55
-0
AmosHygfApplication.java
...z/src/main/java/com/yeejoin/amos/AmosHygfApplication.java
+12
-8
QiyuesuoController.java
...s/boot/module/hygf/biz/controller/QiyuesuoController.java
+342
-389
AcceptanceRectificationOrderServiceImpl.java
...service/impl/AcceptanceRectificationOrderServiceImpl.java
+1
-0
QiyuesuoServiceImpl.java
...oot/module/hygf/biz/service/impl/QiyuesuoServiceImpl.java
+1
-1
application-dev.properties
...le-hygf-biz/src/main/resources/application-dev.properties
+8
-8
application-dev1.properties
...e-hygf-biz/src/main/resources/application-dev1.properties
+230
-0
application.properties
...module-hygf-biz/src/main/resources/application.properties
+1
-1
logback-dev1.xml
...-boot-module-hygf-biz/src/main/resources/logback-dev1.xml
+45
-0
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/config/GlobalExceptionHandler.java
0 → 100644
View file @
2052b3f1
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
config
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.validation.BindException
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.validation.FieldError
;
import
org.springframework.validation.ObjectError
;
import
org.springframework.web.bind.MethodArgumentNotValidException
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestControllerAdvice
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
org.springframework.web.multipart.MaxUploadSizeExceededException
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
/**
* @description: 全局异常处理器
* @author: duanwei
* @create: 2019-08-28 20:07
**/
@RestControllerAdvice
@Slf4j
@Primary
public
class
GlobalExceptionHandler
{
/**
* 校验异常统一拦截地方
*
* @param e
* @return
*/
@ExceptionHandler
({
Exception
.
class
})
@ResponseBody
public
ResponseModel
<
Object
>
handleException
(
Exception
e
)
{
HttpServletRequest
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
())
.
getRequest
();
ResponseModel
<
Object
>
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/java/com/yeejoin/amos/AmosHygfApplication.java
View file @
2052b3f1
package
com
.
yeejoin
.
amos
;
import
com.yeejoin.amos.boot.biz.common.utils.oConvertUtils
;
import
java.net.InetAddress
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.mybatis.spring.boot.autoconfigure.MybatisAutoConfiguration
;
import
org.slf4j.Logger
;
...
...
@@ -16,14 +17,14 @@ import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.FilterType
;
import
org.springframework.core.env.Environment
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
import
org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler
;
import
java.net.InetAddress
;
import
com.yeejoin.amos.boot.biz.common.utils.oConvertUtils
;
/**
* <pre>
...
...
@@ -42,17 +43,20 @@ import java.net.InetAddress;
@EnableScheduling
@MapperScan
({
"org.typroject.tyboot.demo.face.orm.dao*"
,
"org.typroject.tyboot.face.*.orm.dao*"
,
"org.typroject.tyboot.core.auth.face.orm.dao*"
,
"org.typroject.tyboot.component.*.face.orm.dao*"
,
"com.yeejoin.amos.boot.module.**.api.tdenginemapper"
,
"com.yeejoin.amos.boot.module.**.api.mapper"
,
"com.yeejoin.amos.boot.biz.common.dao.mapper"
,
"com.yeejoin.amos.boot.module.common.biz.*"
})
@ComponentScan
(
basePackages
=
{
"org.typroject"
,
"com.yeejoin.amos"
})
@SpringBootApplication
(
exclude
=
{
DataSourceAutoConfiguration
.
class
,
DataSourceTransactionManagerAutoConfiguration
.
class
,
MybatisAutoConfiguration
.
class
})
"com.yeejoin.amos.boot.module.**.api.tdenginemapper"
,
"com.yeejoin.amos.boot.module.**.api.mapper"
,
"com.yeejoin.amos.boot.biz.common.dao.mapper"
,
"com.yeejoin.amos.boot.module.common.biz.*"
})
@ComponentScan
(
basePackages
=
{
"org.typroject"
,
"com.yeejoin.amos"
},
excludeFilters
=
@ComponentScan
.
Filter
(
type
=
FilterType
.
ASSIGNABLE_TYPE
,
classes
=
{
GlobalExceptionHandler
.
class
}))
@SpringBootApplication
(
exclude
=
{
DataSourceAutoConfiguration
.
class
,
DataSourceTransactionManagerAutoConfiguration
.
class
,
MybatisAutoConfiguration
.
class
})
public
class
AmosHygfApplication
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
AmosHygfApplication
.
class
);
public
static
void
main
(
String
[]
args
)
throws
Exception
{
ConfigurableApplicationContext
context
=
SpringApplication
.
run
(
AmosHygfApplication
.
class
,
args
);
GlobalExceptionHandler
.
setAlwaysOk
(
true
);
GlobalExceptionHandler
.
setAlwaysOk
(
true
);
Environment
env
=
context
.
getEnvironment
();
String
ip
=
InetAddress
.
getLocalHost
().
getHostAddress
();
String
port
=
env
.
getProperty
(
"server.port"
);
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/QiyuesuoController.java
View file @
2052b3f1
...
...
@@ -57,398 +57,351 @@ import java.util.Map;
@Api
(
tags
=
"契税锁Api"
)
@RequestMapping
(
value
=
"/qiyuesuo"
)
public
class
QiyuesuoController
extends
BaseController
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
QiyuesuoController
.
class
);
@Autowired
SealDictionaryMapper
sealDictionaryMapper
;
@Autowired
QiyuesuoServiceImpl
qiyuesuoService
;
@Autowired
HouseholdContractServiceImpl
householdContractServiceImpl
;
@Autowired
HouseholdContractMapper
householdContractMapper
;
@Autowired
protected
EmqKeeper
emqKeeper
;
@Autowired
UserMessageMapper
userMessageMapper
;
@Autowired
ToDoTasksMapper
toDoTasksMapper
;
@Value
(
"${qiyuesuo.secretKey}"
)
private
String
secretKey
;
@Autowired
ToDoTasksServiceImpl
toDoTasksServiceImpl
;
@Value
(
"${dealer.engineering}"
)
private
String
engineering
;
@Autowired
ContractFillMapper
contractFillMapper
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"个人token"
,
notes
=
"个人token"
)
@PostMapping
(
value
=
"/getUserToken"
)
public
ResponseModel
<
Object
>
getSdkResponse
(
@RequestBody
UserAuthMiniappTicketRequest
request
)
{
SdkResponse
<
MiniappTicketResult
>
result
=
qiyuesuoService
.
getSdkResponse
(
request
);
return
ResponseHelper
.
buildResponse
(
result
.
getResult
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"合同token"
,
notes
=
"合同token"
)
@PostMapping
(
value
=
"/getContractToken"
)
public
ResponseModel
<
Object
>
getContractSdkResponse
(
@RequestBody
ContractMiniappTicketRequest
request
)
{
SdkResponse
<
MiniappTicketResult
>
result
=
qiyuesuoService
.
getContractSdkResponse
(
request
);
return
ResponseHelper
.
buildResponse
(
result
.
getResult
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"合同token"
,
notes
=
"合同token"
)
@PostMapping
(
value
=
"/getContractTokengz/{sequenceNbr}"
)
public
ResponseModel
<
Object
>
getContractSdkResponseSequenceNbr
(
@RequestBody
ContractMiniappTicketRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
QueryWrapper
<
SealDictionary
>
queryWrapper
=
new
QueryWrapper
();
queryWrapper
.
eq
(
"amos_company_seq"
,
sequenceNbr
);
SealDictionary
sealDictionary
=
sealDictionaryMapper
.
selectOne
(
queryWrapper
);
request
.
setUser
(
new
User
(
sealDictionary
.
getSealedPhone
(),
"MOBILE"
));
SdkResponse
<
MiniappTicketResult
>
result
=
qiyuesuoService
.
getContractSdkResponse
(
request
);
return
ResponseHelper
.
buildResponse
(
result
.
getResult
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取合同浏览令牌"
,
notes
=
"获取合同浏览令牌"
)
@GetMapping
(
value
=
"/getContractTokenTicket/{sequenceNbr}"
)
public
ResponseModel
<
Object
>
getContractTokenTicket
(
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
SdkResponse
<
MiniappTicketResult
>
result
=
qiyuesuoService
.
getContractTokenTicket
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
result
.
getResult
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"创建合同"
,
notes
=
"创建合同"
)
@PostMapping
(
value
=
"/addContract"
)
public
ResponseModel
<
HouseholdContract
>
initiateHouseholdContract
(
@RequestBody
HouseholdContractDto
model
)
{
HouseholdContract
householdContract
=
new
HouseholdContract
();
try
{
householdContract
=
householdContractServiceImpl
.
initiateHouseholdContract
(
model
);
}
catch
(
Exception
e
){
throw
new
BadRequest
(
e
.
getMessage
());
}
return
ResponseHelper
.
buildResponse
(
householdContract
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"合同填充字段"
,
notes
=
"合同填充字段"
)
@GetMapping
(
value
=
"/getContractFill"
)
public
ResponseModel
<
List
<
ContractFill
>>
initiateHouseholdContract
(
Long
templateId
)
{
LambdaQueryWrapper
<
ContractFill
>
up
=
new
LambdaQueryWrapper
();
up
.
eq
(
templateId
!=
null
,
ContractFill:
:
getTemplateId
,
templateId
);
List
<
ContractFill
>
list
=
contractFillMapper
.
selectList
(
up
);
return
ResponseHelper
.
buildResponse
(
list
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"契约锁回调接口"
,
notes
=
"契约锁回调接口"
)
@PostMapping
(
value
=
"/callback"
)
public
String
callback
(
String
content
)
{
try
{
System
.
out
.
println
(
"契约锁回调接口"
+
content
);
String
data
=
this
.
aesDerypt
(
content
,
secretKey
);
System
.
out
.
println
(
"契约锁回调接口解析数据"
+
data
);
CallbackDto
CallbackDto
=
JSON
.
parseObject
(
data
,
CallbackDto
.
class
);
if
(
"PERSONAL"
.
equals
(
CallbackDto
.
getCallbackType
())){
LambdaUpdateWrapper
<
HouseholdContract
>
wrapper
=
new
LambdaUpdateWrapper
<>();
wrapper
.
set
(
HouseholdContract:
:
getSignStatus
,
HouseholdContractEnum
.
签字状态
_
已签字
.
getCode
());
wrapper
.
set
(
HouseholdContract:
:
getStatus
,
HouseholdContractEnum
.
合同状态
_
农户已签署
.
getCode
());
wrapper
.
eq
(
HouseholdContract:
:
getContractLockId
,
CallbackDto
.
getContractId
());
householdContractServiceImpl
.
update
(
wrapper
);
LambdaQueryWrapper
<
HouseholdContract
>
wrapper4
=
new
LambdaQueryWrapper
<>();
wrapper4
.
eq
(
HouseholdContract:
:
getContractLockId
,
CallbackDto
.
getContractId
());
HouseholdContract
householdContrac
=
householdContractMapper
.
selectOne
(
wrapper4
);
//生成填报任务
ToDoTasks
toDoTasks1
=
new
ToDoTasks
(
TaskTypeStationEnum
.
合同填报
.
getCode
(),
householdContrac
.
getSequenceNbr
(),
"用户"
+
householdContrac
.
getPartyA
()+
"合同盖章"
,
null
);
toDoTasksServiceImpl
.
addToDoTasksByRole
(
engineering
,
toDoTasks1
,
"合同签字成功"
);
}
else
if
(
"SEAL"
.
equals
(
CallbackDto
.
getCallbackType
())){
LambdaUpdateWrapper
<
HouseholdContract
>
wrapper
=
new
LambdaUpdateWrapper
<>();
wrapper
.
set
(
HouseholdContract:
:
getStampStatus
,
HouseholdContractEnum
.
盖章状态
_
已盖章
.
getCode
());
wrapper
.
set
(
HouseholdContract:
:
getSigningTime
,
new
Date
());
wrapper
.
set
(
HouseholdContract:
:
getStatus
,
HouseholdContractEnum
.
合同状态
_
双方已签署
.
getCode
());
wrapper
.
set
(
HouseholdContract:
:
getSealedUser
,
getUserInfo
().
getRealName
());
wrapper
.
eq
(
HouseholdContract:
:
getContractLockId
,
CallbackDto
.
getContractId
());
householdContractServiceImpl
.
update
(
wrapper
);
LambdaQueryWrapper
<
HouseholdContract
>
wrapper4
=
new
LambdaQueryWrapper
<>();
wrapper4
.
eq
(
HouseholdContract:
:
getContractLockId
,
CallbackDto
.
getContractId
());
HouseholdContract
contract
=
householdContractMapper
.
selectOne
(
wrapper4
);
LambdaQueryWrapper
<
ToDoTasks
>
wrapper1
=
new
LambdaQueryWrapper
<>();
wrapper1
.
eq
(
ToDoTasks:
:
getType
,
TaskTypeStationEnum
.
合同填报
.
getCode
());
wrapper1
.
eq
(
ToDoTasks:
:
getState
,
"待办"
);
wrapper1
.
eq
(
ToDoTasks:
:
getBusinessId
,
contract
.
getSequenceNbr
());
ToDoTasks
doTasks
=
toDoTasksMapper
.
selectOne
(
wrapper1
);
if
(
doTasks
!=
null
){
doTasks
.
setState
(
"已办"
);
doTasks
.
setCompleteTime
(
new
Date
());
toDoTasksMapper
.
updateById
(
doTasks
);
emqKeeper
.
getMqttClient
().
publish
(
"TASK_MESSAGE"
,
JSON
.
toJSONString
(
doTasks
).
getBytes
(),
2
,
false
);
UserMessage
userMessage
=
new
UserMessage
(
doTasks
.
getType
(),
doTasks
.
getBusinessId
(),
doTasks
.
getAmosUserId
(),
new
Date
(),
doTasks
.
getTaskName
()+
"已完成"
,
doTasks
.
getAmosOrgCode
());
userMessageMapper
.
insert
(
userMessage
);
emqKeeper
.
getMqttClient
().
publish
(
"MY_MESSAGE"
,
JSON
.
toJSONString
(
userMessage
).
getBytes
(),
2
,
false
);
}
}
}
catch
(
Exception
e
){
e
.
printStackTrace
();
throw
new
BadRequest
(
"契约锁回调失败"
);
}
return
"success"
;
}
public
String
aesDerypt
(
String
encrypt
,
String
secret
){
String
decryptStr
=
null
;
try
{
byte
[]
decryptBytes
=
null
;
Cipher
cipher
=
Cipher
.
getInstance
(
Algorithm
.
AES
.
getKey
());
byte
[]
bk
=
secret
.
getBytes
(
"UTF-8"
);
SecretKey
secretKey
=
new
SecretKeySpec
(
bk
,
Algorithm
.
AES
.
getKey
());
cipher
.
init
(
Cipher
.
DECRYPT_MODE
,
secretKey
);
byte
[]
scrBytes
=
Base64Utils
.
decode
(
encrypt
);
decryptBytes
=
cipher
.
doFinal
(
scrBytes
);
if
(
decryptBytes
!=
null
)
{
decryptStr
=
new
String
(
decryptBytes
,
"UTF-8"
);
}
}
catch
(
Exception
e
){
e
.
printStackTrace
();
throw
new
BadRequest
(
"解密失败"
);
}
return
decryptStr
;
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"获取经销商单位"
,
notes
=
"liebiao "
)
@PostMapping
(
value
=
"/getUnit1000"
)
public
ResponseModel
<
ContractListResult
>
getUnit1000
(
@RequestBody
ContractListRequest
request
)
{
String
serverUrl
=
"https://openapi.qiyuesuo.cn"
;
String
accessKey
=
"TdBmNkjAYd"
;
String
accessSecret
=
"y8KiDFKKDdC9Ld9Cm5zuy2rpXjxP5Z"
;
SdkClient
sdkClient
=
new
SdkClient
(
serverUrl
,
accessKey
,
accessSecret
);
ContractListResult
contractListResult
=
null
;
// 解析请求结果
String
response
=
sdkClient
.
service
(
request
);
SdkResponse
<
ContractListResult
>
qysResponse
=
JSONUtils
.
toQysResponse
(
response
,
ContractListResult
.
class
);
if
(
qysResponse
.
getCode
()
==
0
)
{
contractListResult
=
qysResponse
.
getResult
();
}
else
{
throw
new
BaseSdkException
(
"请求失败,错误码:{},错误信息:{}"
);
}
return
ResponseHelper
.
buildResponse
(
qysResponse
.
getResult
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"创建合同"
,
notes
=
"创建合同"
)
@PostMapping
(
value
=
"/getUnit2000"
)
public
ResponseModel
<
SdkResponse
<
Object
>>
getUnit2000
(
@RequestBody
Map
<
String
,
String
>
map
)
{
String
username
=
map
.
get
(
"username"
);
String
contact
=
map
.
get
(
"contact"
);
String
IDCard
=
map
.
get
(
"IDCard"
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
QiyuesuoController
.
class
);
@Autowired
SealDictionaryMapper
sealDictionaryMapper
;
@Autowired
QiyuesuoServiceImpl
qiyuesuoService
;
@Autowired
HouseholdContractServiceImpl
householdContractServiceImpl
;
@Autowired
HouseholdContractMapper
householdContractMapper
;
@Autowired
protected
EmqKeeper
emqKeeper
;
@Autowired
UserMessageMapper
userMessageMapper
;
@Autowired
ToDoTasksMapper
toDoTasksMapper
;
@Value
(
"${qiyuesuo.secretKey}"
)
private
String
secretKey
;
@Autowired
ToDoTasksServiceImpl
toDoTasksServiceImpl
;
@Value
(
"${dealer.engineering}"
)
private
String
engineering
;
@Autowired
ContractFillMapper
contractFillMapper
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"个人token"
,
notes
=
"个人token"
)
@PostMapping
(
value
=
"/getUserToken"
)
public
ResponseModel
<
Object
>
getSdkResponse
(
@RequestBody
UserAuthMiniappTicketRequest
request
)
{
SdkResponse
<
MiniappTicketResult
>
result
=
qiyuesuoService
.
getSdkResponse
(
request
);
return
ResponseHelper
.
buildResponse
(
result
.
getResult
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"合同token"
,
notes
=
"合同token"
)
@PostMapping
(
value
=
"/getContractToken"
)
public
ResponseModel
<
Object
>
getContractSdkResponse
(
@RequestBody
ContractMiniappTicketRequest
request
)
{
SdkResponse
<
MiniappTicketResult
>
result
=
qiyuesuoService
.
getContractSdkResponse
(
request
);
return
ResponseHelper
.
buildResponse
(
result
.
getResult
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"合同token"
,
notes
=
"合同token"
)
@PostMapping
(
value
=
"/getContractTokengz/{sequenceNbr}"
)
public
ResponseModel
<
Object
>
getContractSdkResponseSequenceNbr
(
@RequestBody
ContractMiniappTicketRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
QueryWrapper
<
SealDictionary
>
queryWrapper
=
new
QueryWrapper
();
queryWrapper
.
eq
(
"amos_company_seq"
,
sequenceNbr
);
SealDictionary
sealDictionary
=
sealDictionaryMapper
.
selectOne
(
queryWrapper
);
request
.
setUser
(
new
User
(
sealDictionary
.
getSealedPhone
(),
"MOBILE"
));
SdkResponse
<
MiniappTicketResult
>
result
=
qiyuesuoService
.
getContractSdkResponse
(
request
);
return
ResponseHelper
.
buildResponse
(
result
.
getResult
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"获取合同浏览令牌"
,
notes
=
"获取合同浏览令牌"
)
@GetMapping
(
value
=
"/getContractTokenTicket/{sequenceNbr}"
)
public
ResponseModel
<
Object
>
getContractTokenTicket
(
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
SdkResponse
<
MiniappTicketResult
>
result
=
qiyuesuoService
.
getContractTokenTicket
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
result
.
getResult
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"创建合同"
,
notes
=
"创建合同"
)
@PostMapping
(
value
=
"/addContract"
)
public
ResponseModel
<
HouseholdContract
>
initiateHouseholdContract
(
@RequestBody
HouseholdContractDto
model
)
{
HouseholdContract
householdContract
=
new
HouseholdContract
();
try
{
householdContract
=
householdContractServiceImpl
.
initiateHouseholdContract
(
model
);
}
catch
(
Exception
e
)
{
throw
new
BadRequest
(
e
.
getMessage
());
}
return
ResponseHelper
.
buildResponse
(
householdContract
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"合同填充字段"
,
notes
=
"合同填充字段"
)
@GetMapping
(
value
=
"/getContractFill"
)
public
ResponseModel
<
List
<
ContractFill
>>
initiateHouseholdContract
(
Long
templateId
)
{
LambdaQueryWrapper
<
ContractFill
>
up
=
new
LambdaQueryWrapper
();
up
.
eq
(
templateId
!=
null
,
ContractFill:
:
getTemplateId
,
templateId
);
List
<
ContractFill
>
list
=
contractFillMapper
.
selectList
(
up
);
return
ResponseHelper
.
buildResponse
(
list
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"契约锁回调接口"
,
notes
=
"契约锁回调接口"
)
@PostMapping
(
value
=
"/callback"
)
public
String
callback
(
String
content
)
{
try
{
System
.
out
.
println
(
"契约锁回调接口"
+
content
);
String
data
=
this
.
aesDerypt
(
content
,
secretKey
);
System
.
out
.
println
(
"契约锁回调接口解析数据"
+
data
);
CallbackDto
CallbackDto
=
JSON
.
parseObject
(
data
,
CallbackDto
.
class
);
if
(
"PERSONAL"
.
equals
(
CallbackDto
.
getCallbackType
()))
{
LambdaUpdateWrapper
<
HouseholdContract
>
wrapper
=
new
LambdaUpdateWrapper
<>();
wrapper
.
set
(
HouseholdContract:
:
getSignStatus
,
HouseholdContractEnum
.
签字状态
_
已签字
.
getCode
());
wrapper
.
set
(
HouseholdContract:
:
getStatus
,
HouseholdContractEnum
.
合同状态
_
农户已签署
.
getCode
());
wrapper
.
eq
(
HouseholdContract:
:
getContractLockId
,
CallbackDto
.
getContractId
());
householdContractServiceImpl
.
update
(
wrapper
);
LambdaQueryWrapper
<
HouseholdContract
>
wrapper4
=
new
LambdaQueryWrapper
<>();
wrapper4
.
eq
(
HouseholdContract:
:
getContractLockId
,
CallbackDto
.
getContractId
());
HouseholdContract
householdContrac
=
householdContractMapper
.
selectOne
(
wrapper4
);
// 生成填报任务
ToDoTasks
toDoTasks1
=
new
ToDoTasks
(
TaskTypeStationEnum
.
合同填报
.
getCode
(),
householdContrac
.
getSequenceNbr
(),
"用户"
+
householdContrac
.
getPartyA
()
+
"合同盖章"
,
null
);
toDoTasksServiceImpl
.
addToDoTasksByRole
(
engineering
,
toDoTasks1
,
"合同签字成功"
);
}
else
if
(
"SEAL"
.
equals
(
CallbackDto
.
getCallbackType
()))
{
LambdaUpdateWrapper
<
HouseholdContract
>
wrapper
=
new
LambdaUpdateWrapper
<>();
wrapper
.
set
(
HouseholdContract:
:
getStampStatus
,
HouseholdContractEnum
.
盖章状态
_
已盖章
.
getCode
());
wrapper
.
set
(
HouseholdContract:
:
getSigningTime
,
new
Date
());
wrapper
.
set
(
HouseholdContract:
:
getStatus
,
HouseholdContractEnum
.
合同状态
_
双方已签署
.
getCode
());
wrapper
.
set
(
HouseholdContract:
:
getSealedUser
,
getUserInfo
().
getRealName
());
wrapper
.
eq
(
HouseholdContract:
:
getContractLockId
,
CallbackDto
.
getContractId
());
householdContractServiceImpl
.
update
(
wrapper
);
LambdaQueryWrapper
<
HouseholdContract
>
wrapper4
=
new
LambdaQueryWrapper
<>();
wrapper4
.
eq
(
HouseholdContract:
:
getContractLockId
,
CallbackDto
.
getContractId
());
HouseholdContract
contract
=
householdContractMapper
.
selectOne
(
wrapper4
);
LambdaQueryWrapper
<
ToDoTasks
>
wrapper1
=
new
LambdaQueryWrapper
<>();
wrapper1
.
eq
(
ToDoTasks:
:
getType
,
TaskTypeStationEnum
.
合同填报
.
getCode
());
wrapper1
.
eq
(
ToDoTasks:
:
getState
,
"待办"
);
wrapper1
.
eq
(
ToDoTasks:
:
getBusinessId
,
contract
.
getSequenceNbr
());
ToDoTasks
doTasks
=
toDoTasksMapper
.
selectOne
(
wrapper1
);
if
(
doTasks
!=
null
)
{
doTasks
.
setState
(
"已办"
);
doTasks
.
setCompleteTime
(
new
Date
());
toDoTasksMapper
.
updateById
(
doTasks
);
emqKeeper
.
getMqttClient
().
publish
(
"TASK_MESSAGE"
,
JSON
.
toJSONString
(
doTasks
).
getBytes
(),
2
,
false
);
UserMessage
userMessage
=
new
UserMessage
(
doTasks
.
getType
(),
doTasks
.
getBusinessId
(),
doTasks
.
getAmosUserId
(),
new
Date
(),
doTasks
.
getTaskName
()
+
"已完成"
,
doTasks
.
getAmosOrgCode
());
userMessageMapper
.
insert
(
userMessage
);
emqKeeper
.
getMqttClient
().
publish
(
"MY_MESSAGE"
,
JSON
.
toJSONString
(
userMessage
).
getBytes
(),
2
,
false
);
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
BadRequest
(
"契约锁回调失败"
);
}
return
"success"
;
}
public
String
aesDerypt
(
String
encrypt
,
String
secret
)
{
String
decryptStr
=
null
;
try
{
byte
[]
decryptBytes
=
null
;
Cipher
cipher
=
Cipher
.
getInstance
(
Algorithm
.
AES
.
getKey
());
byte
[]
bk
=
secret
.
getBytes
(
"UTF-8"
);
SecretKey
secretKey
=
new
SecretKeySpec
(
bk
,
Algorithm
.
AES
.
getKey
());
cipher
.
init
(
Cipher
.
DECRYPT_MODE
,
secretKey
);
byte
[]
scrBytes
=
Base64Utils
.
decode
(
encrypt
);
decryptBytes
=
cipher
.
doFinal
(
scrBytes
);
if
(
decryptBytes
!=
null
)
{
decryptStr
=
new
String
(
decryptBytes
,
"UTF-8"
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
BadRequest
(
"解密失败"
);
}
return
decryptStr
;
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"获取经销商单位"
,
notes
=
"liebiao "
)
@PostMapping
(
value
=
"/getUnit1000"
)
public
ResponseModel
<
ContractListResult
>
getUnit1000
(
@RequestBody
ContractListRequest
request
)
{
String
serverUrl
=
"https://openapi.qiyuesuo.cn"
;
String
accessKey
=
"TdBmNkjAYd"
;
String
accessSecret
=
"y8KiDFKKDdC9Ld9Cm5zuy2rpXjxP5Z"
;
SdkClient
sdkClient
=
new
SdkClient
(
serverUrl
,
accessKey
,
accessSecret
);
ContractListResult
contractListResult
=
null
;
// 解析请求结果
String
response
=
sdkClient
.
service
(
request
);
SdkResponse
<
ContractListResult
>
qysResponse
=
JSONUtils
.
toQysResponse
(
response
,
ContractListResult
.
class
);
if
(
qysResponse
.
getCode
()
==
0
)
{
contractListResult
=
qysResponse
.
getResult
();
}
else
{
throw
new
BaseSdkException
(
"请求失败,错误码:{},错误信息:{}"
);
}
return
ResponseHelper
.
buildResponse
(
qysResponse
.
getResult
());
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"创建合同"
,
notes
=
"创建合同"
)
@PostMapping
(
value
=
"/getUnit2000"
)
public
ResponseModel
<
SdkResponse
<
Object
>>
getUnit2000
(
@RequestBody
Map
<
String
,
String
>
map
)
{
String
username
=
map
.
get
(
"username"
);
String
contact
=
map
.
get
(
"contact"
);
String
IDCard
=
map
.
get
(
"IDCard"
);
// 初始化sdkClient
String
serverUrl
=
"https://openapi.qiyuesuo.cn"
;
String
accessKey
=
"TdBmNkjAYd"
;
String
accessSecret
=
"y8KiDFKKDdC9Ld9Cm5zuy2rpXjxP5Z"
;
SdkClient
sdkClient
=
new
SdkClient
(
serverUrl
,
accessKey
,
accessSecret
);
String
serverUrl
=
"https://openapi.qiyuesuo.cn"
;
String
accessKey
=
"TdBmNkjAYd"
;
String
accessSecret
=
"y8KiDFKKDdC9Ld9Cm5zuy2rpXjxP5Z"
;
SdkClient
sdkClient
=
new
SdkClient
(
serverUrl
,
accessKey
,
accessSecret
);
// 合同基本参数
//进行日期格式化
Contract
contract
=
new
Contract
();
contract
.
setSubject
(
"户用光伏测试合同-"
+
username
+
new
Date
().
getTime
());
contract
.
setDescription
(
"户用光伏测试合同-"
+
username
+
new
Date
().
getTime
());
contract
.
setExpireTime
(
"2024-04-24 23:59:59"
);
contract
.
setEndTime
(
"2024-08-24 23:59:59"
);
contract
.
setCategory
(
new
Category
(
"智信能源合同"
));
// contract.setBizId("");
contract
.
setSend
(
false
);
// 个人
Signatory
signatory1
=
new
Signatory
();
signatory1
.
setTenantName
(
username
);
signatory1
.
setTenantType
(
"PERSONAL"
);
signatory1
.
setReceiver
(
new
User
(
username
,
contact
,
"MOBILE"
));
signatory1
.
setSerialNo
(
1
);
// 对接方
Signatory
signatory2
=
new
Signatory
();
signatory2
.
setTenantName
(
"智信能源科技有限公司-测试"
);
signatory2
.
setTenantType
(
"COMPANY"
);
signatory2
.
setReceiver
(
new
User
(
"唐伟"
,
"18291879708"
,
"MOBILE"
));
signatory2
.
setSerialNo
(
2
);
Action
action
=
new
Action
(
"COMPANY"
,
0
);
signatory2
.
addAction
(
action
);
// 设置签署方
contract
.
addSignatory
(
signatory1
);
contract
.
addSignatory
(
signatory2
);
// 创建合同
ContractDraftRequest
request
=
new
ContractDraftRequest
(
contract
);
String
response
=
sdkClient
.
service
(
request
);
SdkResponse
<
Contract
>
responseObj
=
JSONUtils
.
toQysResponse
(
response
,
Contract
.
class
);
// 返回结果
Contract
result
=
new
Contract
();
if
(
responseObj
.
getCode
()
==
0
)
{
result
=
responseObj
.
getResult
();
logger
.
info
(
JSON
.
toJSONString
(
responseObj
));
}
else
{
logger
.
info
(
"请求失败,错误码:{},错误信息:{}"
,
responseObj
.
getCode
(),
responseObj
.
getMessage
());
}
DocumentAddResult
documentAddResult
=
this
.
getDocumentAddResult
(
result
.
getId
(),
username
,
contact
,
IDCard
);
List
<
Signatory
>
list
=
result
.
getSignatories
();
Long
ActionId
=
null
;
Long
SignatoryId
=
null
;
for
(
Signatory
signatory
:
list
)
{
if
(
signatory
.
getTenantType
().
equals
(
"COMPANY"
)){
ActionId
=
signatory
.
getActions
().
get
(
0
).
getId
();
}
else
{
SignatoryId
=
signatory
.
getId
();
}
}
SdkResponse
<
Object
>
data
=
this
.
getSdkResponse
(
result
.
getId
(),
ActionId
,
documentAddResult
.
getDocumentId
(),
SignatoryId
);
return
ResponseHelper
.
buildResponse
(
data
);
}
public
DocumentAddResult
getDocumentAddResult
(
Long
contractId
,
String
username
,
String
contact
,
String
IDCard
)
{
// 初始化sdkClient
String
serverUrl
=
"https://openapi.qiyuesuo.cn"
;
String
accessKey
=
"TdBmNkjAYd"
;
String
accessSecret
=
"y8KiDFKKDdC9Ld9Cm5zuy2rpXjxP5Z"
;
SdkClient
sdkClient
=
new
SdkClient
(
serverUrl
,
accessKey
,
accessSecret
);
// 添加合同文档
List
<
TemplateParam
>
params
=
new
ArrayList
<>();
params
.
add
(
new
TemplateParam
(
"name"
,
username
));
params
.
add
(
new
TemplateParam
(
"IDCard"
,
IDCard
));
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
//进行日期格式化
String
date
=
format
.
format
(
new
Date
());
params
.
add
(
new
TemplateParam
(
"Date"
,
date
));
DocumentAddByTemplateRequest
request
=
new
DocumentAddByTemplateRequest
(
contractId
,
3130034494367662891L
,
params
,
"签署合同,"
);
String
response
=
sdkClient
.
service
(
request
);
SdkResponse
<
DocumentAddResult
>
responseObj
=
JSONUtils
.
toQysResponse
(
response
,
DocumentAddResult
.
class
);
DocumentAddResult
result
=
null
;
if
(
responseObj
.
getCode
()
==
0
)
{
result
=
responseObj
.
getResult
();
logger
.
info
(
"添加合同文档成功,文档ID:{}"
,
JSON
.
toJSONString
(
result
));
}
else
{
logger
.
info
(
"请求失败,错误码:{},错误信息:{}"
,
responseObj
.
getCode
(),
responseObj
.
getMessage
());
}
return
result
;
}
public
SdkResponse
<
Object
>
getSdkResponse
(
Long
contractId
,
Long
ActionId
,
Long
documentId
,
Long
SignatoryId
){
String
serverUrl
=
"https://openapi.qiyuesuo.cn"
;
String
accessKey
=
"TdBmNkjAYd"
;
String
accessSecret
=
"y8KiDFKKDdC9Ld9Cm5zuy2rpXjxP5Z"
;
SdkClient
sdkClient
=
new
SdkClient
(
serverUrl
,
accessKey
,
accessSecret
);
// 发起时可以设置签署位置
Stamper
stamper
=
new
Stamper
();
stamper
.
setActionId
(
ActionId
);
stamper
.
setDocumentId
(
documentId
);
stamper
.
setKeyword
(
"单位名称"
);
stamper
.
setType
(
"COMPANY"
);
stamper
.
setPage
(
1
);
stamper
.
setOffsetX
(
0.3
);
stamper
.
setOffsetY
(
0.0
);
Stamper
stamper2
=
new
Stamper
();
stamper2
.
setSignatoryId
(
SignatoryId
);
stamper2
.
setDocumentId
(
documentId
);
stamper
.
setKeyword
(
"签署方"
);
stamper2
.
setType
(
"PERSONAL"
);
stamper2
.
setPage
(
1
);
stamper2
.
setOffsetX
(
0.0
);
stamper2
.
setOffsetY
(
0.0
);
List
<
Stamper
>
stampers
=
new
ArrayList
<>();
stampers
.
add
(
stamper
);
stampers
.
add
(
stamper2
);
// 进行日期格式化
Contract
contract
=
new
Contract
();
contract
.
setSubject
(
"户用光伏测试合同-"
+
username
+
new
Date
().
getTime
());
contract
.
setDescription
(
"户用光伏测试合同-"
+
username
+
new
Date
().
getTime
());
contract
.
setExpireTime
(
"2024-04-24 23:59:59"
);
contract
.
setEndTime
(
"2024-08-24 23:59:59"
);
contract
.
setCategory
(
new
Category
(
"智信能源合同"
));
// contract.setBizId("");
contract
.
setSend
(
false
);
// 个人
Signatory
signatory1
=
new
Signatory
();
signatory1
.
setTenantName
(
username
);
signatory1
.
setTenantType
(
"PERSONAL"
);
signatory1
.
setReceiver
(
new
User
(
username
,
contact
,
"MOBILE"
));
signatory1
.
setSerialNo
(
1
);
// 对接方
Signatory
signatory2
=
new
Signatory
();
signatory2
.
setTenantName
(
"智信能源科技有限公司-测试"
);
signatory2
.
setTenantType
(
"COMPANY"
);
signatory2
.
setReceiver
(
new
User
(
"唐伟"
,
"18291879708"
,
"MOBILE"
));
signatory2
.
setSerialNo
(
2
);
Action
action
=
new
Action
(
"COMPANY"
,
0
);
signatory2
.
addAction
(
action
);
// 设置签署方
contract
.
addSignatory
(
signatory1
);
contract
.
addSignatory
(
signatory2
);
// 创建合同
ContractDraftRequest
request
=
new
ContractDraftRequest
(
contract
);
String
response
=
sdkClient
.
service
(
request
);
SdkResponse
<
Contract
>
responseObj
=
JSONUtils
.
toQysResponse
(
response
,
Contract
.
class
);
// 返回结果
Contract
result
=
new
Contract
();
if
(
responseObj
.
getCode
()
==
0
)
{
result
=
responseObj
.
getResult
();
logger
.
info
(
JSON
.
toJSONString
(
responseObj
));
}
else
{
logger
.
info
(
"请求失败,错误码:{},错误信息:{}"
,
responseObj
.
getCode
(),
responseObj
.
getMessage
());
}
DocumentAddResult
documentAddResult
=
this
.
getDocumentAddResult
(
result
.
getId
(),
username
,
contact
,
IDCard
);
List
<
Signatory
>
list
=
result
.
getSignatories
();
Long
ActionId
=
null
;
Long
SignatoryId
=
null
;
for
(
Signatory
signatory
:
list
)
{
if
(
signatory
.
getTenantType
().
equals
(
"COMPANY"
))
{
ActionId
=
signatory
.
getActions
().
get
(
0
).
getId
();
}
else
{
SignatoryId
=
signatory
.
getId
();
}
}
SdkResponse
<
Object
>
data
=
this
.
getSdkResponse
(
result
.
getId
(),
ActionId
,
documentAddResult
.
getDocumentId
(),
SignatoryId
);
return
ResponseHelper
.
buildResponse
(
data
);
}
public
DocumentAddResult
getDocumentAddResult
(
Long
contractId
,
String
username
,
String
contact
,
String
IDCard
)
{
// 初始化sdkClient
String
serverUrl
=
"https://openapi.qiyuesuo.cn"
;
String
accessKey
=
"TdBmNkjAYd"
;
String
accessSecret
=
"y8KiDFKKDdC9Ld9Cm5zuy2rpXjxP5Z"
;
SdkClient
sdkClient
=
new
SdkClient
(
serverUrl
,
accessKey
,
accessSecret
);
// 添加合同文档
List
<
TemplateParam
>
params
=
new
ArrayList
<>();
params
.
add
(
new
TemplateParam
(
"name"
,
username
));
params
.
add
(
new
TemplateParam
(
"IDCard"
,
IDCard
));
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
// 进行日期格式化
String
date
=
format
.
format
(
new
Date
());
params
.
add
(
new
TemplateParam
(
"Date"
,
date
));
DocumentAddByTemplateRequest
request
=
new
DocumentAddByTemplateRequest
(
contractId
,
3130034494367662891L
,
params
,
"签署合同,"
);
String
response
=
sdkClient
.
service
(
request
);
SdkResponse
<
DocumentAddResult
>
responseObj
=
JSONUtils
.
toQysResponse
(
response
,
DocumentAddResult
.
class
);
DocumentAddResult
result
=
null
;
if
(
responseObj
.
getCode
()
==
0
)
{
result
=
responseObj
.
getResult
();
logger
.
info
(
"添加合同文档成功,文档ID:{}"
,
JSON
.
toJSONString
(
result
));
}
else
{
logger
.
info
(
"请求失败,错误码:{},错误信息:{}"
,
responseObj
.
getCode
(),
responseObj
.
getMessage
());
}
return
result
;
}
public
SdkResponse
<
Object
>
getSdkResponse
(
Long
contractId
,
Long
ActionId
,
Long
documentId
,
Long
SignatoryId
)
{
String
serverUrl
=
"https://openapi.qiyuesuo.cn"
;
String
accessKey
=
"TdBmNkjAYd"
;
String
accessSecret
=
"y8KiDFKKDdC9Ld9Cm5zuy2rpXjxP5Z"
;
SdkClient
sdkClient
=
new
SdkClient
(
serverUrl
,
accessKey
,
accessSecret
);
// 发起时可以设置签署位置
Stamper
stamper
=
new
Stamper
();
stamper
.
setActionId
(
ActionId
);
stamper
.
setDocumentId
(
documentId
);
stamper
.
setKeyword
(
"单位名称"
);
stamper
.
setType
(
"COMPANY"
);
stamper
.
setPage
(
1
);
stamper
.
setOffsetX
(
0.3
);
stamper
.
setOffsetY
(
0.0
);
Stamper
stamper2
=
new
Stamper
();
stamper2
.
setSignatoryId
(
SignatoryId
);
stamper2
.
setDocumentId
(
documentId
);
stamper
.
setKeyword
(
"签署方"
);
stamper2
.
setType
(
"PERSONAL"
);
stamper2
.
setPage
(
1
);
stamper2
.
setOffsetX
(
0.0
);
stamper2
.
setOffsetY
(
0.0
);
List
<
Stamper
>
stampers
=
new
ArrayList
<>();
stampers
.
add
(
stamper
);
stampers
.
add
(
stamper2
);
// 发起合同
SdkResponse
<
Object
>
responseObj
=
null
;
ContractSendRequest
request
=
new
ContractSendRequest
(
contractId
,
stampers
);
String
response
=
sdkClient
.
service
(
request
);
responseObj
=
JSONUtils
.
toQysResponse
(
response
);
if
(
responseObj
.
getCode
()
==
0
)
{
logger
.
info
(
"合同发起成功"
);
}
else
{
logger
.
info
(
"请求失败,错误码:{},错误信息:{}"
,
responseObj
.
getCode
(),
responseObj
.
getMessage
());
}
return
responseObj
;
}
SdkResponse
<
Object
>
responseObj
=
null
;
ContractSendRequest
request
=
new
ContractSendRequest
(
contractId
,
stampers
);
String
response
=
sdkClient
.
service
(
request
);
responseObj
=
JSONUtils
.
toQysResponse
(
response
);
if
(
responseObj
.
getCode
()
==
0
)
{
logger
.
info
(
"合同发起成功"
);
}
else
{
logger
.
info
(
"请求失败,错误码:{},错误信息:{}"
,
responseObj
.
getCode
(),
responseObj
.
getMessage
());
}
return
responseObj
;
}
}
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/AcceptanceRectificationOrderServiceImpl.java
View file @
2052b3f1
...
...
@@ -54,6 +54,7 @@ public class AcceptanceRectificationOrderServiceImpl extends BaseService<Accepta
return
acceptanceRectificationOrderMapper
.
page
(
page
,
acceptanceSeqNbr
);
}
/**
* 列表查询 示例
*/
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/QiyuesuoServiceImpl.java
View file @
2052b3f1
...
...
@@ -213,7 +213,7 @@ public class QiyuesuoServiceImpl {
List
<
Stamper
>
stampers
=
new
ArrayList
<>();
stampers
.
add
(
stamper
);
stampers
.
add
(
stamper2
);
SdkResponse
<
Object
>
data
=
this
.
getSdkResponse
(
result
.
getId
(),
stampers
);
//
SdkResponse<Object> data = this.getSdkResponse(result.getId(), stampers);
return
result
.
getId
();
}
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/resources/application-dev.properties
View file @
2052b3f1
...
...
@@ -172,16 +172,16 @@ hygf.user.group.empty=1775056568031645697
qiyuesuo.serverUrl
=
https://openapi.qiyuesuo.cn
qiyuesuo.accessKey
=
a1lcd3WRRV
qiyuesuo.accessSecret
=
haqYIOxTP20ZYiDNEN92GVBa6aoJLu
qiyuesuo.secretKey
=
Fp2LQAqK5gc68hi5
#
qiyuesuo.serverUrl = https://openapi.qiyuesuo.cn
#
qiyuesuo.accessKey = a1lcd3WRRV
#
qiyuesuo.accessSecret = haqYIOxTP20ZYiDNEN92GVBa6aoJLu
#
qiyuesuo.secretKey=Fp2LQAqK5gc68hi5
#
qiyuesuo.serverUrl = https://openapi.qiyuesuo.com
#
qiyuesuo.accessKey = QcmHQu55pl
#
qiyuesuo.accessSecret = em0zvOMRNCAXoD1ePNTL7hGR5KpKUs
#
qiyuesuo.secretKey=B6OYbHyfXikAghB2
qiyuesuo.serverUrl
=
https://openapi.qiyuesuo.com
qiyuesuo.accessKey
=
QcmHQu55pl
qiyuesuo.accessSecret
=
em0zvOMRNCAXoD1ePNTL7hGR5KpKUs
qiyuesuo.secretKey
=
B6OYbHyfXikAghB2
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/resources/application-dev1.properties
0 → 100644
View file @
2052b3f1
## DB properties:
spring.datasource.dynamic.primary
=
mysql-service
spring.datasource.mysql-service.driver-class-name
=
com.mysql.cj.jdbc.Driver
spring.datasource.mysql-service.jdbc-url
=
jdbc:mysql://10.20.1.157:3306/amos_project?allowMultiQueries=true&serverTimezone=GMT%2B8&characterEncoding=utf8
spring.datasource.mysql-service.username
=
root
spring.datasource.mysql-service.password
=
Yeejoin@2020
spring.datasource.mysql-service.type
=
com.zaxxer.hikari.HikariDataSource
#最小连接
spring.datasource.mysql-service.minimum-idle
:
5
#最大连接
spring.datasource.mysql-service.maximum-pool-size
:
15
#自动提交
spring.datasource.mysql-service.auto-commit
:
true
#最大空闲时常
spring.datasource.mysql-service.idle-timeout
:
30000
#连接池名
spring.datasource.mysql-service.pool-name
:
MysqlDruidCP
#最大生命周期
spring.datasource.mysql-service.max-lifetime
:
1800000
#连接超时时间
spring.datasource.mysql-service.connection-timeout
:
30000
spring.datasource.tdengine-service.driver-class-name
=
com.taosdata.jdbc.rs.RestfulDriver
spring.datasource.tdengine-service.jdbc-url
=
jdbc:TAOS-RS://47.92.234.253:6041/house_pv_data?user=root&password=taosdata&timezone=GMT+8
spring.datasource.tdengine-service.username
=
root
spring.datasource.tdengine-service.password
=
taosdata
spring.datasource.tdengine-service.type
=
com.zaxxer.hikari.HikariDataSource
#最小连接
spring.datasource.tdengine-service.minimum-idle
:
5
#最大连接
spring.datasource.tdengine-service.maximum-pool-size
:
15
#自动提交
spring.datasource.tdengine-service.auto-commit
:
true
#最大空闲时常
spring.datasource.tdengine-service.idle-timeout
:
30000
#连接池名
spring.datasource.tdengine-service.pool-name
:
Data_trans_HikariCP
#最大生命周期
spring.datasource.tdengine-service.max-lifetime
:
1800000
#连接超时时间
spring.datasource.tdengine-service.connection-timeout
:
30000
spring.datasource.tdengine-service.connection-test-query
:
SELECT 1
## eureka properties:
eureka.instance.hostname
=
47.92.234.253
eureka.client.serviceUrl.defaultZone
=
http://admin:a1234560@${eureka.instance.hostname}:10001/eureka/
## redis properties:
spring.redis.database
=
1
spring.redis.host
=
47.92.234.253
spring.redis.port
=
6379
spring.redis.password
=
yeejoin@2020
spring.cache.type
=
GENERIC
j2cache.open-spring-cache
=
true
j2cache.cache-clean-mode
=
passive
j2cache.allow-null-values
=
true
j2cache.redis-client
=
lettuce
j2cache.l2-cache-open
=
true
j2cache.broadcast
=
net.oschina.j2cache.cache.support.redis.SpringRedisPubSubPolicy
j2cache.L1.provider_class
=
caffeine
j2cache.L2.provider_class
=
net.oschina.j2cache.cache.support.redis.SpringRedisProvider
j2cache.L2.config_section
=
lettuce
j2cache.sync_ttl_to_redis
=
true
j2cache.default_cache_null_object
=
false
j2cache.serialization
=
fst
caffeine.properties
=
/caffeine.properties
lettuce.mode
=
single
lettuce.namespace
=
lettuce.storage
=
generic
lettuce.channel
=
j2cache
lettuce.scheme
=
redis
lettuce.hosts
=
${spring.redis.host}:${spring.redis.port}
lettuce.password
=
${spring.redis.password}
lettuce.database
=
${spring.redis.database}
lettuce.sentinelMasterId
=
lettuce.maxTotal
=
100
lettuce.maxIdle
=
10
lettuce.minIdle
=
10
lettuce.timeout
=
10000
emqx.clean-session
=
true
emqx.client-id
=
${spring.application.name}-${random.int[1024,65536]}
emqx.broker
=
tcp://47.92.234.253:1883
emqx.user-name
=
admin
emqx.password
=
public
emqx.max-inflight
=
1000
spring.influx.url
=
http://47.92.234.253:8086
spring.influx.password
=
Yeejoin@2020
spring.influx.user
=
root
spring.influx.database
=
iot_platform
spring.influx.retention_policy
=
default
spring.influx.retention_policy_time
=
30d
spring.influx.actions
=
10000
spring.influx.bufferLimit
=
20000
knife4j.production
=
false
knife4j.enable
=
true
knife4j.basic.enable
=
true
knife4j.basic.username
=
admin
knife4j.basic.password
=
a1234560
management.security.enabled
=
true
spring.security.user.name
=
admin
spring.security.user.password
=
a1234560
fire-rescue
=
123
mybatis-plus.global-config.db-config.update-strategy
=
ignored
# user-amos setting : This value is the secretkey for person manage moudle accout password encryption.please don't change it!!!
amos.secret.key
=
qaz
# if your service can't be access ,you can use this setting , you need change ip as your.
#eureka.instance.prefer-ip-address=true
#eureka.instance.ip-address=172.16.3.122
spring.activemq.broker-url
=
tcp://47.92.234.253:61616
spring.activemq.user
=
admin
spring.activemq.password
=
admin
spring.jms.pub-sub-domain
=
false
myqueue
=
amos.privilege.v1.JXIOP.AQSC_FDGL.userBusiness
regulator.unit.code
=
86*258
# ������Ӧ��code
dealer.appcode
=
studio_normalapp_5133538
hygf.sms.tempCode
=
SMS_HYGF_0001
# �������������
sms.huawei.url
=
https://smsapi.cn-north-4.myhuaweicloud.com:443/sms/batchSendSms/v1
sms.huawei.appKey
=
n3FYPWO7Heo1ze212QRBvF4VA2E2
sms.huawei.appSecret
=
IFhiMpWROi7w4Ei21ZbfIjKyt97b
# �id
sms.huawei.templateId
=
67931857f6f74e119fadc429bc25a531
# ǩ��ͨ����
sms.huawei.sender
=
1069368924410006092
# 签名名称
sms.huawei.signature
=
江西电建
# 锟斤拷站锟斤拷锟絧ageId
power.station.examine.pageId
=
1680853427061551106
# 锟斤拷站锟斤拷思苹锟絠d
power.station.examine.planId
=
c4ed1873-0dc6-4518-a7a9-dbc588ef35e5
unitInfo.station.examine.planId
=
51776087-a9cf-4a87-9a03-24fd24a8cf45
hygf.sms.tempCodeJXS
=
SMS_HYGF_0002
#工程角色id
hygf.role.gc.roleSeq
=
1702550832882413570
# 锟矫伙拷锟斤拷userGroupId
hygf.user.group.id
=
1702512164058718210
#锟斤拷锟斤拷司
regionalCompanies.company.seq
=
1701778292098498561
hygf.user.group.empty
=
1775056568031645697
#qiyuesuo.serverUrl = https://openapi.qiyuesuo.cn
#qiyuesuo.accessKey = a1lcd3WRRV
#qiyuesuo.accessSecret = haqYIOxTP20ZYiDNEN92GVBa6aoJLu
#qiyuesuo.secretKey=Fp2LQAqK5gc68hi5
qiyuesuo.serverUrl
=
https://openapi.qiyuesuo.com
qiyuesuo.accessKey
=
QcmHQu55pl
qiyuesuo.accessSecret
=
em0zvOMRNCAXoD1ePNTL7hGR5KpKUs
qiyuesuo.secretKey
=
B6OYbHyfXikAghB2
# ============================================= v20230821 add properties =============================================
security.productWeb
=
AMOS_STUDIO_WEB
security.appKey
=
AMOS_STUDIO
login.environment
=
dev
# 锟斤拷锟脚╋拷锟轿拷锟叫★拷锟斤拷锟斤拷锟斤拷?
hygfProgram.appid
=
wx0a2b054a237a3b34
hygfProgram.secret
=
5fc6af660920f6211b1b69bc9c451b09
# 默锟斤拷微锟斤拷小锟斤拷锟斤拷农锟斤拷锟斤拷锟斤拷锟斤拷
farmer.orgCode
=
86
#农锟斤拷锟斤拷锟斤拷锟斤拷位
farmer.sequenceNbr
=
1703583838279593985
farmer.orgNamesWithoutRole
=
#农锟斤拷锟斤拷色
farmer.roleId
=
1702551322030534658
# 锟斤拷锟矫接匡拷锟斤拷权锟矫伙拷
platform.access.loginId
=
hygf_platform
platform.access.password
=
AC286A35E74D2DD281EB979789DECF3A
# 锟斤拷锟斤拷锟矫的撅拷锟斤拷锟斤拷userid
dealer.userId
=
# 锟斤拷锟皆碉拷时锟斤拷默锟斤拷锟斤拷锟斤拷
farmer.registerPassword
=
a123456
#锟斤拷锟斤拷锟教碉拷位锟斤拷锟节碉拷id
dealer.managementUnitId
=
1702211822385393665
#锟斤拷锟斤拷锟教癸拷锟斤拷员锟斤拷色
dealer.roleId
=
1702512164058718210
#锟斤拷询锟斤拷锟斤拷锟斤拷锟矫伙拷锟斤拷
dealer.group
=
1702511386875158529
#锟斤拷锟矫癸拷锟斤拷锟斤拷探锟斤拷?
dealer.engineering
=
1702512052154687489
#锟斤拷时锟斤拷锟斤拷锟饺★拷锟斤拷锟斤拷锟较?
cheduled.crons
=
0 10 0 * * ?
dealer.appcode.manage
=
studio_normalapp_5155413,studio_normalapp_5133538
dealer.appcode.role
=
1767363928842571777
dealer.amosDealerId
=
1767820997374775298
\ No newline at end of file
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/resources/application.properties
View file @
2052b3f1
...
...
@@ -2,7 +2,7 @@ spring.application.name=AMOS-HYGF-CAOTAO
server.servlet.context-path
=
/hygf
server.port
=
33330
server.uri-encoding
=
UTF-8
spring.profiles.active
=
dev
spring.profiles.active
=
dev
1
spring.jackson.time-zone
=
GMT+8
spring.jackson.date-format
=
yyyy-MM-dd HH:mm:ss
logging.config
=
classpath:logback-${spring.profiles.active}.xml
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/resources/logback-dev1.xml
0 → 100644
View file @
2052b3f1
<?xml version="1.0" encoding="UTF-8"?>
<configuration
debug=
"false"
>
<!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径-->
<property
name=
"LOG_HOME"
value=
"log"
/>
<property
name=
"LOG_PATTERN"
value=
"%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %-50.50logger{50} - %msg [%file:%line] %n"
/>
<!-- 按照每天生成日志文件 -->
<appender
name=
"FILE"
class=
"ch.qos.logback.core.rolling.RollingFileAppender"
>
<rollingPolicy
class=
"ch.qos.logback.core.rolling.TimeBasedRollingPolicy"
>
<!--日志文件输出的文件名-->
<FileNamePattern>
${LOG_HOME}/ccs.log.%d{yyyy-MM-dd}.log
</FileNamePattern>
<!--日志文件保留天数-->
<MaxHistory>
7
</MaxHistory>
</rollingPolicy>
<encoder
class=
"ch.qos.logback.classic.encoder.PatternLayoutEncoder"
>
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>
${LOG_PATTERN}
</pattern>
</encoder>
<!--日志文件最大的大小-->
<triggeringPolicy
class=
"ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"
>
<MaxFileSize>
30mb
</MaxFileSize>
</triggeringPolicy>
</appender>
<!-- 控制台输出 -->
<appender
name=
"STDOUT"
class=
"ch.qos.logback.core.ConsoleAppender"
>
<encoder
class=
"ch.qos.logback.classic.encoder.PatternLayoutEncoder"
>
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
<pattern>
${LOG_PATTERN}
</pattern>
</encoder>
</appender>
<!--myibatis log configure-->
<logger
name=
"com.apache.ibatis"
level=
"DEBUG"
/>
<logger
name=
"java.sql.Connection"
level=
"DEBUG"
/>
<logger
name=
"java.sql.Statement"
level=
"DEBUG"
/>
<logger
name=
"java.sql.PreparedStatement"
level=
"DEBUG"
/>
<logger
name=
"com.baomidou.mybatisplus"
level=
"DEBUG"
/>
<logger
name=
"org.springframework"
level=
"DEBUG"
/>
<logger
name=
"org.typroject"
level=
"DEBUG"
/>
<logger
name=
"com.yeejoin"
level=
"DEBUG"
/>
<!-- 日志输出级别 -->
<root
level=
"INFO"
>
<appender-ref
ref=
"FILE"
/>
<appender-ref
ref=
"STDOUT"
/>
</root>
</configuration>
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