Merge branch 'develop_master' into FOTON
This commit is contained in:
@@ -133,6 +133,10 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
||||
addInterceptor.excludePathPatterns("/api/att/attFile/uploadNew");
|
||||
addInterceptor.excludePathPatterns("/api/sarLawsDetailedList/sar-laws-detailed-list/importData");
|
||||
|
||||
//doc文檔重新轉換
|
||||
addInterceptor.excludePathPatterns("/api/sarStandardsInfo/sar-standards-info/convertDocAll_GNW");
|
||||
addInterceptor.excludePathPatterns("/api/sarStandardsInfo/sar-standards-info/convertDocAll_QB");
|
||||
|
||||
|
||||
//// //测试接口使用
|
||||
// addInterceptor.excludePathPatterns("/api/**");
|
||||
|
||||
@@ -80,7 +80,10 @@ public class SendStandMQService {
|
||||
}
|
||||
}
|
||||
String sarStandAttrEOStr = infoEO.getSarStandAttrEOStr();
|
||||
Map<String,Object> attrInfoMap = JSONObject.fromObject(sarStandAttrEOStr);
|
||||
Map<String,Object> attrInfoMap = new TreeMap<>();
|
||||
if(StringUtils.isNotBlank(sarStandAttrEOStr)){
|
||||
attrInfoMap = JSONObject.fromObject(sarStandAttrEOStr);
|
||||
}
|
||||
Map<String,Object> infoMap = infoEO.getAttrInfoMap();
|
||||
Map<String,String> infoEOMapItems = infoEO.getMapItems();
|
||||
|
||||
@@ -178,15 +181,25 @@ public class SendStandMQService {
|
||||
|
||||
// 动态存储属性字段
|
||||
for (String field : fieldInfoList) {
|
||||
saveMap.put(field,attrInfoMap.getOrDefault(field,""));
|
||||
String fieldValue = "";
|
||||
if(infoMap.get(field) != null && StringUtils.isNotBlank(infoMap.get(field).toString())){
|
||||
Object json= new JSONTokener(infoMap.get(field).toString()).nextValue();
|
||||
if(!json.toString().equals("null")){
|
||||
fieldValue = infoMap.get(field).toString();
|
||||
String fieldValue = "";
|
||||
try {
|
||||
saveMap.put(field,attrInfoMap.getOrDefault(field,""));
|
||||
if(infoMap.get(field) != null && StringUtils.isNotBlank(infoMap.get(field).toString())){
|
||||
Object json= new JSONTokener(infoMap.get(field).toString()).nextValue();
|
||||
if(json instanceof org.json.JSONArray){
|
||||
fieldValue = String.join(",", com.alibaba.fastjson.JSONObject.parseArray(standMap.get(field).toString(),String.class));
|
||||
}else {
|
||||
if(!("null").equals(json)){
|
||||
fieldValue = standMap.get(field).toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
saveMap.put(field+"Name",fieldValue);
|
||||
}catch (Exception e){
|
||||
logger.info("国内外标准 消息队列: "+addOrUpdate+", 标准ID:"+infoEO.getId()+",问题字段:"+field);
|
||||
saveMap.put(field+"Name",fieldValue);
|
||||
}
|
||||
saveMap.put(field+"Name",fieldValue);
|
||||
|
||||
}
|
||||
|
||||
if(infoEOMapItems != null && !infoEOMapItems.isEmpty()){
|
||||
|
||||
@@ -33,7 +33,6 @@ import com.adc.da.utils.util.FieldConvertUtil;
|
||||
import com.adc.da.utils.util.InitStandAttrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.google.gson.JsonObject;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.elasticsearch.client.transport.TransportClient;
|
||||
import org.json.JSONTokener;
|
||||
|
||||
+40
@@ -10,9 +10,13 @@ import com.adc.da.exception.AdcDaBaseException;
|
||||
import com.adc.da.http.PageInfo;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarBussStandFile.entity.SarBussStandFile;
|
||||
import com.adc.da.slrs.sarBussStandFile.service.ISarBussStandFileService;
|
||||
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
|
||||
import com.adc.da.slrs.sarBussionessStand.service.ISarBussionessStandService;
|
||||
import com.adc.da.slrs.sarLawsInfo.service.ISarLawsInfoService;
|
||||
import com.adc.da.slrs.sarStandFile.entity.SarStandFile;
|
||||
import com.adc.da.slrs.sarStandFile.service.ISarStandFileService;
|
||||
import com.adc.da.slrs.sarStandMenu.dao.SarStandMenuDao;
|
||||
import com.adc.da.slrs.sarStandMenu.entity.SarStandMenu;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.*;
|
||||
@@ -68,6 +72,9 @@ public class SarStandardsInfoController extends BaseController<SarStandardsInfo>
|
||||
@Autowired
|
||||
private ISarBussionessStandService iSarBussionessStandService;
|
||||
|
||||
@Autowired
|
||||
private ISarStandFileService sarStandFileService;
|
||||
|
||||
|
||||
@Value("${file.path}")
|
||||
private String filePath;
|
||||
@@ -854,4 +861,37 @@ public class SarStandardsInfoController extends BaseController<SarStandardsInfo>
|
||||
}
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private ISarBussStandFileService sarBussStandFileService;
|
||||
|
||||
@ApiOperation(value = "doc文件重新轉換[國内外標準]")
|
||||
@GetMapping("/convertDocAll_GNW")
|
||||
public String convertDocAll_GNW(Integer number) throws Exception {
|
||||
QueryWrapper<SarStandFile> qw = new QueryWrapper();
|
||||
qw.eq("valid_flag","0");
|
||||
qw.and(wrapper -> wrapper.eq("file_suffix","DOC").or().eq("file_suffix","docx"));
|
||||
if(number != null && number > 0){
|
||||
qw.last("limit 5");
|
||||
}
|
||||
List<SarStandFile> list = sarStandFileService.list(qw);
|
||||
logger.error("doc轉換共多少:"+list.size());
|
||||
sarStandardsInfoEOService.convertDocAll(list);
|
||||
return "1";
|
||||
}
|
||||
|
||||
@ApiOperation(value = "doc文件重新轉換[企標]")
|
||||
@GetMapping("/convertDocAll_QB")
|
||||
public String convertDocAll_QB(Integer number) throws Exception {
|
||||
QueryWrapper<SarBussStandFile> qw = new QueryWrapper();
|
||||
qw.eq("valid_flag","0");
|
||||
qw.and(wrapper -> wrapper.eq("file_suffix","DOC").or().eq("file_suffix","docx"));
|
||||
if(number != null && number > 0){
|
||||
qw.last("limit 5");
|
||||
}
|
||||
List<SarBussStandFile> list = sarBussStandFileService.list(qw);
|
||||
logger.error("doc轉換共多少:"+list.size());
|
||||
sarStandardsInfoEOService.convertDocAllQB(list);
|
||||
return "1";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+6
@@ -1,5 +1,7 @@
|
||||
package com.adc.da.slrs.sarStandardsInfo.service;
|
||||
|
||||
import com.adc.da.slrs.sarBussStandFile.entity.SarBussStandFile;
|
||||
import com.adc.da.slrs.sarStandFile.entity.SarStandFile;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.*;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
@@ -64,4 +66,8 @@ public interface ISarStandardsInfoService extends IService<SarStandardsInfo> {
|
||||
void replaceBdtbzhforDtbzh();
|
||||
|
||||
void replaceBdtbzhforDtbzhQb();
|
||||
|
||||
void convertDocAll(List<SarStandFile> list);
|
||||
|
||||
void convertDocAllQB(List<SarBussStandFile> list);
|
||||
}
|
||||
|
||||
+35
@@ -1,5 +1,6 @@
|
||||
package com.adc.da.slrs.sarStandardsInfo.service.impl;
|
||||
|
||||
import com.adc.da.att.dao.AttFileEODao;
|
||||
import com.adc.da.att.entity.AttFileEO;
|
||||
import com.adc.da.person.entity.StandInfo;
|
||||
import com.adc.da.person.entity.TsPersonCollect;
|
||||
@@ -9,6 +10,7 @@ import com.adc.da.slrs.regulations.entity.StandData;
|
||||
import com.adc.da.slrs.sarBussStandAttrInfo.dao.SarBussStandAttrInfoDao;
|
||||
import com.adc.da.slrs.sarBussStandAttrInfo.entity.SarBussStandAttrInfo;
|
||||
import com.adc.da.slrs.sarBussStandAttrInfo.service.ISarBussStandAttrInfoService;
|
||||
import com.adc.da.slrs.sarBussStandFile.entity.SarBussStandFile;
|
||||
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
|
||||
import com.adc.da.slrs.sarBussionessStand.service.ISarBussionessStandService;
|
||||
import com.adc.da.slrs.sarLawsAttrDetailedList.dao.SarLawsAttrDetailedListDao;
|
||||
@@ -271,6 +273,9 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
|
||||
@Autowired
|
||||
private StandDataDao standDataDao;
|
||||
|
||||
@Autowired
|
||||
private AttFileEODao attFileEODao;
|
||||
// /**
|
||||
// * 反向操作标准
|
||||
// */
|
||||
@@ -504,6 +509,36 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void convertDocAll(List<SarStandFile> list) {
|
||||
try{
|
||||
for(SarStandFile sarStandFile : list){
|
||||
logger.error("GB++++++++++++++++:" + sarStandFile.getStandId());
|
||||
AttFileEO attFileEO = new AttFileEO();
|
||||
attFileEO.setId(sarStandFile.getAttId());
|
||||
AttFileEO temp = attFileEODao.selectFileInfoById(attFileEO);
|
||||
createStandFileAppend(sarStandFile.getStandId(), sarStandFile.getStandFileClassify(), Arrays.asList(temp), new ArrayList<>());
|
||||
}
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void convertDocAllQB(List<SarBussStandFile> list) {
|
||||
try{
|
||||
for(SarBussStandFile sarStandFile : list){
|
||||
logger.error("QB++++++++++++++++:" + sarStandFile.getStandId());
|
||||
AttFileEO attFileEO = new AttFileEO();
|
||||
attFileEO.setId(sarStandFile.getAttId());
|
||||
AttFileEO temp = attFileEODao.selectFileInfoById(attFileEO);
|
||||
createStandFileAppend(sarStandFile.getStandId(), sarStandFile.getStandFileClassify(), Arrays.asList(temp), new ArrayList<>());
|
||||
}
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private String convertStandCodeHandle(String standCode) {
|
||||
if (StringUtils.isNotBlank(standCode)) {
|
||||
standCode = standCode.replaceAll("—", "-");
|
||||
|
||||
Reference in New Issue
Block a user