三项制度库数据迁移和自建数据区分
							parent
							
								
									c674e3de1e
								
							
						
					
					
						commit
						ba48e647dc
					
				|  | @ -10,6 +10,7 @@ import com.zcloud.mapper.datasource.depository.TextLibraryMapper; | |||
| import com.zcloud.service.depository.TextLibraryService; | ||||
| import com.zcloud.util.*; | ||||
| import org.apache.commons.lang.StringUtils; | ||||
| import org.springframework.beans.factory.annotation.Value; | ||||
| import org.springframework.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Transactional; | ||||
| import org.springframework.web.multipart.MultipartFile; | ||||
|  | @ -50,6 +51,9 @@ public class TextLibraryServiceImpl implements TextLibraryService { | |||
|     @Resource | ||||
|     private TextInfoMapper textInfoMapper; | ||||
| 
 | ||||
|     @Value("${heBeiQinAnFile}") | ||||
|     private String heBeiQinAnFile; | ||||
| 
 | ||||
|     /** | ||||
|      * 新增 | ||||
|      * | ||||
|  | @ -101,6 +105,12 @@ public class TextLibraryServiceImpl implements TextLibraryService { | |||
|             entity.put("ATTRIBUTE_LIST", _labels.stream().filter(n -> n.get("CATEGORY") != null).filter(n -> n.getString("CATEGORY").equals("ATTRIBUTE_LIST")).collect(Collectors.toList())); | ||||
|             entity.put("CATEGORY_LIST", _labels.stream().filter(n -> n.get("CATEGORY") != null).filter(n -> n.getString("CATEGORY").equals("CATEGORY_LIST")).collect(Collectors.toList())); | ||||
|         } | ||||
|         // 如果是迁移数据就用河北秦安的路径
 | ||||
|         for (PageData entity : list) { | ||||
|             if(!"1".equals(entity.getString("MIGRATION_FLAG"))){ | ||||
|                 entity.put("PATH",heBeiQinAnFile + entity.getString("PATH")); | ||||
|             } | ||||
|         } | ||||
|         return list; | ||||
|     } | ||||
| 
 | ||||
|  | @ -160,11 +170,12 @@ public class TextLibraryServiceImpl implements TextLibraryService { | |||
|         if (StringUtils.isNotBlank(condition.getString("BUS_TEXT_LIBRARY_ID"))) { | ||||
|             // 保存历史文件
 | ||||
|             PageData entity = textlibraryMapper.findById(condition); | ||||
|             condition.put("REMOTE_FILE_NAME", Warden.getFileName(condition.getString("PATH"))); | ||||
|             condition.put("CREATED_TIME", entity.get("CREATED_TIME")); | ||||
|             condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); | ||||
|             condition.put("STATUS", "1"); | ||||
|             textlibraryMapper.edit(condition); | ||||
|             entity.put("REMOTE_FILE_NAME", Warden.getFileName(condition.getString("PATH"))); | ||||
|             entity.put("CREATED_TIME", entity.get("CREATED_TIME")); | ||||
|             entity.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); | ||||
|             entity.put("STATUS", "1"); | ||||
|             entity.put("MIGRATION_FLAG", "1"); | ||||
|             textlibraryMapper.edit(entity); | ||||
|             libraryLabelsMapper.deleteByLibraryId(condition); | ||||
|             List<PageData> types = Warden.getList(condition.getString("TYPES")); | ||||
|             List<PageData> list = new ArrayList<>(types); | ||||
|  | @ -238,6 +249,7 @@ public class TextLibraryServiceImpl implements TextLibraryService { | |||
|             condition.put("ISDELETE", "0"); | ||||
|             condition.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); | ||||
|             condition.put("STATUS", "1"); | ||||
|             condition.put("MIGRATION_FLAG", "1"); | ||||
|             textlibraryMapper.save(condition); | ||||
| 
 | ||||
|             List<PageData> list = new ArrayList<>(); | ||||
|  |  | |||
|  | @ -126,3 +126,5 @@ mq.gwj.file.topic=czks_dockingPicture | |||
| 
 | ||||
| #港务局文件服务器前缀 | ||||
| cfd.prevention.api.url=http://192.168.0.31:7021/qa-regulatory-cfd | ||||
| #河北秦安文件服务器前缀 | ||||
| heBeiQinAnFile=https://file.zcloudchina.com/YTHFile | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue