Merge remote-tracking branch 'origin/develop_master' into develop_master

This commit is contained in:
庄新伟
2022-03-16 16:28:54 +08:00
8 changed files with 92 additions and 7 deletions
@@ -114,7 +114,7 @@ public class WebMvcConfig implements WebMvcConfigurer {
addInterceptor.excludePathPatterns("/api/search/resetSearchCenter/resetAStandSearchCenter");
addInterceptor.excludePathPatterns("/api/search/resetSearchCenter/resetBLawsSearchCenter");
addInterceptor.excludePathPatterns("/api/search/resetSearchCenter/resetCBussStandSearchCenter");
addInterceptor.excludePathPatterns("/api/search/resetSearchCenter/syncSearchCenterData");
addInterceptor.excludePathPatterns("/api/att/attFile/downloadFileForSarNew");
addInterceptor.excludePathPatterns("/api/att/attFile/downloadFileForSarWaterMarkNew");
@@ -11,6 +11,9 @@ import com.adc.da.util.http.ResponseMessage;
import com.adc.da.util.http.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -22,6 +25,8 @@ import java.util.Map;
@Api(description = "搜索中心重置索引及数据+实施预警触发")
public class ResetSearchCenterController extends BaseController<Map<String, Object>> {
private static final Logger logger = LoggerFactory.getLogger(ResetSearchCenterController.class);
@Autowired
private ResetSearchCenterService resetSearchCenterService;
@ApiOperation(value = "|SearchCenter|重新创建ALL标准数据索引")
@@ -77,4 +82,35 @@ public class ResetSearchCenterController extends BaseController<Map<String, Obje
SarBussionessStandEOPage sarBussionessStandEOPage = new SarBussionessStandEOPage();
return resetSearchCenterService.resetBussStandSearchCenter(sarBussionessStandEOPage,searchCenter);
}
/**
* 根据资源ID对搜索中心数据进行处理
* @param standId
* @param dataType(STAND BUSS)
* @return
*/
@ApiOperation(value = "|SearchCenter|根据资源ID对搜索中心数据进行处理")
@GetMapping(value="/syncSearchCenterData")
public ResponseMessage syncSearchCenterData(@RequestParam("standId") String standId,
@RequestParam("dataType") String dataType){
if(StringUtils.isNotBlank(standId) && StringUtils.isNotBlank(dataType)){
try {
if("STAND".equals(dataType)){
resetSearchCenterService.syncStandSearchCenterData(standId);
}else if("BUSS".equals(dataType)){
resetSearchCenterService.syncBussStandSearchCenterData(standId);
}else{
return Result.error("-1","资源类型错误,请检查",null);
}
return Result.success("200","开始同步",null);
} catch (Exception e) {
logger.error(e.getMessage(),e);
return Result.error("-1","请求错误,请检查",null);
}
}else{
return Result.error("-1","参数有误,请检查",null);
}
}
}
@@ -18,6 +18,7 @@ import com.adc.da.util.http.ResponseMessage;
import com.adc.da.util.http.Result;
import com.adc.da.utils.util.DateUtil;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.JsonObject;
import org.apache.commons.lang3.StringUtils;
import org.elasticsearch.client.transport.TransportClient;
import org.slf4j.Logger;
@@ -298,4 +299,51 @@ public class ResetSearchCenterService {
logger.info("重置企标:新增-"+ countAddSuccess + "条 更新-"+countUpdateSuccess+"条(企标共:"+rowsStand.size()+"条)");
return Result.success("重置企标:新增-"+ countAddSuccess + "条 更新-"+countUpdateSuccess+"条(企标共:"+rowsStand.size()+"条)");
}
/**
* 同步添加标准搜索中心数据内容
* @param standId
*/
public void syncStandSearchCenterData(String standId) throws Exception {
if(StringUtils.isNotBlank(standId)){
SarStandardsInfo sarStandardsInfo = iSarStandardsInfoService.selectStandardsInfoByKey(standId);
logger.debug("本次处理的标准信息:"+JSONObject.toJSONString(sarStandardsInfo));
if(sarStandardsInfo!=null){
if (sarStandardsInfo.getAttrInfoMap() != null) {
sarStandardsInfo.setSarStandAttrEOStr(JSONObject.toJSONString(sarStandardsInfo.getAttrInfoMap()));
}
Map<String, Object> indexstate = elasticsearchService.searchDataById("stand","stand",standId,null);
if(!indexstate.isEmpty()){
createStandMQService.sendStandMQ(sarStandardsInfo,"update");
}else{
createStandMQService.sendStandMQ(sarStandardsInfo,"add");
}
}
}
}
/**
* 同步添加企业标准搜索中心数据内容
* @param standId
*/
public void syncBussStandSearchCenterData(String standId) throws Exception {
if(StringUtils.isNotBlank(standId)){
SarBussionessStand sarBussionessStand = iSarBussionessStandService.selectStandardsInfoByKey(standId);
logger.debug("本次处理的标准信息:"+JSONObject.toJSONString(sarBussionessStand));
if(sarBussionessStand!=null){
if (sarBussionessStand.getAttrInfoMap() != null) {
sarBussionessStand.setSarStandAttrEOStr(JSONObject.toJSONString(sarBussionessStand.getAttrInfoMap()));
}
Map<String, Object> indexstate = elasticsearchService.searchDataById("bussstand","bussstand",standId,null);
if(!indexstate.isEmpty()){
createStandMQService.sendBussStandMQ(sarBussionessStand,"update");
}else{
createStandMQService.sendBussStandMQ(sarBussionessStand,"add");
}
}
}
}
}
@@ -70,7 +70,7 @@ public class SarStandUnqualifiedServiceImpl extends ServiceImpl<SarStandUnqualif
Page<SarStandUnqualified> standUnqualifiedPage=new Page<>();
//判断前端是否提供页码和每页条数
sarStandUnqualifiedPage.setCloseState(1);
List<SarStandUnqualified> sarStandUnqualifieds=sarStandUnqualifiedDao.getSarStandUnqualifiedPage((sarStandUnqualifiedPage.getCurrent()-1)*sarStandUnqualifiedPage.getSize(),sarStandUnqualifiedPage.getCurrent()*sarStandUnqualifiedPage.getSize(),sarStandUnqualifiedPage);
List<SarStandUnqualified> sarStandUnqualifieds=sarStandUnqualifiedDao.getSarStandUnqualifiedPage((sarStandUnqualifiedPage.getCurrent()-1)*sarStandUnqualifiedPage.getSize(),sarStandUnqualifiedPage.getSize(),sarStandUnqualifiedPage);
Integer total=sarStandUnqualifiedDao.getSarStandUnqualifiedCount(sarStandUnqualifiedPage);
standUnqualifiedPage.setRecords(sarStandUnqualifieds);
standUnqualifiedPage.setTotal(total);
@@ -113,7 +113,7 @@ public class SarStandUnqualifiedServiceImpl extends ServiceImpl<SarStandUnqualif
// standUnqualifiedPage=new Page<>(sarStandUnqualifiedPage.getCurrent(),sarStandUnqualifiedPage.getSize());
// }
sarStandUnqualifiedPage.setCloseState(2);
List<SarStandUnqualified> sarStandUnqualifieds=sarStandUnqualifiedDao.getSarStandUnqualifiedPage((sarStandUnqualifiedPage.getCurrent()-1)*sarStandUnqualifiedPage.getSize(),sarStandUnqualifiedPage.getCurrent()*sarStandUnqualifiedPage.getSize(),sarStandUnqualifiedPage);
List<SarStandUnqualified> sarStandUnqualifieds=sarStandUnqualifiedDao.getSarStandUnqualifiedPage((sarStandUnqualifiedPage.getCurrent()-1)*sarStandUnqualifiedPage.getSize(),sarStandUnqualifiedPage.getSize(),sarStandUnqualifiedPage);
Integer total=sarStandUnqualifiedDao.getSarStandUnqualifiedCount(sarStandUnqualifiedPage);
Page page=new Page();
page.setSize(sarStandUnqualifiedPage.getSize());
@@ -202,7 +202,7 @@ public class SarUpdLogServiceImpl extends ServiceImpl<SarUpdLogDao, SarUpdLog> i
switch (field) {
case "textStatus":return "文本状态";
case "country": return "适用区域";
case "isRelateAccess": return "重要度";
case "isRelateAccess": return "是否纳入认证清单";
case "issueTime": return "发布日期";
case "standYear": return "标准年份";
case "standNature": return "标准性质";
@@ -41,9 +41,9 @@
left join ts_institution on ts_institution.id=ts_user.INSTITUTION_ID
WHERE
sar_public_idea_all.idea_id = #{ideaId}
LIMIT ${(page-1)*size},${size}
)c
ORDER BY CONVERT(SUBSTRING(c.part_code,1,(SELECT LOCATE('.',CONCAT(c.part_code,'.')))),SIGNED) ,c.rows
LIMIT ${(page-1)*size},${size}
</select>
<select id="getAllDataByIdeaCount" resultType="java.lang.Integer">
@@ -58,9 +58,9 @@
or sar_stand_unqualified.STAND_NAME like concat(concat('%',#{sar.standSerialNumber}),'%'))
</if>
order by sar_stand_unqualified.ID,sar_stand_unqualified.STAND_ID ,sar_stand_unqualified.ITEMS_NUM asc
limit #{start},#{end}
)c
ORDER BY c.STAND_ID, CONVERT(SUBSTRING(c.ITEMS_NUM,1,(SELECT LOCATE('.',CONCAT(c.ITEMS_NUM,'.')))),SIGNED) ,c.rows
limit #{start},#{end}
</select>
<select id="getSarStandUnqualifiedExcel" resultType="com.adc.da.slrs.sarStandUnqualified.entity.SarStandUnqualified">
@@ -59,8 +59,9 @@
AND specific_item like concat(concat('%',#{specificItem}),'%')
</if>
ORDER BY STAND_ID, specific_item
LIMIT ${(current-1)*size},${size}
) c ORDER BY c.STAND_ID, CONVERT(SUBSTRING(c.specific_item,1,(SELECT LOCATE('.',CONCAT(c.specific_item,'.')))),SIGNED) ,rows
LIMIT ${(current-1)*size},${size}
</select>
<select id="getAllDatasCout" resultType="java.lang.Integer">
SELECT