|
@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.fdkk.sxz.base.Result;
|
|
|
import com.fdkk.sxz.base.impl.BaseServiceImpl;
|
|
|
import com.fdkk.sxz.entity.ComponentModelUploadEntity;
|
|
|
+import com.fdkk.sxz.entity.ModelUploadEntity;
|
|
|
import com.fdkk.sxz.entity.custuom.CustomComponentClassifyEntity;
|
|
|
import com.fdkk.sxz.entity.custuom.CustomComponentEntity;
|
|
|
import com.fdkk.sxz.entity.custuom.CustomProductEntity;
|
|
@@ -216,9 +217,20 @@ public class CustomProductServiceImpl extends BaseServiceImpl<ICustomProductMapp
|
|
|
componentsEntity.remove("id");
|
|
|
entityChild.add(componentsEntity);
|
|
|
}
|
|
|
+ /****4:处理 tb_model_upload 表 *****/
|
|
|
+ ModelUploadEntity uploadModel = modelUploadService.findByFileId(a.getName());
|
|
|
+ if (ObjectUtil.isNotNull(uploadModel)) {
|
|
|
+ entity.put("escFilePath", uploadModel.getFileId());
|
|
|
+ JSONObject cache = JSON.parseObject(uploadModel.getCacheData());
|
|
|
+ JSONObject uploadModelJson = (JSONObject) JSONObject.toJSON(uploadModel);
|
|
|
+ uploadModelJson.put("cacheData", cache);
|
|
|
+ entity.put("uploadModel", uploadModelJson);
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
entity.put("child", entityChild);
|
|
|
+
|
|
|
+
|
|
|
res.add(entity);
|
|
|
});
|
|
|
CustomProductServiceImpl.log.info("数据准备完毕");
|
|
@@ -253,6 +265,23 @@ public class CustomProductServiceImpl extends BaseServiceImpl<ICustomProductMapp
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+ /****4:处理 tb_model_upload 表 *****/
|
|
|
+ if (customProductJson.containsKey("uploadModel")) {
|
|
|
+ JSONObject uploadModelJson = customProductJson.getJSONObject("uploadModel");
|
|
|
+ ModelUploadEntity uploadModel = JSONObject.toJavaObject(uploadModelJson, ModelUploadEntity.class);
|
|
|
+ ModelUploadEntity uploadModelS = modelUploadService.findByFileId(uploadModel.getFileId());
|
|
|
+ if (ObjectUtil.isNull(uploadModelS)) {
|
|
|
+ uploadModel.setPartsDetailId(entity.getId());
|
|
|
+ uploadModel.setUserId(371L);
|
|
|
+ boolean saveAttaching = modelUploadService.save(uploadModel);
|
|
|
+ if (saveAttaching && uploadModelJson.containsKey("cacheData")) {
|
|
|
+ JSONObject cache = uploadModelJson.getJSONObject("cacheData");
|
|
|
+ uploadModel.setCacheData(cache.toJSONString());
|
|
|
+ modelUploadService.updateById(uploadModel);
|
|
|
+ }
|
|
|
+ CustomProductServiceImpl.log.info("tb_model_upload保存结果{}", saveAttaching);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
CustomProductServiceImpl.log.info("定制模型保存ids数量{}", ids.size());
|
|
|
if (ids.size() > 0) {
|