|
|
@@ -384,7 +384,7 @@ public class ProjectTaskServiceImpl implements ProjectTaskService {
|
|
|
ProjectStaffRecord projectStaffRecord) throws InterruptedException {
|
|
|
String json = JSONObject.toJSONString(map);
|
|
|
String address = getAddress();
|
|
|
- String operateId = DateUtils.dateTimeNow();
|
|
|
+ String operateId = "yfdk_"+DateUtils.dateTimeNow();
|
|
|
String s = tianheService.seveText(address, json, operateId);
|
|
|
JSONObject res = JSONObject.parseObject(s);
|
|
|
Integer code = (Integer) res.get("code");
|
|
|
@@ -393,8 +393,8 @@ public class ProjectTaskServiceImpl implements ProjectTaskService {
|
|
|
sleep(1000);
|
|
|
String certificate = tianheService.getCertificate(address, operateId);
|
|
|
JSONObject certificateData = JSONObject.parseObject(certificate);
|
|
|
- String code2=res.getString("code");
|
|
|
- if (code2.equals("200")){
|
|
|
+ Integer code2= (Integer) certificateData.get("code");
|
|
|
+ if (code2==HttpStatus.OK.value()){
|
|
|
log.debug(certificateData.toJSONString());
|
|
|
tianheCloudUrl=certificateData.getString("data");
|
|
|
if (projectTask!=null){
|
|
|
@@ -413,9 +413,14 @@ public class ProjectTaskServiceImpl implements ProjectTaskService {
|
|
|
projectStaffRecordMapper.updateByPrimaryKeySelective(newPSR);
|
|
|
}
|
|
|
}else {
|
|
|
- log.error(res.getString("msg"));
|
|
|
+ String msg = certificateData.getString("msg");
|
|
|
+ log.error(msg);
|
|
|
+ throw new RuntimeException(msg);
|
|
|
}
|
|
|
-
|
|
|
+ }else {
|
|
|
+ String msg = res.getString("msg");
|
|
|
+ log.error(msg);
|
|
|
+ throw new RuntimeException(msg);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -438,9 +443,8 @@ public class ProjectTaskServiceImpl implements ProjectTaskService {
|
|
|
private String getAddress() {
|
|
|
String address = null;
|
|
|
SysUser user = SecurityUtils.getLoginUser().getUser();
|
|
|
- if (user.getTianheId()==null){
|
|
|
- SysUser sysUser = userMapper.selectUserById(user.getUserId());
|
|
|
- if (sysUser.getTianheId()==null){
|
|
|
+ SysUser sysUser = userMapper.selectUserById(user.getUserId());
|
|
|
+ if (sysUser.getTianheId()==null){
|
|
|
try {
|
|
|
String userId=user.getUserId().toString();
|
|
|
String s = tianheService.addUser( userId, "123456");
|
|
|
@@ -456,12 +460,8 @@ public class ProjectTaskServiceImpl implements ProjectTaskService {
|
|
|
user.setTianheId(address);
|
|
|
userMapper.updateUser(user);
|
|
|
}
|
|
|
- }else {
|
|
|
- address = sysUser.getTianheId();
|
|
|
- }
|
|
|
}else {
|
|
|
-
|
|
|
- address = user.getTianheId();
|
|
|
+ address=sysUser.getTianheId();
|
|
|
}
|
|
|
if (address==null){
|
|
|
throw new ServiceException("天河账号不存在,请稍后再试");
|