|
|
@@ -29,6 +29,7 @@ import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.validation.Validator;
|
|
|
@@ -333,10 +334,23 @@ public class ProjectTaskServiceImpl implements ProjectTaskService {
|
|
|
|
|
|
}
|
|
|
}
|
|
|
+ @Override
|
|
|
+ @Transactional
|
|
|
+ public void saveText(String ids) {
|
|
|
+ String[] split = ids.split(",");
|
|
|
+ try {
|
|
|
+ for (String id : split) {
|
|
|
+ saveProjectText(Long.valueOf(id));
|
|
|
+ Thread.sleep(1000);
|
|
|
+ }
|
|
|
+ } catch (InterruptedException e) {
|
|
|
+ throw new RuntimeException("上链异常,请稍后再试");
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
|
|
|
- @Override
|
|
|
- public AjaxResult seveText(Long id) {
|
|
|
+
|
|
|
+ public void saveProjectText(Long id) throws InterruptedException {
|
|
|
ProjectTask projectTask = projectTaskMapper.selectByPrimaryKey(id);
|
|
|
List<ProjectStaffRecord> projectStaffRecords = projectStaffRecordMapper.selectByPidAndAid(id, null);
|
|
|
Map<String,Object> map=new HashMap<>();
|
|
|
@@ -351,19 +365,18 @@ public class ProjectTaskServiceImpl implements ProjectTaskService {
|
|
|
Integer code = (Integer) res.get("code");
|
|
|
String tianheCloudUrl=null;
|
|
|
if (code== HttpStatus.OK.value()){
|
|
|
- try {
|
|
|
sleep(1000);
|
|
|
- } catch (InterruptedException e) {
|
|
|
- throw new RuntimeException(e);
|
|
|
- }
|
|
|
+
|
|
|
String certificate = tianheService.getCertificate(address, operateId);
|
|
|
JSONObject certificateData = JSONObject.parseObject(certificate);
|
|
|
String tianheCloudId=res.getString("data");
|
|
|
log.debug(certificateData.toJSONString());
|
|
|
tianheCloudUrl=certificateData.getString("data");
|
|
|
-
|
|
|
+ if (tianheCloudUrl!=null){
|
|
|
+ projectTask.setTianheUrl(tianheCloudId);
|
|
|
+ projectTaskMapper.updateByPrimaryKey(projectTask);
|
|
|
+ }
|
|
|
}
|
|
|
- return AjaxResult.success(tianheCloudUrl);
|
|
|
}
|
|
|
|
|
|
private String getAddress() {
|