Merge branch 'fix_foton_20231031' into 'dev_20230829_change'
Fix foton 20231031 See merge request laws-foton-slrs/foton-slrs-system-rest!131
This commit is contained in:
+1
-1
@@ -66,7 +66,7 @@ public class ActSarItemsBussEOController extends BaseController<ActSarItemsEO> {
|
|||||||
}
|
}
|
||||||
Object issueTime = jsonObject.get("issueTime");
|
Object issueTime = jsonObject.get("issueTime");
|
||||||
Object standSort = jsonObject.get("standSort");
|
Object standSort = jsonObject.get("standSort");
|
||||||
if(issueTime!=null && standSort!=null){
|
if(issueTime!=null && standSort!=null){
|
||||||
String issueTimeStr =issueTime.toString();
|
String issueTimeStr =issueTime.toString();
|
||||||
String standSortStr = standSort.toString();
|
String standSortStr = standSort.toString();
|
||||||
if(StringUtils.isNotBlank(issueTimeStr) && StringUtils.isNotBlank(standSortStr)){
|
if(StringUtils.isNotBlank(issueTimeStr) && StringUtils.isNotBlank(standSortStr)){
|
||||||
|
|||||||
+5
-6
@@ -561,17 +561,16 @@ public class ActSarItemsBussEOService {
|
|||||||
evaluation.setCreateTime(date);
|
evaluation.setCreateTime(date);
|
||||||
evaluation.setModifyTime(date);
|
evaluation.setModifyTime(date);
|
||||||
evaluations.add(evaluation);
|
evaluations.add(evaluation);
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
qualityEvaluationService.saveBatch(evaluations);
|
qualityEvaluationService.saveBatch(evaluations);
|
||||||
//当新增完成之后进行循环校验查出流程是重新技术委员会评审、评审意见修改就根据标准id将技术委员会评审、评审意见修改的评分赋值为0
|
//当新增完成之后进行循环校验查出流程是重新技术委员会评审、评审意见修改就根据标准id将技术委员会评审、评审意见修改的评分赋值为0
|
||||||
for (QualityEvaluation qualityEvaluation :evaluations){
|
// for (QualityEvaluation qualityEvaluation :evaluations){
|
||||||
if (qualityEvaluation.getProcessNode().equals("重新技术委员会评审、评审意见修改")){
|
// if (qualityEvaluation.getProcessNode().equals("重新技术委员会评审、评审意见修改")){
|
||||||
qualityEvaluationDao.updateByProcessNode(qualityEvaluation.getLawId());
|
// qualityEvaluationDao.updateByProcessNode(qualityEvaluation.getLawId());
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+135
-23
@@ -6,22 +6,20 @@ import com.adc.da.search.util.DateUtil;
|
|||||||
import com.adc.da.search.util.InitStandAttrSearchUtil;
|
import com.adc.da.search.util.InitStandAttrSearchUtil;
|
||||||
import com.adc.da.sys.dao.DicTypeEODao;
|
import com.adc.da.sys.dao.DicTypeEODao;
|
||||||
import com.adc.da.sys.entity.DicTypeEO;
|
import com.adc.da.sys.entity.DicTypeEO;
|
||||||
import com.adc.da.sys.sarMenuStandard.entity.SarMenuStandard;
|
|
||||||
import com.adc.da.sys.sarMenuStandard.service.ISarMenuStandardService;
|
import com.adc.da.sys.sarMenuStandard.service.ISarMenuStandardService;
|
||||||
|
import com.adc.da.sys.sarResource.entity.SysTsResource;
|
||||||
|
import com.adc.da.sys.sarResource.service.ISysTsResourceService;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.beanutils.BeanUtils;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.poi.ss.formula.functions.T;
|
|
||||||
import org.elasticsearch.action.search.SearchRequestBuilder;
|
import org.elasticsearch.action.search.SearchRequestBuilder;
|
||||||
import org.elasticsearch.action.search.SearchResponse;
|
import org.elasticsearch.action.search.SearchResponse;
|
||||||
import org.elasticsearch.action.search.SearchType;
|
import org.elasticsearch.action.search.SearchType;
|
||||||
import org.elasticsearch.action.support.master.AcknowledgedResponse;
|
import org.elasticsearch.action.support.master.AcknowledgedResponse;
|
||||||
import org.elasticsearch.client.transport.TransportClient;
|
import org.elasticsearch.client.transport.TransportClient;
|
||||||
import org.elasticsearch.common.collect.HppcMaps;
|
|
||||||
import org.elasticsearch.common.settings.Settings;
|
import org.elasticsearch.common.settings.Settings;
|
||||||
import org.elasticsearch.common.text.Text;
|
import org.elasticsearch.common.text.Text;
|
||||||
import org.elasticsearch.index.query.BoolQueryBuilder;
|
import org.elasticsearch.index.query.BoolQueryBuilder;
|
||||||
@@ -45,7 +43,6 @@ import org.springframework.stereotype.Component;
|
|||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
@@ -61,6 +58,9 @@ public class SearchCenterServiceImpl implements SearchCenterService {
|
|||||||
@Resource
|
@Resource
|
||||||
private ISarMenuStandardService sarMenuStandardService;
|
private ISarMenuStandardService sarMenuStandardService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ISysTsResourceService tsResourceService;
|
||||||
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private TransportClient transportClient;
|
private TransportClient transportClient;
|
||||||
@@ -231,6 +231,7 @@ public class SearchCenterServiceImpl implements SearchCenterService {
|
|||||||
String sortField1 = "";
|
String sortField1 = "";
|
||||||
String sortField2 = "";
|
String sortField2 = "";
|
||||||
String sortField3 = "";
|
String sortField3 = "";
|
||||||
|
String sortField4 = "";
|
||||||
if("laws".equals(searchInfoEO.getSelectIndex())){
|
if("laws".equals(searchInfoEO.getSelectIndex())){
|
||||||
sortField1 = "lawsNumber";
|
sortField1 = "lawsNumber";
|
||||||
sortField2 = "lawsYear";
|
sortField2 = "lawsYear";
|
||||||
@@ -240,18 +241,69 @@ public class SearchCenterServiceImpl implements SearchCenterService {
|
|||||||
sortField2 = "standYear";
|
sortField2 = "standYear";
|
||||||
sortField3 = "standSort.keyword";
|
sortField3 = "standSort.keyword";
|
||||||
}
|
}
|
||||||
|
// if("laws".equals(searchInfoEO.getSelectIndex())){
|
||||||
|
// sortField1 = "lawsNumber";
|
||||||
|
// sortField2 = "lawsYear";
|
||||||
|
// sortField3 = "lawsType.keyword";
|
||||||
|
// } else if("bussstand".equals(searchInfoEO.getSelectIndex())) {
|
||||||
|
// sortField1 = "putTime";
|
||||||
|
// sortField2 = "standNumber";
|
||||||
|
// sortField3 = "standYear";
|
||||||
|
// sortField4 = "standSort.keyword";
|
||||||
|
// } else if ("stand".equals(searchInfoEO.getSelectIndex())) {
|
||||||
|
// sortField1 = "SSRQ";
|
||||||
|
// sortField2 = "standNumber";
|
||||||
|
// sortField3 = "standYear";
|
||||||
|
// sortField4 = "standSort.keyword";
|
||||||
|
// } else {
|
||||||
|
// sortField1 = "standNumber";
|
||||||
|
// sortField2 = "standYear";
|
||||||
|
// sortField3 = "standSort.keyword";
|
||||||
|
// }
|
||||||
|
|
||||||
List<String> menuNameList = new ArrayList<>();
|
|
||||||
// 国内海外查询标准体系字段由id变为文字
|
// 国内海外查询标准体系字段由id变为文字
|
||||||
|
// if (StringUtils.isNotBlank(searchInfoEO.getStandSystem())) {
|
||||||
|
// ArrayList<String> menuIdList = new ArrayList<>();
|
||||||
|
// Collections.addAll(menuIdList,searchInfoEO.getStandSystem().split(","));
|
||||||
|
// LambdaQueryWrapper<SarMenuStandard> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
// wrapper.in(SarMenuStandard::getId,menuIdList);
|
||||||
|
// wrapper.select(SarMenuStandard::getMenuName);
|
||||||
|
// List<SarMenuStandard> sarMenuStandardList = sarMenuStandardService.list(wrapper);
|
||||||
|
// menuNameList = sarMenuStandardList.stream().map(SarMenuStandard::getMenuName).collect(Collectors.toList());
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 处理菜单名称
|
||||||
|
List<String> menuNameList = new ArrayList<>();
|
||||||
if (StringUtils.isNotBlank(searchInfoEO.getStandSystem())) {
|
if (StringUtils.isNotBlank(searchInfoEO.getStandSystem())) {
|
||||||
ArrayList<String> menuIdList = new ArrayList<>();
|
ArrayList<String> menuIdList = new ArrayList<>();
|
||||||
Collections.addAll(menuIdList,searchInfoEO.getStandSystem().split(","));
|
Collections.addAll(menuIdList, searchInfoEO.getStandSystem().split(","));
|
||||||
LambdaQueryWrapper<SarMenuStandard> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SysTsResource> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.in(SarMenuStandard::getId,menuIdList);
|
wrapper.in(SysTsResource::getId, menuIdList);
|
||||||
wrapper.select(SarMenuStandard::getMenuName);
|
wrapper.select(SysTsResource::getMenuName);
|
||||||
List<SarMenuStandard> sarMenuStandardList = sarMenuStandardService.list(wrapper);
|
List<SysTsResource> tsResourceList = tsResourceService.list(wrapper);
|
||||||
menuNameList = sarMenuStandardList.stream().map(SarMenuStandard::getMenuName).collect(Collectors.toList());
|
List<String> tempList = tsResourceList.stream().map(SysTsResource::getMenuName).collect(Collectors.toList());
|
||||||
|
if ("bussstand".equals(searchInfoEO.getSelectIndex())) {
|
||||||
|
// 和ES中的类别对应
|
||||||
|
for (String menuName : tempList) {
|
||||||
|
menuNameList.add(getReplaceStandSortStr(menuName));
|
||||||
|
}
|
||||||
|
} else if ("stand".equals(searchInfoEO.getSelectIndex())) {
|
||||||
|
if (StringUtils.isNotBlank(searchInfoEO.getStandSystem())) {
|
||||||
|
// 使用正则表达式提取括号内的内容
|
||||||
|
Pattern pattern = Pattern.compile("(([^()]+))");
|
||||||
|
for (String menuName : tempList) {
|
||||||
|
Matcher matcher = pattern.matcher(menuName);
|
||||||
|
if (matcher.find()) {
|
||||||
|
String contentInBrackets = matcher.group(1);
|
||||||
|
menuNameList.add(contentInBrackets);
|
||||||
|
} else {
|
||||||
|
menuNameList.add(menuName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
searchRequestBuilder = client.prepareSearch(searchInfoEO.getSelectIndex())
|
searchRequestBuilder = client.prepareSearch(searchInfoEO.getSelectIndex())
|
||||||
.setSearchType(SearchType.DFS_QUERY_THEN_FETCH)
|
.setSearchType(SearchType.DFS_QUERY_THEN_FETCH)
|
||||||
.addSort(new ScoreSortBuilder().order(SortOrder.DESC))
|
.addSort(new ScoreSortBuilder().order(SortOrder.DESC))
|
||||||
@@ -353,9 +405,9 @@ public class SearchCenterServiceImpl implements SearchCenterService {
|
|||||||
boolQueryBuilder.must(QueryBuilders.wildcardQuery("standType.keyword", "*"+searchInfoEO.getStandType()+"*"));
|
boolQueryBuilder.must(QueryBuilders.wildcardQuery("standType.keyword", "*"+searchInfoEO.getStandType()+"*"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotBlank(searchInfoEO.getTextStatus())) {
|
// if (StringUtils.isNotBlank(searchInfoEO.getTextStatus())) {
|
||||||
boolQueryBuilder.must(QueryBuilders.wildcardQuery("textStatus.keyword", "*"+searchInfoEO.getTextStatus()+"*"));
|
// boolQueryBuilder.must(QueryBuilders.wildcardQuery("textStatus.keyword", "*"+searchInfoEO.getTextStatus()+"*"));
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(searchInfoEO.getLawsSyqy())) {
|
if (StringUtils.isNotBlank(searchInfoEO.getLawsSyqy())) {
|
||||||
boolQueryBuilder.must(QueryBuilders.wildcardQuery("lawsSyqy.keyword", "*"+searchInfoEO.getLawsSyqy()+"*"));
|
boolQueryBuilder.must(QueryBuilders.wildcardQuery("lawsSyqy.keyword", "*"+searchInfoEO.getLawsSyqy()+"*"));
|
||||||
@@ -366,21 +418,39 @@ public class SearchCenterServiceImpl implements SearchCenterService {
|
|||||||
}
|
}
|
||||||
boolQueryBuilder.must(boolQueryShould);
|
boolQueryBuilder.must(boolQueryShould);
|
||||||
}else {
|
}else {
|
||||||
|
// if (!menuNameList.isEmpty()) {
|
||||||
|
// menuNameList.forEach(each -> {
|
||||||
|
// if ("stand".equals(searchInfoEO.getSelectIndex())) {
|
||||||
|
// boolQueryBuilder.must(QueryBuilders.matchQuery("standSystem","*"+each+"*"));
|
||||||
|
// }else if ("bussstand".equals(searchInfoEO.getSelectIndex())) {
|
||||||
|
// boolQueryBuilder.must(QueryBuilders.matchQuery("TXLBBUSS",each));
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
if (!menuNameList.isEmpty()) {
|
if (!menuNameList.isEmpty()) {
|
||||||
menuNameList.forEach(each -> {
|
menuNameList.forEach(each -> boolQueryBuilder.must(QueryBuilders.matchQuery("standSort","*"+each+"*")));
|
||||||
if ("stand".equals(searchInfoEO.getSelectIndex())) {
|
|
||||||
boolQueryBuilder.must(QueryBuilders.matchQuery("standSystem","*"+each+"*"));
|
|
||||||
}else if ("bussstand".equals(searchInfoEO.getSelectIndex())) {
|
|
||||||
boolQueryBuilder.must(QueryBuilders.matchQuery("TXLBBUSS",each));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
if ("stand".equals(searchInfoEO.getSelectIndex()) && StringUtils.isNotBlank(searchInfoEO.getStandType())) {
|
if ("stand".equals(searchInfoEO.getSelectIndex()) && StringUtils.isNotBlank(searchInfoEO.getStandType())) {
|
||||||
boolQueryBuilder.must(QueryBuilders.wildcardQuery("standType.keyword", "*"+searchInfoEO.getStandType()+"*"));
|
boolQueryBuilder.must(QueryBuilders.wildcardQuery("standType.keyword", "*"+searchInfoEO.getStandType()+"*"));
|
||||||
}
|
}
|
||||||
boolQueryBuilder.must(boolQueryShould);
|
boolQueryBuilder.must(boolQueryShould);
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(searchInfoEO.getTextStatusBuss())) {
|
||||||
|
if (searchInfoEO.getSelectIndex().equals("bussstand")) {
|
||||||
|
if ("现行有效".equals(searchInfoEO.getTextStatusBuss())) {
|
||||||
|
boolQueryBuilder.must(QueryBuilders.termQuery("textStatusBuss", "9z741h2m3j")).boost(1009f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(searchInfoEO.getTextStatus())) {
|
||||||
|
if (searchInfoEO.getSelectIndex().equals("stand")) {
|
||||||
|
if ("现行有效".equals(searchInfoEO.getTextStatus())) {
|
||||||
|
boolQueryBuilder.must(QueryBuilders.termQuery("textStatus", "vsaga7nwub")).boost(1009f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
searchRequestBuilder.setQuery(boolQueryBuilder).setTrackTotalHits(true);
|
searchRequestBuilder.setQuery(boolQueryBuilder).setTrackTotalHits(true);
|
||||||
|
|
||||||
// 获取查询到的结果
|
// 获取查询到的结果
|
||||||
@@ -2207,6 +2277,48 @@ public class SearchCenterServiceImpl implements SearchCenterService {
|
|||||||
log.info(response.getHits().toString());
|
log.info(response.getHits().toString());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getReplaceStandSortStr(String standSort){
|
||||||
|
switch (standSort){
|
||||||
|
case "A类标准(技术条件)":
|
||||||
|
return "Q/FT A";
|
||||||
|
case "B类标准(技术基础)":
|
||||||
|
return "Q/FT B";
|
||||||
|
case "C类标准(产品标准)":
|
||||||
|
return "Q/FT C";
|
||||||
|
case "E类标准(发动机)":
|
||||||
|
return "Q/FT E";
|
||||||
|
case " F类标准(仿真分析)":
|
||||||
|
return "Q/FT F";
|
||||||
|
case "G类标准":
|
||||||
|
return "Q/FT G";
|
||||||
|
case "M类标准(工程机械)":
|
||||||
|
return "Q/FT M";
|
||||||
|
case "P类标准(工艺工装)":
|
||||||
|
return "Q/FT P";
|
||||||
|
case "Q类标准(质量评审)":
|
||||||
|
return "Q/FT Q";
|
||||||
|
case "T类标准(试验标准)":
|
||||||
|
return "Q/FT T";
|
||||||
|
case "R类标准(设计规范)":
|
||||||
|
return "Q/FT R";
|
||||||
|
case "V类标准(评价标准)":
|
||||||
|
return "Q/FT V";
|
||||||
|
case "X类标准(出口车)":
|
||||||
|
return "Q/FT X";
|
||||||
|
case "Z类标准(指导性技术文件)":
|
||||||
|
return "Q/FT Z";
|
||||||
|
case "S类标准(产品试制标准)":
|
||||||
|
return "Q/FT S";
|
||||||
|
case "Y类标准(标杆研究标准)":
|
||||||
|
return "Q/FT Y";
|
||||||
|
case "参考标准":
|
||||||
|
return "FT";
|
||||||
|
default:
|
||||||
|
return "其他企业标准";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -31,13 +31,25 @@ public class ScheduledSync {
|
|||||||
private boolean isNotScheduled; //是否开启定时器
|
private boolean isNotScheduled; //是否开启定时器
|
||||||
|
|
||||||
//每天凌晨两点执行
|
//每天凌晨两点执行
|
||||||
|
// @Scheduled(cron="0 0 2 * * ?")
|
||||||
|
// @Async
|
||||||
|
// public void syncSchedulingTasks() {
|
||||||
|
// if(isNotScheduled){
|
||||||
|
// log.info("======================================开始同步基础数据========================================");
|
||||||
|
// iDataSyncService.orgDataSync(); //时间短
|
||||||
|
// iDataSyncService.dataSync(); //时间长
|
||||||
|
// log.info("======================================结束同步基础数据========================================");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
//每天凌晨两点执行,改为全量同步
|
||||||
@Scheduled(cron="0 0 2 * * ?")
|
@Scheduled(cron="0 0 2 * * ?")
|
||||||
@Async
|
@Async
|
||||||
public void syncSchedulingTasks() {
|
public void syncSchedulingTasks() {
|
||||||
if(isNotScheduled){
|
if(isNotScheduled){
|
||||||
log.info("======================================开始同步基础数据========================================");
|
log.info("======================================开始同步基础数据========================================");
|
||||||
iDataSyncService.orgDataSync(); //时间短
|
iDataSyncService.orgDataSync3(); //时间短
|
||||||
iDataSyncService.dataSync(); //时间长
|
iDataSyncService.dataSync3(); //时间长
|
||||||
log.info("======================================结束同步基础数据========================================");
|
log.info("======================================结束同步基础数据========================================");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,12 +47,24 @@ public class DataSyncController {
|
|||||||
return iDataSyncService.dataSync2(chuo);
|
return iDataSyncService.dataSync2(chuo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("同步用户数据3,不带时间戳,全量同步")
|
||||||
|
@PostMapping("/importUserData3")
|
||||||
|
public String importUserData3() throws Exception {
|
||||||
|
return iDataSyncService.dataSync3();
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation("同步组织机构")
|
@ApiOperation("同步组织机构")
|
||||||
@PostMapping("/importOrgData")
|
@PostMapping("/importOrgData")
|
||||||
public String importOrgData() throws Exception {
|
public String importOrgData() throws Exception {
|
||||||
return iDataSyncService.orgDataSync2();
|
return iDataSyncService.orgDataSync2();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("同步组织机构,改成全量同步")
|
||||||
|
@PostMapping("/importOrgData3")
|
||||||
|
public String importOrgData3() throws Exception {
|
||||||
|
return iDataSyncService.orgDataSync3();
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation("同步组织机构,添加参数")
|
@ApiOperation("同步组织机构,添加参数")
|
||||||
@PostMapping("/updateByOrgs")
|
@PostMapping("/updateByOrgs")
|
||||||
public String updateByOrgs() throws Exception {
|
public String updateByOrgs() throws Exception {
|
||||||
|
|||||||
@@ -8,10 +8,14 @@ public interface IDataSyncService {
|
|||||||
public String dataSync();
|
public String dataSync();
|
||||||
|
|
||||||
public String dataSync2(Long chuo);
|
public String dataSync2(Long chuo);
|
||||||
|
|
||||||
|
public String dataSync3();
|
||||||
// 定时增量同步
|
// 定时增量同步
|
||||||
public String orgDataSync();
|
public String orgDataSync();
|
||||||
// 手动全量同步
|
|
||||||
public String orgDataSync2();
|
public String orgDataSync2();
|
||||||
|
// 全量同步
|
||||||
|
public String orgDataSync3();
|
||||||
|
|
||||||
public String updateByOrgs();
|
public String updateByOrgs();
|
||||||
}
|
}
|
||||||
|
|||||||
+204
@@ -469,6 +469,115 @@ public class DataSyncServiceImpl implements IDataSyncService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 同步人员数据,去掉时间戳 版本
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = {RuntimeException.class,Exception.class})
|
||||||
|
public String dataSync3(){
|
||||||
|
try{
|
||||||
|
SyncUserService syncUserService = new SyncUserService();
|
||||||
|
List<String> res = syncUserService.syncFotonUser3();
|
||||||
|
if(res!=null && !res.isEmpty()){
|
||||||
|
res.forEach(each -> logger.info("同步人员数据:"+each));
|
||||||
|
//存放岗位信息
|
||||||
|
Map<String, String> positionMap = new HashMap<>();
|
||||||
|
TsPosition position = new TsPosition();
|
||||||
|
position.setCurrent(1);
|
||||||
|
position.setPageSize(100000);
|
||||||
|
IPage<TsPosition> iPage = tsPositionService.getPosition(position);
|
||||||
|
List<TsPosition> positions=iPage.getRecords();
|
||||||
|
if (!positions.isEmpty()) {
|
||||||
|
positions.forEach(tsPosition -> {
|
||||||
|
positionMap.put(tsPosition.getName(), tsPosition.getId());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
List<TsUser> addUserList = new ArrayList<>();
|
||||||
|
List<TsUser> upUserList = new ArrayList<>();
|
||||||
|
for (String s : res) {
|
||||||
|
JSONObject userData = JSONObject.parseObject(s);
|
||||||
|
if(userData.containsKey("results")){
|
||||||
|
JSONArray jsonArray = userData.getJSONArray("results");
|
||||||
|
jsonArray.forEach(object -> {
|
||||||
|
JSONObject jsonObject = JSONObject.parseObject(object.toString());
|
||||||
|
String userid = jsonObject.getString("userid");
|
||||||
|
TsUser userEO = tsUserService.getById(userid);
|
||||||
|
String userState = "";
|
||||||
|
if(userEO != null){
|
||||||
|
userState = "UPDATE";
|
||||||
|
}else{
|
||||||
|
userState = "ADD";
|
||||||
|
userEO = new TsUser();
|
||||||
|
}
|
||||||
|
//先获取岗位以及岗位id
|
||||||
|
//设置岗位
|
||||||
|
if (null != jsonObject.getString("title")) {
|
||||||
|
//通过岗位名称查询系统表中是否有岗位,有则设定用户的岗位为系统中的岗位,否则新增
|
||||||
|
if (null == positionMap.get(jsonObject.getString("title"))) {
|
||||||
|
TsPosition tsPosition = new TsPosition();
|
||||||
|
tsPosition.setId(String.valueOf(UUID.randomUUID()));
|
||||||
|
tsPosition.setName(jsonObject.getString("title"));
|
||||||
|
tsPositionService.addPosition(tsPosition);
|
||||||
|
//放入岗位的map集合中
|
||||||
|
positionMap.put(tsPosition.getName(), tsPosition.getId());
|
||||||
|
//放入类中
|
||||||
|
userEO.setPositionName(tsPosition.getName());
|
||||||
|
userEO.setPositionId(tsPosition.getId());
|
||||||
|
} else {
|
||||||
|
userEO.setPositionName(jsonObject.getString("title").trim());
|
||||||
|
userEO.setPositionId(positionMap.get(jsonObject.getString("title").trim()));
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
userEO.setPositionId(null);
|
||||||
|
userEO.setPositionName(null);
|
||||||
|
}
|
||||||
|
//设置其他数据
|
||||||
|
Timestamp createTime = new Timestamp(new Date().getTime());
|
||||||
|
userEO.setState(jsonObject.getString("userStatus"));
|
||||||
|
userEO.setUname(null!=jsonObject.getString("name")?jsonObject.getString("name"):"");
|
||||||
|
userEO.setCreationTime(createTime);
|
||||||
|
userEO.setUserId(jsonObject.getString("userid"));
|
||||||
|
userEO.setAccount(jsonObject.getString("userid"));
|
||||||
|
userEO.setInstitutionId(null!=jsonObject.getString("orgNumber")?jsonObject.getString("orgNumber"):"" );
|
||||||
|
userEO.setInstitutionName(null!=jsonObject.getString("orgName")?jsonObject.getString("orgName"):"" );
|
||||||
|
//2022-05-23:用户同步增加状态标识,将停用的用户过滤掉
|
||||||
|
if("1".equals(jsonObject.getString("userStatus"))){
|
||||||
|
userEO.setValidFlag(ValidFlagEnum.VALID_TRUE.getValue()+"");
|
||||||
|
userEO.setDisableFlag(ValidFlagEnum.VALID_TRUE.getValue()+"");
|
||||||
|
}else{
|
||||||
|
userEO.setValidFlag(ValidFlagEnum.VALID_FALSE.getValue()+"");
|
||||||
|
userEO.setDisableFlag(ValidFlagEnum.VALID_FALSE.getValue()+"");
|
||||||
|
}
|
||||||
|
if("ADD".equals(userState)){
|
||||||
|
addUserList.add(userEO);
|
||||||
|
}else {
|
||||||
|
upUserList.add(userEO);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!addUserList.isEmpty()){
|
||||||
|
logger.debug("本次新增的用户为:"+JSONObject.toJSONString(addUserList));
|
||||||
|
tsUserService.saveBatch(addUserList);
|
||||||
|
}
|
||||||
|
if(!upUserList.isEmpty()){
|
||||||
|
logger.debug("本次更新的用户为:"+JSONObject.toJSONString(upUserList));
|
||||||
|
tsUserService.updateBatchById(upUserList);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
logger.info("本次获取用户的数据为空,原因有2种:1、没有同步数据 2、请求接口报错");
|
||||||
|
}
|
||||||
|
}catch(Exception e){
|
||||||
|
logger.error(e.getMessage(),e);
|
||||||
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
|
}
|
||||||
|
return "1";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 增量同步部门数据
|
// 增量同步部门数据
|
||||||
@Transactional(rollbackFor = {RuntimeException.class,Exception.class})
|
@Transactional(rollbackFor = {RuntimeException.class,Exception.class})
|
||||||
public String orgDataSync(){
|
public String orgDataSync(){
|
||||||
@@ -655,6 +764,101 @@ public class DataSyncServiceImpl implements IDataSyncService {
|
|||||||
return "1";
|
return "1";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 手动全量同步部门信息
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = {RuntimeException.class,Exception.class})
|
||||||
|
public String orgDataSync3(){
|
||||||
|
try{
|
||||||
|
SyncUserService syncUserService = new SyncUserService();
|
||||||
|
List<String> res = syncUserService.syncFotonOrg3();
|
||||||
|
if(res!=null && !res.isEmpty()){
|
||||||
|
res.forEach(each -> logger.info("同步部门数据:"+each));
|
||||||
|
//获取到所有用户数据
|
||||||
|
List<String> strings=new ArrayList<>();
|
||||||
|
//tsInstitutionService.clearData();
|
||||||
|
for (String s : res) {
|
||||||
|
JSONArray jsonArray = JSONArray.parseArray(JSONObject.parseObject(s.toString()).getString("results"));
|
||||||
|
jsonArray.forEach(object -> {
|
||||||
|
JSONObject jsonObject = JSONObject.parseObject(object.toString());
|
||||||
|
strings.add(jsonObject.getString("parentOrgNumber"));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
List<TsInstitution> allTsInstitutionList = tsInstitutionService.list();
|
||||||
|
List<TsInstitution> addTsInstitutionList = new ArrayList<>();
|
||||||
|
List<TsInstitution> updateTsInstitutionList = new ArrayList<>();
|
||||||
|
List<TsInstitution> delTsInstitutionList = new ArrayList<>();
|
||||||
|
Set<String> syncAllIdList = new HashSet<>();
|
||||||
|
for (String s : res) {
|
||||||
|
JSONArray jsonArray = JSONArray.parseArray(JSONObject.parseObject(s.toString()).getString("results"));
|
||||||
|
if(jsonArray!=null){
|
||||||
|
jsonArray.forEach(object -> {
|
||||||
|
JSONObject jsonObject = JSONObject.parseObject(object.toString());
|
||||||
|
TsInstitution tsInstitution=new TsInstitution();
|
||||||
|
tsInstitution.setId(jsonObject.getString("orgNumber"));
|
||||||
|
tsInstitution.setName(jsonObject.getString("orgName"));
|
||||||
|
tsInstitution.setHasChild(strings.contains(jsonObject.getString("orgNumber"))?"1":"0");
|
||||||
|
tsInstitution.setParentId(jsonObject.getString("parentOrgNumber"));
|
||||||
|
//部门为"null"的数据不保存
|
||||||
|
if (!"null".equals(jsonObject.getString("orgName"))){
|
||||||
|
TsInstitution institution = tsInstitutionService.getById(tsInstitution.getId());
|
||||||
|
if(institution!=null){
|
||||||
|
updateTsInstitutionList.add(tsInstitution);
|
||||||
|
}else{
|
||||||
|
addTsInstitutionList.add(tsInstitution);
|
||||||
|
}
|
||||||
|
syncAllIdList.add(tsInstitution.getId());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//遍历出来需要删除的数据
|
||||||
|
for(TsInstitution data :allTsInstitutionList){
|
||||||
|
if(!syncAllIdList.contains(data.getId())){
|
||||||
|
delTsInstitutionList.add(data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//需要新增的数据
|
||||||
|
if(!addTsInstitutionList.isEmpty()){
|
||||||
|
logger.debug("本次新增的组织机构为:"+JSONObject.toJSONString(addTsInstitutionList));
|
||||||
|
tsInstitutionService.saveBatch(addTsInstitutionList);
|
||||||
|
}
|
||||||
|
//需要更新的数据
|
||||||
|
if(!updateTsInstitutionList.isEmpty()){
|
||||||
|
logger.debug("本次更新的组织机构为:"+JSONObject.toJSONString(updateTsInstitutionList));
|
||||||
|
tsInstitutionService.updateBatchById(updateTsInstitutionList);
|
||||||
|
}
|
||||||
|
//需要删除的数据
|
||||||
|
// 先行注释,会删除所有部门
|
||||||
|
if(!delTsInstitutionList.isEmpty()){
|
||||||
|
logger.debug("本次删除的组织机构为:"+JSONObject.toJSONString(delTsInstitutionList));
|
||||||
|
List<String> delIdList = new ArrayList<>();
|
||||||
|
for(TsInstitution data : delTsInstitutionList){
|
||||||
|
delIdList.add(data.getId());
|
||||||
|
}
|
||||||
|
tsInstitutionService.removeByIds(delIdList);
|
||||||
|
}
|
||||||
|
//全部部门
|
||||||
|
List<TsInstitution> allTsInstitutionListForPids = new ArrayList<>(addTsInstitutionList);
|
||||||
|
allTsInstitutionListForPids.addAll(updateTsInstitutionList);
|
||||||
|
for (TsInstitution tsInstitution : allTsInstitutionListForPids){
|
||||||
|
List<String> parentIds = new ArrayList<>();
|
||||||
|
getParentTaxCompanyIds(allTsInstitutionListForPids, tsInstitution.getId(), parentIds);
|
||||||
|
tsInstitution.setParentIds(String.join(",",parentIds));
|
||||||
|
}
|
||||||
|
if (! allTsInstitutionListForPids.isEmpty()) {
|
||||||
|
tsInstitutionService.updateBatchById(allTsInstitutionListForPids);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
logger.info("本次获取组织机构的数据为空,原因有2种:1、没有同步数据 2、请求接口报错");
|
||||||
|
}
|
||||||
|
}catch(Exception e){
|
||||||
|
logger.error(e.getMessage(),e);
|
||||||
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
|
}
|
||||||
|
return "1";
|
||||||
|
}
|
||||||
|
|
||||||
public String updateByOrgs(){
|
public String updateByOrgs(){
|
||||||
QueryWrapper<TsInstitution> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<TsInstitution> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.ne("id","");
|
queryWrapper.ne("id","");
|
||||||
|
|||||||
@@ -70,17 +70,6 @@ public class NewsFeedController extends BaseController<NewsFeed> {
|
|||||||
}
|
}
|
||||||
queryWrapper.orderByDesc("RENEW_TIME");
|
queryWrapper.orderByDesc("RENEW_TIME");
|
||||||
IPage<NewsFeed> newsFeedList = newsFeedService.page(iPage,queryWrapper);
|
IPage<NewsFeed> newsFeedList = newsFeedService.page(iPage,queryWrapper);
|
||||||
// 标准名称或标准编号后三天之内直接显示(new),修改标准名称
|
|
||||||
List<NewsFeed> records = newsFeedList.getRecords();
|
|
||||||
for (NewsFeed record : records) {
|
|
||||||
LocalDate localDate = LocalDate.now().plusDays(-3);
|
|
||||||
Instant instant = localDate.atTime(LocalTime.MIDNIGHT).atZone(ZoneId.systemDefault()).toInstant();
|
|
||||||
Date date = Date.from(instant);
|
|
||||||
if (record.getRenewTime().compareTo(date) >= 0) {
|
|
||||||
record.setStandardName(record.getStandardName() + "(new)");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
newsFeedList.setRecords(records);
|
|
||||||
return Result.success(newsFeedList);
|
return Result.success(newsFeedList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
@@ -238,6 +238,12 @@ public class EsRevisePlanController extends BaseController<EsRevisePlan> {
|
|||||||
return Result.success(iEsRevisePlanService.modPlanByState(esRevisePlan));
|
return Result.success(iEsRevisePlanService.modPlanByState(esRevisePlan));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @ApiOperation(value = "编辑企标计划-企标技术更新计划状态-计算质量评分")
|
||||||
|
// @PostMapping("modPlanByStateAndScore")
|
||||||
|
// public ResponseMessage<Object> modPlanByStateAndScore(EsRevisePlan esRevisePlan){
|
||||||
|
// return Result.success(iEsRevisePlanService.modPlanByStateAndScore(esRevisePlan));
|
||||||
|
// }
|
||||||
|
|
||||||
@ApiOperation(value = "编辑企标计划-流程")
|
@ApiOperation(value = "编辑企标计划-流程")
|
||||||
@PostMapping("modPlanByProcess")
|
@PostMapping("modPlanByProcess")
|
||||||
public ResponseMessage<Object> modPlanByProcess(@RequestBody EsRevisePlan esRevisePlan){
|
public ResponseMessage<Object> modPlanByProcess(@RequestBody EsRevisePlan esRevisePlan){
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ public class EsRevisePlan extends BasePage {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String standNumber;
|
private String standNumber;
|
||||||
@ApiModelProperty(value = "质量评分")
|
@ApiModelProperty(value = "质量评分")
|
||||||
@TableField(exist = false)
|
|
||||||
private Double score;
|
private Double score;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
@@ -37,4 +37,5 @@ public interface IEsRevisePlanService extends IService<EsRevisePlan> {
|
|||||||
|
|
||||||
List<EsRevisePlan> batchToDoTasks(String json);
|
List<EsRevisePlan> batchToDoTasks(String json);
|
||||||
|
|
||||||
|
// String modPlanByStateAndScore(EsRevisePlan esRevisePlan);
|
||||||
}
|
}
|
||||||
|
|||||||
+25
-9
@@ -20,7 +20,9 @@ import com.adc.da.sys.entity.UserEO;
|
|||||||
import com.adc.da.util.UUIDUtils;
|
import com.adc.da.util.UUIDUtils;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
@@ -59,7 +61,6 @@ public class EsRevisePlanServiceImpl extends ServiceImpl<EsRevisePlanDao, EsRevi
|
|||||||
private EsRevisePlanLogDao esRevisePlanLogDao;
|
private EsRevisePlanLogDao esRevisePlanLogDao;
|
||||||
@Autowired
|
@Autowired
|
||||||
private IEsRevisePlanLogService esRevisePlanLogService;
|
private IEsRevisePlanLogService esRevisePlanLogService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private IQualityEvaluationService qualityEvaluationService;
|
private IQualityEvaluationService qualityEvaluationService;
|
||||||
|
|
||||||
@@ -81,14 +82,15 @@ public class EsRevisePlanServiceImpl extends ServiceImpl<EsRevisePlanDao, EsRevi
|
|||||||
esRevisePlan.getPager().setRowCount(count);
|
esRevisePlan.getPager().setRowCount(count);
|
||||||
List<EsRevisePlan> esRevisePlans = esRevisePlanDao.queryAll(esRevisePlan);
|
List<EsRevisePlan> esRevisePlans = esRevisePlanDao.queryAll(esRevisePlan);
|
||||||
// 获取质量评分
|
// 获取质量评分
|
||||||
NumberFormat nf = NumberFormat.getNumberInstance();
|
// NumberFormat nf = NumberFormat.getNumberInstance();
|
||||||
nf.setMaximumFractionDigits(2);
|
// nf.setMaximumFractionDigits(2);
|
||||||
nf.setRoundingMode(RoundingMode.UP);
|
// nf.setRoundingMode(RoundingMode.UP);
|
||||||
for (EsRevisePlan revisePlan : esRevisePlans) {
|
if (esRevisePlan.getScore() == null){
|
||||||
if (StringUtils.isNotBlank(revisePlan.getStandId())) {
|
for (EsRevisePlan revisePlan : esRevisePlans) {
|
||||||
Map<String, Double> scoreMap = qualityEvaluationService.getScore(revisePlan.getStandId());
|
if (StringUtils.isNotBlank(revisePlan.getStandId())) {
|
||||||
String quality = nf.format(scoreMap.get("quality"));
|
Map<String, Double> score = qualityEvaluationService.getScore(revisePlan.getStandId());
|
||||||
revisePlan.setScore(Double.valueOf(quality));
|
revisePlan.setScore(score.get("finalScore"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return esRevisePlans;
|
return esRevisePlans;
|
||||||
@@ -280,4 +282,18 @@ public class EsRevisePlanServiceImpl extends ServiceImpl<EsRevisePlanDao, EsRevi
|
|||||||
}
|
}
|
||||||
return esRevisePlans;
|
return esRevisePlans;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public String modPlanByStateAndScore(EsRevisePlan esRevisePlan) {
|
||||||
|
// if (StringUtils.isBlank(esRevisePlan.getStandId())) {
|
||||||
|
// return "失败";
|
||||||
|
// }
|
||||||
|
// modPlanByState(esRevisePlan);
|
||||||
|
// String score = qualityEvaluationService.getScore(esRevisePlan.getStandId());
|
||||||
|
// LambdaUpdateWrapper<EsRevisePlan> wrapper = new LambdaUpdateWrapper<>();
|
||||||
|
// wrapper.eq(EsRevisePlan::getStandId, esRevisePlan.getStandId());
|
||||||
|
// wrapper.set(EsRevisePlan::getScore, score.get("quality"));
|
||||||
|
// update(wrapper);
|
||||||
|
// return "修改成功";
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-4
@@ -4,11 +4,14 @@ import com.adc.da.slrs.sarBussStandSn.entity.SarBussStandSn;
|
|||||||
import com.adc.da.slrs.sarBussStandSn.dao.SarBussStandSnDao;
|
import com.adc.da.slrs.sarBussStandSn.dao.SarBussStandSnDao;
|
||||||
import com.adc.da.slrs.sarBussStandSn.service.ISarBussStandSnService;
|
import com.adc.da.slrs.sarBussStandSn.service.ISarBussStandSnService;
|
||||||
import com.adc.da.slrs.sarBussionessStand.service.ISarBussionessStandService;
|
import com.adc.da.slrs.sarBussionessStand.service.ISarBussionessStandService;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@@ -25,6 +28,8 @@ import java.util.Date;
|
|||||||
@Service
|
@Service
|
||||||
public class SarBussStandSnServiceImpl extends ServiceImpl<SarBussStandSnDao, SarBussStandSn> implements ISarBussStandSnService {
|
public class SarBussStandSnServiceImpl extends ServiceImpl<SarBussStandSnDao, SarBussStandSn> implements ISarBussStandSnService {
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(SarBussStandSnServiceImpl.class);
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISarBussStandSnService iSarBussStandSnService;
|
private ISarBussStandSnService iSarBussStandSnService;
|
||||||
|
|
||||||
@@ -33,10 +38,12 @@ public class SarBussStandSnServiceImpl extends ServiceImpl<SarBussStandSnDao, Sa
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean verifySnExists(String taskId,String standSn,String standSort){
|
public Boolean verifySnExists(String taskId,String standSn,String standSort){
|
||||||
QueryWrapper<SarBussStandSn> qw = new QueryWrapper();
|
LambdaQueryWrapper<SarBussStandSn> qw = new LambdaQueryWrapper<>();
|
||||||
qw.eq("STAND_SORT",standSort);
|
qw.eq(SarBussStandSn::getStandSort,standSort);
|
||||||
qw.eq("STAND_SN",standSn);
|
qw.eq(SarBussStandSn::getStandSn,standSn);
|
||||||
qw.and(wrapper -> wrapper.ne("TASK_ID",taskId).or().isNull("TASK_ID"));
|
qw.eq(SarBussStandSn::getUseStatus,"yes");
|
||||||
|
qw.eq(SarBussStandSn::getValidFlag,"0");
|
||||||
|
qw.and(wrapper -> wrapper.ne(SarBussStandSn::getTaskId,taskId).or().isNull(SarBussStandSn::getTaskId));
|
||||||
int count = iSarBussStandSnService.count(qw);
|
int count = iSarBussStandSnService.count(qw);
|
||||||
QueryWrapper qw2 = new QueryWrapper();
|
QueryWrapper qw2 = new QueryWrapper();
|
||||||
qw2.eq("STAND_SORT",standSort);
|
qw2.eq("STAND_SORT",standSort);
|
||||||
@@ -59,6 +66,7 @@ public class SarBussStandSnServiceImpl extends ServiceImpl<SarBussStandSnDao, Sa
|
|||||||
updateWrapper.set("USE_STATUS","no");
|
updateWrapper.set("USE_STATUS","no");
|
||||||
updateWrapper.set("TASK_ID",null);
|
updateWrapper.set("TASK_ID",null);
|
||||||
updateWrapper.eq("TASK_ID",taskId);
|
updateWrapper.eq("TASK_ID",taskId);
|
||||||
|
logger.info("任务"+ taskId +",修改顺序号为未使用");
|
||||||
return iSarBussStandSnService.update(updateWrapper);
|
return iSarBussStandSnService.update(updateWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+36
-1
@@ -89,6 +89,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.sql.Clob;
|
import java.sql.Clob;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
@@ -228,6 +229,8 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISarBussStandSnService sarBussStandSnService;
|
private ISarBussStandSnService sarBussStandSnService;
|
||||||
|
@Resource
|
||||||
|
private ISarMenuStandardService sarMenuStandardService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getStandInfoByReviseStatus(String reviseStatus,String standSort,String taskId){
|
public String getStandInfoByReviseStatus(String reviseStatus,String standSort,String taskId){
|
||||||
@@ -1380,6 +1383,14 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
sarBussionessStandEO = newStandList.get(0);
|
sarBussionessStandEO = newStandList.get(0);
|
||||||
|
// 处理标准体系字段
|
||||||
|
Object txlbbuss = sarBussionessStandEO.getAttrInfoMap().get("TXLBBUSS");
|
||||||
|
if (txlbbuss != null && !Objects.equals(txlbbuss.toString(), "")) {
|
||||||
|
// 配置体系类别
|
||||||
|
String txlbBussLevel = getParentNodePathRecursive((String) txlbbuss);
|
||||||
|
sarBussionessStandEO.getAttrInfoCaseMap().put("txlbbuss",txlbBussLevel);
|
||||||
|
sarBussionessStandEO.getAttrInfoMap().put("TXLBBUSS",txlbBussLevel);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 处理 在线编辑pdf存储失败问题 发布稿的在线编辑文件 判断文件表是否有没有则 添加 每次进入 都进行判断
|
// 处理 在线编辑pdf存储失败问题 发布稿的在线编辑文件 判断文件表是否有没有则 添加 每次进入 都进行判断
|
||||||
Object fbgbuss = sarBussionessStandEO.getAttrInfoCaseMap().get("fbgbuss");
|
Object fbgbuss = sarBussionessStandEO.getAttrInfoCaseMap().get("fbgbuss");
|
||||||
@@ -1945,7 +1956,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
if("TXLBBUSS".equals(name)){
|
if("TXLBBUSS".equals(name)){
|
||||||
if(value1 != null){
|
if(value1 != null){
|
||||||
String value = entry.getValue().toString();
|
String value = entry.getValue().toString();
|
||||||
QueryWrapper wrapper = new QueryWrapper();
|
QueryWrapper<SarMenuStandard> wrapper = new QueryWrapper<>();
|
||||||
wrapper.eq("REPLACE(MENU_NAME,' ','')",value.trim());
|
wrapper.eq("REPLACE(MENU_NAME,' ','')",value.trim());
|
||||||
wrapper.like("PARENT_IDS","aaaaaaaaaaaaaaaaaaaaaa");
|
wrapper.like("PARENT_IDS","aaaaaaaaaaaaaaaaaaaaaa");
|
||||||
List<SarMenuStandard> list = iSarMenuStandardService.list(wrapper);
|
List<SarMenuStandard> list = iSarMenuStandardService.list(wrapper);
|
||||||
@@ -5213,4 +5224,28 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
|||||||
}
|
}
|
||||||
return "2";
|
return "2";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询标准体系
|
||||||
|
* @param nodeName 标准体系节点名称
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public String getParentNodePathRecursive(String nodeName) {
|
||||||
|
LambdaQueryWrapper<SarMenuStandard> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(SarMenuStandard::getMenuName, nodeName);
|
||||||
|
SarMenuStandard node = sarMenuStandardService.list(wrapper).get(0); // 根据 txlbBuss 查询节点
|
||||||
|
if (node == null) {
|
||||||
|
return nodeName; // 未找到节点,返回空路径
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(node.getParentId())) {
|
||||||
|
return nodeName;
|
||||||
|
}
|
||||||
|
SarMenuStandard sarMenuStandard = sarMenuStandardService.selectMenuById(node.getParentId());
|
||||||
|
String parentNodePath = getParentNodePathRecursive(sarMenuStandard.getMenuName()); // 递归获取父节点路径
|
||||||
|
if (parentNodePath.isEmpty()) {
|
||||||
|
return nodeName; // 如果父节点路径为空,直接返回当前节点的 txlbBuss
|
||||||
|
} else {
|
||||||
|
return parentNodePath + "/" + nodeName; // 否则,拼接当前节点的 txlbBuss 到父节点路径
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
@@ -37,6 +37,8 @@ public interface QualityEvaluationDao extends BaseMapper<QualityEvaluation> {
|
|||||||
|
|
||||||
List<Integer> selectBZSH(@Param("node") String node,@Param("lawId") String lawId);
|
List<Integer> selectBZSH(@Param("node") String node,@Param("lawId") String lawId);
|
||||||
|
|
||||||
|
List<Integer> selectDTPJ(@Param("lawId") String lawId);
|
||||||
|
|
||||||
void updateByProcessNode(@Param("lawId") String lawId);
|
void updateByProcessNode(@Param("lawId") String lawId);
|
||||||
|
|
||||||
@Select("select * from quality_evaluation")
|
@Select("select * from quality_evaluation")
|
||||||
|
|||||||
+55
-36
@@ -20,6 +20,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.io.PipedReader;
|
import java.io.PipedReader;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
import java.text.NumberFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collector;
|
import java.util.stream.Collector;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -61,6 +64,7 @@ public class QualityEvaluationServiceImpl extends ServiceImpl<QualityEvaluationD
|
|||||||
|
|
||||||
QueryWrapper<QualityEvaluation> qw = new QueryWrapper();
|
QueryWrapper<QualityEvaluation> qw = new QueryWrapper();
|
||||||
qw.eq("law_id",form.getLawId());
|
qw.eq("law_id",form.getLawId());
|
||||||
|
qw.eq("user_id",form.getUserId());
|
||||||
qw.eq("evaluation_type","dynamic");
|
qw.eq("evaluation_type","dynamic");
|
||||||
List<QualityEvaluation> list = this.baseMapper.selectList(qw);
|
List<QualityEvaluation> list = this.baseMapper.selectList(qw);
|
||||||
|
|
||||||
@@ -194,52 +198,58 @@ public class QualityEvaluationServiceImpl extends ServiceImpl<QualityEvaluationD
|
|||||||
Integer countCXJSWYStr = null;
|
Integer countCXJSWYStr = null;
|
||||||
Integer countBZHFSStr = null;
|
Integer countBZHFSStr = null;
|
||||||
Integer countBZSHStr = null;
|
Integer countBZSHStr = null;
|
||||||
if(!list.isEmpty()){
|
Integer countDTPJStr = null;
|
||||||
for (QualityEvaluation qualityEvaluations :list){
|
if (!list.isEmpty()) {
|
||||||
if("征求意见".equals(qualityEvaluations.getProcessNode())) {
|
List<Integer> countZQYJList = qualityEvaluationDao.selectCountZQYJ("征求意见", lawId);
|
||||||
List<Integer> countZQYJList = qualityEvaluationDao.selectCountZQYJ(qualityEvaluations.getProcessNode(), qualityEvaluations.getLawId());
|
if (!countZQYJList.isEmpty()) {
|
||||||
if(!countZQYJList.isEmpty()){
|
countZQYJStr = countZQYJList.size();
|
||||||
countZQYJStr = countZQYJList.size();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if("技术委员会评审、评审意见修改".equals(qualityEvaluations.getProcessNode())) {
|
|
||||||
List<Integer> countJSWYList = qualityEvaluationDao.selectCountJSWY(qualityEvaluations.getProcessNode(), qualityEvaluations.getLawId());
|
|
||||||
if(!countJSWYList.isEmpty()){
|
|
||||||
countJSWYStr = countJSWYList.size();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if("重新技术委员会评审、评审意见修改".equals(qualityEvaluations.getProcessNode())) {
|
|
||||||
List<Integer> countCXJSWYList = qualityEvaluationDao.selectCXJSWY(qualityEvaluations.getProcessNode(), qualityEvaluations.getLawId());
|
|
||||||
if(!countCXJSWYList.isEmpty()){
|
|
||||||
countCXJSWYStr = countCXJSWYList.size();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if("标准化复审".equals(qualityEvaluations.getProcessNode())) {
|
|
||||||
List<Integer> countBZHFSList = qualityEvaluationDao.selectBZHFS(qualityEvaluations.getProcessNode(), qualityEvaluations.getLawId());
|
|
||||||
if(!countBZHFSList.isEmpty()){
|
|
||||||
countBZHFSStr = countBZHFSList.size();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if("标准法规部高级经理审核".equals(qualityEvaluations.getProcessNode())) {
|
|
||||||
List<Integer> countBZSHList = qualityEvaluationDao.selectBZSH(qualityEvaluations.getProcessNode(), qualityEvaluations.getLawId());
|
|
||||||
if(!countBZSHList.isEmpty()){
|
|
||||||
countBZSHStr = countBZSHList.size();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<Integer> countJSWYList = qualityEvaluationDao.selectCountJSWY("技术委员会评审、评审意见修改", lawId);
|
||||||
|
if (!countJSWYList.isEmpty()) {
|
||||||
|
countJSWYStr = countJSWYList.size();
|
||||||
|
}
|
||||||
|
List<Integer> countCXJSWYList = qualityEvaluationDao.selectCXJSWY("重新技术委员会评审、评审意见修改", lawId);
|
||||||
|
if (!countCXJSWYList.isEmpty()) {
|
||||||
|
countCXJSWYStr = countCXJSWYList.size();
|
||||||
|
}
|
||||||
|
List<Integer> countBZHFSList = qualityEvaluationDao.selectBZHFS("标准化复审", lawId);
|
||||||
|
if (!countBZHFSList.isEmpty()) {
|
||||||
|
countBZHFSStr = countBZHFSList.size();
|
||||||
|
}
|
||||||
|
List<Integer> countBZSHList = qualityEvaluationDao.selectBZSH("标准法规部高级经理审核", lawId);
|
||||||
|
if (!countBZSHList.isEmpty()) {
|
||||||
|
countBZSHStr = countBZSHList.size();
|
||||||
|
}
|
||||||
|
List<Integer> countDTPJList = qualityEvaluationDao.selectDTPJ(lawId);
|
||||||
|
if (!countDTPJList.isEmpty()) {
|
||||||
|
countDTPJStr = countDTPJList.size();
|
||||||
|
}
|
||||||
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
final Integer countZQYJ = countZQYJStr;
|
final Integer countZQYJ = countZQYJStr;
|
||||||
final Integer countJSWY = countJSWYStr;
|
final Integer countJSWY = countJSWYStr;
|
||||||
final Integer countCXJSWY = countCXJSWYStr;
|
final Integer countCXJSWY = countCXJSWYStr;
|
||||||
final Integer countBZHFS = countBZHFSStr;
|
final Integer countBZHFS = countBZHFSStr;
|
||||||
final Integer countBZSH = countBZSHStr;
|
final Integer countBZSH = countBZSHStr;
|
||||||
|
final Integer countDTPJ = countDTPJStr;
|
||||||
|
|
||||||
HashMap<String, Double> result = new HashMap<>();
|
HashMap<String, Double> result = new HashMap<>();
|
||||||
result.put("dynamic",0.0);
|
result.put("dynamic",0.0);
|
||||||
result.put("quality",0.0);
|
result.put("quality",0.0);
|
||||||
|
|
||||||
|
|
||||||
|
if (list.size() > 0) {
|
||||||
|
// 如果存在 技术委员会评审、评审意见修改 节点 和 重新技术委员会评审、评审意见修改 节点,则仅计算 重新技术委员会评审、评审意见修改
|
||||||
|
List<QualityEvaluation> collect = list.stream().filter(item -> item.getProcessNode() != null
|
||||||
|
&& "重新技术委员会评审、评审意见修改".equals(item.getProcessNode())).collect(Collectors.toList());
|
||||||
|
if (collect.size()>0) {
|
||||||
|
List<QualityEvaluation> collect1 = list.stream().filter(item -> item.getProcessNode() != null
|
||||||
|
&& "技术委员会评审、评审意见修改".equals(item.getProcessNode())).collect(Collectors.toList());
|
||||||
|
list.removeAll(collect1);
|
||||||
|
}
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 同一节点为多人评价时,需要取多人评价的平均分用以计算最终得分。
|
* 同一节点为多人评价时,需要取多人评价的平均分用以计算最终得分。
|
||||||
* 各环节评分权重分别设置为30%、40%、30%,
|
* 各环节评分权重分别设置为30%、40%、30%,
|
||||||
@@ -249,7 +259,7 @@ public class QualityEvaluationServiceImpl extends ServiceImpl<QualityEvaluationD
|
|||||||
.collect(Collectors.groupingBy(QualityEvaluation::getEvaluationType,
|
.collect(Collectors.groupingBy(QualityEvaluation::getEvaluationType,
|
||||||
Collectors.summingDouble(item ->{
|
Collectors.summingDouble(item ->{
|
||||||
|
|
||||||
Double score;
|
double score;
|
||||||
String value;
|
String value;
|
||||||
if (item.getProcessNode()==null){
|
if (item.getProcessNode()==null){
|
||||||
value="";
|
value="";
|
||||||
@@ -272,12 +282,21 @@ public class QualityEvaluationServiceImpl extends ServiceImpl<QualityEvaluationD
|
|||||||
case "标准法规部高级经理审核":
|
case "标准法规部高级经理审核":
|
||||||
score=Double.valueOf(item.getScore()) / countBZSH * 0.15;
|
score=Double.valueOf(item.getScore()) / countBZSH * 0.15;
|
||||||
break;
|
break;
|
||||||
|
case "动态评价":
|
||||||
default: score=Double.valueOf(item.getScore());
|
score=Double.valueOf(item.getScore()) / (countDTPJ*4);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
score=Double.valueOf(item.getScore());
|
||||||
}
|
}
|
||||||
|
|
||||||
return score;
|
return score;
|
||||||
} ))));
|
} ))));
|
||||||
|
BigDecimal qualityScore = BigDecimal.valueOf(result.get("quality"));
|
||||||
|
BigDecimal dynamicScore = BigDecimal.valueOf(result.get("dynamic"));
|
||||||
|
double finalScore = qualityScore.setScale(2, RoundingMode.HALF_UP).doubleValue() * 0.9 + dynamicScore.setScale(2, RoundingMode.HALF_UP).doubleValue();
|
||||||
|
result.put("dynamic",dynamicScore.setScale(2, RoundingMode.HALF_UP).doubleValue());
|
||||||
|
result.put("quality",qualityScore.setScale(2, RoundingMode.HALF_UP).doubleValue());
|
||||||
|
result.put("finalScore", new BigDecimal(finalScore).setScale(2, RoundingMode.HALF_UP).doubleValue());
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -686,7 +686,7 @@ public class SarFileSplitInfoEOServiceImpl implements SarFileSplitInfoEOService
|
|||||||
if (ObjectUtils.isNotEmpty(smalltext)) {
|
if (ObjectUtils.isNotEmpty(smalltext)) {
|
||||||
switch (subscript) {
|
switch (subscript) {
|
||||||
case BASELINE:
|
case BASELINE:
|
||||||
xwrun.setText(smalltext,0);
|
xwrun.setText(smalltext, 0);
|
||||||
break;
|
break;
|
||||||
case SUBSCRIPT:
|
case SUBSCRIPT:
|
||||||
xwrun.setText("<span class=sub>" + smalltext + "</span>");
|
xwrun.setText("<span class=sub>" + smalltext + "</span>");
|
||||||
|
|||||||
@@ -70,6 +70,7 @@
|
|||||||
<result property="area" column="area"></result>
|
<result property="area" column="area"></result>
|
||||||
<result property="rqbJson" column="rqb_json"></result>
|
<result property="rqbJson" column="rqb_json"></result>
|
||||||
<result property="tsJson" column="ts_json"></result>
|
<result property="tsJson" column="ts_json"></result>
|
||||||
|
<result property="score" column="score" />
|
||||||
<result property="esMatingRelations" column="es_mating_relations"/>
|
<result property="esMatingRelations" column="es_mating_relations"/>
|
||||||
<result property="esStandRelations" column="es_stand_relations"/>
|
<result property="esStandRelations" column="es_stand_relations"/>
|
||||||
<result property="isRelate" column="is_relate"/>
|
<result property="isRelate" column="is_relate"/>
|
||||||
@@ -147,6 +148,7 @@
|
|||||||
es_revise_plan.technologic,
|
es_revise_plan.technologic,
|
||||||
es_revise_plan.buss_sort,
|
es_revise_plan.buss_sort,
|
||||||
es_revise_plan.LXD,
|
es_revise_plan.LXD,
|
||||||
|
es_revise_plan.score,
|
||||||
sar_bussioness_stand.STAND_CODE as rqbName,
|
sar_bussioness_stand.STAND_CODE as rqbName,
|
||||||
sar_bussioness_stand.STAND_SORT as standType,
|
sar_bussioness_stand.STAND_SORT as standType,
|
||||||
(select group_concat(ts_institution.name order by ts_institution.name) from ts_institution where find_in_set(ts_institution.id,unit) ORDER BY find_in_set(ts_institution.id,unit)) as unitName,
|
(select group_concat(ts_institution.name order by ts_institution.name) from ts_institution where find_in_set(ts_institution.id,unit) ORDER BY find_in_set(ts_institution.id,unit)) as unitName,
|
||||||
@@ -219,6 +221,7 @@
|
|||||||
es_revise_plan.technologic,
|
es_revise_plan.technologic,
|
||||||
es_revise_plan.buss_sort,
|
es_revise_plan.buss_sort,
|
||||||
es_revise_plan.LXD,
|
es_revise_plan.LXD,
|
||||||
|
es_revise_plan.score,
|
||||||
sar_bussioness_stand.STAND_CODE as rqbName,
|
sar_bussioness_stand.STAND_CODE as rqbName,
|
||||||
sar_bussioness_stand.STAND_SORT as standType,
|
sar_bussioness_stand.STAND_SORT as standType,
|
||||||
sar_bussioness_stand.stand_number as standNum,
|
sar_bussioness_stand.stand_number as standNum,
|
||||||
@@ -301,6 +304,7 @@
|
|||||||
es_revise_plan.technologic,
|
es_revise_plan.technologic,
|
||||||
es_revise_plan.buss_sort,
|
es_revise_plan.buss_sort,
|
||||||
es_revise_plan.LXD,
|
es_revise_plan.LXD,
|
||||||
|
es_revise_plan.score,
|
||||||
sar_bussioness_stand.STAND_CODE as rqbName,
|
sar_bussioness_stand.STAND_CODE as rqbName,
|
||||||
sar_bussioness_stand.STAND_SORT as standType,
|
sar_bussioness_stand.STAND_SORT as standType,
|
||||||
(select group_concat(ts_institution.name order by ts_institution.name) from ts_institution where find_in_set(ts_institution.id,unit) ORDER BY find_in_set(ts_institution.id,unit)) as unitName,
|
(select group_concat(ts_institution.name order by ts_institution.name) from ts_institution where find_in_set(ts_institution.id,unit) ORDER BY find_in_set(ts_institution.id,unit)) as unitName,
|
||||||
@@ -544,6 +548,7 @@
|
|||||||
es_revise_plan.technologic,
|
es_revise_plan.technologic,
|
||||||
es_revise_plan.buss_sort,
|
es_revise_plan.buss_sort,
|
||||||
es_revise_plan.LXD,
|
es_revise_plan.LXD,
|
||||||
|
es_revise_plan.score,
|
||||||
sar_bussioness_stand.STAND_CODE as rqbName,
|
sar_bussioness_stand.STAND_CODE as rqbName,
|
||||||
sar_bussioness_stand.STAND_SORT as standType,
|
sar_bussioness_stand.STAND_SORT as standType,
|
||||||
(select group_concat(ts_institution.name order by ts_institution.name) from ts_institution where find_in_set(ts_institution.id,unit) ORDER BY find_in_set(ts_institution.id,unit)) as unitName,
|
(select group_concat(ts_institution.name order by ts_institution.name) from ts_institution where find_in_set(ts_institution.id,unit) ORDER BY find_in_set(ts_institution.id,unit)) as unitName,
|
||||||
|
|||||||
+10
@@ -124,4 +124,14 @@
|
|||||||
and process_node = '标准法规部高级经理审核'
|
and process_node = '标准法规部高级经理审核'
|
||||||
group by user_id
|
group by user_id
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectDTPJ" resultType="java.lang.Integer">
|
||||||
|
select
|
||||||
|
count(1)
|
||||||
|
from
|
||||||
|
quality_evaluation
|
||||||
|
where
|
||||||
|
law_id = #{lawId}
|
||||||
|
and process_node = '动态评价'
|
||||||
|
group by user_id;
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -84,10 +84,10 @@ public class SyncUserService {
|
|||||||
// 用户参数
|
// 用户参数
|
||||||
params.put("filter", "(userid=*)");
|
params.put("filter", "(userid=*)");
|
||||||
params.put("basedn", "ou=People,o=foton.com.cn,o=isp");
|
params.put("basedn", "ou=People,o=foton.com.cn,o=isp");
|
||||||
System.out.println("RequestBody:" + params.toString());
|
log.info("RequestBody:" + params.toString());
|
||||||
// 用户测试
|
// 用户测试
|
||||||
String rs = util.getResponseFromServer("http://idmsync.foton.com.cn/rest/users/getUserList", params);
|
String rs = util.getResponseFromServer("http://idmsync.foton.com.cn/rest/users/getUserList", params);
|
||||||
log.debug("远程调用同步的员工数据:"+rs);
|
log.info("远程调用同步的员工数据:"+rs);
|
||||||
JSONObject responseStr = JSON.parseObject(rs);
|
JSONObject responseStr = JSON.parseObject(rs);
|
||||||
if(responseStr.containsKey("status") && responseStr.getBoolean("status")){
|
if(responseStr.containsKey("status") && responseStr.getBoolean("status")){
|
||||||
json.add(rs);
|
json.add(rs);
|
||||||
@@ -114,6 +114,57 @@ public class SyncUserService {
|
|||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 去掉时间戳,其他与syncFotonUser2相同
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public List<String> syncFotonUser3()throws Exception{
|
||||||
|
String appuser = "app_slrs";
|
||||||
|
String appkey = "Fxi5LHbI5yGbQQDpVp86GcCdXeC5Bjfe";
|
||||||
|
AuthUtils util = new AuthUtils(appuser, appkey, null);
|
||||||
|
|
||||||
|
List<String> json=new ArrayList<>();
|
||||||
|
byte[] cookie = null;
|
||||||
|
int index = 1;
|
||||||
|
do {
|
||||||
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
|
params.put("cookie", Base64.encodeBase64String(cookie));
|
||||||
|
// params.put("timestamp", "");
|
||||||
|
|
||||||
|
// 用户参数
|
||||||
|
params.put("filter", "(userid=*)");
|
||||||
|
params.put("basedn", "ou=People,o=foton.com.cn,o=isp");
|
||||||
|
params.forEach((key, value) -> log.info("同步用户数据的请求参数:" + key + " : " + value));
|
||||||
|
// 用户测试
|
||||||
|
String rs = util.getResponseFromServer("http://idmsync.foton.com.cn/rest/users/getUserList", params);
|
||||||
|
log.info("第{}次调用,远程调用同步的员工数据:{}",index,rs);
|
||||||
|
JSONObject responseStr = JSON.parseObject(rs);
|
||||||
|
if(responseStr.containsKey("status") && responseStr.getBoolean("status")){
|
||||||
|
json.add(rs);
|
||||||
|
}
|
||||||
|
if (responseStr.containsKey("cookie")) {
|
||||||
|
try {
|
||||||
|
JSONArray entries = responseStr.getJSONArray("cookie");
|
||||||
|
if(entries==null){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
cookie = new byte[entries.size()];
|
||||||
|
for (int i = 0; i < entries.size(); i++) {
|
||||||
|
cookie[i] = (byte) entries.getByte(i);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage(),e);
|
||||||
|
if (e.getMessage().contains("is not a JSONArray")) {
|
||||||
|
cookie = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
index++;
|
||||||
|
} while (cookie != null);
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public List<String> syncFotonOrg()throws Exception{
|
public List<String> syncFotonOrg()throws Exception{
|
||||||
@@ -128,9 +179,10 @@ public class SyncUserService {
|
|||||||
Map<String, Object> params = new HashMap<String, Object>();
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
params.put("cookie", Base64.encodeBase64String(cookie));
|
params.put("cookie", Base64.encodeBase64String(cookie));
|
||||||
// params.put("timestamp", System.currentTimeMillis());
|
// params.put("timestamp", System.currentTimeMillis());
|
||||||
Calendar calendar = Calendar.getInstance();
|
// Calendar calendar = Calendar.getInstance();
|
||||||
String timestamp = sdf.format(calendar.getTime());
|
// String timestamp = sdf.format(calendar.getTime());
|
||||||
params.put("timestamp", timestamp);
|
// params.put("timestamp", timestamp);
|
||||||
|
params.put("timestamp",null);
|
||||||
// 组织参数
|
// 组织参数
|
||||||
params.put("filter", "(orgNumber=*)");
|
params.put("filter", "(orgNumber=*)");
|
||||||
params.put("basedn", "ou=Organizations,o=foton.com.cn,o=isp");
|
params.put("basedn", "ou=Organizations,o=foton.com.cn,o=isp");
|
||||||
@@ -204,4 +256,50 @@ public class SyncUserService {
|
|||||||
} while (cookie != null);
|
} while (cookie != null);
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 不添加时间戳,全量同步部门信息
|
||||||
|
public List<String> syncFotonOrg3()throws Exception{
|
||||||
|
String appuser = "app_slrs";
|
||||||
|
String appkey = "Fxi5LHbI5yGbQQDpVp86GcCdXeC5Bjfe";
|
||||||
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss'Z'");
|
||||||
|
AuthUtils util = new AuthUtils(appuser, appkey, null);
|
||||||
|
|
||||||
|
byte[] cookie = null;
|
||||||
|
List<String> json=new ArrayList<>();
|
||||||
|
int index=1;
|
||||||
|
do {
|
||||||
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
|
params.put("cookie", Base64.encodeBase64String(cookie));
|
||||||
|
// params.put("timestamp","");
|
||||||
|
// 组织参数
|
||||||
|
params.put("filter", "(orgNumber=*)");
|
||||||
|
params.put("basedn", "ou=Organizations,o=foton.com.cn,o=isp");
|
||||||
|
// 组织测试
|
||||||
|
String rs = util.getResponseFromServer("http://idmsync.foton.com.cn/rest/orgs/getOrgList", params);
|
||||||
|
log.info("第{}次调用:远程调用同步的部门数据:{}",index,rs);
|
||||||
|
JSONObject responseStr = JSONObject.parseObject(rs);
|
||||||
|
if(responseStr.containsKey("status") && responseStr.getBoolean("status")){
|
||||||
|
json.add(rs);
|
||||||
|
}
|
||||||
|
if (responseStr.containsKey("cookie")) {
|
||||||
|
try {
|
||||||
|
JSONArray entries = responseStr.getJSONArray("cookie");
|
||||||
|
if(entries==null){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
cookie = new byte[entries.size()];
|
||||||
|
for (int i = 0; i < entries.size(); i++) {
|
||||||
|
cookie[i] = (byte) entries.getByte(i);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage(),e);
|
||||||
|
if (e.getMessage().contains("is not a JSONArray")) {
|
||||||
|
cookie = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
index++;
|
||||||
|
} while (cookie != null);
|
||||||
|
return json;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,8 +39,11 @@ public class AuthUtils {
|
|||||||
public String getResponseFromServer(String url, Map<String, Object> params) throws Exception {
|
public String getResponseFromServer(String url, Map<String, Object> params) throws Exception {
|
||||||
HttpPost httpPost = new HttpPost(url);
|
HttpPost httpPost = new HttpPost(url);
|
||||||
createSignHeader(httpPost, params);
|
createSignHeader(httpPost, params);
|
||||||
|
Header[] allHeaders = httpPost.getAllHeaders();
|
||||||
|
for (Header header : allHeaders) {
|
||||||
|
logger.info("请求头:" + header.getName() + ":" + header.getValue());
|
||||||
|
}
|
||||||
JSONObject object = JSONObject.fromObject(params);
|
JSONObject object = JSONObject.fromObject(params);
|
||||||
params.forEach((key,value) -> logger.info("请求参数:{}:{}",key,value));
|
|
||||||
httpPost.setEntity(new ByteArrayEntity(object.toString().getBytes(), ContentType.APPLICATION_JSON));
|
httpPost.setEntity(new ByteArrayEntity(object.toString().getBytes(), ContentType.APPLICATION_JSON));
|
||||||
return execute(httpPost);
|
return execute(httpPost);
|
||||||
}
|
}
|
||||||
@@ -52,7 +55,7 @@ public class AuthUtils {
|
|||||||
client = HttpClientBuilder.create().build();
|
client = HttpClientBuilder.create().build();
|
||||||
logger.info("请求地址:"+request.getURI().toString());
|
logger.info("请求地址:"+request.getURI().toString());
|
||||||
for (Header header : request.getAllHeaders()) {
|
for (Header header : request.getAllHeaders()) {
|
||||||
logger.info("请求头:"+header.toString());
|
logger.info("请求头:"+header.getName() + ":" + header.getValue());
|
||||||
}
|
}
|
||||||
resp = client.execute(request);
|
resp = client.execute(request);
|
||||||
return EntityUtils.toString(resp.getEntity());
|
return EntityUtils.toString(resp.getEntity());
|
||||||
|
|||||||
+1
-1
@@ -110,7 +110,7 @@ public class SarMenuStandardServiceImpl extends ServiceImpl<SarMenuStandardDao,
|
|||||||
@Override
|
@Override
|
||||||
public List<SarMenuStandard> getAll(String dicId) {
|
public List<SarMenuStandard> getAll(String dicId) {
|
||||||
QueryWrapper sarMenuQueryWrapper=new QueryWrapper<>();
|
QueryWrapper sarMenuQueryWrapper=new QueryWrapper<>();
|
||||||
sarMenuQueryWrapper.eq("VALID_FLAG",0);
|
//sarMenuQueryWrapper.eq("VALID_FLAG",0);
|
||||||
sarMenuQueryWrapper.eq("DIC_ID",dicId);
|
sarMenuQueryWrapper.eq("DIC_ID",dicId);
|
||||||
sarMenuQueryWrapper.orderByAsc("DISPLAY_SEQ");
|
sarMenuQueryWrapper.orderByAsc("DISPLAY_SEQ");
|
||||||
// sarMenuQueryWrapper.isNull("PARENT_ID");
|
// sarMenuQueryWrapper.isNull("PARENT_ID");
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.adc.da.sys.sarResource.dao;
|
||||||
|
|
||||||
|
import com.adc.da.sys.sarResource.entity.SysTsResource;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author zyl
|
||||||
|
* @since 2021-06-30
|
||||||
|
*/
|
||||||
|
@Repository
|
||||||
|
public interface SysTsResourceDao extends BaseMapper<SysTsResource> {
|
||||||
|
|
||||||
|
List<SysTsResource> queryMenuByDis(SysTsResource sarMenuEO);
|
||||||
|
|
||||||
|
List<SysTsResource> selectMenuByRole(SysTsResource sarMenuEO);
|
||||||
|
|
||||||
|
int insertTsRoleResource(HashMap<String,Object> map);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
package com.adc.da.sys.sarResource.entity;
|
||||||
|
|
||||||
|
import com.adc.da.base.entity.BaseEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
*
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author zyl
|
||||||
|
* @since 2021-06-30
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@ApiModel(value="TsResource对象", description="")
|
||||||
|
@TableName("ts_resource")
|
||||||
|
public class SysTsResource extends BaseEntity {
|
||||||
|
public interface update{
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "主键")
|
||||||
|
@TableId(value = "ID",type = IdType.UUID)
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "标准法规划分")
|
||||||
|
@TableField("SOR_DIVIDE")
|
||||||
|
private String sorDivide;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "目录名称")
|
||||||
|
@TableField("MENU_NAME")
|
||||||
|
private String menuName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "父级ID")
|
||||||
|
@TableField("PARENT_ID")
|
||||||
|
private String parentId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "父级ID")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String middleParentId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "父级ID集合")
|
||||||
|
@TableField("PARENT_IDS")
|
||||||
|
private String parentIds;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序序号")
|
||||||
|
@TableField("DISPLAY_SEQ")
|
||||||
|
private Integer displaySeq;
|
||||||
|
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否有效")
|
||||||
|
@TableField("VALID_FLAG")
|
||||||
|
private Integer validFlag;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
@TableField("CREATION_TIME")
|
||||||
|
private Date creationTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
@TableField("MODIFY_TIME")
|
||||||
|
private Date modifyTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
@TableField("REMARKS")
|
||||||
|
private String remarks;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "子菜单")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<SysTsResource> children;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "上级菜单名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String parentIdsName;
|
||||||
|
|
||||||
|
@TableField(exist=false)
|
||||||
|
private List<String> roleIds;
|
||||||
|
|
||||||
|
@TableField(exist=false)
|
||||||
|
private List<String> childMenuIds;
|
||||||
|
|
||||||
|
@TableField(exist=false)
|
||||||
|
private String userId;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String isFlow;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "树结构数据 区分 类型: 标准数据 tsr 技术系列 sarMs")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String treeType;
|
||||||
|
|
||||||
|
}
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
package com.adc.da.sys.sarResource.service;
|
||||||
|
|
||||||
|
import com.adc.da.sys.sarResource.entity.SysTsResource;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author zyl
|
||||||
|
* @since 2021-06-30
|
||||||
|
*/
|
||||||
|
public interface ISysTsResourceService extends IService<SysTsResource> {
|
||||||
|
|
||||||
|
}
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
package com.adc.da.sys.sarResource.service.impl;
|
||||||
|
|
||||||
|
import com.adc.da.sys.sarResource.dao.SysTsResourceDao;
|
||||||
|
import com.adc.da.sys.sarResource.entity.SysTsResource;
|
||||||
|
import com.adc.da.sys.sarResource.service.ISysTsResourceService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author zyl
|
||||||
|
* @since 2021-06-30
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SysTsResourceServiceImpl extends ServiceImpl<SysTsResourceDao, SysTsResource> implements ISysTsResourceService {
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user