|
@@ -32,7 +32,7 @@ import java.util.Map;
|
|
* @author liutao yaFan
|
|
* @author liutao yaFan
|
|
*/
|
|
*/
|
|
@Service
|
|
@Service
|
|
-public class PlatformServiceImpl extends ServiceImpl<PlatformMapper,Platform> implements PlatformService {
|
|
|
|
|
|
+public class PlatformServiceImpl extends ServiceImpl<PlatformMapper, Platform> implements PlatformService {
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
@@ -51,26 +51,26 @@ public class PlatformServiceImpl extends ServiceImpl<PlatformMapper,Platform> im
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@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.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());
|
|
platform.setShortAutoSignUrlCreate(new Date());
|
|
Integer autoSignStatus = (Integer) data.get("autoSignStatus");
|
|
Integer autoSignStatus = (Integer) data.get("autoSignStatus");
|
|
- platform.setAutoSignStatus(autoSignStatus == 1?true:false);
|
|
|
|
|
|
+ platform.setAutoSignStatus(autoSignStatus == 1 ? true : false);
|
|
save(platform);
|
|
save(platform);
|
|
|
|
|
|
//电子签章获取认证地址
|
|
//电子签章获取认证地址
|
|
@@ -106,31 +106,31 @@ public class PlatformServiceImpl extends ServiceImpl<PlatformMapper,Platform> im
|
|
public GridPage findPage(ConditionVo conditionVo) {
|
|
public GridPage findPage(ConditionVo conditionVo) {
|
|
Page<Platform> page = PageHelper.startPage(conditionVo.getPage(), conditionVo.getRows());
|
|
Page<Platform> page = PageHelper.startPage(conditionVo.getPage(), conditionVo.getRows());
|
|
list(new QueryWrapper<Platform>().orderByDesc("gmt_create"));
|
|
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
|
|
@Override
|
|
- public Platform getPlateformByBusiness(String businessNumber) {
|
|
|
|
|
|
+ public Platform getPlateformByBusiness(String businessNumber) {
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public void updateShortUrl(Date date) {
|
|
public void updateShortUrl(Date date) {
|
|
List<Platform> list = list();
|
|
List<Platform> list = list();
|
|
- if(list!=null && list.size()>0){
|
|
|
|
|
|
+ if (list != null && list.size() > 0) {
|
|
for (Platform platform : list) {
|
|
for (Platform platform : list) {
|
|
- if(platform.getAuthStatus().equals(0)){
|
|
|
|
|
|
+ if (platform.getAuthStatus().equals(0)) {
|
|
Date shortAuthUrlCreate = platform.getShortAuthUrlCreate();
|
|
Date shortAuthUrlCreate = platform.getShortAuthUrlCreate();
|
|
long between = cn.hutool.core.date.DateUtil.between(shortAuthUrlCreate, date, DateUnit.DAY);
|
|
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());
|
|
String newShortUrl = ElectronicSignatureUtil.shortUrl(null, platform.getAuthUrl());
|
|
platform.setShortAuthUrl(newShortUrl);
|
|
platform.setShortAuthUrl(newShortUrl);
|
|
platform.setShortAuthUrlCreate(date);
|
|
platform.setShortAuthUrlCreate(date);
|
|
//自动签署链接
|
|
//自动签署链接
|
|
String autoSignUrl = platform.getAutoSignUrl();
|
|
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.setShortAutoSignUrl(newShortAutoSignUrl);
|
|
platform.setShortAutoSignUrlCreate(date);
|
|
platform.setShortAutoSignUrlCreate(date);
|
|
}
|
|
}
|
|
@@ -145,8 +145,8 @@ public class PlatformServiceImpl extends ServiceImpl<PlatformMapper,Platform> im
|
|
public void flushUrl(Long id) {
|
|
public void flushUrl(Long id) {
|
|
Platform platform = getById(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.setAuthUrl(data.get("authUrl"));
|
|
platform.setShortAuthUrl(data.get("shortAuthUrl"));
|
|
platform.setShortAuthUrl(data.get("shortAuthUrl"));
|
|
platform.setAuthStatus(0);
|
|
platform.setAuthStatus(0);
|
|
@@ -185,8 +185,8 @@ public class PlatformServiceImpl extends ServiceImpl<PlatformMapper,Platform> im
|
|
Platform platform = getById(id);
|
|
Platform platform = getById(id);
|
|
|
|
|
|
//先从sop更新信息
|
|
//先从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.setAuthUrl(data.get("authUrl"));
|
|
platform.setShortAuthUrl(data.get("shortAuthUrl"));
|
|
platform.setShortAuthUrl(data.get("shortAuthUrl"));
|
|
platform.setFddCustomerId(data.get("fddCustomerId"));
|
|
platform.setFddCustomerId(data.get("fddCustomerId"));
|
|
@@ -197,7 +197,7 @@ public class PlatformServiceImpl extends ServiceImpl<PlatformMapper,Platform> im
|
|
|
|
|
|
//获取认证状态
|
|
//获取认证状态
|
|
String result = ElectronicSignatureUtil.getAuthInfo(platform.getSocialCreditCode(), "2");
|
|
String result = ElectronicSignatureUtil.getAuthInfo(platform.getSocialCreditCode(), "2");
|
|
- if ("1".equals(result)){
|
|
|
|
|
|
+ if ("1".equals(result)) {
|
|
platform.setAuthStatus(1);
|
|
platform.setAuthStatus(1);
|
|
updateById(platform);
|
|
updateById(platform);
|
|
}
|
|
}
|