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
b519f300
Commit
b519f300
authored
Aug 28, 2023
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加合同回调方法
parent
c674475a
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
228 additions
and
11 deletions
+228
-11
ControllerAop.java
...a/com/yeejoin/amos/boot/biz/common/aop/ControllerAop.java
+1
-0
CallbackTypeEnum.java
...join/amos/boot/module/hygf/api/Enum/CallbackTypeEnum.java
+55
-0
ContractStatusEnum.java
...in/amos/boot/module/hygf/api/Enum/ContractStatusEnum.java
+67
-0
HouseholdContractEnum.java
...amos/boot/module/hygf/api/Enum/HouseholdContractEnum.java
+3
-3
CallbackDto.java
...om/yeejoin/amos/boot/module/hygf/api/dto/CallbackDto.java
+20
-0
QiyuesuoController.java
...s/boot/module/hygf/biz/controller/QiyuesuoController.java
+80
-1
QiyuesuoServiceImpl.java
...oot/module/hygf/biz/service/impl/QiyuesuoServiceImpl.java
+0
-6
SurveyInformationServiceImpl.java
...e/hygf/biz/service/impl/SurveyInformationServiceImpl.java
+2
-1
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/aop/ControllerAop.java
View file @
b519f300
...
...
@@ -103,6 +103,7 @@ public class ControllerAop {
urls
.
add
(
"/hygf/unit-info/sendTelCode/.*"
);
urls
.
add
(
"/hygf/unit-info/verifyTelCode/.*/.*"
);
urls
.
add
(
"/hygf/peasant-household/mobile/login"
);
urls
.
add
(
"/hygf/qiyuesuo/callback"
);
// 获取请求路径
for
(
String
uri
:
urls
)
{
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/Enum/CallbackTypeEnum.java
0 → 100644
View file @
b519f300
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
Enum
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
import
org.omg.CORBA.UNKNOWN
;
/**
* @description:通知类型
* @author: tw
* @createDate: 2023/8/25
*/
@Getter
@AllArgsConstructor
public
enum
CallbackTypeEnum
{
发送签署
(
"SEND_SIGNING"
,
"SEND_SIGNING"
),
发送填参
(
"SEND_FILLING"
,
"SEND_FILLING"
),
完成参数
(
"FILLED"
,
"FILLED"
),
配置流程
(
"CONFIG_FLOW"
,
"CONFIG_FLOW"
),
个人签字
(
"PERSONAL"
,
"PERSONAL"
),
经办人签名
(
"OPERATOR"
,
"OPERATOR"
),
法定代表人签字
(
"LEGAL_PERSON"
,
"LEGAL_PERSON"
),
企业签章
(
"SEAL"
,
"SEAL"
),
审批并签署
(
"AUDIT_SIGN"
,
"AUDIT_SIGN"
),
文件审批
(
"AUDIT"
,
"AUDIT"
),
撤回文件
(
"RECALLED"
,
"RECALLED"
),
退回文件
(
"REJECTED"
,
"REJECTED"
),
文件过期
(
"EXPIRED"
,
"EXPIRED"
),
文件完成
(
"COMPLETE"
,
"COMPLETE"
),
发送作废
(
"SEND_INVALID"
,
"SEND_INVALID"
),
签署作废
(
"INVALIDING"
,
"INVALIDING"
),
作废完成
(
"INVALIDED"
,
"INVALIDED"
),
拒绝作废
(
"INVALID_REJECTED"
,
"INVALID_REJECTED"
),
签署失败
(
"FAILED"
,
"FAILED"
),
未知
(
"UNKNOWN"
,
"UNKNOWN"
),
强制结束
(
"END"
,
"END"
);
/**
* 名称,描述
*/
private
String
name
;
/**
* 编码
*/
private
String
code
;
public
static
CallbackTypeEnum
getNodeByCode
(
String
code
)
{
CallbackTypeEnum
dealerReviewEnum
=
null
;
for
(
CallbackTypeEnum
type:
CallbackTypeEnum
.
values
())
{
if
(
type
.
getCode
().
equals
(
code
))
{
dealerReviewEnum
=
type
;
break
;
}
}
return
dealerReviewEnum
;
}
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/Enum/ContractStatusEnum.java
0 → 100644
View file @
b519f300
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
Enum
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
/**
* @description:
* @author: tw
* @createDate: 2023/8/25
*/
@Getter
@AllArgsConstructor
public
enum
ContractStatusEnum
{
草稿
(
"DRAFT"
,
"DRAFT"
),
已撤回
(
"RECALLED"
,
"RECALLED"
),
签署中
(
"SIGNING"
,
"SIGNING"
),
已退回
(
"REJECTED"
,
"REJECTED"
),
已完成
(
"COMPLETE"
,
"COMPLETE"
),
已过期
(
"EXPIRED"
,
"EXPIRED"
),
拟定中
(
"FILLING"
,
"FILLING"
),
签署失败
(
"FAILED"
,
"FAILED"
),
作废中
(
"INVALIDING"
,
"INVALIDING"
),
已作废
(
"INVALIDED"
,
"INVALIDED"
),
强制结束
(
"END"
,
"END"
);
/**
* 名称,描述
*/
private
String
name
;
/**
* 编码
*/
private
String
code
;
public
static
ContractStatusEnum
getNodeByCode
(
String
code
)
{
ContractStatusEnum
dealerReviewEnum
=
null
;
for
(
ContractStatusEnum
type:
ContractStatusEnum
.
values
())
{
if
(
type
.
getCode
().
equals
(
code
))
{
dealerReviewEnum
=
type
;
break
;
}
}
return
dealerReviewEnum
;
}
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/Enum/HouseholdContractEnum.java
View file @
b519f300
...
...
@@ -35,9 +35,9 @@ public enum HouseholdContractEnum {
*/
private
String
code
;
public
static
PowerStationNode
Enum
getNodeByCode
(
String
code
)
{
PowerStationNode
Enum
powerStationNodeEnum
=
null
;
for
(
PowerStationNodeEnum
type:
PowerStationNode
Enum
.
values
())
{
public
static
HouseholdContract
Enum
getNodeByCode
(
String
code
)
{
HouseholdContract
Enum
powerStationNodeEnum
=
null
;
for
(
HouseholdContractEnum
type:
HouseholdContract
Enum
.
values
())
{
if
(
type
.
getCode
().
equals
(
code
))
{
powerStationNodeEnum
=
type
;
break
;
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/dto/CallbackDto.java
0 → 100644
View file @
b519f300
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
dto
;
import
lombok.Data
;
/**
* @description:
* @author: tw
* @createDate: 2023/8/25
*/
@Data
public
class
CallbackDto
{
private
String
contractId
;
//当前回调的合同 Id
private
String
callbackType
;
//当前回调的通知类型,具体类型信息见后方列 表
private
String
callbackSourceType
;
//当前回调地址来源,具体分为业务分类、集成 管理、SaaS
private
String
contractStatus
;
//当前回调的合同状态,具体类型信息见后方列表
private
String
tenantType
;
//签署方类型: PERSONAL-个人 COMPANY-公司
private
String
tenantName
;
//签署方名称
private
String
contact
;
//联系方式
private
String
tenantId
;
// 签署方 ID
}
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/QiyuesuoController.java
View file @
b519f300
...
...
@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.hygf.biz.controller;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.qiyuesuo.sdk.v2.SdkClient
;
import
com.qiyuesuo.sdk.v2.bean.*
;
import
com.qiyuesuo.sdk.v2.exception.BaseSdkException
;
...
...
@@ -11,6 +13,11 @@ import com.qiyuesuo.sdk.v2.response.ContractListResult;
import
com.qiyuesuo.sdk.v2.response.DocumentAddResult
;
import
com.qiyuesuo.sdk.v2.response.MiniappTicketResult
;
import
com.qiyuesuo.sdk.v2.response.SdkResponse
;
import
com.qiyuesuo.sdk.v2.utils.Algorithm
;
import
com.qiyuesuo.sdk.v2.utils.Base64Utils
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.HouseholdContractEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.CallbackDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.ContractDataDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.HouseholdContractDto
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.HouseholdContract
;
...
...
@@ -23,12 +30,16 @@ import io.swagger.annotations.ApiOperation;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.*
;
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.crypto.Cipher
;
import
javax.crypto.SecretKey
;
import
javax.crypto.spec.SecretKeySpec
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Date
;
...
...
@@ -43,7 +54,7 @@ import java.util.Map;
@RestController
@Api
(
tags
=
"契税锁Api"
)
@RequestMapping
(
value
=
"/qiyuesuo"
)
public
class
QiyuesuoController
{
public
class
QiyuesuoController
extends
BaseController
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
QiyuesuoController
.
class
);
@Autowired
...
...
@@ -53,6 +64,10 @@ public class QiyuesuoController {
@Autowired
HouseholdContractServiceImpl
householdContractServiceImpl
;
@Value
(
"${qiyuesuo.secretKey}"
)
private
String
secretKey
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"post"
,
value
=
"个人token"
,
notes
=
"个人token"
)
@PostMapping
(
value
=
"/getUserToken"
)
...
...
@@ -96,6 +111,70 @@ public class QiyuesuoController {
@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
);
}
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
);
}
}
catch
(
Exception
e
){
e
.
printStackTrace
();
throw
new
RuntimeException
(
"契约锁回调失败"
);
}
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
RuntimeException
(
"解密失败"
);
}
return
decryptStr
;
}
...
...
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 @
b519f300
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.TypeReference
;
import
com.qiyuesuo.sdk.v2.SdkClient
;
import
com.qiyuesuo.sdk.v2.bean.*
;
import
com.qiyuesuo.sdk.v2.bean.vo.DocumentUrlVO
;
...
...
@@ -9,20 +8,15 @@ import com.qiyuesuo.sdk.v2.exception.BaseSdkException;
import
com.qiyuesuo.sdk.v2.json.JSONUtils
;
import
com.qiyuesuo.sdk.v2.request.*
;
import
com.qiyuesuo.sdk.v2.response.*
;
import
com.yeejoin.amos.boot.module.common.api.dto.ContractDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.ContractDataDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.TemplateParamDto
;
import
jdk.internal.org.objectweb.asm.tree.TryCatchBlockNode
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
/**
* @description:
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/SurveyInformationServiceImpl.java
View file @
b519f300
...
...
@@ -29,6 +29,7 @@ import org.apache.commons.lang3.StringUtils;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.exception.BaseException
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
...
...
@@ -103,7 +104,7 @@ public class SurveyInformationServiceImpl extends BaseService<SurveyInformationD
return
this
.
queryForList
(
""
,
false
);
}
@Transactional
public
SurveyInfoAllDto
saveSurveyInfo
(
SurveyInfoAllDto
surveyInfoAllDto
,
String
operationType
)
{
JSONArray
regionName
=
getRegionName
();
List
<
RegionModel
>
list
=
JSONArray
.
parseArray
(
regionName
.
toJSONString
(),
RegionModel
.
class
);
...
...
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