|
@@ -1,16 +1,19 @@
|
|
|
package com.miniframe.service.mq;
|
|
|
|
|
|
import com.miniframe.aftercure.ActionMsg;
|
|
|
+import com.miniframe.core.exception.BusinessException;
|
|
|
import com.miniframe.core.ext.UtilTools;
|
|
|
import com.miniframe.generate.appcode.Processing;
|
|
|
+import com.miniframe.model.system.AdiModeling;
|
|
|
+import com.miniframe.model.system.AdiModelingSQLBuilder;
|
|
|
import com.miniframe.model.system.AdiSolverConfigImg;
|
|
|
+import com.miniframe.model.system.dao.AdiModelingMapper;
|
|
|
import com.miniframe.model.system.dao.AdiSolverConfigImgMapper;
|
|
|
import com.miniframe.spring.mq.IMFMqOp;
|
|
|
import com.miniframe.spring.mq.MFMqConfig;
|
|
|
import com.miniframe.spring.mq.MFMqInfo;
|
|
|
import com.miniframe.spring.mq.MFMqListenerInfo;
|
|
|
-import com.miniframe.tools.XIDateTimeUtils;
|
|
|
-import com.miniframe.tools.XiJsonUtil;
|
|
|
+import com.miniframe.tools.*;
|
|
|
import com.miniframe.websocket.WebsocketEndPoint;
|
|
|
import com.rabbitmq.client.Channel;
|
|
|
import org.springframework.amqp.core.AcknowledgeMode;
|
|
@@ -138,7 +141,43 @@ public class CaeMQ extends CaeViewMFMqDynamic {
|
|
|
point.sendMessageToUser(msg.getProId(),data);
|
|
|
}
|
|
|
}else if(msg.getAction().equals("meshResultFile")){
|
|
|
+ String pid =msg.getProId();
|
|
|
+ String usrId =msg.getUsrId();
|
|
|
+ String path =msg.getPath();
|
|
|
+
|
|
|
+// String gridFileId ="";
|
|
|
+ String gridFileType ="";
|
|
|
+ //文件处理
|
|
|
+ String gridFileId = "";
|
|
|
+ gridFileId = XIFileUtils.saveUploadFiles(path, usrId, "");
|
|
|
+ if (gridFileId.isEmpty()) {
|
|
|
+ throw new BusinessException("EB2000006");
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
+ AdiModelingMapper modelingMapper = UtilTools.getBean(AdiModelingMapper.class);
|
|
|
+ AdiModelingSQLBuilder sb = new AdiModelingSQLBuilder();
|
|
|
+ AdiModelingSQLBuilder.Criteria sc =sb.createCriteria();
|
|
|
+ sc.andPidEqualTo(pid);
|
|
|
+ List<AdiModeling> modelings =modelingMapper.selectByExample(sb);
|
|
|
+ if(modelings.isEmpty()){
|
|
|
+ AdiModeling modeling =new AdiModeling();
|
|
|
+ modeling.setId(UtilTools.getUUid());
|
|
|
+ modeling.setPid(pid);
|
|
|
+ modeling.setGridFile(gridFileId);
|
|
|
+ modeling.setGridFileType(gridFileType);
|
|
|
+ modeling.setUid(usrId);
|
|
|
+ modelingMapper.insert(modeling);
|
|
|
+ }else{
|
|
|
+ AdiModeling modeling =modelings.get(0);
|
|
|
+ if(!gridFileId.equals(modeling.getGridFile())) {
|
|
|
+ CaeFileUtils.deleFile(modeling.getGridFile());
|
|
|
+ }
|
|
|
+
|
|
|
+ modeling.setGridFile(gridFileId);
|
|
|
+ modeling.setGridFileType(gridFileType);
|
|
|
+ modelingMapper.updateByPrimaryKey(modeling);
|
|
|
+ }
|
|
|
|
|
|
}else{
|
|
|
point.sendMessageToUser(msg.getProId(),data);
|