|
|
@@ -369,6 +369,40 @@ public class ProjectTaskServiceImpl implements ProjectTaskService {
|
|
|
throw new RuntimeException("上链异常,请稍后再试");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void saveText(String content) {
|
|
|
+ String address = getAddress();
|
|
|
+ String operateId ="text_"+DateUtils.dateTimeNow();
|
|
|
+ //文字导入
|
|
|
+ String s = tianheService.seveText(address, content, operateId);
|
|
|
+ JSONObject res = JSONObject.parseObject(s);
|
|
|
+ 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);
|
|
|
+ Integer code2= (Integer) certificateData.get("code");
|
|
|
+ if (code2==HttpStatus.OK.value()){
|
|
|
+ log.debug(certificateData.toJSONString());
|
|
|
+ tianheCloudUrl=certificateData.getString("data");
|
|
|
+ }else {
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public void saveRecordsText(Long id) throws InterruptedException {
|
|
|
ProjectStaffRecord projectStaffRecord = projectStaffRecordMapper.selectByPrimaryKey(Long.valueOf(id));
|
|
|
Map<String,Object> map=new HashMap<>();
|