|
@@ -32,7 +32,7 @@ import java.util.Map;
|
|
|
* @author liutao yaFan
|
|
|
*/
|
|
|
@Service
|
|
|
-public class PlatformServiceImpl extends ServiceImpl<PlatformMapper,Platform> implements PlatformService {
|
|
|
+public class PlatformServiceImpl extends ServiceImpl<PlatformMapper, Platform> implements PlatformService {
|
|
|
|
|
|
|
|
|
@Autowired
|
|
@@ -51,26 +51,26 @@ public class PlatformServiceImpl extends ServiceImpl<PlatformMapper,Platform> im
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public ResponseJson add(Platform platform){
|
|
|
+ public ResponseJson add(Platform platform) {
|
|
|
// 对比统一社会信用代码
|
|
|
- List<Platform> list = list(new QueryWrapper<Platform>().eq("socialCreditCode",platform.getSocialCreditCode()));
|
|
|
- if(!list.isEmpty()){
|
|
|
- return new ResponseJson("500","企业已添加,勿重复操作");
|
|
|
+ List<Platform> list = list(new QueryWrapper<Platform>().eq("socialCreditCode", platform.getSocialCreditCode()));
|
|
|
+ if (!list.isEmpty()) {
|
|
|
+ return new ResponseJson("500", "企业已添加,勿重复操作");
|
|
|
}
|
|
|
|
|
|
- ResponseJson forObject = restTemplate.getForObject(enterpriseInfoUrl+"?code="+platform.getSocialCreditCode(), ResponseJson.class);
|
|
|
- Map<String,Object> data = (Map) forObject.getData();
|
|
|
+ ResponseJson forObject = restTemplate.getForObject(enterpriseInfoUrl + "?code=" + platform.getSocialCreditCode(), ResponseJson.class);
|
|
|
+ Map<String, Object> data = (Map) forObject.getData();
|
|
|
|
|
|
|
|
|
- platform.setAuthUrl(data.get("authUrl").toString());
|
|
|
- platform.setShortAuthUrl(data.get("shortAuthUrl").toString());
|
|
|
+ platform.setAuthUrl(data.get("authUrl") == null ? "" : data.get("authUrl").toString());
|
|
|
+ platform.setShortAuthUrl(data.get("shortAuthUrl") == null ? "" : data.get("shortAuthUrl").toString());
|
|
|
platform.setAuthStatus(0);
|
|
|
- platform.setFddCustomerId(data.get("fddCustomerId").toString());
|
|
|
- platform.setAutoSignUrl(data.get("autoSignUrl").toString());
|
|
|
- platform.setShortAutoSignUrl(data.get("shortAutoSignUrl").toString());
|
|
|
+ platform.setFddCustomerId(data.get("fddCustomerId") == null ? "" : data.get("fddCustomerId").toString());
|
|
|
+ platform.setAutoSignUrl(data.get("autoSignUrl") == null ? "" : data.get("autoSignUrl").toString());
|
|
|
+ platform.setShortAutoSignUrl(data.get("shortAutoSignUrl") == null ? "" : data.get("shortAutoSignUrl").toString());
|
|
|
platform.setShortAutoSignUrlCreate(new Date());
|
|
|
Integer autoSignStatus = (Integer) data.get("autoSignStatus");
|
|
|
- platform.setAutoSignStatus(autoSignStatus == 1?true:false);
|
|
|
+ platform.setAutoSignStatus(autoSignStatus == 1 ? true : false);
|
|
|
save(platform);
|
|
|
|
|
|
//电子签章获取认证地址
|
|
@@ -106,31 +106,31 @@ public class PlatformServiceImpl extends ServiceImpl<PlatformMapper,Platform> im
|
|
|
public GridPage findPage(ConditionVo conditionVo) {
|
|
|
Page<Platform> page = PageHelper.startPage(conditionVo.getPage(), conditionVo.getRows());
|
|
|
list(new QueryWrapper<Platform>().orderByDesc("gmt_create"));
|
|
|
- return new GridPage(conditionVo.getRows(),conditionVo.getPage(),page.getTotal(),page.getResult());
|
|
|
+ return new GridPage(conditionVo.getRows(), conditionVo.getPage(), page.getTotal(), page.getResult());
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Platform getPlateformByBusiness(String businessNumber) {
|
|
|
+ public Platform getPlateformByBusiness(String businessNumber) {
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void updateShortUrl(Date date) {
|
|
|
List<Platform> list = list();
|
|
|
- if(list!=null && list.size()>0){
|
|
|
+ if (list != null && list.size() > 0) {
|
|
|
for (Platform platform : list) {
|
|
|
- if(platform.getAuthStatus().equals(0)){
|
|
|
+ if (platform.getAuthStatus().equals(0)) {
|
|
|
Date shortAuthUrlCreate = platform.getShortAuthUrlCreate();
|
|
|
long between = cn.hutool.core.date.DateUtil.between(shortAuthUrlCreate, date, DateUnit.DAY);
|
|
|
- if(between>=6){
|
|
|
+ if (between >= 6) {
|
|
|
//注册链接
|
|
|
String newShortUrl = ElectronicSignatureUtil.shortUrl(null, platform.getAuthUrl());
|
|
|
platform.setShortAuthUrl(newShortUrl);
|
|
|
platform.setShortAuthUrlCreate(date);
|
|
|
//自动签署链接
|
|
|
String autoSignUrl = platform.getAutoSignUrl();
|
|
|
- if(autoSignUrl!=null){
|
|
|
- String newShortAutoSignUrl = ElectronicSignatureUtil.shortUrl(null,autoSignUrl);
|
|
|
+ if (autoSignUrl != null) {
|
|
|
+ String newShortAutoSignUrl = ElectronicSignatureUtil.shortUrl(null, autoSignUrl);
|
|
|
platform.setShortAutoSignUrl(newShortAutoSignUrl);
|
|
|
platform.setShortAutoSignUrlCreate(date);
|
|
|
}
|
|
@@ -145,8 +145,8 @@ public class PlatformServiceImpl extends ServiceImpl<PlatformMapper,Platform> im
|
|
|
public void flushUrl(Long id) {
|
|
|
Platform platform = getById(id);
|
|
|
|
|
|
- ResponseJson forObject = restTemplate.getForObject(flushUrl+"?code="+platform.getSocialCreditCode(), ResponseJson.class);
|
|
|
- Map<String,String> data = (Map) forObject.getData();
|
|
|
+ ResponseJson forObject = restTemplate.getForObject(flushUrl + "?code=" + platform.getSocialCreditCode(), ResponseJson.class);
|
|
|
+ Map<String, String> data = (Map) forObject.getData();
|
|
|
platform.setAuthUrl(data.get("authUrl"));
|
|
|
platform.setShortAuthUrl(data.get("shortAuthUrl"));
|
|
|
platform.setAuthStatus(0);
|
|
@@ -185,8 +185,8 @@ public class PlatformServiceImpl extends ServiceImpl<PlatformMapper,Platform> im
|
|
|
Platform platform = getById(id);
|
|
|
|
|
|
//先从sop更新信息
|
|
|
- ResponseJson forObject = restTemplate.getForObject(synchronizeInformation+"?socialCreditCode="+platform.getSocialCreditCode(), ResponseJson.class);
|
|
|
- Map<String,String> data = (Map) forObject.getData();
|
|
|
+ ResponseJson forObject = restTemplate.getForObject(synchronizeInformation + "?socialCreditCode=" + platform.getSocialCreditCode(), ResponseJson.class);
|
|
|
+ Map<String, String> data = (Map) forObject.getData();
|
|
|
platform.setAuthUrl(data.get("authUrl"));
|
|
|
platform.setShortAuthUrl(data.get("shortAuthUrl"));
|
|
|
platform.setFddCustomerId(data.get("fddCustomerId"));
|
|
@@ -197,7 +197,7 @@ public class PlatformServiceImpl extends ServiceImpl<PlatformMapper,Platform> im
|
|
|
|
|
|
//获取认证状态
|
|
|
String result = ElectronicSignatureUtil.getAuthInfo(platform.getSocialCreditCode(), "2");
|
|
|
- if ("1".equals(result)){
|
|
|
+ if ("1".equals(result)) {
|
|
|
platform.setAuthStatus(1);
|
|
|
updateById(platform);
|
|
|
}
|