Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
customer-service
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SuperHive
back-end
customer-service
Commits
84df6ac0
Commit
84df6ac0
authored
Aug 13, 2020
by
zhangzc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加企查查接口
parent
c53db0e6
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
168 additions
and
5 deletions
+168
-5
pom.xml
pom.xml
+9
-0
FreightThirdpartyService.java
.../esv/freight/customer/feign/FreightThirdpartyService.java
+28
-0
GoodsOwnerController.java
...er/module/goodsowner/controller/GoodsOwnerController.java
+14
-0
AccountForm.java
.../freight/customer/module/goodsowner/form/AccountForm.java
+1
-1
QccPojo.java
.../esv/freight/customer/module/goodsowner/pojo/QccPojo.java
+51
-0
GoodsOwnerAccountService.java
...r/module/goodsowner/service/GoodsOwnerAccountService.java
+9
-0
GoodsOwnerAccountServiceImpl.java
...goodsowner/service/impl/GoodsOwnerAccountServiceImpl.java
+38
-0
ValidatorAuditQcc.java
...module/goodsowner/validator/groups/ValidatorAuditQcc.java
+14
-0
bootstrap.yml
src/main/resources/bootstrap.yml
+4
-4
No files found.
pom.xml
View file @
84df6ac0
...
...
@@ -153,6 +153,15 @@
</dependencies>
</dependencyManagement>
<repositories>
<repository>
<id>
esv-repository
</id>
<url>
http://192.168.31.249:18084/repository/maven-public/
</url>
<!-- 外网环境使用 -->
<!-- <url>http://esvsy.wicp.vip:18084/repository/maven-public/</url>-->
</repository>
</repositories>
<profiles>
<profile>
<id>
develop
</id>
...
...
src/main/java/com/esv/freight/customer/feign/FreightThirdpartyService.java
0 → 100644
View file @
84df6ac0
package
com
.
esv
.
freight
.
customer
.
feign
;
import
com.alibaba.fastjson.JSONObject
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.PostMapping
;
/**
* @description:
* @project: freight-customer-service
* @name: com.esv.freight.customer.feign.FreightThirdpartyService
* @author: 张志臣
* @email: zhangzhichen@esvtek.com
* @createTime: 2020/06/04 9:48
* @version:1.0
*/
@FeignClient
(
value
=
"freight-thirdparty-service"
)
public
interface
FreightThirdpartyService
{
/**
* description 企查查数据查询
* param [bodyJson]
* return com.alibaba.fastjson.JSONObject
* author zhangzhichen
* createTime 2020/08/14 9:31
**/
@PostMapping
(
value
=
"/thirdparty/qcc/audit"
)
JSONObject
audit
(
JSONObject
bodyJson
);
}
src/main/java/com/esv/freight/customer/module/goodsowner/controller/GoodsOwnerController.java
View file @
84df6ac0
...
...
@@ -20,6 +20,7 @@ import com.esv.freight.customer.module.goodsowner.form.AccountForm;
import
com.esv.freight.customer.module.goodsowner.form.AccountInfoForm
;
import
com.esv.freight.customer.module.goodsowner.form.AccountQueryForm
;
import
com.esv.freight.customer.module.goodsowner.form.AccountScoreForm
;
import
com.esv.freight.customer.module.goodsowner.pojo.QccPojo
;
import
com.esv.freight.customer.module.goodsowner.service.GoodsOwnerAccountService
;
import
com.esv.freight.customer.module.goodsowner.service.GoodsOwnerInfoService
;
import
com.esv.freight.customer.module.goodsowner.validator.groups.*
;
...
...
@@ -304,4 +305,17 @@ public class GoodsOwnerController {
goodsOwnerInfoService
.
updateOverallScore
(
form
);
return
EResponse
.
ok
();
}
/**
* description 企查查查询
* param [form]
* return com.esv.freight.customer.common.response.EResponse
* author zhangzhichen
* createTime 2020/08/12 16:38
**/
@PostMapping
(
"/audit/qcc"
)
public
EResponse
auditQcc
(
@RequestBody
@Validated
(
ValidatorAuditQcc
.
class
)
AccountForm
form
)
throws
EException
{
QccPojo
qccPojo
=
goodsOwnerAccountService
.
auditQcc
(
form
);
return
EResponse
.
ok
(
qccPojo
);
}
}
src/main/java/com/esv/freight/customer/module/goodsowner/form/AccountForm.java
View file @
84df6ac0
...
...
@@ -23,7 +23,7 @@ import javax.validation.constraints.NotNull;
@Data
public
class
AccountForm
{
@NotNull
(
message
=
"参数id不能为空"
,
groups
=
{
ValidatorBlock
.
class
,
ValidatorUnblock
.
class
,
ValidatorAudit
.
class
,
ValidatorAuditHistory
.
class
,
ValidatorPasswordReset
.
class
})
@NotNull
(
message
=
"参数id不能为空"
,
groups
=
{
Validator
AuditQcc
.
class
,
Validator
Block
.
class
,
ValidatorUnblock
.
class
,
ValidatorAudit
.
class
,
ValidatorAuditHistory
.
class
,
ValidatorPasswordReset
.
class
})
private
Long
id
;
@NotNull
(
message
=
"参数auditStatus不能为空"
,
groups
=
{
ValidatorAudit
.
class
})
...
...
src/main/java/com/esv/freight/customer/module/goodsowner/pojo/QccPojo.java
0 → 100644
View file @
84df6ac0
package
com
.
esv
.
freight
.
customer
.
module
.
goodsowner
.
pojo
;
import
lombok.Data
;
/**
* @description:
* @project: spring-cloud-single-template
* @name: com.esv.freight.customer.module.goodsowner.pojo.QccPojo
* @author: 张志臣
* @email: zhangzhichen@esvtek.com
* @createTime: 2020/8/14 14:27
* @version:1.0
*/
@Data
public
class
QccPojo
{
/**
* 内部KeyNo
*/
private
String
KeyNo
;
/**
* 公司名称
*/
private
String
Name
;
/**
* 法人名称
*/
private
String
OperName
;
/**
* 成立日期
*/
private
String
StartDate
;
/**
* 企业状态
*/
private
String
Status
;
/**
* 注册号
*/
private
String
No
;
/**
* 社会统一信用代码
*/
private
String
CreditCode
;
}
src/main/java/com/esv/freight/customer/module/goodsowner/service/GoodsOwnerAccountService.java
View file @
84df6ac0
...
...
@@ -8,6 +8,7 @@ import com.esv.freight.customer.module.goodsowner.entity.AuditHistoryEntity;
import
com.esv.freight.customer.module.goodsowner.form.AccountForm
;
import
com.esv.freight.customer.module.goodsowner.form.AccountInfoForm
;
import
com.esv.freight.customer.module.goodsowner.form.AccountQueryForm
;
import
com.esv.freight.customer.module.goodsowner.pojo.QccPojo
;
import
com.esv.freight.customer.module.goodsowner.vo.AccountAvailableVO
;
import
java.util.List
;
...
...
@@ -138,5 +139,13 @@ public interface GoodsOwnerAccountService extends IService<GoodsOwnerAccountEnti
**/
Integer
resetAccountPwd
(
AccountForm
form
);
/**
* description 企业查询
* param [form]
* return QccPojo
* author Administrator
* createTime 2020/08/12 17:27
**/
QccPojo
auditQcc
(
AccountForm
form
);
}
src/main/java/com/esv/freight/customer/module/goodsowner/service/impl/GoodsOwnerAccountServiceImpl.java
View file @
84df6ac0
...
...
@@ -11,10 +11,13 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import
com.esv.freight.customer.common.component.ErrorMessageComponent
;
import
com.esv.freight.customer.common.component.PasswordComponent
;
import
com.esv.freight.customer.common.exception.EException
;
import
com.esv.freight.customer.common.response.ECode
;
import
com.esv.freight.customer.common.response.EResponse
;
import
com.esv.freight.customer.common.util.FeignUtils
;
import
com.esv.freight.customer.common.util.ReqUtils
;
import
com.esv.freight.customer.common.vo.PageResultVO
;
import
com.esv.freight.customer.feign.FeignBaseService
;
import
com.esv.freight.customer.feign.FreightThirdpartyService
;
import
com.esv.freight.customer.module.carrier.entity.CarrierAccountEntity
;
import
com.esv.freight.customer.module.carrier.service.CarrierAccountService
;
import
com.esv.freight.customer.module.driver.entity.DriverAccountEntity
;
...
...
@@ -28,6 +31,7 @@ import com.esv.freight.customer.module.goodsowner.entity.InfoEntity;
import
com.esv.freight.customer.module.goodsowner.form.AccountForm
;
import
com.esv.freight.customer.module.goodsowner.form.AccountInfoForm
;
import
com.esv.freight.customer.module.goodsowner.form.AccountQueryForm
;
import
com.esv.freight.customer.module.goodsowner.pojo.QccPojo
;
import
com.esv.freight.customer.module.goodsowner.service.GoodsOwnerAccountService
;
import
com.esv.freight.customer.module.goodsowner.service.AuditHistoryService
;
import
com.esv.freight.customer.module.goodsowner.service.GoodsOwnerInfoService
;
...
...
@@ -62,6 +66,9 @@ public class GoodsOwnerAccountServiceImpl extends ServiceImpl<AccountDao, GoodsO
@Autowired
private
CarrierAccountService
carrierAccountService
;
@Autowired
private
FreightThirdpartyService
freightThirdpartyService
;
@Autowired
public
GoodsOwnerAccountServiceImpl
(
FeignBaseService
feignBaseService
,
PasswordComponent
passwordComponent
,
ErrorMessageComponent
errorMessageComponent
,
GoodsOwnerInfoService
goodsOwnerInfoService
,
...
...
@@ -402,4 +409,35 @@ public class GoodsOwnerAccountServiceImpl extends ServiceImpl<AccountDao, GoodsO
return
this
.
baseMapper
.
updateById
(
goodsOwnerAccountEntity
);
}
@Override
public
QccPojo
auditQcc
(
AccountForm
form
)
{
// 1.判断帐号是否存在
Long
accountId
=
form
.
getId
();
GoodsOwnerAccountEntity
goodsOwnerAccountEntity
=
this
.
getAccountRecordById
(
accountId
);
if
(
null
==
goodsOwnerAccountEntity
)
{
throw
new
EException
(
1001
,
errorMessageComponent
.
getGoodsOwnerAccountAudit1001
());
}
else
{
if
(
GoodsOwnerConstants
.
OWNER_AUDIT_STATUS_SUCCESS
.
equals
(
goodsOwnerAccountEntity
.
getAuditStatus
()))
{
throw
new
EException
(
1002
,
errorMessageComponent
.
getGoodsOwnerAccountAudit1002
());
}
}
// 2.获取企业详情
AccountInfoDto
dto
=
this
.
baseMapper
.
getAccountInfoById
(
form
.
getId
());
// 3.调用feign接口请求企查查数据查询
JSONObject
feignReqJson
=
new
JSONObject
();
feignReqJson
.
put
(
"keyword"
,
dto
.
getUniCreditCode
());
log
.
info
(
"Feign请求[企查查]传参:{}"
,
feignReqJson
.
toJSONString
());
JSONObject
feignResJson
=
freightThirdpartyService
.
audit
(
feignReqJson
);
log
.
info
(
"Feign请求[企查查]返回:{}"
,
feignResJson
.
toJSONString
());
if
(
ECode
.
SUCCESS
.
code
()
!=
feignResJson
.
getIntValue
(
"code"
))
{
throw
new
EException
(
feignResJson
.
getIntValue
(
"code"
),
feignResJson
.
getString
(
"message"
));
}
QccPojo
qccPojo
=
JSONObject
.
toJavaObject
(
FeignUtils
.
getFeignResultData
(
feignResJson
),
QccPojo
.
class
);
return
qccPojo
;
}
}
\ No newline at end of file
src/main/java/com/esv/freight/customer/module/goodsowner/validator/groups/ValidatorAuditQcc.java
0 → 100644
View file @
84df6ac0
package
com
.
esv
.
freight
.
customer
.
module
.
goodsowner
.
validator
.
groups
;
import
javax.validation.groups.Default
;
/**
* @description: 参数校验分组:企业查询
* @project: SpringCloudTemplate
* @name: com.esv.freight.customer.module.goodsowner.validator.groups.ValidatorAudit
* @author: 张志臣
* @email: zhangzhichen@esvtek.com
* @createTime: 2020/08/12 16:53
* @version:1.0
*/
public
interface
ValidatorAuditQcc
extends
Default
{
}
src/main/resources/bootstrap.yml
View file @
84df6ac0
...
...
@@ -3,14 +3,14 @@ server:
servlet
:
context-path
:
/customer
nacos
:
url
:
1
19.3.171.225
:8848
namespace
:
38512237-cfe2-44e5-a6ba-df156723d7b6
group
:
TES
T_GROUP
url
:
1
92.168.31.248
:8848
namespace
:
aad5aa26-5351-4e7a-a65e-ecb332f3c52c
group
:
DEFAUL
T_GROUP
spring
:
application
:
name
:
freight-customer-service
profiles
:
active
:
test
active
:
dev
cloud
:
nacos
:
discovery
:
...
...
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