Merge branch 'develop_migration' into 'develop_master'

Develop migration

See merge request LiuChao/foton-slrs-system-rest!211
This commit is contained in:
super_liu
2021-10-30 00:56:26 +08:00
54 changed files with 4116 additions and 254 deletions
@@ -242,6 +242,29 @@ public class SeniorSearchInfoEO extends BasePage {
private String queryStatus; private String queryStatus;
private String lawsType;
private String lawsNumber;
private String lawsName;
private String lawsEnName;
private String lawsNo;
private String issueCompany;
private String commentCycleDate;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
private Date commentCycleStart;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
private Date commentCycleEnd;
private String lawsTextState;
private String lawsSyqy;
private String lawsSycx;
private String lawsYear;
private String lawsNotisyncNum;
private String lawsBulletin;
private String lawsLabel;
private String lawsRemark;
} }
@@ -536,205 +536,112 @@ public class SearchCenterServiceImpl implements SearchCenterService {
//检索国内外政策数据 //检索国内外政策数据
public BoolQueryBuilder queryLawsMsg(SeniorSearchInfoEO searchInfoEO, BoolQueryBuilder boolQueryBuilder, SearchRequestBuilder searchRequestBuilder) throws Exception{ public BoolQueryBuilder queryLawsMsg(SeniorSearchInfoEO searchInfoEO, BoolQueryBuilder boolQueryBuilder, SearchRequestBuilder searchRequestBuilder) throws Exception{
String numbershowStr = "numbershow";
String nameshowStr = "nameshow"; if (StringUtils.isNotBlank(searchInfoEO.getLawsType())) {
String replacedStandNumStr = "replaced_stand_num"; boolQueryBuilder.must(QueryBuilders.wildcardQuery("lawsType.keyword", "*"+searchInfoEO.getLawsType()+"*"));
String replaceStandNumStr = "replace_stand_num";
//国家,国内外标准,国内外法规有此属性
if (StringUtils.isNotBlank(searchInfoEO.getCountry())) {
// 如果等于All,相当于不限制,查询全部
if (!searchInfoEO.getCountry().equals("all") && !searchInfoEO.getCountry().equals("[]")) {
// String[] arrlist = searchInfoEO.getCountry().split(",");
// boolQueryBuilder.must(QueryBuilders.termsQuery("country.keyword", arrlist));
boolQueryBuilder.must(QueryBuilders.matchQuery("country", searchInfoEO.getCountry()));
}
} }
//标准性质,国内外标准,法规有此属性 if (StringUtils.isNotBlank(searchInfoEO.getLawsNumber())) {
if (StringUtils.isNotBlank(searchInfoEO.getNature())) { boolQueryBuilder.must(QueryBuilders.wildcardQuery("lawsNumber.keyword", "*"+searchInfoEO.getLawsNumber()+"*"));
// 如果等于All,相当于不限制,查询全部
if (!searchInfoEO.getNature().equals("all") && !searchInfoEO.getNature().equals("[]")) {
String[] arrlist = searchInfoEO.getNature().split(",");
boolQueryBuilder.must(QueryBuilders.termsQuery("nature.keyword", arrlist));
}
} }
if (StringUtils.isNotBlank(searchInfoEO.getSYCLLX())) { if (StringUtils.isNotBlank(searchInfoEO.getLawsName())) {
// 如果等于All,相当于不限制,查询全部 boolQueryBuilder.must(QueryBuilders.wildcardQuery("lawsName.keyword", "*"+searchInfoEO.getLawsName()+"*"));
if (!searchInfoEO.getSYCLLX().equals("all") && !searchInfoEO.getSYCLLX().equals("[]") ) {
String[] arrlist = searchInfoEO.getSYCLLX().split(",");
boolQueryBuilder.must(QueryBuilders.termsQuery("SYCLLX.keyword", arrlist));
}
} }
if (StringUtils.isNotBlank(searchInfoEO.getWSSFCY())) { if (StringUtils.isNotBlank(searchInfoEO.getLawsEnName())) {
// 如果等于All,相当于不限制,查询全部 boolQueryBuilder.must(QueryBuilders.wildcardQuery("lawsEnName.keyword", "*"+searchInfoEO.getLawsEnName()+"*"));
if (!searchInfoEO.getWSSFCY().equals("all") && !searchInfoEO.getWSSFCY().equals("[]") ) {
String[] arrlist = searchInfoEO.getWSSFCY().split(",");
boolQueryBuilder.must(QueryBuilders.termsQuery("WSSFCY.keyword", arrlist));
}
} }
if (StringUtils.isNotBlank(searchInfoEO.getCBCD())) { if (StringUtils.isNotBlank(searchInfoEO.getLawsNo())) {
// 如果等于All,相当于不限制,查询全部 boolQueryBuilder.must(QueryBuilders.wildcardQuery("lawsNo.keyword", "*"+searchInfoEO.getLawsNo()+"*"));
if (!searchInfoEO.getCBCD().equals("all") && !searchInfoEO.getCBCD().equals("[]") ) {
String[] arrlist = searchInfoEO.getCBCD().split(",");
boolQueryBuilder.must(QueryBuilders.termsQuery("CBCD.keyword", arrlist));
}
} }
if (StringUtils.isNotBlank(searchInfoEO.getZRLX())) {
// 如果等于All,相当于不限制,查询全部
if (!searchInfoEO.getZRLX().equals("all") && !searchInfoEO.getZRLX().equals("[]") ) {
String[] arrlist = searchInfoEO.getZRLX().split(",");
boolQueryBuilder.must(QueryBuilders.termsQuery("ZRLX.keyword", arrlist));
}
}
//编号,国内外标准,国内外法规,企业标准 有此属性
if (StringUtils.isNotBlank(searchInfoEO.getNumberShow())) {
boolQueryBuilder.must(QueryBuilders.wildcardQuery(numbershowStr, "*"+searchInfoEO.getNumberShow()+"*"));
}
//名称,国内外标准,国内外法规,企业标准 有此属性
if (StringUtils.isNotBlank(searchInfoEO.getNameShow())) {
boolQueryBuilder.must(QueryBuilders.wildcardQuery(nameshowStr, "*"+searchInfoEO.getNameShow()+"*"));
}
//发布部门
if (StringUtils.isNotBlank(searchInfoEO.getIssueUnit())) {
boolQueryBuilder.must(QueryBuilders.matchQuery("issueUnit", searchInfoEO.getIssueUnit()));
}
//文件状态,国内外标准,国内外法规,企业标准 有此属性
if (StringUtils.isNotBlank(searchInfoEO.getStandState())) {
// 如果等于All,相当于不限制,查询全部
if (!searchInfoEO.getStandState().equals("all") && !searchInfoEO.getStandState().equals("[]")) {
String[] arrlist = searchInfoEO.getStandState().split(",");
boolQueryBuilder.must(QueryBuilders.termsQuery("statecode.keyword", arrlist));
//boolQueryBuilder.must(QueryBuilders.matchQuery("statecode", searchInfoEO.getStandState()));
}
}
//代替文件号
if (StringUtils.isNotBlank(searchInfoEO.getReplaceStandNum())) {
boolQueryBuilder.must(QueryBuilders.matchQuery("replace_laws_num", searchInfoEO.getReplaceStandNum()));
}
//适用车型,国内外标准,国内外法规,企业标准 有此属性 录入可多选
if (StringUtils.isNotBlank(searchInfoEO.getApplyArctic())) {
// 如果等于All,相当于不限制,查询全部
if (!searchInfoEO.getApplyArctic().equals("all") && !searchInfoEO.getApplyArctic().equals("[]")) {
boolQueryBuilder.must(QueryBuilders.matchQuery("apply_arctic", searchInfoEO.getApplyArctic()));
}
}
//能源种类,国内外标准,国内外法规,企业标准 有此属性 录入可多选
if (StringUtils.isNotBlank(searchInfoEO.getEnergyKind())) {
// 如果等于All,相当于不限制,查询全部
if (!searchInfoEO.getEnergyKind().equals("all") && !searchInfoEO.getEnergyKind().equals("[]") ) {
boolQueryBuilder.must(QueryBuilders.matchQuery("energy_kind", searchInfoEO.getEnergyKind()));
}
}
//适用认证,国内外标准,国内外法规 有此属性 录入可多选
if (StringUtils.isNotBlank(searchInfoEO.getApplyAuth())) {
// 如果等于All,相当于不限制,查询全部
if (!searchInfoEO.getApplyAuth().equals("all") && !searchInfoEO.getApplyAuth().equals("[]")) {
boolQueryBuilder.must(QueryBuilders.matchQuery("apply_auth", searchInfoEO.getApplyAuth()));
}
}
//责任部门
if (StringUtils.isNotBlank(searchInfoEO.getResponsibleUnit())) {
boolQueryBuilder.must(QueryBuilders.matchQuery("responsibleUnit", searchInfoEO.getResponsibleUnit()));
}
//发布日期
if (searchInfoEO.getIssueTime() != null) { if (searchInfoEO.getIssueTime() != null) {
Long starttime = searchInfoEO.getIssueTime().getTime(); Long starttime = searchInfoEO.getIssueTime().getTime();
Long endtime = searchInfoEO.getIssueTime().getTime(); Long endtime = searchInfoEO.getIssueTime().getTime();
RangeQueryBuilder rangeQueryBuilder = QueryBuilders.rangeQuery(ISSUE_TIME).format(EPOCH_MILLIS).from(starttime).to(endtime).includeLower(true).includeUpper(true); RangeQueryBuilder rangeQueryBuilder = QueryBuilders.rangeQuery(ISSUE_TIME).format(EPOCH_MILLIS).from(starttime).to(endtime).includeLower(true).includeUpper(true);
boolQueryBuilder.filter(rangeQueryBuilder); boolQueryBuilder.filter(rangeQueryBuilder);
} }
//实施日期,国内外标准,国内外法规,企业标准 有此属性 if (StringUtils.isNotBlank(searchInfoEO.getIssueCompany())) {
if (searchInfoEO.getPutTime() != null) { boolQueryBuilder.must(QueryBuilders.wildcardQuery("issueCompany.keyword", "*"+searchInfoEO.getIssueCompany()+"*"));
Long starttime = searchInfoEO.getPutTime().getTime(); }
Long endtime = searchInfoEO.getPutTime().getTime(); if (searchInfoEO.getIssueTime() != null) {
RangeQueryBuilder rangeQueryBuilder = QueryBuilders.rangeQuery("put_time").format(EPOCH_MILLIS).from(starttime).to(endtime).includeLower(true).includeUpper(true); Long startTime = searchInfoEO.getIssueTime().getTime();
Long endTime = searchInfoEO.getIssueTime().getTime();
RangeQueryBuilder rangeQueryBuilder = QueryBuilders.rangeQuery(ISSUE_TIME).format(EPOCH_MILLIS).from(startTime).to(endTime).includeLower(true).includeUpper(true);
boolQueryBuilder.filter(rangeQueryBuilder); boolQueryBuilder.filter(rangeQueryBuilder);
} }
//内容摘要 if (searchInfoEO.getCommentCycleStart() != null) {
if (StringUtils.isNotBlank(searchInfoEO.getSynopsis())) { Long startTime = searchInfoEO.getCommentCycleStart().getTime();
boolQueryBuilder.must(QueryBuilders.matchQuery("synopsis", searchInfoEO.getSynopsis())); Long endTime = searchInfoEO.getCommentCycleStart().getTime();
} RangeQueryBuilder rangeQueryBuilder = QueryBuilders.rangeQuery("commentCycleStart_data").format(EPOCH_MILLIS).from(startTime).to(endTime).includeLower(true).includeUpper(true);
//标准英文名称
if (StringUtils.isNotBlank(searchInfoEO.getStandEnName())) {
boolQueryBuilder.must(QueryBuilders.matchQuery("standEnName", searchInfoEO.getStandEnName()));
}
//新定型车实施日期
if (searchInfoEO.getNewcarPutTime() != null) {
Long starttime = searchInfoEO.getNewcarPutTime().getTime();
Long endtime = searchInfoEO.getNewcarPutTime().getTime();
RangeQueryBuilder rangeQueryBuilder = QueryBuilders.rangeQuery("newcarPutTime").format(EPOCH_MILLIS).from(starttime).to(endtime).includeLower(true).includeUpper(true);
boolQueryBuilder.filter(rangeQueryBuilder); boolQueryBuilder.filter(rangeQueryBuilder);
} }
//在产车实施日期 if (searchInfoEO.getCommentCycleEnd() != null) {
if (searchInfoEO.getProductPutTime() != null) { Long startTime = searchInfoEO.getCommentCycleEnd().getTime();
Long starttime = searchInfoEO.getProductPutTime().getTime(); Long endTime = searchInfoEO.getCommentCycleEnd().getTime();
Long endtime = searchInfoEO.getProductPutTime().getTime(); RangeQueryBuilder rangeQueryBuilder = QueryBuilders.rangeQuery("commentCycleEnd_data").format(EPOCH_MILLIS).from(startTime).to(endTime).includeLower(true).includeUpper(true);
RangeQueryBuilder rangeQueryBuilder = QueryBuilders.rangeQuery("productPutTime").format(EPOCH_MILLIS).from(starttime).to(endtime).includeLower(true).includeUpper(true);
boolQueryBuilder.filter(rangeQueryBuilder); boolQueryBuilder.filter(rangeQueryBuilder);
} }
//新生产车实施日期
if (searchInfoEO.getNewproductPutTime() != null) { if (StringUtils.isNotBlank(searchInfoEO.getLawsTextState())) {
Long starttime = searchInfoEO.getNewproductPutTime().getTime(); List<String> list = Arrays.asList(searchInfoEO.getLawsTextState().split(",")).stream().map(s -> (s.trim())).collect(Collectors.toList());
Long endtime = searchInfoEO.getNewproductPutTime().getTime(); if(list.size() > 1){
RangeQueryBuilder rangeQueryBuilder = QueryBuilders.rangeQuery("newproductPutTime").format(EPOCH_MILLIS).from(starttime).to(endtime).includeLower(true).includeUpper(true); BoolQueryBuilder boolQueryBuilderShould = new BoolQueryBuilder();
boolQueryBuilder.filter(rangeQueryBuilder); list.forEach(s -> {
} boolQueryBuilderShould.should(QueryBuilders.wildcardQuery("lawsTextState.keyword", "*"+s+"*"));
//新生产车实施日期 });
if (searchInfoEO.getRegisterPutTime() != null) { boolQueryBuilder.must(boolQueryBuilderShould);
Long starttime = searchInfoEO.getRegisterPutTime().getTime(); }else {
Long endtime = searchInfoEO.getRegisterPutTime().getTime(); boolQueryBuilder.must(QueryBuilders.wildcardQuery("lawsTextState.keyword", "*"+searchInfoEO.getLawsTextState()+"*"));
RangeQueryBuilder rangeQueryBuilder = QueryBuilders.rangeQuery("registerPutTime").format(EPOCH_MILLIS).from(starttime).to(endtime).includeLower(true).includeUpper(true);
boolQueryBuilder.filter(rangeQueryBuilder);
}
//被代替标准号
if (StringUtils.isNotBlank(searchInfoEO.getReplacedStandNum())) {
boolQueryBuilder.must(QueryBuilders.matchQuery(replacedStandNumStr, searchInfoEO.getReplacedStandNum()));
}
//关键词
if (StringUtils.isNotBlank(searchInfoEO.getTags())) {
boolQueryBuilder.must(QueryBuilders.matchQuery("standTag", searchInfoEO.getTags()));
}
//所属类别,国内外标准, 有此属性
if (StringUtils.isNotBlank(searchInfoEO.getCategory())) {
// 如果等于All,相当于不限制,查询全部
if (!searchInfoEO.getCategory().equals("all") && !searchInfoEO.getCategory().equals("[]")) {
boolQueryBuilder.must(QueryBuilders.matchQuery("category", searchInfoEO.getCategory()));
} }
} }
//发布时间范围 if (StringUtils.isNotBlank(searchInfoEO.getLawsSyqy())) {
if (searchInfoEO.getIssueTimeSt() != null || searchInfoEO.getIssueTimeEd() != null) { List<String> list = Arrays.asList(searchInfoEO.getLawsSyqy().split(",")).stream().map(s -> (s.trim())).collect(Collectors.toList());
Long starttime = 0L; if(list.size() > 1){
Long endtime = 0L; BoolQueryBuilder boolQueryBuilderShould = new BoolQueryBuilder();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); list.forEach(s -> {
if (searchInfoEO.getIssueTimeSt() != null) { boolQueryBuilderShould.should(QueryBuilders.wildcardQuery("lawsSyqy.keyword", "*"+s+"*"));
starttime = searchInfoEO.getIssueTimeSt().getTime(); });
} else { boolQueryBuilder.must(boolQueryBuilderShould);
starttime = sdf.parse("1970-01-01 00:00:00").getTime(); }else {
boolQueryBuilder.must(QueryBuilders.wildcardQuery("lawsSyqy.keyword", "*"+searchInfoEO.getLawsSyqy()+"*"));
} }
if (searchInfoEO.getIssueTimeEd() != null) {
endtime = searchInfoEO.getIssueTimeEd().getTime();
} else {
endtime = sdf.parse("2999-01-01 00:00:00").getTime();
}
RangeQueryBuilder rangeQueryBuilder = QueryBuilders.rangeQuery(ISSUE_TIME).format(EPOCH_MILLIS).from(starttime).to(endtime).includeLower(true).includeUpper(true);
boolQueryBuilder.filter(rangeQueryBuilder);
} }
if (searchInfoEO.getPutTimeSt() != null || searchInfoEO.getPutTimeEd() != null) { if (StringUtils.isNotBlank(searchInfoEO.getLawsSycx())) {
Long starttime = 0L; List<String> list = Arrays.asList(searchInfoEO.getLawsSycx().split(",")).stream().map(s -> (s.trim())).collect(Collectors.toList());
Long endtime = 0L; if(list.size() > 1){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); BoolQueryBuilder boolQueryBuilderShould = new BoolQueryBuilder();
if (searchInfoEO.getPutTimeSt() != null) { list.forEach(s -> {
starttime = searchInfoEO.getPutTimeSt().getTime(); boolQueryBuilderShould.should(QueryBuilders.wildcardQuery("lawsSycx.keyword", "*"+s+"*"));
} else { });
starttime = sdf.parse("1970-01-01 00:00:00").getTime(); boolQueryBuilder.must(boolQueryBuilderShould);
}else {
boolQueryBuilder.must(QueryBuilders.wildcardQuery("lawsSycx.keyword", "*"+searchInfoEO.getLawsSycx()+"*"));
} }
if (searchInfoEO.getPutTimeEd() != null) {
endtime = searchInfoEO.getPutTimeEd().getTime();
} else {
endtime = sdf.parse("2999-01-01 00:00:00").getTime();
}
RangeQueryBuilder rangeQueryBuilder = QueryBuilders.rangeQuery(PUT_TIME).format(EPOCH_MILLIS).from(starttime).to(endtime).includeLower(true).includeUpper(true);
boolQueryBuilder.filter(rangeQueryBuilder);
} }
if (StringUtils.isNotBlank(searchInfoEO.getIsRelateAccess())) {
boolQueryBuilder.must(QueryBuilders.wildcardQuery("isRelateAccess.keyword", "*"+searchInfoEO.getIsRelateAccess()+"*"));
}
if (StringUtils.isNotBlank(searchInfoEO.getLawsYear())) {
boolQueryBuilder.must(QueryBuilders.wildcardQuery("lawsYear.keyword", "*"+searchInfoEO.getLawsYear()+"*"));
}
if (StringUtils.isNotBlank(searchInfoEO.getLawsNotisyncNum())) {
boolQueryBuilder.must(QueryBuilders.wildcardQuery("lawsNotisyncNum.keyword", "*"+searchInfoEO.getLawsNotisyncNum()+"*"));
}
if (StringUtils.isNotBlank(searchInfoEO.getLawsBulletin())) {
boolQueryBuilder.must(QueryBuilders.wildcardQuery("lawsBulletin.keyword", "*"+searchInfoEO.getLawsBulletin()+"*"));
}
if (StringUtils.isNotBlank(searchInfoEO.getLawsLabel())) {
boolQueryBuilder.must(QueryBuilders.wildcardQuery("lawsLabel.keyword", "*"+searchInfoEO.getLawsLabel()+"*"));
}
if (StringUtils.isNotBlank(searchInfoEO.getLawsRemark())) {
boolQueryBuilder.must(QueryBuilders.wildcardQuery("lawsRemark.keyword", "*"+searchInfoEO.getLawsRemark()+"*"));
}
querySeniorMsg(searchInfoEO,boolQueryBuilder); querySeniorMsg(searchInfoEO,boolQueryBuilder);
return boolQueryBuilder; return boolQueryBuilder;
} }
@@ -801,8 +708,8 @@ public class SearchCenterServiceImpl implements SearchCenterService {
List<String> fieldNameList = new ArrayList<>(); List<String> fieldNameList = new ArrayList<>();
String[] standStr = {"content","standSort","standNumber","standYear","stand_name","standEnName","standNatureName", String[] standStr = {"content","standSort","standNumber","standYear","stand_name","standEnName","standNatureName",
"textStatusName","isRelateAccessName","numbershow","standSystem"}; "textStatusName","isRelateAccessName","numbershow","standSystem"};
String[] lawsStr = {"content", String[] lawsStr = {"content","lawsType","lawsNumber","lawsName","lawsEnName","lawsNo","issueTime","issueCompany","commentCycleStart",
"standSort","stand_code","standYear","stand_name","standEnName","textStatusBuss"}; "commentCycleEnd","lawsTextState","lawsSyqy","lawsSycx","isRelateAccess","lawsYear","lawsNotisyncNum","lawsBulletin","lawsLabel","lawsRemark"};
String[] bussstandStr = {"content","standSort","stand_code","standYear","stand_name","standEnName","textStatusBuss"}; String[] bussstandStr = {"content","standSort","stand_code","standYear","stand_name","standEnName","textStatusBuss"};
for (String field : fieldList) { for (String field : fieldList) {
// 关键字查询属性字段 // 关键字查询属性字段
@@ -243,34 +243,42 @@ public class StandLawsSearchServiceImpl implements StandLawsSearchService {
attrInfoMap.put(key, "null"); attrInfoMap.put(key, "null");
} }
} }
fullTextSearchEO.put("title",attrInfoMap.get("numbershow")+" "+attrInfoMap.get("nameshow")); fullTextSearchEO.put("title",attrInfoMap.get("lawsNumber")+" "+attrInfoMap.get("lawsNumber"));
StringBuilder contentBuilder = new StringBuilder(); StringBuilder contentBuilder = new StringBuilder();
contentBuilder.append("适用区域: ").append(attrInfoMap.get("countryShow")).append(" "); contentBuilder.append("政策分类: ").append(attrInfoMap.get("lawsTypeName")).append(" ");
contentBuilder.append("政策状态: ").append(attrInfoMap.get("standstateshow")).append(" "); contentBuilder.append("政策编号: ").append(attrInfoMap.get("lawsNumber")).append(" ");
contentBuilder.append("政策号: ").append(attrInfoMap.get("numbershow")).append(" "); contentBuilder.append("中文名称: ").append(attrInfoMap.get("lawsName")).append(" ");
contentBuilder.append("政策名称: ").append(attrInfoMap.get("nameshow")).append(" "); contentBuilder.append("英文名称: ").append(attrInfoMap.get("lawsEnName")).append(" ");
contentBuilder.append("英文名称: ").append(attrInfoMap.get("standEnName")).append(" "); contentBuilder.append("政策文号: ").append(attrInfoMap.get("lawsNo")).append(" ");
// contentBuilder.append("发布日期:"+attrInfoMap.get("issueTime")+" "); // contentBuilder.append("发布日期:"+attrInfoMap.get("issueTime")+" ");
contentBuilder.append("纳入标准法规清单的国家/地区: ").append(attrInfoMap.get("accessCountry")).append(" "); contentBuilder.append("地区: ").append(attrInfoMap.get("country")).append(" ");
contentBuilder.append("代替政策编号: ").append(attrInfoMap.get("replaceLawsNum")).append(" "); contentBuilder.append("发文日期: ").append(attrInfoMap.get("issueTime")).append(" ");
contentBuilder.append("重要度: ").append(attrInfoMap.get("isRelateAccess")).append(" "); contentBuilder.append("发文单位: ").append(attrInfoMap.get("issueCompany")).append(" ");
contentBuilder.append("要求类型: ").append(attrInfoMap.get("YQLXShow")).append(" "); contentBuilder.append("征集意见周期-起始时间: ").append(attrInfoMap.get("commentCycleStart")).append(" ");
contentBuilder.append("适用车辆类型: ").append(attrInfoMap.get("SYCLLXShow")).append(" "); contentBuilder.append("征集意见周期-结束时间: ").append(attrInfoMap.get("commentCycleEnd")).append(" ");
// contentBuilder.append("监管类型:"+attrInfoMap.get("")+" "); contentBuilder.append("文本状态: ").append(attrInfoMap.get("lawsTextStateName")).append(" ");
contentBuilder.append("监管类型: ").append(attrInfoMap.get("ZRLXShow")).append(" "); contentBuilder.append("适用区域: ").append(attrInfoMap.get("lawsSyqyName")).append(" ");
contentBuilder.append("个性化标签: ").append(attrInfoMap.get("GXHBQShow")).append(" "); contentBuilder.append("适用车型: ").append(attrInfoMap.get("lawsSycxName")).append(" ");
contentBuilder.append("新车型实施日期(文本): ").append(attrInfoMap.get("XCXSSRQ")).append(" "); contentBuilder.append("是否纳入认证清单: ").append(attrInfoMap.get("isRelateAccessName")).append(" ");
contentBuilder.append("在产车实施日期(文本): ").append(attrInfoMap.get("ZCCSSRQ")).append(" "); contentBuilder.append("年度: ").append(attrInfoMap.get("lawsYearName")).append(" ");
contentBuilder.append("EOP实施日期(文本): ").append(attrInfoMap.get("EOPSSRQ")).append(" "); contentBuilder.append("福田转发通知文号: ").append(attrInfoMap.get("lawsNotisyncNum")).append(" ");
contentBuilder.append("维护工程师: ").append(attrInfoMap.get("ZCGCSShow")).append(" "); contentBuilder.append("信息简报: ").append(attrInfoMap.get("lawsBulletin")).append(" ");
contentBuilder.append("组织标准起草的执行机构/单位: ").append(attrInfoMap.get("FBJGShow")).append(" "); contentBuilder.append("标签: ").append(attrInfoMap.get("lawsLabel")).append(" ");
contentBuilder.append("SVPPS: ").append(attrInfoMap.get("SVPPSName")).append(" "); contentBuilder.append("备注: ").append(attrInfoMap.get("lawsRemark")).append(" ");
contentBuilder.append("相关部门: ").append(attrInfoMap.get("XGBMShow")).append(" "); contentBuilder.append("实施日期(文本): ").append(attrInfoMap.get("SSRQLAWSName")).append(" ");
contentBuilder.append("责任部门: ").append(attrInfoMap.get("ZRBMShow")).append(" "); contentBuilder.append("新车型实施日期(文本): ").append(attrInfoMap.get("XCXSSRQLAWSName")).append(" ");
contentBuilder.append("FO: ").append(attrInfoMap.get("FOShow")).append(" "); contentBuilder.append("在产车实施日期(文本): ").append(attrInfoMap.get("ZCXSSRQLAWSName")).append(" ");
contentBuilder.append("归口管理部门: ").append(attrInfoMap.get("GKGLBMShow")).append(" "); contentBuilder.append("发布机构: ").append(attrInfoMap.get("FBJGLAWSName")).append(" ");
contentBuilder.append("我司是否参与: ").append(attrInfoMap.get("WSSFCYShow")).append(" "); contentBuilder.append("我司参与深度: ").append(attrInfoMap.get("CYSDLAWSName")).append(" ");
contentBuilder.append("相关流程: ").append(attrInfoMap.get("XGLC")).append(" "); contentBuilder.append("投稿人: ").append(attrInfoMap.get("TGRLAWSName")).append(" ");
contentBuilder.append("投稿单位: ").append(attrInfoMap.get("TGRLAWSName")).append(" ");
contentBuilder.append("能源类型: ").append(attrInfoMap.get("NYLXLAWSName")).append(" ");
contentBuilder.append("适用认证: ").append(attrInfoMap.get("YYRZLAWSName")).append(" ");
contentBuilder.append("责任部门: ").append(attrInfoMap.get("ZRBMLAWSName")).append(" ");
contentBuilder.append("责任工程师: ").append(attrInfoMap.get("ZRGCSLAWSName")).append(" ");
contentBuilder.append("代替文件号: ").append(attrInfoMap.get("DTWJHLAWSName")).append(" ");
contentBuilder.append("被代替文件号: ").append(attrInfoMap.get("BDTWJHLAWSName")).append(" ");
contentBuilder.append("引用标准&政策: ").append(attrInfoMap.get("YYBZZCLAWSName")).append(" ");
// contentBuilder.append("相关资料:"+attrInfoMap.get("")+" "); // contentBuilder.append("相关资料:"+attrInfoMap.get("")+" ");
if (attrInfoMap.containsKey("content")){ if (attrInfoMap.containsKey("content")){
if (null !=attrInfoMap.get("content") && StringUtils.isNotBlank(String.valueOf(attrInfoMap.get("content")))){ if (null !=attrInfoMap.get("content") && StringUtils.isNotBlank(String.valueOf(attrInfoMap.get("content")))){
@@ -285,10 +293,10 @@ public class StandLawsSearchServiceImpl implements StandLawsSearchService {
StringBuilder textContent = replaceAll(contentBuilder, "null", "--"); StringBuilder textContent = replaceAll(contentBuilder, "null", "--");
fullTextSearchEO.put("textContent",textContent.toString()); fullTextSearchEO.put("textContent",textContent.toString());
if (null != attrInfoMap.get("issue_time") && !"".equals(attrInfoMap.get("issue_time")) && !"null".equals(attrInfoMap.get("issue_time"))) { if (null != attrInfoMap.get("issueTime") && !"".equals(attrInfoMap.get("issueTime")) && !"null".equals(attrInfoMap.get("issueTime"))) {
fullTextSearchEO.put("issue_time", attrInfoMap.get("issue_time")); fullTextSearchEO.put("issue_time", attrInfoMap.get("issueTime"));
}else { }else {
fullTextSearchEO.put("issue_time", ""); fullTextSearchEO.put("issue_time", "--");
} }
}else if ("bussstand".equals(attrInfoMap.get("type"))){ }else if ("bussstand".equals(attrInfoMap.get("type"))){
@@ -11,6 +11,7 @@ import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner; import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@@ -37,9 +38,7 @@ public class InitStandAttrSearchUtil implements ApplicationRunner {
standTypeList.add(SarTypeEnum.STAND.getValue()); standTypeList.add(SarTypeEnum.STAND.getValue());
standTypeList.add(SarTypeEnum.INLAND_STAND.getValue()); standTypeList.add(SarTypeEnum.INLAND_STAND.getValue());
standTypeList.add(SarTypeEnum.FOREIGN_STAND.getValue()); standTypeList.add(SarTypeEnum.FOREIGN_STAND.getValue());
lawsTypeList.add(SarTypeEnum.LAWS.getValue()); lawsTypeList.add(SarTypeEnum.LAWS_STAND.getValue());
lawsTypeList.add(SarTypeEnum.INLAND_LAWS.getValue());
lawsTypeList.add(SarTypeEnum.FOREIGN_LAWS.getValue());
standStateList.add("DRAFT"); standStateList.add("DRAFT");
standStateList.add("ADVICE"); standStateList.add("ADVICE");
standStateList.add("RADYSUBMIT"); standStateList.add("RADYSUBMIT");
@@ -78,6 +77,7 @@ public class InitStandAttrSearchUtil implements ApplicationRunner {
public static List<String> numFieldListLaws = new ArrayList<>(); // 属性表数字类型字段 public static List<String> numFieldListLaws = new ArrayList<>(); // 属性表数字类型字段
public static List<SarStandAttrDetails> lawsInlandAttrFieldList = new ArrayList<>(); // 属性表数字类型字段 public static List<SarStandAttrDetails> lawsInlandAttrFieldList = new ArrayList<>(); // 属性表数字类型字段
public static List<SarStandAttrDetails> lawsForeignAttrFieldList = new ArrayList<>(); // 全部政策字段属性 public static List<SarStandAttrDetails> lawsForeignAttrFieldList = new ArrayList<>(); // 全部政策字段属性
public static List<SarStandAttrDetails> lawsStandAttrFieldList = new ArrayList<>(); // 全部政策字段属性
public static Map<String,String> selectFieldMapLaws = new HashMap<>(); // 下拉属性字段及选项值 public static Map<String,String> selectFieldMapLaws = new HashMap<>(); // 下拉属性字段及选项值
// 企标属性字段信息 // 企标属性字段信息
@@ -95,7 +95,7 @@ public class InitStandAttrSearchUtil implements ApplicationRunner {
@Override @Override
public void run(ApplicationArguments args) throws Exception { public void run(ApplicationArguments args) throws Exception {
logger.info("项目启动时加载-搜索中心-查询标准属性类!"); logger.info("项目启动时加载--查询标准属性类!");
// 属性表需要查询的字段 // 属性表需要查询的字段
StringBuilder fieldInfoBuilder = new StringBuilder(); StringBuilder fieldInfoBuilder = new StringBuilder();
StringBuilder fieldInfoBuilderLaws = new StringBuilder(); StringBuilder fieldInfoBuilderLaws = new StringBuilder();
@@ -108,7 +108,7 @@ public class InitStandAttrSearchUtil implements ApplicationRunner {
qw.orderByAsc("ORDER_NUM"); qw.orderByAsc("ORDER_NUM");
List<SarStandAttrDetails> getDetailsList = sarStandAttrDetailsEOService.list(qw); List<SarStandAttrDetails> getDetailsList = sarStandAttrDetailsEOService.list(qw);
if (getDetailsList != null && !getDetailsList.isEmpty()) { if (getDetailsList != null && !getDetailsList.isEmpty()) {
logger.info("项目启动时加载-搜索中心-查询标准属性类--查询到" + getDetailsList.size() + "条属性字段数据!"); logger.info("项目启动时加载--查询标准属性类--查询到" + getDetailsList.size() + "条属性字段数据!");
for (SarStandAttrDetails detailsEO : getDetailsList) { for (SarStandAttrDetails detailsEO : getDetailsList) {
String sarType = detailsEO.getSarType(); String sarType = detailsEO.getSarType();
String attrType = detailsEO.getAttrType(); String attrType = detailsEO.getAttrType();
@@ -137,12 +137,16 @@ public class InitStandAttrSearchUtil implements ApplicationRunner {
numFieldList.add(detailsEO.getAttrField()); numFieldList.add(detailsEO.getAttrField());
} }
} else if (lawsTypeList.contains(sarType)) { } else if (lawsTypeList.contains(sarType)) {
if (!SarTypeEnum.FOREIGN_LAWS.getValue().equals(sarType)) { if (SarTypeEnum.FOREIGN_LAWS.getValue().equals(sarType)) {
lawsInlandAttrFieldList.add(detailsEO);
}
if (!SarTypeEnum.INLAND_LAWS.getValue().equals(sarType)) {
lawsForeignAttrFieldList.add(detailsEO); lawsForeignAttrFieldList.add(detailsEO);
} }
if (SarTypeEnum.LAWS_STAND.getValue().equals(sarType)) {
lawsStandAttrFieldList.add(detailsEO);
}
if (SarTypeEnum.INLAND_LAWS.getValue().equals(sarType)) {
lawsInlandAttrFieldList.add(detailsEO);
}
fieldInfoBuilderLaws.append(detailsEO.getAttrField() + ","); fieldInfoBuilderLaws.append(detailsEO.getAttrField() + ",");
fieldInfoNameBuilderLaws.append(detailsEO.getAttrName() + ","); fieldInfoNameBuilderLaws.append(detailsEO.getAttrName() + ",");
queryFieldListLaws.add(detailsEO.getAttrField()); queryFieldListLaws.add(detailsEO.getAttrField());
@@ -193,9 +197,9 @@ public class InitStandAttrSearchUtil implements ApplicationRunner {
if (StringUtils.isNotBlank(queryFieldBuss)) { if (StringUtils.isNotBlank(queryFieldBuss)) {
queryFieldBuss = queryFieldBuss.substring(0,queryFieldBuss.length()-1); queryFieldBuss = queryFieldBuss.substring(0,queryFieldBuss.length()-1);
} }
logger.info("项目启动时加载-搜索中心-查询标准属性类--查询到属性字段为:" + queryField); logger.info("项目启动时加载--查询标准属性类--查询到属性字段为:" + queryField);
logger.info("项目启动时加载-搜索中心-查询政策属性类--查询到属性字段为:" + queryFieldLaws); logger.info("项目启动时加载--查询政策属性类--查询到属性字段为:" + queryFieldLaws);
logger.info("项目启动时加载-搜索中心-查询企标属性类--查询到属性字段为:" + queryFieldBuss); logger.info("项目启动时加载--查询企标属性类--查询到属性字段为:" + queryFieldBuss);
queryFieldNames = fieldInfoNameBuilder.toString(); queryFieldNames = fieldInfoNameBuilder.toString();
queryFieldNamesLaws = fieldInfoNameBuilderLaws.toString(); queryFieldNamesLaws = fieldInfoNameBuilderLaws.toString();
queryFieldNamesBuss = fieldInfoNameBuilderBuss.toString(); queryFieldNamesBuss = fieldInfoNameBuilderBuss.toString();
@@ -208,11 +212,11 @@ public class InitStandAttrSearchUtil implements ApplicationRunner {
if (StringUtils.isNotBlank(queryFieldNamesBuss)) { if (StringUtils.isNotBlank(queryFieldNamesBuss)) {
queryFieldNamesBuss = queryFieldNamesBuss.substring(0,queryFieldNamesBuss.length()-1); queryFieldNamesBuss = queryFieldNamesBuss.substring(0,queryFieldNamesBuss.length()-1);
} }
logger.info("项目启动时加载-搜索中心-查询标准属性类--查询到属性字段名称为:" + queryFieldNames); logger.info("项目启动时加载--查询标准属性类--查询到属性字段名称为:" + queryFieldNames);
logger.info("项目启动时加载-搜索中心-查询政策属性类--查询到属性字段名称为:" + queryFieldNamesLaws); logger.info("项目启动时加载--查询政策属性类--查询到属性字段名称为:" + queryFieldNamesLaws);
logger.info("项目启动时加载-搜索中心-查询企标属性类--查询到属性字段名称为:" + queryFieldNamesBuss); logger.info("项目启动时加载--查询企标属性类--查询到属性字段名称为:" + queryFieldNamesBuss);
} else { } else {
logger.error("项目启动时加载-搜索中心-查询标准属性类--未查询到属性字段数据!"); logger.error("项目启动时加载--查询标准属性类--未查询到属性字段数据!");
} }
} }
@@ -11,6 +11,7 @@ public enum SarTypeEnum {
FOREIGN_STAND("FOREIGN_STAND","国外标准法规"),FOREIGN_LAWS("FOREIGN_LAWS","国外政策"), FOREIGN_STAND("FOREIGN_STAND","国外标准法规"),FOREIGN_LAWS("FOREIGN_LAWS","国外政策"),
STAND("STAND","国内外标准法规"), STAND("STAND","国内外标准法规"),
LAWS("LAWS","国内外政策"), LAWS("LAWS","国内外政策"),
LAWS_STAND("LAWS_STAND","国内外政策"),
BUSINESS("BUSINESS","企业标准"), BUSINESS("BUSINESS","企业标准"),
BUSS("BUSS","企业标准"), BUSS("BUSS","企业标准"),
SPLIT("SPLIT","标准拆分"), SPLIT("SPLIT","标准拆分"),
@@ -11,6 +11,7 @@ public enum SarTypeEnum {
FOREIGN_STAND("FOREIGN_STAND","国外标准法规"),FOREIGN_LAWS("FOREIGN_LAWS","国外政策"), FOREIGN_STAND("FOREIGN_STAND","国外标准法规"),FOREIGN_LAWS("FOREIGN_LAWS","国外政策"),
STAND("STAND","国内外标准法规"), STAND("STAND","国内外标准法规"),
LAWS("LAWS","国内外政策"), LAWS("LAWS","国内外政策"),
LAWS_STAND("LAWS_STAND","国内外政策"),
BUSINESS("BUSINESS","企业标准"), BUSINESS("BUSINESS","企业标准"),
BUSS("BUSS","企业标准"), BUSS("BUSS","企业标准"),
SPLIT("SPLIT","标准拆分"), SPLIT("SPLIT","标准拆分"),
@@ -2,6 +2,7 @@ package com.adc.da.mq;
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand; import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
import com.adc.da.slrs.sarLawsInfo.entity.SarLawsInfo; import com.adc.da.slrs.sarLawsInfo.entity.SarLawsInfo;
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfo;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import org.springframework.amqp.core.AmqpTemplate; import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -32,15 +33,17 @@ public class CreateStandMQService {
this.rabbitTemplate.convertAndSend("stand-exchange_SQ_GSAR_RELEASE", "stand-key_SQ_GSAR_RELEASE", standMap); this.rabbitTemplate.convertAndSend("stand-exchange_SQ_GSAR_RELEASE", "stand-key_SQ_GSAR_RELEASE", standMap);
} }
public void sendLawsMQ(SarLawsInfo sarLawsInfoEO, String addOrUpdate) throws Exception{ public void sendLawsMQ(SarLawsStandInfo sarLawsStandInfo, String addOrUpdate) throws Exception{
JSONObject json = JSONObject.fromObject(sarLawsInfoEO); // JSONObject json = JSONObject.fromObject(sarLawsStandInfo);
String sarLawsInfoStr = json.toString(); com.alibaba.fastjson.JSONObject object = (com.alibaba.fastjson.JSONObject) com.alibaba.fastjson.JSONObject.toJSON(sarLawsStandInfo);
String sarLawsInfoStr = object.toString();
Map<String,Object> lawsMap = new HashMap<String,Object>(); Map<String,Object> lawsMap = new HashMap<String,Object>();
lawsMap.put("sarLaws", sarLawsInfoStr); lawsMap.put("sarLaws", sarLawsInfoStr);
lawsMap.put("addOrUpdate", addOrUpdate); lawsMap.put("addOrUpdate", addOrUpdate);
//发送消息队列 //发送消息队列
this.rabbitTemplate.convertAndSend("laws-exchange_SQ_GSAR", "laws-key_SQ_GSAR", lawsMap); this.rabbitTemplate.convertAndSend("laws-exchange_SQ_GSAR_RELEASE", "laws-key_SQ_GSAR_RELEASE", lawsMap);
} }
public void sendBussStandMQ(Object sarBussionessStandEO, String addOrUpdate) throws Exception{ public void sendBussStandMQ(Object sarBussionessStandEO, String addOrUpdate) throws Exception{
@@ -0,0 +1,314 @@
package com.adc.da.mq;
import com.adc.da.slrs.otSvpps.service.IOtSvppsService;
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfo;
import com.adc.da.slrs.sarStandardsInfo.service.ISarStandardsInfoService;
import com.adc.da.slrs.sysInfo.service.SysInfoEOService;
import com.adc.da.sys.dao.DicTypeEODao;
import com.adc.da.utils.util.InitStandAttrUtil;
import com.alibaba.fastjson.JSON;
import com.rabbitmq.client.Channel;
import net.sf.json.JSONObject;
import org.apache.commons.lang.StringUtils;
import org.json.JSONTokener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.support.AmqpHeaders;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.Message;
import org.springframework.stereotype.Component;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@Component
public class SendLawsMQService {
@Autowired
private ISarStandardsInfoService sarStandardsInfoService;
@Autowired
private SysInfoEOService sysInfoEOService;
@Autowired
private DicTypeEODao dicTypeEODao;
private static final Logger logger = LoggerFactory.getLogger(SendLawsMQService.class);
@RabbitListener(bindings = @QueueBinding(
value = @Queue(value = "createLawsMQ_SQ_GSAR_RELEASE", durable = "true"),
exchange = @Exchange(value = "laws-exchange_SQ_GSAR_RELEASE", ignoreDeclarationExceptions = "true"),
key = "laws-key_SQ_GSAR_RELEASE"))
public void createMQ(Map<String,Object> bussMap, Message message, Channel channel) throws Exception{
try{
try{
Thread.sleep(5000);
insertOrUpdateBussInfo(bussMap);
}catch(InterruptedException e){
logger.error(e.toString());
Thread.currentThread().interrupt();
}
} catch (Exception e) {
logger.error("搜索中心国内外政策消息队列进入转换前失败!");
logger.error(e.getMessage(),e);
} finally {
Long tag = (Long) message.getHeaders().get(AmqpHeaders.DELIVERY_TAG);
channel.basicAck(tag,false);
logger.debug("消息确认成功!!!!!!!!!");
}
}
public void insertOrUpdateBussInfo(Map<String,Object> bussMap) throws Exception {
String addOrUpdate = bussMap.get("addOrUpdate").toString();
String sarBuss = bussMap.get("sarLaws").toString();
// JSONObject jsonobject = JSONObject.fromObject(sarBuss);
SarLawsStandInfo infoEO = com.alibaba.fastjson.JSONObject.parseObject(sarBuss,SarLawsStandInfo.class);
// SarLawsStandInfo infoEO = (SarLawsStandInfo) JSONObject.toBean(jsonobject,SarLawsStandInfo.class);
String FZRQFSRQ = null;
if ("updateFromAct".equals(addOrUpdate)){
addOrUpdate = "update";
FZRQFSRQ = "1";
}
String sarStandAttrEOStr = infoEO.getSarStandAttrEOStr();
Map<String,Object> attrInfoMap = JSONObject.fromObject(sarStandAttrEOStr);
Map<String,Object> infoMap = infoEO.getAttrInfoCaseMap();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
//修改索引信息表
// 往索引表中插入数据
String baseSearchContent = "";
String getCodeName = "";
Map<String,Object> saveMap = new HashMap<>();
//发布日期 高级查询
saveMap.put("issueTime",dateFormatToStr(infoEO.getIssueTime()));
Date issue_time_data = null;
if (StringUtils.isNotBlank(infoEO.getIssueTime())) {
try {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
issue_time_data = format.parse(dateFormatToStr(infoEO.getIssueTime())+" 00:00:00");
} catch (ParseException ignored) {
}
}
if (issue_time_data != null) {
saveMap.put("issue_time_data",issue_time_data.getTime());
}else{
saveMap.put("issue_time_data",-1000000000000000000L);
}
//征集意见周期-起始时间
saveMap.put("commentCycleStart",dateFormatToStr(infoEO.getCommentCycleStart()));
Date commentCycleStart_data = null;
if (StringUtils.isNotBlank(infoEO.getCommentCycleStart())) {
try {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
commentCycleStart_data = format.parse(dateFormatToStr(infoEO.getCommentCycleStart())+" 00:00:00");
} catch (ParseException ignored) {
}
}
if (commentCycleStart_data != null) {
saveMap.put("commentCycleStart_data",commentCycleStart_data.getTime());
}else{
saveMap.put("commentCycleStart_data",-1000000000000000000L);
}
//征集意见周期-结束时间
saveMap.put("commentCycleEnd",dateFormatToStr(infoEO.getCommentCycleEnd()));
Date commentCycleEnd_data = null;
if (StringUtils.isNotBlank(infoEO.getCommentCycleStart())) {
try {
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
commentCycleEnd_data = format.parse(dateFormatToStr(infoEO.getCommentCycleStart())+" 00:00:00");
} catch (ParseException ignored) {
}
}
if (commentCycleEnd_data != null) {
saveMap.put("commentCycleEnd_data",commentCycleEnd_data.getTime());
}else{
saveMap.put("commentCycleEnd_data",-1000000000000000000L);
}
saveMap.put("id",infoEO.getId());
String lawsTypeName = "";
if(infoEO.getLawsTextState() != null && StringUtils.isNotBlank(infoEO.getLawsType())){
List<String> valArr = Arrays.asList(infoEO.getLawsType().split(","));
lawsTypeName = dicTypeEODao.getDicNamesByCodes(valArr);
}
saveMap.put("lawsType",infoEO.getLawsType());
saveMap.put("lawsTypeName",lawsTypeName);
saveMap.put("lawsNumber",infoEO.getLawsNumber());
saveMap.put("lawsName",infoEO.getLawsName());
saveMap.put("lawsEnName",infoEO.getLawsEnName());
saveMap.put("lawsNo",infoEO.getLawsNo());
saveMap.put("issueCompany",infoEO.getIssueCompany());
String lawsSyqyName = "";
if(infoEO.getLawsTextState() != null && StringUtils.isNotBlank(infoEO.getLawsSyqy())){
List<String> valArr = Arrays.asList(infoEO.getLawsSyqy().split(","));
lawsSyqyName = dicTypeEODao.getDicNamesByCodes(valArr);
}
saveMap.put("lawsSyqy",infoEO.getLawsSyqy());
saveMap.put("lawsSyqyName",lawsSyqyName);
String lawsSycxName = "";
if(infoEO.getLawsTextState() != null && StringUtils.isNotBlank(infoEO.getLawsSycx())){
List<String> valArr = Arrays.asList(infoEO.getLawsSycx().split(","));
lawsSycxName = dicTypeEODao.getDicNamesByCodes(valArr);
}
saveMap.put("lawsSycx",infoEO.getLawsSycx());
saveMap.put("lawsSycxName",lawsSycxName);
String isRelateAccessName = "";
if(infoEO.getIsRelateAccess() != null && StringUtils.isNotBlank(infoEO.getIsRelateAccess())){
if(infoEO.getIsRelateAccess().equals("1")){
isRelateAccessName = "";
}else {
isRelateAccessName = "";
}
}
saveMap.put("isRelateAccess",infoEO.getIsRelateAccess());
saveMap.put("isRelateAccessName",isRelateAccessName);
String lawsYearName = "";
if(infoEO.getLawsTextState() != null && StringUtils.isNotBlank(infoEO.getLawsYear())){
List<String> valArr = Arrays.asList(infoEO.getLawsYear().split(","));
lawsYearName = dicTypeEODao.getDicNamesByCodes(valArr);
}
saveMap.put("lawsYear",infoEO.getLawsYear());
saveMap.put("lawsYearName",lawsYearName);
saveMap.put("lawsNotisyncNum",infoEO.getLawsNotisyncNum());
saveMap.put("lawsBulletin",infoEO.getLawsBulletin());
String lawsLabelName = "";
if(infoEO.getLawsTextState() != null && StringUtils.isNotBlank(infoEO.getLawsLabel())){
List<String> valArr = Arrays.asList(infoEO.getLawsLabel().split(","));
lawsLabelName = dicTypeEODao.getDicNamesByCodes(valArr);
}
saveMap.put("lawsLabel",infoEO.getLawsLabel());
saveMap.put("lawsLabelName",lawsLabelName);
saveMap.put("lawsRemark",infoEO.getLawsRemark());
String lawsTextStateName = "";
if(infoEO.getLawsTextState() != null && StringUtils.isNotBlank(infoEO.getLawsTextState())){
List<String> valArr = Arrays.asList(infoEO.getLawsTextState().split(","));
lawsTextStateName = dicTypeEODao.getDicNamesByCodes(valArr);
}
saveMap.put("lawsTextState",infoEO.getLawsTextState());
saveMap.put("lawsTextStateName",lawsTextStateName);
//新加字段
saveMap.put("country",infoEO.getCountry());
if(StringUtils.isNotEmpty(infoEO.getCountry())){
String codeName = sysInfoEOService.getDicNamesByCodes(infoEO.getCountry());
saveMap.put("countryShow",codeName);
}
// 自定义属性字段
if (attrInfoMap != null && !attrInfoMap.isEmpty()) {
attrInfoMap = sysInfoEOService.changeSelectInfo(attrInfoMap, "laws",baseSearchContent);
saveMap.putAll(attrInfoMap);
}
saveMap.put("type","laws");
saveMap.put("validFlag","0");
saveMap.put("content",infoEO.getFileIds());
String fieldInfo = InitStandAttrUtil.queryFieldLaws;
List<String> fieldInfoList = Arrays.asList(fieldInfo .split(",")).stream().map(s -> (s.trim())).collect(Collectors.toList());
// 动态存储属性字段
for (String field : fieldInfoList) {
saveMap.put(field,attrInfoMap.getOrDefault(field,""));
String fieldValue = "";
String fieldFilter = field.toLowerCase();
if(infoMap.get(fieldFilter) != null && StringUtils.isNotBlank(infoMap.get(fieldFilter).toString())){
Object json= new JSONTokener(infoMap.get(fieldFilter).toString()).nextValue();
if(!json.toString().equals("null")){
fieldValue = infoMap.get(fieldFilter).toString();
}
}
saveMap.put(field+"Name",fieldValue);
}
//当建立代替时,产生的没有文件的问题
if (StringUtils.isBlank(String.valueOf(saveMap.get("content")))) {
String context = filterStringIsNotBlank(String.valueOf(saveMap.get("ZCWBLAWS")),true)
+ filterStringIsNotBlank(String.valueOf(saveMap.get("GCWBLAWS")),true)
+ filterStringIsNotBlank(String.valueOf(saveMap.get("JDWJLAWS")),true)
+ filterStringIsNotBlank(String.valueOf(saveMap.get("GLWJLAWS")),true);
context = context.replace(",,", ",");
saveMap.put("content", context);
}
if("add".equals(addOrUpdate)){
sarStandardsInfoService.insertIntoIndexForMap(saveMap);
} else {
sarStandardsInfoService.updateIntoIndexForMap(saveMap);
}
}
private String filterStringIsNotBlank(String str,boolean boo){
String f = ",";
return (str == null || str.equals("") || str.equals("null")) ? "" : (boo ? str+f : str);
}
private String dateFormatToStr(String dateStr){
if(dateStr == null || dateStr.equals("")){
return "";
}
String dateToStr = "";
try {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
dateToStr = dateFormat.format(dateFormat.parse(dateStr.trim().substring(0,10)));
}catch (Exception e){
e.getMessage();
}
return dateToStr;
}
public Map<String,Object> dealNumberMsg (Map<String,Object> saveMap,SarBussionessStand infoEO,String getCodeName) {
/*if(StringUtils.isNotEmpty(infoEO.getStandYear())){
String num = getCodeName + " " + infoEO.getStandCode() + "-" + infoEO.getStandYear();
saveMap.put("numbershow",num);
int index = infoEO.getStandCode().indexOf(".");
int index1 = infoEO.getStandCode().indexOf(":");
String numberExpNull = "";
if(index > -1){
numberExpNull = getCodeName + infoEO.getStandCode() + "-" + num.replaceAll(" ","")
+ "-" + getCodeName + infoEO.getStandCode().substring(0,index) + "-" + infoEO.getStandCode().substring(0,index);
}else if(index1 > -1){
numberExpNull = getCodeName + infoEO.getStandCode() + "-" + num.replaceAll(" ","")
+ "-" + getCodeName + infoEO.getStandCode().substring(0,index1) + "-" + infoEO.getStandCode().substring(0,index1);
}else{
numberExpNull = getCodeName + infoEO.getStandCode() + "-" + num.replaceAll(" ","");
}
} else {
String number = getCodeName + " " + infoEO.getStandCode();
saveMap.put("numbershow",number);
String numberExpNull = "";
int index = infoEO.getStandCode().indexOf(".");
if(index > -1){
numberExpNull = getCodeName + infoEO.getStandCode() + "-" + number.replaceAll(" ","")
+ "-" + getCodeName + infoEO.getStandCode().substring(0,index) + "-" + infoEO.getStandCode().substring(0,index);
}else{
numberExpNull = getCodeName + infoEO.getStandCode() + "-" + number.replaceAll(" ","");
}
saveMap.put("numberExpNull",numberExpNull);
}*/
String number = infoEO.getStandCode();
saveMap.put("numbershow",number);
String numberExpNull = "";
int index = infoEO.getStandCode().indexOf(".");
if(index > -1){
numberExpNull = infoEO.getStandCode() + "-" + number.replaceAll(" ","")
+ "-" + infoEO.getStandCode().substring(0,index) + "-" + infoEO.getStandCode().substring(0,index);
}else{
numberExpNull = infoEO.getStandCode() + "-" + number.replaceAll(" ","");
}
saveMap.put("numberExpNull",numberExpNull);
return saveMap;
}
}
@@ -865,10 +865,10 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
public void attrInfoShowSearchDetails(SarBussionessStand row,String type) throws Exception { public void attrInfoShowSearchDetails(SarBussionessStand row,String type) throws Exception {
if (row != null) { if (row != null) {
attrInfoSearchDetails(row,type); attrInfoSearchDetails(row,type);
Map<String, Object> getAttrMap = row.getAttrInfoMap(); Map<String, Object> getAttrMap = row.getAttrInfoCaseMap();
if (getAttrMap != null && getAttrMap.size() > 0) { if (getAttrMap != null && getAttrMap.size() > 0) {
for (Map.Entry<String, Object> entry : getAttrMap.entrySet()) { for (Map.Entry<String, Object> entry : getAttrMap.entrySet()) {
String name = entry.getKey(); String name = entry.getKey().toUpperCase();
String value = ""; String value = "";
List<String> valArr = new ArrayList<>(); List<String> valArr = new ArrayList<>();
if (entry.getValue() != null && InitStandAttrUtil.selectionFieldListBuss != null && InitStandAttrUtil.selectionFieldListBuss.size() > 0 && InitStandAttrUtil.selectionFieldListBuss.contains(name)) { if (entry.getValue() != null && InitStandAttrUtil.selectionFieldListBuss != null && InitStandAttrUtil.selectionFieldListBuss.size() > 0 && InitStandAttrUtil.selectionFieldListBuss.contains(name)) {
@@ -4,6 +4,7 @@ import com.adc.da.slrs.sarLawsAttrInfo.entity.SarLawsAttrInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.swagger.models.auth.In; import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.Map; import java.util.Map;
@@ -15,6 +16,7 @@ import java.util.Map;
* @author super_liu * @author super_liu
* @since 2021-06-04 * @since 2021-06-04
*/ */
@Repository
public interface SarLawsAttrInfoDao extends BaseMapper<SarLawsAttrInfo> { public interface SarLawsAttrInfoDao extends BaseMapper<SarLawsAttrInfo> {
void deleteLawsAttr(@Param("fieldInfo") String fieldInfo); void deleteLawsAttr(@Param("fieldInfo") String fieldInfo);
@@ -0,0 +1,23 @@
package com.adc.da.slrs.sarLawsFile.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.adc.da.slrs.sarLawsFile.entity.SarLawsFile;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.adc.da.base.web.BaseController;
/**
* <p>
* 前端控制器
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
@RestController
@Api(description = "|SarLawsFile|")
@RequestMapping("/sarLawsFile/sar-laws-file")
public class SarLawsFileController extends BaseController<SarLawsFile> {
}
@@ -0,0 +1,40 @@
package com.adc.da.slrs.sarLawsFile.dao;
import com.adc.da.slrs.sarLawsFile.entity.SarLawsFile;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
@Repository
public interface SarLawsFileDao extends BaseMapper<SarLawsFile> {
List<SarLawsFile> selectFileBylawsId(String lawsId);
List<SarLawsFile> selectFileBylawsIdAndId(SarLawsFile laws);
List<SarLawsFile> selectFileByAttId(String attId);
List<SarLawsFile> selectFileMsgByAttId(String attId);
List<SarLawsFile> selectFileByResId(SarLawsFile sarBussStandFileEO);
int deleteBylawsId(String standId);
int insertForeach(List<SarLawsFile> list); //批量新增
int insertSelective(SarLawsFile sarBussStandFile);
int updateByPrimaryKeySelective(SarLawsFile sarBussStandFile);
int deleteByPrimaryKey(String value);
}
@@ -0,0 +1,98 @@
package com.adc.da.slrs.sarLawsFile.entity;
import com.adc.da.base.entity.BaseEntity;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="SarLawsFile对象", description="")
public class SarLawsFile extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
@TableField("ID")
private String id;
@ApiModelProperty(value = "政策ID")
@TableField("LAWS_ID")
private String lawsId;
@ApiModelProperty(value = "政策文件分类")
@TableField("LAWS_FILE_CLASSIFY")
private String lawsFileClassify;
@ApiModelProperty(value = "文件主键")
@TableField("ATT_ID")
private String attId;
@ApiModelProperty(value = "文件名称")
@TableField("FILE_NAME")
private String fileName;
@ApiModelProperty(value = "文件后缀")
@TableField("FILE_SUFFIX")
private String fileSuffix;
@ApiModelProperty(value = "使用模式(SOURCE_FILE原文件,WEB_FILE转换后文件)")
@TableField("USE_MODEL")
private String useModel;
@ApiModelProperty(value = "加密密码")
@TableField("PASSWORD")
private String password;
@TableField("CREATION_USER")
private String creationUser;
@ApiModelProperty(value = "是否有效")
@TableField("VALID_FLAG")
private Integer validFlag;
@ApiModelProperty(value = "创建时间")
@TableField("CREATION_TIME")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date creationTime;
@ApiModelProperty(value = "修改时间")
@TableField("MODIFY_TIME")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date modifyTime;
@ApiModelProperty(value = "转换原文件id")
@TableField("ORI_ATT_ID")
private String oriAttId;
@TableField(exist = false)
private List<String> idList = new ArrayList<>();
@TableField(exist = false)
private String useModule;
@TableField(exist = false)
private String resId;
@TableField(exist = false)
private Integer pageCount;
@TableField(exist = false)
private String fileOldName;
}
@@ -0,0 +1,16 @@
package com.adc.da.slrs.sarLawsFile.service;
import com.adc.da.slrs.sarLawsFile.entity.SarLawsFile;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 服务类
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
public interface ISarLawsFileService extends IService<SarLawsFile> {
}
@@ -0,0 +1,20 @@
package com.adc.da.slrs.sarLawsFile.service.impl;
import com.adc.da.slrs.sarLawsFile.entity.SarLawsFile;
import com.adc.da.slrs.sarLawsFile.dao.SarLawsFileDao;
import com.adc.da.slrs.sarLawsFile.service.ISarLawsFileService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
@Service
public class SarLawsFileServiceImpl extends ServiceImpl<SarLawsFileDao, SarLawsFile> implements ISarLawsFileService {
}
@@ -2,9 +2,12 @@ package com.adc.da.slrs.sarLawsInfo.dao;
import com.adc.da.slrs.sarLawsInfo.entity.SarLawsInfo; import com.adc.da.slrs.sarLawsInfo.entity.SarLawsInfo;
import com.adc.da.slrs.sarLawsInfo.page.SarLawsInfoEOPage; import com.adc.da.slrs.sarLawsInfo.page.SarLawsInfoEOPage;
import com.adc.da.slrs.sarStandardsInfo.entity.RecommendVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@@ -15,6 +18,7 @@ import java.util.List;
* @author super_liu * @author super_liu
* @since 2021-06-01 * @since 2021-06-01
*/ */
@Repository
public interface SarLawsInfoDao extends BaseMapper<SarLawsInfo> { public interface SarLawsInfoDao extends BaseMapper<SarLawsInfo> {
Integer selectLawsColumn(@Param("columnName") String columnName); Integer selectLawsColumn(@Param("columnName") String columnName);
@@ -22,4 +26,85 @@ public interface SarLawsInfoDao extends BaseMapper<SarLawsInfo> {
List<SarLawsInfo> queryByPage(SarLawsInfoEOPage page); List<SarLawsInfo> queryByPage(SarLawsInfoEOPage page);
Integer queryByCount(SarLawsInfoEOPage page); Integer queryByCount(SarLawsInfoEOPage page);
/**
* @return com.adc.da.lawss.entity.SarLawsInfo
* @Author yangxuenan
* @Description 通过id查询详细信息
* Date 2018/9/21 16:42
* @Param [id]
**/
SarLawsInfo selectInfoById(String id);
/**
* @return java.util.List<com.adc.da.lawss.entity.SarLawsInfo>
* @Author yangxuenan
* @Description 分页查询配置法规
* Date 2018/9/30 17:02
* @Param [page]
**/
List<SarLawsInfo> queryConfigLawsByPage(SarLawsInfoEOPage page);
int queryConfigLawsByCount(SarLawsInfoEOPage page);
//liwenxuan:标准法规更新数量及清单:国内法规
Integer selectCounterLawsCountINLAND(Date visitTime);
//liwenxuan:标准法规更新数量及清单:国内法规All
Integer selectCounterLawsCountINLANDAll();
//liwenxuan:标准法规更新数量及清单:国外法规
Integer selectCounterLawsCountFOREIGN(Date visitTime);
//liwenxuan:标准法规更新数量及清单:国外法规All
Integer selectCounterLawsCountFOREIGNAll();
/**
* 功能描述: 通过文件号查询详细信息
*
* @param: [Number]
* @return: com.adc.da.lawss.entity.SarLawsInfo
* @auther: SYT
* @date: 2018/10/11 20:34
*/
List<SarLawsInfo> selectInfoByNumber(@Param("number") String number, @Param("resName") String resName, @Param("type") String type);
/**
* 搜索中心查询相关推荐
*
* @param:
* @auther: gaoyan
* @date: 2018/11/10 9:22
*/
List<RecommendVO> selectRecommendLaws(SarLawsInfoEOPage pagenew);
List<RecommendVO> selectCloseLaws(SarLawsInfoEOPage pagenew);
/**
* 功能描述: 查询所有小于当前时间的即将实施的条目
*
* @param: [lawsEO]
* @return: java.util.List<com.adc.da.lawss.entity.SarLawsInfo>
* @auther: SYT
* @date: 2018/11/16 15:24
*/
List<SarLawsInfo> queryByPutTimeList(SarLawsInfo lawsEO);
int updateSarStandReplaced(SarLawsInfo lawsInfoEO);
int updateRelacedNumByNumber(SarLawsInfoEOPage lawsInfoEO);
List<SarLawsInfo> selectLawsInfoByIdAndRole(SarLawsInfoEOPage lawsEOPage);
int queryByCountForES(SarLawsInfoEOPage lawsEOPage);
List<SarLawsInfo> queryByPageForES(SarLawsInfoEOPage lawsEOPage);
int updateByPrimaryKeyForSynchron(SarLawsInfo SarLawsInfo);
int deleteByPrimaryKeyFlag(String id);
SarLawsInfo selectByPrimaryKeyAndTime(SarLawsInfo lawsEO);
} }
@@ -0,0 +1,23 @@
package com.adc.da.slrs.sarLawsItemVal.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.adc.da.slrs.sarLawsItemVal.entity.SarLawsItemVal;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.adc.da.base.web.BaseController;
/**
* <p>
* 前端控制器
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
@RestController
@Api(description = "|SarLawsItemVal|")
@RequestMapping("/sarLawsItemVal/sar-laws-item-val")
public class SarLawsItemValController extends BaseController<SarLawsItemVal> {
}
@@ -0,0 +1,16 @@
package com.adc.da.slrs.sarLawsItemVal.dao;
import com.adc.da.slrs.sarLawsItemVal.entity.SarLawsItemVal;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
public interface SarLawsItemValDao extends BaseMapper<SarLawsItemVal> {
}
@@ -0,0 +1,59 @@
package com.adc.da.slrs.sarLawsItemVal.entity;
import com.adc.da.base.entity.BaseEntity;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="SarLawsItemVal对象", description="")
public class SarLawsItemVal extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
@TableId("ID")
private String id;
@ApiModelProperty(value = "法规条目ID")
@TableField("LAWS_ITEM_ID")
private String lawsItemId;
@ApiModelProperty(value = "参数类型")
@TableField("PROPERTY_TYPE")
private String propertyType;
@ApiModelProperty(value = "参数内容")
@TableField("PROPERTY_VAL")
private String propertyVal;
@ApiModelProperty(value = "是否有效")
@TableField("VALID_FLAG")
private BigDecimal validFlag;
@ApiModelProperty(value = "创建时间")
@TableField("CREATION_TIME")
private LocalDateTime creationTime;
@ApiModelProperty(value = "修改时间")
@TableField("MODIFY_TIME")
private LocalDateTime modifyTime;
}
@@ -0,0 +1,16 @@
package com.adc.da.slrs.sarLawsItemVal.service;
import com.adc.da.slrs.sarLawsItemVal.entity.SarLawsItemVal;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 服务类
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
public interface ISarLawsItemValService extends IService<SarLawsItemVal> {
}
@@ -0,0 +1,20 @@
package com.adc.da.slrs.sarLawsItemVal.service.impl;
import com.adc.da.slrs.sarLawsItemVal.entity.SarLawsItemVal;
import com.adc.da.slrs.sarLawsItemVal.dao.SarLawsItemValDao;
import com.adc.da.slrs.sarLawsItemVal.service.ISarLawsItemValService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
@Service
public class SarLawsItemValServiceImpl extends ServiceImpl<SarLawsItemValDao, SarLawsItemVal> implements ISarLawsItemValService {
}
@@ -6,6 +6,7 @@ import com.adc.da.slrs.sarStandItems.entity.SarStandItems;
import com.adc.da.slrs.sarStandItems.page.SarStandItemsEOPage; import com.adc.da.slrs.sarStandItems.page.SarStandItemsEOPage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
@@ -18,6 +19,7 @@ import java.util.Set;
* @author super_liu * @author super_liu
* @since 2021-06-02 * @since 2021-06-02
*/ */
@Repository
public interface SarLawsItemsDao extends BaseMapper<SarLawsItems> { public interface SarLawsItemsDao extends BaseMapper<SarLawsItems> {
Set<String> selectClaimTypesByStandId(@Param("standId") String standId, @Param("fileType") String fileType, @Param("idList") String[] idList); Set<String> selectClaimTypesByStandId(@Param("standId") String standId, @Param("fileType") String fileType, @Param("idList") String[] idList);
@@ -25,4 +27,6 @@ public interface SarLawsItemsDao extends BaseMapper<SarLawsItems> {
Set<String> selectSvppsByStandId(@Param("standId") String standId, @Param("fileType") String fileType, @Param("idList") String[] idList); Set<String> selectSvppsByStandId(@Param("standId") String standId, @Param("fileType") String fileType, @Param("idList") String[] idList);
List<SarLawsItems> queryByList(SarLawsItemsEOPage page); List<SarLawsItems> queryByList(SarLawsItemsEOPage page);
int deleteByStandIdAndFileType(@Param("standId") String standId, @Param("fileType") String fileType);
} }
@@ -0,0 +1,81 @@
package com.adc.da.slrs.sarLawsMenu.controller;
import com.adc.da.slrs.sarBussStandMenu.service.ISarBussStandMenuService;
import com.adc.da.slrs.sarLawsMenu.service.ISarLawsMenuService;
import com.adc.da.slrs.sarResource.entity.TsResource;
import com.adc.da.slrs.sarResource.service.ITsResourceService;
import com.adc.da.sys.util.UUIDUtils;
import com.adc.da.util.http.ResponseMessage;
import com.adc.da.util.http.Result;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import com.adc.da.slrs.sarLawsMenu.entity.SarLawsMenu;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.adc.da.base.web.BaseController;
import java.util.List;
/**
* <p>
* 前端控制器
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
@RestController
@Api(description = "|SarLawsMenu|")
@RequestMapping("/sarLawsMenu/sar-laws-menu")
public class SarLawsMenuController extends BaseController<SarLawsMenu> {
@Autowired
private ISarLawsMenuService lawsMenuService;
@Autowired
private ITsResourceService sarMenuEOService;
@ApiOperation(value = "|SarBussStandMenuEO|修改")
@PutMapping("/removeStandInfo")
// @RequiresPermissions("lawss:sarStandMenu:update")
public ResponseMessage removeStandInfo(@RequestBody SarLawsMenu standardsInfoEO) throws Exception {
String[] idList = standardsInfoEO.getIdlist();
int count = 0;
if(idList != null){
for(String id : idList){
SarLawsMenu menuEO = new SarLawsMenu();
menuEO.setLawsId(id);
menuEO.setMenuId(standardsInfoEO.getMenuId());
//删除所选目录下关联
String oldMenuId = standardsInfoEO.getOldMenuId();
if (StringUtils.isEmpty(oldMenuId)) {
oldMenuId = standardsInfoEO.getMenuId();
}
menuEO.setOldMenuId(oldMenuId);
count += lawsMenuService.deleteByMenuId(menuEO);
//查询是否还有与其他节点的关联,若没有则增加与根节点的关联
List<SarLawsMenu> getList = lawsMenuService.selectAllMenuByStandId(menuEO);
if (getList == null || getList.isEmpty()) {
// 查询根节点
TsResource sarMenuEO = new TsResource();
sarMenuEO.setSorDivide("BUSINESS_STAND");
List<TsResource> getRootMenu = sarMenuEOService.queryMenuByDis(sarMenuEO);
menuEO.setMenuId(getRootMenu.get(0).getId());
menuEO.setId(UUIDUtils.randomUUID20());
menuEO.setValidFlag(0);
lawsMenuService.save(menuEO);
}
}
}
if(count>0){
return Result.success("0","移除成功!",true);
} else {
return Result.error("移除失败!");
}
}
}
@@ -0,0 +1,37 @@
package com.adc.da.slrs.sarLawsMenu.dao;
import com.adc.da.slrs.sarBussStandMenu.entity.NewmenuOldmenuVO;
import com.adc.da.slrs.sarLawsMenu.entity.SarLawsMenu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
@Repository
public interface SarLawsMenuDao extends BaseMapper<SarLawsMenu> {
List<SarLawsMenu> selectByLawsInfo(SarLawsMenu sarLawsMenuEO);
int updateMenuidByMenuid(NewmenuOldmenuVO var1);
List<SarLawsMenu> selectByLawsId(String lawsId);
void deleteByLawsId(String lawsId);
List<SarLawsMenu> selectMenuByMenuParentId(SarLawsMenu sarLawsMenuEO);
int updateByLawsIdAndMenuId(SarLawsMenu sarLawsMenuEO);
int deleteByLawsIdAndMenuId(SarLawsMenu sarLawsMenuEO);
List<SarLawsMenu> selectAllMenuByStandId(SarLawsMenu sarStandMenuEO);
int deleteByMenuId(SarLawsMenu sarLawsMenuEO);
}
@@ -0,0 +1,57 @@
package com.adc.da.slrs.sarLawsMenu.entity;
import com.adc.da.base.entity.BaseEntity;
import java.math.BigDecimal;
import java.util.List;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="SarLawsMenu对象", description="")
public class SarLawsMenu extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
@TableId("ID")
private String id;
@ApiModelProperty(value = "法规ID")
@TableField("LAWS_ID")
private String lawsId;
@ApiModelProperty(value = "目录ID")
@TableField("MENU_ID")
private String menuId;
@ApiModelProperty(value = "是否有效")
@TableField("VALID_FLAG")
private Integer validFlag;
@TableField(exist = false)
private String oldMenuId;
@TableField(exist = false)
private String[] idlist;
@TableField(exist = false)
private List<String> menuIds;
}
@@ -0,0 +1,87 @@
package com.adc.da.slrs.sarLawsMenu.entity;
import com.adc.da.sys.common.BasePage;
/**
* <b>功能:</b>SAR_LAWS_MENU SarLawsMenuEOPage<br>
* <b>作者:</b>code generator<br>
* <b>日期:</b> 2018-09-03 <br>
* <b>版权所有:<b>版权归北京卡达克数据技术中心所有。<br>
*/
public class SarLawsMenuEOPage extends BasePage {
private String validFlag;
private String validFlagOperator = "=";
private String menuId;
private String menuIdOperator = "=";
private String lawsId;
private String lawsIdOperator = "=";
private String id;
private String idOperator = "=";
public String getValidFlag() {
return this.validFlag;
}
public void setValidFlag(String validFlag) {
this.validFlag = validFlag;
}
public String getValidFlagOperator() {
return this.validFlagOperator;
}
public void setValidFlagOperator(String validFlagOperator) {
this.validFlagOperator = validFlagOperator;
}
public String getMenuId() {
return this.menuId;
}
public void setMenuId(String menuId) {
this.menuId = menuId;
}
public String getMenuIdOperator() {
return this.menuIdOperator;
}
public void setMenuIdOperator(String menuIdOperator) {
this.menuIdOperator = menuIdOperator;
}
public String getLawsId() {
return this.lawsId;
}
public void setLawsId(String lawsId) {
this.lawsId = lawsId;
}
public String getLawsIdOperator() {
return this.lawsIdOperator;
}
public void setLawsIdOperator(String lawsIdOperator) {
this.lawsIdOperator = lawsIdOperator;
}
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public String getIdOperator() {
return this.idOperator;
}
public void setIdOperator(String idOperator) {
this.idOperator = idOperator;
}
}
@@ -0,0 +1,22 @@
package com.adc.da.slrs.sarLawsMenu.service;
import com.adc.da.slrs.sarLawsMenu.entity.SarLawsMenu;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* <p>
* 服务类
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
public interface ISarLawsMenuService extends IService<SarLawsMenu> {
List<SarLawsMenu> selectAllMenuByStandId(SarLawsMenu sarStandMenuEO);
int deleteByMenuId (SarLawsMenu sarStandMenuEO);
}
@@ -0,0 +1,37 @@
package com.adc.da.slrs.sarLawsMenu.service.impl;
import com.adc.da.slrs.sarLawsMenu.entity.SarLawsMenu;
import com.adc.da.slrs.sarLawsMenu.dao.SarLawsMenuDao;
import com.adc.da.slrs.sarLawsMenu.service.ISarLawsMenuService;
import com.adc.da.slrs.sarResource.service.ITsResourceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 服务实现类
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
@Service
public class SarLawsMenuServiceImpl extends ServiceImpl<SarLawsMenuDao, SarLawsMenu> implements ISarLawsMenuService {
@Autowired
private ITsResourceService sarMenuEOService;
public int deleteByMenuId (SarLawsMenu sarStandMenuEO){
List<String> menuIds = sarMenuEOService.getChildMenuList(sarStandMenuEO.getOldMenuId());
sarStandMenuEO.setMenuIds(menuIds);
return this.baseMapper.deleteByMenuId(sarStandMenuEO);
}
@Override
public List<SarLawsMenu> selectAllMenuByStandId(SarLawsMenu sarStandMenuEO){
return this.baseMapper.selectAllMenuByStandId(sarStandMenuEO);
}
}
@@ -0,0 +1,247 @@
package com.adc.da.slrs.sarLawsStandInfo.controller;
import com.adc.da.common.ReadExcel;
import com.adc.da.excel.poi.excel.ExcelExportUtil;
import com.adc.da.exception.AdcDaBaseException;
import com.adc.da.person.service.IPersonCollectEOService;
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfoPage;
import com.adc.da.slrs.sarLawsStandInfo.service.ISarLawsStandInfoService;
import com.adc.da.slrs.sarResource.service.ITsResourceService;
import com.adc.da.slrs.sarStandardsInfo.entity.SarAdvanceSearchVO;
import com.adc.da.http.PageInfo;
import com.adc.da.http.ResponseMessage;
import com.adc.da.http.Result;
import com.adc.da.slrs.sarStandardsInfo.entity.StandardsInfoExcelVO;
import com.adc.da.slrs.sarUser.service.ITsUserService;
import com.adc.da.sys.entity.DicTypeEO;
import com.adc.da.sys.service.IDicTypeEOService;
import com.adc.da.util.utils.StringUtils;
import com.adc.da.utils.util.LawsStandExportUtil;
import com.adc.da.utils.util.SarAdvanceSearchUtil;
import com.adc.da.utils.util.StandExportUtil;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.util.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfo;
import io.swagger.annotations.Api;
import com.adc.da.base.web.BaseController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Date;
import java.util.List;
/**
* <p>
* 前端控制器
* </p>
*
* @author super_liu
* @since 2021-10-25
*/
@RestController
@Api(description = "|SarLawsStandInfo|")
@RequestMapping("/${restPath}/lawss/sarLawsInfo")
public class SarLawsStandInfoController extends BaseController<SarLawsStandInfo> {
private static final Logger logger = LoggerFactory.getLogger(SarLawsStandInfoController.class);
@Autowired
private ISarLawsStandInfoService sarLawsInfoEOService;
@Autowired
private IPersonCollectEOService personCollectEOService;
@Autowired
private ITsResourceService iTsResourceService;
@Autowired
private ITsUserService tsUserService;
@Autowired
private IDicTypeEOService dicTypeEOService;
@ApiOperation(value = "|SarLawsInfoEO|分页查询")
@GetMapping("/page")
/*@RequiresPermissions("lawss:sarLawsInfo:page")*/
public ResponseMessage<PageInfo<SarLawsStandInfo>> page(SarLawsStandInfoPage page) throws Exception {
if (null != page.getNowOrderBy()) {
switch (page.getNowOrderBy()) {
case 1:
page.setOrderByA("a.issueTime");//发布日期
break;
case 2:
page.setOrderByA("SAR_LAWS_ATTR_INFO.XCXSSRQLAWS");//新车型实施日期
break;
case 3:
page.setOrderByA("SAR_LAWS_ATTR_INFO.ZCXSSRQLAWS");//在产车实施日期
break;
case 4:
page.setOrderByA("a.LAWS_TEXT_STATE");//文本状态
break;
case 5:
page.setOrderByA("paixu");
break;
case 6:
page.setOrderByA("SAR_LAWS_ATTR_INFO.SSRQ");
break;
default:
page.setNowOrder(null);
break;
}
if (null != page.getNowOrder()) {
switch (page.getNowOrder()) {
case 1:
page.setOrder1("desc");
break;
case 2:
page.setOrder1("asc");
default:
page.setOrder1(null);
break;
}
}
}
if (com.adc.da.util.utils.StringUtils.isNotBlank(page.getAdvanceSearchVOStr())) {
List<SarAdvanceSearchVO> searchList = JSONObject.parseArray(page.getAdvanceSearchVOStr(),SarAdvanceSearchVO.class);
String advanceStr = SarAdvanceSearchUtil.createSql(searchList,"SAR_LAWS_ATTR_INFO");
if (StringUtils.isNotBlank(advanceStr)) {
page.setAdvanceSearchStr(advanceStr);
} else {
page.setAdvanceSearchStr(null);
}
}
List<SarLawsStandInfo> rows = sarLawsInfoEOService.getSarStandardsInfoPage(page);
return Result.success(getPageInfo(page.getPager(), rows));
}
@ApiOperation(value = "|SarLawsStandInfo|详情")
@GetMapping("/getStandInfoById")
//@RequiresPermissions("lawss:sarStandardsInfo:get")
public ResponseMessage<SarLawsStandInfo> find(String id) throws Exception {
SarLawsStandInfo result = sarLawsInfoEOService.selectStandardsInfoByKey(id);
return Result.success(result);
}
@ApiOperation(value = "|SarLawsStandInfo|详情")
@GetMapping("/getStandInfoUpdateById")
//@RequiresPermissions("lawss:sarStandardsInfo:get")
public ResponseMessage<SarLawsStandInfo> getStandInfoUpdateById(String id) throws Exception {
SarLawsStandInfo result = sarLawsInfoEOService.selectStandardsInfoUpdateByKey(id);
String collectId = personCollectEOService.queryCollectByUserAndId(id);
result.setCollectId(collectId);
return Result.success(result);
}
@ApiOperation(value = "|SarLawsStandInfo|导出excel")
@GetMapping(value = "/exportStandardsInfoExcel")
public void exportStandardsInfoExcel(String exportContent, String exportType, String exportName,String userId, HttpServletResponse response,
HttpServletRequest request) throws Exception {
OutputStream os = null;
Workbook workbook = null;
try {
if(StringUtils.isEmpty(exportName)||exportName.equals("null")){
exportName="政策库";
}
response.setHeader("Content-Disposition",
"attachment; filename=" + ReadExcel.encodeFileName(exportName+".xlsx",request));
response.setContentType("application/force-download");
// 导出所有数据
List<SarLawsStandInfo> data = sarLawsInfoEOService.getExportData(exportType,exportContent,userId);
workbook = LawsStandExportUtil.exportDatas(data);
os = response.getOutputStream();
workbook.write(os);
os.flush();
} catch (IOException e) {
logger.error(e.getMessage(), e);
throw new AdcDaBaseException("下载文件失败,请重试");
} finally {
IOUtils.closeQuietly(os);
}
}
@ApiOperation(value = "|SarLawsStandInfo|确认配置标准")
@PostMapping("/saveStandardsMenu")
//@RequiresPermissions("lawss:sarBussionessStand:saveStandardsMenu")
public ResponseMessage saveStandardsMenu(@RequestBody SarLawsStandInfoPage standardsInfoEO){
if ("wdsc".equals(standardsInfoEO.getMenuId()) || "gxhbq".equals(standardsInfoEO.getMenuId())) {
return Result.error("所选节点不支持配置标准");
} else {
SarLawsStandInfoPage standlist = sarLawsInfoEOService.updateStandardsMenu(standardsInfoEO);
return Result.success(standardsInfoEO);
}
}
@ApiOperation(value = "|SarLawsStandInfo|企业标准修改")
@PostMapping(value = "/updateSarLawsStandInfo")
public ResponseMessage<SarLawsStandInfo> updateSarLawsStandInfo(@RequestBody SarLawsStandInfo sarLawsStandInfo) throws Exception {
sarLawsStandInfo.setModifyTime(new Date());
sarLawsInfoEOService.updateSarLawsStandInfo(sarLawsStandInfo);
return Result.success("","修改成功",sarLawsStandInfo);
}
@ApiOperation(value = "|SarLawsStandInfo|删除")
@PostMapping("deleteSarLawsStandInfo")
public ResponseMessage delete(String ids) throws Exception {
SarLawsStandInfoPage sarLawsStandInfoPage = new SarLawsStandInfoPage();
sarLawsStandInfoPage.setIdlist(ids.split(","));
ResponseMessage<SarLawsStandInfo> result = sarLawsInfoEOService.deleteSarLawsStandInfo(sarLawsStandInfoPage);
logger.info("delete from SAR_BUSSIONESS_STAND where id = {}", ids);
return result;
}
/**
* 新增过程中验证标准号
*
* @param page
* @return
*/
@ApiOperation(value = "|SarLawsStandInfo|验证输入的标准号")
@PostMapping("/validateStandNumber")
//@RequiresPermissions("lawss:sarStandardsInfo:selectReplaceStandNum")
public ResponseMessage validateStandNumber(SarLawsStandInfoPage page) throws Exception {
String sortName = "";
String standNumShow = "";
List<DicTypeEO> getDicCode = dicTypeEOService.getDicEOByDicTypeCode(page.getStandSort());
if(getDicCode!= null && getDicCode.size()>0){
sortName = getDicCode.get(0).getDicTypeName();
}
if (StringUtils.isNotEmpty(page.getLawsNumber())) {
List<SarLawsStandInfo> standlist = sarLawsInfoEOService.selectStandardsByStandNumber(page.getLawsNumber());
if (standlist.size() > 0) {
if (StringUtils.isNotEmpty(page.getId())) {
// 如果是修改,判断id是否一样
for (int i = 0; i < standlist.size(); i++) {
if (standlist.get(i).getId().equals(page.getId())) {
continue;
} else {
return Result.error(standNumShow + "政策编号已存在");
}
}
return Result.success();
} else {
return Result.error(standNumShow + "政策编号已存在");
}
} else {
return Result.success();
}
} else {
return Result.success();
}
}
}
@@ -0,0 +1,30 @@
package com.adc.da.slrs.sarLawsStandInfo.dao;
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfo;
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfoPage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author super_liu
* @since 2021-10-25
*/
@Repository
public interface SarLawsStandInfoDao extends BaseMapper<SarLawsStandInfo> {
List<SarLawsStandInfo> getSarStandardsInfoPage(SarLawsStandInfoPage page);
int getSarStandardsInfoCount(SarLawsStandInfoPage page);
List<SarLawsStandInfo> selectStandardsInfoByKey(String id);
List<SarLawsStandInfo> getSarStandardsExportInfo(SarLawsStandInfoPage page);
}
@@ -0,0 +1,243 @@
package com.adc.da.slrs.sarLawsStandInfo.entity;
import com.adc.da.att.vo.AttFileVo;
import com.adc.da.base.entity.BaseEntity;
import java.math.BigDecimal;
import com.adc.da.slrs.sarStandAttrDetails.entity.SarStandAttrDetails;
import com.adc.da.slrs.standardSplit.entity.SarStandAttrDetailsEO;
import com.adc.da.sys.entity.DicTypeEO;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.util.*;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import oracle.sql.DATE;
/**
* <p>
*
* </p>
*
* @author super_liu
* @since 2021-10-25
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="SarLawsStandInfo对象", description="")
public class SarLawsStandInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
@TableId("ID")
private String id;
@ApiModelProperty(value = "政策分类 共四级,逐级选择-配置管理中维护")
@TableField("LAWS_TYPE")
private String lawsType;
@ApiModelProperty(value = "政策编号")
@TableField("LAWS_NUMBER")
private String lawsNumber;
@ApiModelProperty(value = "中文名称")
@TableField("LAWS_NAME")
private String lawsName;
@ApiModelProperty(value = "英文名称")
@TableField("LAWS_EN_NAME")
private String lawsEnName;
@ApiModelProperty(value = "政策文号")
@TableField("LAWS_NO")
private String lawsNo;
@ApiModelProperty(value = "发文日期")
@TableField("ISSUE_TIME")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
private String issueTime;
@ApiModelProperty(value = "发文单位")
@TableField("ISSUE_COMPANY")
private String issueCompany;
@ApiModelProperty(value = "征集意见周期-起始时间")
@TableField("COMMENT_CYCLE_START")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
private String commentCycleStart;
@ApiModelProperty(value = "征集意见周期-结束时间")
@TableField("COMMENT_CYCLE_END")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
private String commentCycleEnd;
@ApiModelProperty(value = "文件状态-配置管理中维护")
@TableField("LAWS_TEXT_STATE")
private String lawsTextState;
@ApiModelProperty(value = "适用区域-配置管理中维护")
@TableField("LAWS_SYQY")
private String lawsSyqy;
@ApiModelProperty(value = "适用车型-配置管理中维护")
@TableField("LAWS_SYCX")
private String lawsSycx;
@ApiModelProperty(value = "是/否(选择否,只有政策、政策中文名称是必填项目)")
@TableField("IS_RELATE_ACCESS")
private String isRelateAccess;
@ApiModelProperty(value = "年度-可在配置管理中维护,根据发布日期自动带入可手动修改")
@TableField("LAWS_YEAR")
private String lawsYear;
@ApiModelProperty(value = "福田转发通知文号")
@TableField("LAWS_NOTISYNC_NUM")
private String lawsNotisyncNum;
@ApiModelProperty(value = "信息简报 xxx期次xxx板块")
@TableField("LAWS_BULLETIN")
private String lawsBulletin;
@ApiModelProperty(value = "标签-可在配置管理中维护")
@TableField("LAWS_LABEL")
private String lawsLabel;
@ApiModelProperty(value = "备注")
@TableField("LAWS_REMARK")
private String lawsRemark;
@ApiModelProperty(value = "国家地区")
@TableField("COUNTRY")
private String country;
@TableField("CREATION_USER")
private String creationUser;
@ApiModelProperty(value = "是否有效")
@TableField("VALID_FLAG")
private Integer validFlag;
@ApiModelProperty(value = "创建时间")
@TableField("CREATION_TIME")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date creationTime;
@ApiModelProperty(value = "修改时间")
@TableField("MODIFY_TIME")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date modifyTime;
@ApiModelProperty(value = "参数1")
@TableField("PARAM1")
private Long param1;
@ApiModelProperty(value = "参数2")
@TableField("PARAM2")
private String param2;
// 非表字段
@TableField(exist = false)
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private String firstPutTime;
@TableField(exist = false)
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
private String putTimeShow;
@TableField(exist = false)
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
private String issueTimeShow;
@TableField(exist = false)
private String issueTimeStr;
@TableField(exist = false)
private String putTimeStr;
//目录ID 非标准信息表中的字段
@TableField(exist = false)
private String menuId;
@TableField(exist = false)
private String menuParentId;
@TableField(exist = false)
private String standStatusShow; // 标准状态下拉框 --单选
@TableField(exist = false)
private String standNatrueShow;
@TableField(exist = false)
private String standSortShow;
@TableField(exist = false)
private String applyCountryShow;
@TableField(exist = false)
private List<AttFileVo> standFileList = new ArrayList<AttFileVo>();
@TableField(exist = false)
private List<AttFileVo> opinionFilesList = new ArrayList<AttFileVo>();
@TableField(exist = false)
private List<AttFileVo> relevanceFileList = new ArrayList<AttFileVo>();
@TableField(exist = false)
private String collectId;
//文件的类型
@TableField(exist = false)
private String standFileClassify;
//文件的下载id
@TableField(exist = false)
private String attId;
//记录是否修改了替代文件号
@TableField(exist = false)
private int upReplaceNumFlag;
//记录是否修改了文件号
@TableField(exist = false)
private int upNumFlag;
// 数据库新加的字段
@TableField(exist = false)
private String remark;//备注
@TableField(exist = false)
private Map<String, Object> attrInfoMap = new LinkedHashMap<>(); //属性表字段与值
@TableField(exist = false)
private Map<String, Object> attrInfoCaseMap = new LinkedHashMap<>(); //属性表字段与值小写前端带入渲染
@TableField(exist = false)
private String sarStandAttrEOStr; //新增修改时属性表信息
@TableField(exist = false)
private String fileIds; //全部文件ID
@TableField(exist = false)
private List<SarStandAttrDetailsEO> attrInfoList = new ArrayList<>();
@TableField(exist = false)
private String standTextStatusShow; // 标准文本状态显示名称
// 以下为非表中字段
@TableField(exist = false)
private String countryShow; //国家地区显示名称
@TableField(exist = false)
private String standStateShow; // 标准状态显示名称
@TableField(exist = false)
private String standNatureShow; // 标准性质显示名称
@TableField(exist = false)
private List<DicTypeEO> dicTypeList = new ArrayList(); // 记录标准涉及到的所有数据字典数据
}
@@ -0,0 +1,256 @@
package com.adc.da.slrs.sarLawsStandInfo.entity;
import com.adc.da.base.entity.BaseEntity;
import com.adc.da.base.page.BasePage;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import oracle.sql.DATE;
import java.util.Date;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author super_liu
* @since 2021-10-25
*/
@Data
public class SarLawsStandInfoPage extends BasePage {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
private String id;
@ApiModelProperty(value = "政策分类 共四级,逐级选择-配置管理中维护")
private String lawsType;
@ApiModelProperty(value = "政策编号")
private String lawsNumber;
@ApiModelProperty(value = "中文名称")
private String lawsName;
@ApiModelProperty(value = "英文名称")
private String lawsEnName;
@ApiModelProperty(value = "政策文号")
private String lawsNo;
@ApiModelProperty(value = "发文日期")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
private String issueTime;
@ApiModelProperty(value = "发文单位")
private String issueCompany;
@ApiModelProperty(value = "征集意见周期-起始时间")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
private String commentCycleStart;
@ApiModelProperty(value = "征集意见周期-结束时间")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
private String commentCycleEnd;
@ApiModelProperty(value = "文件状态-配置管理中维护")
private String lawsTextState;
@ApiModelProperty(value = "适用区域-配置管理中维护")
private String lawsSyqy;
@ApiModelProperty(value = "适用车型-配置管理中维护")
private String lawsSycx;
@ApiModelProperty(value = "是/否(选择否,只有政策、政策中文名称是必填项目)")
private String isRelateAccess;
@ApiModelProperty(value = "年度-可在配置管理中维护,根据发布日期自动带入可手动修改")
private String lawsYear;
@ApiModelProperty(value = "福田转发通知文号")
private String lawsNotisyncNum;
@ApiModelProperty(value = "信息简报 xxx期次xxx板块")
private String lawsBulletin;
@ApiModelProperty(value = "标签-可在配置管理中维护")
private String lawsLabel;
@ApiModelProperty(value = "备注")
private String lawsRemark;
@ApiModelProperty(value = "国家地区")
private String country;
@TableField("CREATION_USER")
private String creationUser;
@ApiModelProperty(value = "是否有效")
private String validFlag;
@ApiModelProperty(value = "创建时间")
private String creationTime;
@ApiModelProperty(value = "修改时间")
private String modifyTime;
@ApiModelProperty(value = "参数1")
private String param1;
@ApiModelProperty(value = "参数2")
private String param2;
private String[] commentCycleDate;
private String modifyTime1;
private String modifyTime2;
private String modifyTimeOperator = "=";
private String creationTime1;
private String creationTime2;
private String creationTimeOperator = "=";
private String validFlagOperator = "=";
private String putUser;
private String putUserOperator = "=";
private String citationUser;
private String citationUserOperator = "=";
private String responsibleUnit;
private String responsibleUnitOperator = "=";
private String standFile;
private String standFileOperator = "=";
private String tags;
private String tagsOperator = "=";
private String standStatus;
private String standStatusOperator = "=";
private String replacedStandNum;
private String replacedStandNumOperator = "=";
private String replaceStandNum;
private String replaceStandNumOperator = "=";
private String quoteStand;
private String quoteStandOperator = "=";
private String firstPutTime;
private String firstPutTime1;
private String firstPutTime2;
private String firstPutTimeOperator = "=";
private String putYear;
private String putYear1;
private String putYear2;
private String putYearOperator = "=";
private String putTime;
private String putTime1;
private String putTime2;
private String putTimeOperator = "=";
private String issueTime1;
private String issueTime2;
private String issueTimeOperator = "=";
private String energyKind;
private String energyKindOperator = "=";
private String applyArctic;
private String applyArcticOperator = "=";
private String standEnName;
private String standEnNameOperator = "=";
private String standName;
private String standNameOperator = "=";
private String standCode;
private String standCodeOperator = "=";
private String classifyCode;
private String classifyCodeOperator = "=";
private String standSubclass;
private String standSubclassOperator = "=";
private String standGenera;
private String standGeneraOperator = "=";
private String idOperator = "=";
private String menuId;
private List<String> menuIdList;
private String[] idlist;
//为了在sql中区分修改操作
private String updateFlag;
// 数据库新增字段
private String applyCountry;
private String standYear;
private String applyCountryOperator = "=";
private String standNature;
private String standNatureOperator = "=";
private String synopsis;
private String synopsisOperator = "=";
private String standSort;
private String standSortOperator = "=";
private String opinionFile;
private String opinionFileOperator = "=";
private String relevanceFile;
private String relevanceFileOperator = "=";
private String remark;
private String remarkOperator = "=";
private List<String> roleIds;
private String rootMenuId;
private String orgName;
private List<String> menuRoleList;
private String[] replacedStandNumList;
private String numberName;
// 树结构增加搜索条件
private String collectMenuId;
private String advanceSearchVOStr;
private String advanceSearchStr;
private List<String> menuAllChildrenIdList;
private String userId;
private String zqcrId;
private String textStatusBuss;
// 新增字段
private String FZRQBUSS;
private String FSRQBUSS;
private String FBGBUSS;
private String BZSMBUSS;
private String LSBBBUSS;
private String QTWJBUSS;
private String QCDW;
private String QCRBUSS;
private String WJSCRYBUSS;
private String SYCXCLASS;
private String NYLXCLASS;
private String SYCPXCLASS;
private String TXLBBUSS;
private String VPPSBMBUSS;
private String VPPSCNBUSS;
private String DTQBBHBUSS;
private String BDTQBBHBUSS;
private String XGJLBUSS;
private String XGLC;
private String GLWJBUSS;
private String XCSJBUSS;
//页面排序
private String paixu;
private String shunxu;
private String sql;
// 树结构增加搜索条件
@TableField(exist = false)
private String labelMenuId;
@TableField(exist = false)
private String ids;
@TableField(exist = false)
private String proType;
@TableField(exist = false)
private Integer nowOrder;
@TableField(exist = false)
private Integer nowOrderBy;
@TableField(exist = false)
private String orderByA = "a.issue_time";
@TableField(exist = false)
private String orderBy1 = "SAR_LAWS_STAND_INFO.issue_time";
@TableField(exist = false)
private String order1 = "desc";
}
@@ -0,0 +1,38 @@
package com.adc.da.slrs.sarLawsStandInfo.service;
import com.adc.da.http.ResponseMessage;
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfo;
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfoPage;
import com.adc.da.slrs.sarStandardsInfo.entity.SarBussionessStandEOPage;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* <p>
* 服务类
* </p>
*
* @author super_liu
* @since 2021-10-25
*/
public interface ISarLawsStandInfoService extends IService<SarLawsStandInfo> {
List<SarLawsStandInfo> selectStandardsByStandNumber(String replaceStandNum);
ResponseMessage<SarLawsStandInfo> deleteSarLawsStandInfo(SarLawsStandInfoPage page) throws Exception;
SarLawsStandInfo updateSarLawsStandInfo(SarLawsStandInfo sarLawsStandInfo) throws Exception;
SarLawsStandInfoPage updateStandardsMenu(SarLawsStandInfoPage standardsInfoEO);
List<SarLawsStandInfo> getExportData(String exportType, String exportContent,String userId) throws Exception;
List<SarLawsStandInfo> getSarStandardsInfoPage(SarLawsStandInfoPage page) throws Exception;
SarLawsStandInfo selectStandardsInfoByKey(String id) throws Exception;
SarLawsStandInfo selectStandardsInfoUpdateByKey(String id) throws Exception;
}
@@ -0,0 +1,812 @@
package com.adc.da.slrs.sarLawsStandInfo.service.impl;
import com.adc.da.att.entity.AttFileEO;
import com.adc.da.att.service.IAttFileEOService;
import com.adc.da.common.SarTypeEnum;
import com.adc.da.common.SelectionTypeEnum;
import com.adc.da.common.UseModuleEnum;
import com.adc.da.http.ResponseMessage;
import com.adc.da.http.Result;
import com.adc.da.login.util.UserUtils;
import com.adc.da.mq.CreateMQService;
import com.adc.da.mq.CreateStandMQService;
import com.adc.da.person.dao.PersonCollectEODao;
import com.adc.da.person.entity.TsPersonCollect;
import com.adc.da.person.page.PersonCollectEOPage;
import com.adc.da.person.service.IPersonCollectEOService;
import com.adc.da.search.entity.StandLawsEO;
import com.adc.da.search.service.StandLawsSearchService;
import com.adc.da.slrs.otConvertMq.dao.OtConvertMqDao;
import com.adc.da.slrs.otConvertMq.entity.OtConvertMq;
import com.adc.da.slrs.sarBussStandAttrInfo.dao.SarBussStandAttrInfoDao;
import com.adc.da.slrs.sarBussStandFile.dao.SarBussStandFileDao;
import com.adc.da.slrs.sarBussStandItems.dao.SarBussStandItemsDao;
import com.adc.da.slrs.sarBussStandMenu.dao.SarBussStandMenuDao;
import com.adc.da.slrs.sarBussStandVal.dao.SarBussStandValDao;
import com.adc.da.slrs.sarBussionessStand.dao.SarBussionessStandDao;
import com.adc.da.slrs.sarLawsAttrInfo.dao.SarLawsAttrInfoDao;
import com.adc.da.slrs.sarLawsAttrInfo.entity.SarLawsAttrInfo;
import com.adc.da.slrs.sarLawsFile.dao.SarLawsFileDao;
import com.adc.da.slrs.sarLawsFile.entity.SarLawsFile;
import com.adc.da.slrs.sarLawsInfo.dao.SarLawsInfoDao;
import com.adc.da.slrs.sarLawsItems.dao.SarLawsItemsDao;
import com.adc.da.slrs.sarLawsMenu.dao.SarLawsMenuDao;
import com.adc.da.slrs.sarLawsMenu.entity.SarLawsMenu;
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfo;
import com.adc.da.slrs.sarLawsStandInfo.dao.SarLawsStandInfoDao;
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfoPage;
import com.adc.da.slrs.sarLawsStandInfo.service.ISarLawsStandInfoService;
import com.adc.da.slrs.sarLawsVal.dao.SarLawsValDao;
import com.adc.da.slrs.sarLawsVal.entity.SarLawsVal;
import com.adc.da.slrs.sarResource.entity.TsResource;
import com.adc.da.slrs.sarResource.service.ITsResourceService;
import com.adc.da.slrs.sarStandAttrInfo.dao.SarStandAttrInfoDao;
import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao;
import com.adc.da.slrs.sarStandardsInfo.entity.SarAdvanceSearchVO;
import com.adc.da.slrs.sarUpdLog.service.ISarUpdLogService;
import com.adc.da.slrs.sarUser.service.ITsUserService;
import com.adc.da.slrs.sysInfo.service.SysInfoEOService;
import com.adc.da.sys.constant.ValueStateEnum;
import com.adc.da.sys.dao.DicTypeEODao;
import com.adc.da.sys.util.LoginUserUtil;
import com.adc.da.util.UUIDUtils;
import com.adc.da.utils.util.FieldConvertUtil;
import com.adc.da.utils.util.InitStandAttrUtil;
import com.adc.da.utils.util.SarAdvanceSearchUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import net.sf.json.JSONObject;
import org.apache.commons.lang.StringUtils;
import org.json.JSONTokener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.sql.Clob;
import java.util.*;
import java.util.stream.Collectors;
/**
* <p>
* 服务实现类
* </p>
*
* @author super_liu
* @since 2021-10-25
*/
@Service
public class SarLawsStandInfoServiceImpl extends ServiceImpl<SarLawsStandInfoDao, SarLawsStandInfo> implements ISarLawsStandInfoService {
@Value("${elas.flag}")
private boolean elasflag; //ES是否启用
@Value("${file.path}")
private String filePath;//文件存储路径
@Autowired
private IPersonCollectEOService personCollectEOService;
@Autowired
private ITsResourceService iTsResourceService;
@Autowired
private ITsUserService tsUserService;
@Autowired
private IAttFileEOService attFileEOService;
@Autowired
private DicTypeEODao dicTypeEODao;
@Autowired
private SysInfoEOService sysInfoEOService;
@Autowired
private SarLawsMenuDao sarLawsMenuDao;
@Autowired
private OtConvertMqDao otConvertEODao;
@Autowired
private CreateMQService convertMq;
@Autowired
private SarLawsValDao sarBussStandValEODao;
@Autowired
private SarLawsFileDao sarBussStandFileEODao;
@Autowired
private CreateStandMQService createStandMQService;
@Autowired
private ISarUpdLogService sarUpdLogEOService;
@Autowired
private ITsResourceService sarMenuEOService;
@Autowired
private PersonCollectEODao personCollectEODao;
@Autowired
private SarLawsAttrInfoDao sarLawsAttrInfoDao;
@Autowired
private SarLawsItemsDao sarLawsItemsDao;
@Autowired
private StandLawsSearchService standLawsSearchService;
@Override
public List<SarLawsStandInfo> getSarStandardsInfoPage(SarLawsStandInfoPage page) throws Exception {
//查询当前登录人角色拥有权限的菜单
String userId = UserUtils.getUserId();
if(page.getMenuId() != null && page.getUserId() != null && StringUtils.isNotBlank(userId)){
QueryWrapper<TsResource> qw = new QueryWrapper<>();
qw.eq("ID",page.getMenuId());
qw.isNull("PARENT_ID");
List<TsResource> children = iTsResourceService.list(qw);
if(children.isEmpty() && !page.getMenuId().equals("nomenu")){
List<String> getMenuIdList = tsUserService.getResourceUserId(userId);
if (!getMenuIdList.isEmpty()) {
page.setMenuRoleList(getMenuIdList);
} else {
page.setMenuRoleList(null);
}
List<String> ids = iTsResourceService.getChildMenuList(userId);
if (ids != null && !ids.isEmpty()) {
page.setMenuAllChildrenIdList(ids);
}
}
}
Integer rowCount = this.baseMapper.getSarStandardsInfoCount(page);
page.getPager().setRowCount(rowCount);
List<SarLawsStandInfo> rows = this.baseMapper.getSarStandardsInfoPage(page);
attrInfoCollect(rows);
return rows;
}
/***
* @Description: 处理属性表数据
* @Param: [sarlist]
* @Return: void
*/
public void attrInfo (List<SarLawsStandInfo> sarlist) throws Exception {
for(SarLawsStandInfo row : sarlist){
attrInfoDetails(row);
}
}
public void attrInfoCollect (List<SarLawsStandInfo> sarlist) throws Exception {
List<String> collectResIds = sarlist.stream().map(SarLawsStandInfo::getId).collect(Collectors.toList());
Map<String,String> collectMap = personCollectEOService.queryCollectByUserAndIds(collectResIds);
for (SarLawsStandInfo row : sarlist) {
if(collectMap != null && collectMap.get(row.getId()) != null){
row.setCollectId(collectMap.get(row.getId()));
}
}
}
@Override
public SarLawsStandInfo selectStandardsInfoByKey(String id) throws Exception{
List<SarLawsStandInfo> sarLawsStandInfoList = this.baseMapper.selectStandardsInfoByKey(id);
SarLawsStandInfo sarLawsStandInfo = new SarLawsStandInfo();
if(!sarLawsStandInfoList.isEmpty()) {
List<SarLawsStandInfo> newStandList = new ArrayList<>();
newStandList.add(sarLawsStandInfoList.get(0));
attrInfoShowDetails(newStandList);
sarLawsStandInfo = newStandList.get(0);
}
return sarLawsStandInfo;
}
@Override
public SarLawsStandInfo selectStandardsInfoUpdateByKey(String id) throws Exception{
List<SarLawsStandInfo> sarLawsStandInfoList = this.baseMapper.selectStandardsInfoByKey(id);
SarLawsStandInfo sarLawsStandInfo = new SarLawsStandInfo();
if(!sarLawsStandInfoList.isEmpty()) {
List<SarLawsStandInfo> newStandList = new ArrayList<>();
newStandList.add(sarLawsStandInfoList.get(0));
attrInfo(newStandList);
sarLawsStandInfo = newStandList.get(0);
}
return sarLawsStandInfo;
}
public void attrInfoDetails (SarLawsStandInfo row) throws Exception {
String fieldInfo = InitStandAttrUtil.queryFieldLaws;
String collectId = personCollectEOService.queryCollectByUserAndId(row.getId());
row.setCollectId(collectId);
// 查询属性表数据
if (StringUtils.isNotBlank(fieldInfo)) {
Map<String, Object> getAttrMap = sarLawsAttrInfoDao.selectLawsFieldAndData(fieldInfo,row.getId());
if (InitStandAttrUtil.clobFieldListLaws != null && !InitStandAttrUtil.clobFieldListLaws.isEmpty()) {
// 遍历修改所有clob类型的值
for (String clobField : InitStandAttrUtil.clobFieldListLaws) {
Clob clobValue = (Clob) getAttrMap.get(clobField);
String fieldValue = FieldConvertUtil.ClobToString(clobValue);
getAttrMap.put(clobField,fieldValue);
}
}
// 组织机构和人员
Map<String,Object> newMap = new HashMap<>();
if(getAttrMap != null){
for (Map.Entry<String,Object> entry : getAttrMap.entrySet()) {
String name = entry.getKey();
Object value1 = entry.getValue();
if (value1 != null && value1.toString().equals("\"null\"")){
entry.setValue("");
}
if (entry.getValue() != null && InitStandAttrUtil.selectionFieldListLaws != null && InitStandAttrUtil.selectionFieldListLaws.size() > 0 && InitStandAttrUtil.selectionFieldListLaws.contains(name)) {
String value = entry.getValue().toString();
String selVal = InitStandAttrUtil.selectFieldMapLaws.get(name);
if (SelectionTypeEnum.ORGLIST.getValue().equals(selVal)) {
value = sysInfoEOService.getOrgNamesByIds(value);
newMap.put(name + "Name",value);
} else if (SelectionTypeEnum.USERLIST.getValue().equals(selVal)) {
value = sysInfoEOService.getUserNamesByIds(value);
newMap.put(name + "Name",value);
} else if (SelectionTypeEnum.ROLELIST.getValue().equals(selVal)) {
value = sysInfoEOService.getRoleNamesByIds(value);
newMap.put(name + "Name",value);
}
}
}
getAttrMap.putAll(newMap);
}
if (getAttrMap != null && !getAttrMap.isEmpty()) {
row.setAttrInfoCaseMap(transformUpperCase(getAttrMap));
}
row.setAttrInfoMap(getAttrMap);
}
}
private Map<String, Object> transformUpperCase(Map<String, Object> orgMap) {
Map<String, Object> resultMap = new HashMap<>();
for (Map.Entry<String, Object> entry : orgMap.entrySet()) {
String newKey = entry.getKey().toLowerCase();
resultMap.put(newKey, orgMap.get(entry.getKey()));
if (entry.getValue() != null && InitStandAttrUtil.fileFieldListLaws != null && !InitStandAttrUtil.fileFieldListLaws.isEmpty() && InitStandAttrUtil.fileFieldListLaws.contains(entry.getKey())) {
String value = entry.getValue().toString();
if (StringUtils.isNotBlank(value)) {
List<AttFileEO> fileObj = attFileEOService.getMultiFileInfos(value);
if(!fileObj.isEmpty()){
resultMap.put(newKey + "Name", fileObj.get(0).getOldFileName());
}
}
}
}
return resultMap;
}
public void attrInfoShowDetails(List<SarLawsStandInfo> sarlist) throws Exception {
for (SarLawsStandInfo row : sarlist) {
attrInfoDetails(row);
Map<String, Object> getAttrMap = row.getAttrInfoMap();
if (getAttrMap != null && getAttrMap.size() > 0) {
for (Map.Entry<String, Object> entry : getAttrMap.entrySet()) {
String name = entry.getKey();
String value = "";
if (entry.getValue() != null && InitStandAttrUtil.fileFieldListLaws != null && InitStandAttrUtil.fileFieldListLaws.size() > 0 && InitStandAttrUtil.fileFieldListLaws.contains(name)) {
value = entry.getValue().toString();
if (StringUtils.isNotBlank(value)) {
List<AttFileEO> fileObj = attFileEOService.getMultiFileInfos(value);
entry.setValue(fileObj);
}
}else if (entry.getValue() != null && InitStandAttrUtil.selectionFieldListLaws != null && InitStandAttrUtil.selectionFieldListLaws.size() > 0 && InitStandAttrUtil.selectionFieldListLaws.contains(name)) {
value = entry.getValue().toString();
List<String> valArr = Arrays.asList(value.split(","));
value = dicTypeEODao.getDicNamesByCodes(valArr);
entry.setValue(value);
}
}
}
}
}
@Override
public List<SarLawsStandInfo> getExportData(String exportType, String exportContent,String userId) throws Exception {
SarLawsStandInfoPage page = new SarLawsStandInfoPage();
if ("apart".equals(exportType)) {
page.setIdlist(exportContent.split(","));
} else {
JSONObject jsonObject = JSONObject.fromObject(exportContent);
page = (SarLawsStandInfoPage)JSONObject.toBean(jsonObject, SarLawsStandInfoPage.class);
page.setPage(1);
page.setPageSize(10000);
//查询当前登录人角色拥有权限的菜单
if(page.getMenuId() != null && page.getUserId() != null && StringUtils.isNotBlank(page.getUserId())){
QueryWrapper<TsResource> qw = new QueryWrapper<>();
qw.eq("ID",page.getMenuId());
qw.isNull("PARENT_ID");
List<TsResource> children = iTsResourceService.list(qw);
if(children.isEmpty() && !page.getMenuId().equals("nomenu")){
List<String> getMenuIdList = tsUserService.getResourceUserId(page.getUserId());
if (getMenuIdList != null && !getMenuIdList.isEmpty()) {
page.setMenuRoleList(getMenuIdList);
} else {
page.setMenuRoleList(null);
}
List<String> ids = iTsResourceService.getChildMenuList(page.getMenuId());
if (ids != null && !ids.isEmpty()) {
page.setMenuAllChildrenIdList(ids);
}
}
}
if (StringUtils.isNotBlank(page.getAdvanceSearchVOStr())) {
List<SarAdvanceSearchVO> searchList = com.alibaba.fastjson.JSONObject.parseArray(page.getAdvanceSearchVOStr(),SarAdvanceSearchVO.class);
String advanceStr = SarAdvanceSearchUtil.createSql(searchList,"SAR_LAWS_ATTR_INFO");
if (com.adc.da.util.utils.StringUtils.isNotBlank(advanceStr)) {
page.setAdvanceSearchStr(advanceStr);
} else {
page.setAdvanceSearchStr(null);
}
}
}
page.setOrderBy("SAR_LAWS_ATTR_INFO.issue_time is null,SAR_LAWS_ATTR_INFO.issue_time desc,SAR_LAWS_ATTR_INFO.id");
if(userId != null){
page.setUserId(userId);
}else {
page.setUserId(LoginUserUtil.getUserId());
}
List<SarLawsStandInfo> rows = this.baseMapper.getSarStandardsExportInfo(page);
attrInfoShow(rows);
return rows;
}
public void attrInfoShow (List<SarLawsStandInfo> sarlist) throws Exception {
for(SarLawsStandInfo row : sarlist){
attrInfoDetails(row);
Map<String, Object> getAttrMap = row.getAttrInfoMap();
Map<String, Object> getNewMap = new LinkedHashMap<>();
if (getAttrMap != null && getAttrMap.size() > 0) {
String svppsTip = "";
for (Map.Entry<String,Object> entry : getAttrMap.entrySet()) {
String name = entry.getKey();
String value = "";
if (entry.getValue() != null && InitStandAttrUtil.fileFieldListLaws != null && InitStandAttrUtil.fileFieldListLaws.size() > 0 && InitStandAttrUtil.fileFieldListLaws.contains(name)) {
value = entry.getValue().toString();
if (StringUtils.isNotBlank(value)) {
List<AttFileEO> fileObj = attFileEOService.getMultiFileInfos(value);
entry.setValue(fileObj);
}
} else if (entry.getValue() != null && InitStandAttrUtil.selectionFieldListLaws != null && InitStandAttrUtil.selectionFieldListLaws.size() > 0 && InitStandAttrUtil.selectionFieldListLaws.contains(name)) {
value = entry.getValue().toString();
String selVal = InitStandAttrUtil.selectFieldMapLaws.get(name);
if (SelectionTypeEnum.ORGLIST.getValue().equals(selVal) || SelectionTypeEnum.USERLIST.getValue().equals(selVal) || SelectionTypeEnum.ROLELIST.getValue().equals(selVal)) {
if("ZYQCR".equals(name)||"QTQCR".equals(name)){
if(getAttrMap.get(name + "Name")!=null && !getAttrMap.get(name + "Name").equals("")){
value = String.valueOf(getAttrMap.get(name + "Name"));
}
}else{
value = String.valueOf(getAttrMap.get(name + "Name"));
}
} else {
List<String> valArr = Arrays.asList(value.split(","));
value = dicTypeEODao.getDicNamesByCodes(valArr);
}
entry.setValue(value);
}
}
getAttrMap.put("SVPPSTips",svppsTip);
}
}
}
@Override
public SarLawsStandInfoPage updateStandardsMenu(SarLawsStandInfoPage standardsInfoEO) {
SarLawsMenu sarStandMenuEO = new SarLawsMenu();
String nowMenuId = standardsInfoEO.getMenuId();
sarStandMenuEO.setMenuId(nowMenuId);
for (int i = 0; i < standardsInfoEO.getIdlist().length; i++) {
sarStandMenuEO.setLawsId(standardsInfoEO.getIdlist()[i]);
sarStandMenuEO.setId(null);
sarStandMenuEO.setValidFlag(0);
// 根据当前目录查询所在父节点
String secondLevelId = "";
List<String> getMenuPIds = iTsResourceService.getParentMenuId(nowMenuId);
if (getMenuPIds != null && getMenuPIds.size() > 1) {
int idSize = getMenuPIds.size();
secondLevelId = getMenuPIds.get(idSize-1);
} else {
secondLevelId = nowMenuId;
}
//查询标准是否已在 当前父节点中
SarLawsMenu standMenuEOQuery = new SarLawsMenu();
standMenuEOQuery.setMenuId(secondLevelId);
standMenuEOQuery.setLawsId(standardsInfoEO.getIdlist()[i]);
List<String> menuIds = iTsResourceService.getChildMenuList(secondLevelId);
standMenuEOQuery.setMenuIds(menuIds);
List<SarLawsMenu> getInfo = sarLawsMenuDao.selectMenuByMenuParentId(standMenuEOQuery);
//删除节点与根节点的关联
SarLawsMenu sarStandMenuDel = new SarLawsMenu();
sarStandMenuDel.setLawsId(standardsInfoEO.getIdlist()[i]);
sarStandMenuDel.setMenuId(standardsInfoEO.getRootMenuId());
sarLawsMenuDao.deleteByLawsIdAndMenuId(sarStandMenuDel);
if (getInfo == null || getInfo.isEmpty()) {
sarStandMenuEO.setId(UUIDUtils.randomUUID20());
sarLawsMenuDao.insert(sarStandMenuEO);
} else {
sarStandMenuEO.setOldMenuId(secondLevelId);
List<String> menuOldIds = iTsResourceService.getChildMenuList(secondLevelId);
sarStandMenuEO.setMenuIds(menuOldIds);
sarLawsMenuDao.updateByLawsIdAndMenuId(sarStandMenuEO);
}
}
return standardsInfoEO;
}
public SarLawsStandInfo updateSarLawsStandInfo(SarLawsStandInfo sarLawsStandInfo) throws Exception {
String standId = sarLawsStandInfo.getId();
SarLawsStandInfo beforeStandEO = this.baseMapper.selectById(standId);
if(beforeStandEO!=null){
attrInfoDetails(beforeStandEO);
}
//规范性引用文件,如有数据,删除以前关联
int resultCount = this.baseMapper.updateById(sarLawsStandInfo);
if (resultCount >= 1) {
// 修改属性表数据
sarLawsAttrInfoDao.deleteLawsAttrByStandId(standId);
//
sarBussStandValEODao.deleteDataBylawsId(standId);
//删除文件详情表数据
sarBussStandFileEODao.deleteBylawsId(standId);
SarLawsFile sarBussStandFileEO = new SarLawsFile();
sarBussStandFileEO.setLawsId(standId);
sarBussStandFileEO.setIdList(null);
List<SarLawsFile> listFile = sarBussStandFileEODao.selectFileBylawsIdAndId(sarBussStandFileEO);
if (listFile != null) {
if (!listFile.isEmpty()) {
for (int f = 0; f < listFile.size(); f++) {
//删除转换表ot_convert数据
otConvertEODao.deleteByAttId(listFile.get(f).getAttId());
}
}
}
createStandAttrInfo(sarLawsStandInfo);
// 根据代替标准号 ,修改代替标准号标准中的,被代替标准号
// updateReplaceConnect(sarLawsStandInfo);
//修改收藏分享编号名称
updateCollectAndShare(sarLawsStandInfo);
// 记录修改日志
saveUpdateLog(sarLawsStandInfo,beforeStandEO);
if (elasflag) {
attrInfoShowSearchDetails(sarLawsStandInfo,"upd");
createStandMQService.sendLawsMQ(sarLawsStandInfo, "update");
}
}
return sarLawsStandInfo;
}
public void attrInfoShowSearchDetails(SarLawsStandInfo row,String type) throws Exception {
if (row != null) {
attrInfoSearchDetails(row,type);
Map<String, Object> getAttrMap = row.getAttrInfoCaseMap();
if (getAttrMap != null && getAttrMap.size() > 0) {
for (Map.Entry<String, Object> entry : getAttrMap.entrySet()) {
String name = entry.getKey().toUpperCase();
String value = "";
List<String> valArr = new ArrayList<>();
if (entry.getValue() != null && InitStandAttrUtil.selectionFieldListLaws != null && InitStandAttrUtil.selectionFieldListLaws.size() > 0 && InitStandAttrUtil.selectionFieldListLaws.contains(name)) {
if(StringUtils.isNotBlank(entry.getValue().toString())){
Object json= new JSONTokener(entry.getValue().toString()).nextValue();
if(json instanceof org.json.JSONArray){
valArr = com.alibaba.fastjson.JSONObject.parseArray(entry.getValue().toString(),String.class);
}else {
value = entry.getValue().toString();
valArr = Arrays.asList(value.split(","));
}
if(!valArr.isEmpty()){
value = dicTypeEODao.getDicNamesByCodes(valArr);
}
}
entry.setValue(value);
}
}
}
}
}
public void attrInfoSearchDetails(SarLawsStandInfo row,String type) throws Exception {
String fieldInfo = InitStandAttrUtil.queryFieldLaws;
String collectId = personCollectEOService.queryCollectByUserAndId(row.getId());
row.setCollectId(collectId);
// 查询属性表数据
if (StringUtils.isNotBlank(fieldInfo)) {
Map<String, Object> getAttrMap = new TreeMap<>();
if(type.equals("add")){
String sarStandAttrEOStr = row.getSarStandAttrEOStr();
getAttrMap = JSONObject.fromObject(sarStandAttrEOStr);
}else {
getAttrMap = sarLawsAttrInfoDao.selectLawsFieldAndData(fieldInfo, row.getId());
}
if (InitStandAttrUtil.clobFieldList != null && !InitStandAttrUtil.clobFieldList.isEmpty()) {
// 遍历修改所有clob类型的值
for (String clobField : InitStandAttrUtil.clobFieldList) {
Clob clobValue = (Clob) getAttrMap.get(clobField);
String fieldValue = FieldConvertUtil.ClobToString(clobValue);
getAttrMap.put(clobField, fieldValue);
}
}
if (getAttrMap != null && !getAttrMap.isEmpty()) {
row.setAttrInfoCaseMap(transformUpperCase(getAttrMap));
}
// row.setAttrInfoMap(getAttrMap);
}
}
public void saveUpdateLog(SarLawsStandInfo sarStandardsInfoEO,SarLawsStandInfo beforeSarStandardsInfo) throws Exception{
Map<String,Object> newMap = new HashMap<>();
Map<String,Object> oldMap = beforeSarStandardsInfo.getAttrInfoMap();
String attrStr = sarStandardsInfoEO.getSarStandAttrEOStr();
if (StringUtils.isNotBlank(attrStr)) {
newMap = JSONObject.fromObject(attrStr);
}
newMap = changeMap(sarStandardsInfoEO,newMap);
oldMap = changeMap(beforeSarStandardsInfo,oldMap);
String sortName = sysInfoEOService.getDicNamesByCodes(sarStandardsInfoEO.getLawsType());
String number = sortName + " " + sarStandardsInfoEO.getLawsNumber();
String content = number + "" + sarStandardsInfoEO.getLawsName()+" " + sarStandardsInfoEO.getLawsEnName() + "";
sarUpdLogEOService.createUpdateLog(SarTypeEnum.BUSINESS.getValue(),sarStandardsInfoEO.getId(),oldMap,newMap,content);
}
public Map<String,Object> changeMap (SarLawsStandInfo sarStandardsInfoEO,Map<String,Object> map) {
// map.put("country",verifyObj(sarStandardsInfoEO.getApplyCountry()));
map.put("lawsType",verifyObj(sarStandardsInfoEO.getLawsType()));
map.put("lawsNumber",verifyObj(sarStandardsInfoEO.getLawsNumber()));
map.put("lawsName",verifyObj(sarStandardsInfoEO.getLawsName()));
map.put("lawsEnName",verifyObj(sarStandardsInfoEO.getLawsEnName()));
map.put("lawsNo",verifyObj(sarStandardsInfoEO.getLawsNo()));
return map;
}
private Object verifyObj(Object str){
return str == null ? "" : str;
}
public void updateCollectAndShare(SarLawsStandInfo sarLawsStandInfo) throws Exception {
//修改收藏表中
String number = sarLawsStandInfo.getLawsNumber()+ "";
PersonCollectEOPage personCollectEOPage = new PersonCollectEOPage();
personCollectEOPage.setValidFlag("0");
personCollectEOPage.setCollectResId(sarLawsStandInfo.getId());
List<TsPersonCollect> listCollect = personCollectEOService.queryByList(personCollectEOPage);
if (listCollect != null && listCollect.size() > 0) {
for (TsPersonCollect getCollect : listCollect) {
TsPersonCollect collectEO = new TsPersonCollect();
collectEO.setId(getCollect.getId());
collectEO.setCollectTitle(sarLawsStandInfo.getLawsName() + " " + " 编号:" + number);
personCollectEOService.updateByPrimaryKeySelective(collectEO);
}
}
}
/***
* @Description: 新增属性表数据
* @Date: 2020/9/8 9:53
* @Param: [sarStandardsInfoEO]
* @Return: void
*/
public void createStandAttrInfo (SarLawsStandInfo sarBussionessStandEO) throws Exception {
String sarStandAttrEOStr = sarBussionessStandEO.getSarStandAttrEOStr();
String mustFields = FieldConvertUtil.mustFieldsLaws;
String mustValues = FieldConvertUtil.mustValues(sarBussionessStandEO.getId());
// 将字符串转为map进行解析
Map<String,String> sarStandAttrMap = JSONObject.fromObject(sarStandAttrEOStr);
StringBuilder fieldsBuilder = new StringBuilder();
StringBuilder valuesBuilder = new StringBuilder();
Map<String,String> selectionMap = new HashMap<>();
Map<String,String> fileMap = new HashMap<>();
Map<String,String> multiTimeMap = new HashMap<>();
String fileIds = "";
for (Map.Entry<String,String> entry : sarStandAttrMap.entrySet()) {
String attrKey = entry.getKey();
String attrValue = entry.getValue();
if (InitStandAttrUtil.queryFieldListLaws != null && !InitStandAttrUtil.queryFieldListLaws.isEmpty()) {
if (InitStandAttrUtil.queryFieldListLaws.contains(attrKey)) {
fieldsBuilder.append("," + attrKey);
// 多选项,文件类型需要单独处理 向子表添加数据
if (InitStandAttrUtil.selectionFieldListLaws.contains(attrKey)) {
selectionMap.put(attrKey,attrValue);
} else if (InitStandAttrUtil.fileFieldListLaws.contains(attrKey)) {
fileMap.put(attrKey,attrValue);
fileIds += attrValue + ",";
} else if (InitStandAttrUtil.multiTimeFieldList.contains(attrKey)) {
multiTimeMap.put(attrKey,attrValue);
}
// 不同类型存储数据需单独处理值
if (InitStandAttrUtil.numFieldListLaws.contains(attrKey)) {
if (StringUtils.isBlank(attrValue)) {
attrValue = "null";
}
} else if (InitStandAttrUtil.timeFieldListLaws.contains(attrKey)) {
attrValue = FieldConvertUtil.changeTimeValue(attrValue);
} else {
attrValue = "'" + attrValue + "'";
}
valuesBuilder.append("," + attrValue);
sarBussionessStandEO.setFileIds(fileIds);
}
}
}
String insertField = mustFields + fieldsBuilder.toString();
String insertValue = mustValues + valuesBuilder.toString();
int insertRes = sarLawsAttrInfoDao.insertLawsAttr(insertField,insertValue);
if (insertRes > 0) {
// 多选项处理
createStandVal(sarBussionessStandEO.getId(),selectionMap);
// 文件处理
createStandFile(sarBussionessStandEO.getId(),fileMap);
// 多时间处理
// createStandPutTime(sarBussionessStandEO.getId(),multiTimeMap);
}
}
/***
* @Description: 多选项处理
* @Author: yangxuenan
* @Date: 2020/9/8 14:37
* @Param: [sarStandardsInfoEO, selectionMap]
* @Return: void
*/
public void createStandVal (String standId,Map<String,String> selectionMap) {
if (selectionMap != null && selectionMap.size() > 0) {
List<SarLawsVal> standValList = new ArrayList<>();
for (Map.Entry<String,String> entry : selectionMap.entrySet()) {
String value = entry.getValue();
String field = entry.getKey();
if (StringUtils.isNotBlank(value)) {
String[] valArr = value.trim().split(",");
for (String val : valArr) {
SarLawsVal sarStandValEO = new SarLawsVal();
sarStandValEO.setValidFlag(ValueStateEnum.VALUE_TRUE.getValue());
sarStandValEO.setCreationTime(new Date());
sarStandValEO.setModifyTime(new Date());
sarStandValEO.setLawsId(standId);
sarStandValEO.setId(UUIDUtils.randomUUID20());
sarStandValEO.setPropertyType(field);
sarStandValEO.setPropertyVal(val);
standValList.add(sarStandValEO);
}
}
}
if (standValList != null && !standValList.isEmpty()) {
sarBussStandValEODao.insertForeach(standValList);
}
}
}
/***
* @Description: 文件处理
* @Author: yangxuenan
* @Date: 2020/9/8 15:01
* @Param: [standId, fileMap]
* @Return: void
*/
public void createStandFile (String standId,Map<String,String> fileMap) throws Exception {
if (fileMap != null && fileMap.size() > 0) {
List<SarLawsFile> standFileList = new ArrayList<>();
for (Map.Entry<String,String> entry : fileMap.entrySet()) {
String value = entry.getValue();
String field = entry.getKey();
if (StringUtils.isNotBlank(value)) {
List<AttFileEO> fileList = attFileEOService.getMultiFileInfos(value);
if (fileList != null && !fileList.isEmpty()) {
createStandFileAppend(standId,field,fileList,standFileList);
}
}
}
if (standFileList != null && !standFileList.isEmpty()) {
sarBussStandFileEODao.insertForeach(standFileList);
}
}
}
public void createStandFileAppend (String standId,String field,List<AttFileEO> fileList,List<SarLawsFile> standFileList) throws Exception {
for (AttFileEO fileInfo : fileList) {
SarLawsFile sarStandFileEO = new SarLawsFile();
sarStandFileEO.setCreationUser(LoginUserUtil.getUserId());
sarStandFileEO.setCreationTime(new Date());
sarStandFileEO.setModifyTime(new Date());
sarStandFileEO.setValidFlag(0);
sarStandFileEO.setLawsId(standId); //标准ID
sarStandFileEO.setUseModel(UseModuleEnum.SOURCE_FILE.getValue()); //文件使用模式
sarStandFileEO.setId(com.adc.da.sys.util.UUIDUtils.randomUUID20());
sarStandFileEO.setAttId(fileInfo.getId()); //文件ID
sarStandFileEO.setLawsFileClassify(field); //文件分类
sarStandFileEO.setFileName(fileInfo.getOldFileName());
sarStandFileEO.setFileSuffix(fileInfo.getFileSuffix());
sarStandFileEO.setOriAttId(fileInfo.getId());
standFileList.add(sarStandFileEO);
//文档转换
if ("pdf".equals(fileInfo.getFileSuffix()) || "PDF".equals(fileInfo.getFileSuffix())) {
SarLawsFile newFileEO = new SarLawsFile();
newFileEO.setCreationUser(LoginUserUtil.getUserId());
newFileEO.setCreationTime(new Date());
newFileEO.setModifyTime(new Date());
newFileEO.setValidFlag(0);
newFileEO.setLawsId(standId); //标准ID
newFileEO.setId(com.adc.da.sys.util.UUIDUtils.randomUUID20());
newFileEO.setAttId(fileInfo.getId()); //文件ID
newFileEO.setLawsFileClassify(field); //文件分类
newFileEO.setFileName(fileInfo.getOldFileName());
newFileEO.setFileSuffix(fileInfo.getFileSuffix());
newFileEO.setUseModel(UseModuleEnum.WEB_FILE.getValue()); //文件使用模式 //文件名称@@@@@@@需要修改
newFileEO.setOriAttId(fileInfo.getId());
standFileList.add(newFileEO);
} else {
String filePath = fileInfo.getFilePath() + fileInfo.getFileName();
OtConvertMq convert = new OtConvertMq();
convert.setLawsId(standId);
convert.setAttId(fileInfo.getId());
convert.setFilePath(filePath);
convert.setAddOrUp("0");
convert.setFileSuffix(fileInfo.getFileSuffix());
convert.setStandFileClassify(field);
convert.setConvertType(SarTypeEnum.LAWS_STAND.getValue());
convertMq.sendMQ(convert);
}
}
}
@Override
public ResponseMessage<SarLawsStandInfo> deleteSarLawsStandInfo(SarLawsStandInfoPage page) throws Exception {
SarLawsStandInfo sarLawsStandInfo = new SarLawsStandInfo();
sarLawsStandInfo.setValidFlag(1);
sarLawsStandInfo.setModifyTime(new Date());
for (String id : page.getIdlist()) {
//删除标准表
sarLawsStandInfo.setId(id);
this.baseMapper.updateById(sarLawsStandInfo);
// 删除标准属性表
sarLawsAttrInfoDao.deleteLawsAttrByStandId(id);
// 删除条款
sarLawsItemsDao.deleteByStandIdAndFileType(id,null);
//删除收藏表中数据
personCollectEODao.deleteByResId(id);
//删除标准关联的value表
sarBussStandValEODao.deleteDataBylawsId(id);
List<SarLawsFile> listFile = sarBussStandFileEODao.selectFileBylawsId(id);
if (listFile != null) {
if (!listFile.isEmpty()) {
for (int f = 0; f < listFile.size(); f++) {
sarBussStandFileEODao.deleteByPrimaryKey(listFile.get(f).getId());
//删除文件信息表数据
// sarFileInfoEODao.deleteByfileId(listFile.get(f).getId());
//删除转换表ot_convert数据
otConvertEODao.deleteByAttId(listFile.get(f).getAttId());
}
}
}
if(elasflag) {
//删除成功后,将索引中对应数据删除
StandLawsEO standLawsEO = new StandLawsEO();
standLawsEO.setId(sarLawsStandInfo.getId());
standLawsEO.setType("laws");
standLawsSearchService.deleteStandLawsSearch(standLawsEO);
}
}
return Result.success("0", "删除成功", sarLawsStandInfo);
}
public List<SarLawsStandInfo> selectStandardsByStandNumber(String replaceStandNum) {
QueryWrapper wrapper = new QueryWrapper();
wrapper.eq("LAWS_NUMBER",replaceStandNum);
wrapper.eq("VALID_FLAG",0);
return this.baseMapper.selectList(wrapper);
}
}
@@ -0,0 +1,23 @@
package com.adc.da.slrs.sarLawsVal.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import com.adc.da.slrs.sarLawsVal.entity.SarLawsVal;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.adc.da.base.web.BaseController;
/**
* <p>
* 前端控制器
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
@RestController
@Api(description = "|SarLawsVal|")
@RequestMapping("/sarLawsVal/sar-laws-val")
public class SarLawsValController extends BaseController<SarLawsVal> {
}
@@ -0,0 +1,24 @@
package com.adc.da.slrs.sarLawsVal.dao;
import com.adc.da.slrs.sarLawsVal.entity.SarLawsVal;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
@Repository
public interface SarLawsValDao extends BaseMapper<SarLawsVal> {
//通过标准id删除表中数据
int deleteDataBylawsId(String standId);
int insertForeach(List<SarLawsVal> list); //批量新增
}
@@ -0,0 +1,64 @@
package com.adc.da.slrs.sarLawsVal.entity;
import com.adc.da.base.entity.BaseEntity;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="SarLawsVal对象", description="")
public class SarLawsVal extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
@TableId("ID")
private String id;
@ApiModelProperty(value = "法规ID")
@TableField("LAWS_ID")
private String lawsId;
@ApiModelProperty(value = "参数类型")
@TableField("PROPERTY_TYPE")
private String propertyType;
@ApiModelProperty(value = "参数内容")
@TableField("PROPERTY_VAL")
private String propertyVal;
@ApiModelProperty(value = "是否有效")
@TableField("VALID_FLAG")
private Integer validFlag;
@ApiModelProperty(value = "创建时间")
@TableField("CREATION_TIME")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date creationTime;
@ApiModelProperty(value = "修改时间")
@TableField("MODIFY_TIME")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date modifyTime;
}
@@ -0,0 +1,16 @@
package com.adc.da.slrs.sarLawsVal.service;
import com.adc.da.slrs.sarLawsVal.entity.SarLawsVal;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 服务类
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
public interface ISarLawsValService extends IService<SarLawsVal> {
}
@@ -0,0 +1,20 @@
package com.adc.da.slrs.sarLawsVal.service.impl;
import com.adc.da.slrs.sarLawsVal.entity.SarLawsVal;
import com.adc.da.slrs.sarLawsVal.dao.SarLawsValDao;
import com.adc.da.slrs.sarLawsVal.service.ISarLawsValService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author super_liu
* @since 2021-10-28
*/
@Service
public class SarLawsValServiceImpl extends ServiceImpl<SarLawsValDao, SarLawsVal> implements ISarLawsValService {
}
@@ -77,6 +77,8 @@ public class SarStandAttrDetailsController extends BaseController<SarStandAttrDe
// 政策属性字段 // 政策属性字段
List<SarStandAttrDetails> getLawsStandList = InitStandAttrUtil.lawsStandAttrFieldList;
resultMap.put(SarTypeEnum.LAWS_STAND.getValue(),getLawsStandList);
List<SarStandAttrDetails> getInlandLawsList = InitStandAttrUtil.lawsInlandAttrFieldList; List<SarStandAttrDetails> getInlandLawsList = InitStandAttrUtil.lawsInlandAttrFieldList;
resultMap.put(SarTypeEnum.INLAND_LAWS.getValue(),getInlandLawsList); resultMap.put(SarTypeEnum.INLAND_LAWS.getValue(),getInlandLawsList);
List<SarStandAttrDetails> getForeignLawsList = InitStandAttrUtil.lawsForeignAttrFieldList; List<SarStandAttrDetails> getForeignLawsList = InitStandAttrUtil.lawsForeignAttrFieldList;
@@ -66,6 +66,7 @@ public class SarStandAttrDetailsServiceImpl extends ServiceImpl<SarStandAttrDeta
standTypeList.add(SarTypeEnum.INLAND_STAND.getValue()); standTypeList.add(SarTypeEnum.INLAND_STAND.getValue());
standTypeList.add(SarTypeEnum.FOREIGN_STAND.getValue()); standTypeList.add(SarTypeEnum.FOREIGN_STAND.getValue());
lawsTypeList.add(SarTypeEnum.LAWS.getValue()); lawsTypeList.add(SarTypeEnum.LAWS.getValue());
lawsTypeList.add(SarTypeEnum.LAWS_STAND.getValue());
lawsTypeList.add(SarTypeEnum.INLAND_LAWS.getValue()); lawsTypeList.add(SarTypeEnum.INLAND_LAWS.getValue());
lawsTypeList.add(SarTypeEnum.FOREIGN_LAWS.getValue()); lawsTypeList.add(SarTypeEnum.FOREIGN_LAWS.getValue());
} }
@@ -44,8 +44,8 @@ public class FieldConvertUtil {
"EOP实施日期(文本),责任部门,相关部门,SVPPS,FO,项目评估角色,法规维护人,代替标准编号," + "EOP实施日期(文本),责任部门,相关部门,SVPPS,FO,项目评估角色,法规维护人,代替标准编号," +
"对应其他标准,文字描述,等效标准,引用标准,被引用标准,覆盖关系"; "对应其他标准,文字描述,等效标准,引用标准,被引用标准,覆盖关系";
public static String exportBaseFieldNamesLaws = "政策编号,中文名称,英文名称," + public static String exportBaseFieldNamesLaws = "政策分类,政策编号,中文名称,英文名称,政策文号,发文日期,发文单位,征集意见周期-起始时间,征集意见周期-结束时间,文本状态," +
"政策状态,适用区域,重要度,代替政策编号,发布日期"; "适用区域,适用车型,是否纳入认证清单,年度,福田转发通知文号,信息简报,标签,备注";
public static String exportAttrFieldNamesLaws = "适用车辆类型,要求类型," + public static String exportAttrFieldNamesLaws = "适用车辆类型,要求类型," +
"个性化标签,政策文本,过程稿件,新车型实施日期(文本),在产车实施日期(文本),EOP实施日期(文本),SVPPS," + "个性化标签,政策文本,过程稿件,新车型实施日期(文本),在产车实施日期(文本),EOP实施日期(文本),SVPPS," +
@@ -41,9 +41,7 @@ public class InitStandAttrUtil implements ApplicationRunner {
standTypeList.add(SarTypeEnum.STAND.getValue()); standTypeList.add(SarTypeEnum.STAND.getValue());
standTypeList.add(SarTypeEnum.INLAND_STAND.getValue()); standTypeList.add(SarTypeEnum.INLAND_STAND.getValue());
standTypeList.add(SarTypeEnum.FOREIGN_STAND.getValue()); standTypeList.add(SarTypeEnum.FOREIGN_STAND.getValue());
lawsTypeList.add(SarTypeEnum.LAWS.getValue()); lawsTypeList.add(SarTypeEnum.LAWS_STAND.getValue());
lawsTypeList.add(SarTypeEnum.INLAND_LAWS.getValue());
lawsTypeList.add(SarTypeEnum.FOREIGN_LAWS.getValue());
standStateList.add("DRAFT"); standStateList.add("DRAFT");
standStateList.add("ADVICE"); standStateList.add("ADVICE");
standStateList.add("RADYSUBMIT"); standStateList.add("RADYSUBMIT");
@@ -82,6 +80,7 @@ public class InitStandAttrUtil implements ApplicationRunner {
public static List<String> numFieldListLaws = new ArrayList<>(); // 属性表数字类型字段 public static List<String> numFieldListLaws = new ArrayList<>(); // 属性表数字类型字段
public static List<SarStandAttrDetails> lawsInlandAttrFieldList = new ArrayList<>(); // 属性表数字类型字段 public static List<SarStandAttrDetails> lawsInlandAttrFieldList = new ArrayList<>(); // 属性表数字类型字段
public static List<SarStandAttrDetails> lawsForeignAttrFieldList = new ArrayList<>(); // 全部政策字段属性 public static List<SarStandAttrDetails> lawsForeignAttrFieldList = new ArrayList<>(); // 全部政策字段属性
public static List<SarStandAttrDetails> lawsStandAttrFieldList = new ArrayList<>(); // 全部政策字段属性
public static Map<String,String> selectFieldMapLaws = new HashMap<>(); // 下拉属性字段及选项值 public static Map<String,String> selectFieldMapLaws = new HashMap<>(); // 下拉属性字段及选项值
// 企标属性字段信息 // 企标属性字段信息
@@ -141,12 +140,16 @@ public class InitStandAttrUtil implements ApplicationRunner {
numFieldList.add(detailsEO.getAttrField()); numFieldList.add(detailsEO.getAttrField());
} }
} else if (lawsTypeList.contains(sarType)) { } else if (lawsTypeList.contains(sarType)) {
if (!SarTypeEnum.FOREIGN_LAWS.getValue().equals(sarType)) { if (SarTypeEnum.FOREIGN_LAWS.getValue().equals(sarType)) {
lawsInlandAttrFieldList.add(detailsEO);
}
if (!SarTypeEnum.INLAND_LAWS.getValue().equals(sarType)) {
lawsForeignAttrFieldList.add(detailsEO); lawsForeignAttrFieldList.add(detailsEO);
} }
if (SarTypeEnum.LAWS_STAND.getValue().equals(sarType)) {
lawsStandAttrFieldList.add(detailsEO);
}
if (SarTypeEnum.INLAND_LAWS.getValue().equals(sarType)) {
lawsInlandAttrFieldList.add(detailsEO);
}
fieldInfoBuilderLaws.append(detailsEO.getAttrField() + ","); fieldInfoBuilderLaws.append(detailsEO.getAttrField() + ",");
fieldInfoNameBuilderLaws.append(detailsEO.getAttrName() + ","); fieldInfoNameBuilderLaws.append(detailsEO.getAttrName() + ",");
queryFieldListLaws.add(detailsEO.getAttrField()); queryFieldListLaws.add(detailsEO.getAttrField());
@@ -0,0 +1,176 @@
package com.adc.da.utils.util;
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
import com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfo;
import com.adc.da.slrs.sarStandAttrDetails.entity.SarStandAttrDetails;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Description: 标准导出工具
* date: 2020/9/16 14:09
*/
public class LawsStandExportUtil {
private static final Logger logger = LoggerFactory.getLogger(LawsStandExportUtil.class);
public static Workbook exportDatas (List<SarLawsStandInfo> datas) {
Workbook workbook = new XSSFWorkbook();
try {
StringBuilder attrBud = new StringBuilder();
List<SarStandAttrDetails> detailsEOList = InitStandAttrUtil.lawsStandAttrFieldList;
Map<String,String> attrInfoMap = new HashMap<>();
for (SarStandAttrDetails detailsEO : detailsEOList) {
if (!InitStandAttrUtil.fileFieldListLaws.contains(detailsEO.getAttrField())) {
attrBud.append(detailsEO.getAttrName() + ",");
attrInfoMap.put(detailsEO.getAttrName(),detailsEO.getAttrField());
}
}
String header = FieldConvertUtil.exportBaseFieldNamesLaws + "," + attrBud.toString();
//创建工作表对象
Sheet sheet = workbook.createSheet();
// 创建头部
createHeader(workbook,sheet,header);
// 创建数据
createDatas(workbook,sheet,datas,header,attrInfoMap);
} catch (Exception e) {
logger.error(e.getMessage(), e);
}
return workbook;
}
public static void createHeader(Workbook workbook,Sheet sheet,String header){
CellStyle cellStyle = workbook.createCellStyle();//初始化单元格格式对象
cellStyle.setAlignment(HorizontalAlignment.CENTER);
Row rowHeader = sheet.createRow(0);//开始创建标题行
if (StringUtils.isNotBlank(header)) {
String[] headerArr = header.split(",");
for (int i=0;i < headerArr.length; i++) {
rowHeader.createCell(i).setCellValue(headerArr[i]);
// rowHeader.createCell(i).setCellStyle(cellStyle);
}
}
}
public static void createDatas(Workbook workbook,Sheet sheet,List<SarLawsStandInfo> datas,
String header,Map<String,String> attrInfoMap) throws Exception{
CellStyle cellStyle = workbook.createCellStyle();//初始化单元格格式对象
cellStyle.setAlignment(HorizontalAlignment.CENTER);
if (datas != null && !datas.isEmpty()) {
for (int i=0;i < datas.size(); i++) {
SarLawsStandInfo sarStandardsInfoEO = datas.get(i);
Row row = sheet.createRow(i+1);
String[] headerArr = header.split(",");
int sheetNum = 0;
for (String headerName : headerArr) {
String value = getValueByName(headerName,sarStandardsInfoEO,attrInfoMap);
if (StringUtils.isBlank(value) || "null".equals(value)) {
value = "";
}
row.createCell(sheetNum).setCellValue(value);
sheetNum++;
}
}
}
}
// 根据表头返回相应值
public static String getValueByName (String name,SarLawsStandInfo sarStandardsInfoEO,Map<String,String> attrInfoMap) throws Exception{
String value = "";
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Map<String,Object> attrValueMap = sarStandardsInfoEO.getAttrInfoMap();
switch (name) {
case "政策分类":
value = sarStandardsInfoEO.getLawsType();
break;
case "政策编号":
value = sarStandardsInfoEO.getLawsNumber();
break;
case "中文名称":
value = sarStandardsInfoEO.getLawsName();
break;
case "英文名称":
value = sarStandardsInfoEO.getLawsEnName();
break;
case "政策文号":
value = sarStandardsInfoEO.getLawsNo();
break;
case "发文日期":
String issueTime="";
if (Date.class.equals(sarStandardsInfoEO.getIssueTime())) {
issueTime = sdf.format(sarStandardsInfoEO.getIssueTime());
}else {
issueTime=sarStandardsInfoEO.getIssueTime();
}
value = issueTime;
break;
case "发文单位":
value = sarStandardsInfoEO.getIssueCompany();
break;
case "征集意见周期-起始时间":
String commentCycleStart="";
if (Date.class.equals(sarStandardsInfoEO.getCommentCycleStart().getClass())){
commentCycleStart = sdf.format(sarStandardsInfoEO.getCommentCycleStart());
}else {
commentCycleStart=sarStandardsInfoEO.getCommentCycleStart();
}
value = commentCycleStart;
break;
case "征集意见周期-结束时间":
String commentCycleEnd="";
if (Date.class.equals(sarStandardsInfoEO.getCommentCycleEnd().getClass())){
commentCycleEnd = sdf.format(sarStandardsInfoEO.getCommentCycleEnd());
}else {
commentCycleEnd=sarStandardsInfoEO.getCommentCycleEnd();
}
value = commentCycleEnd;
break;
case "文本状态":
value = sarStandardsInfoEO.getStandStatusShow();
break;
case "适用区域":
value = sarStandardsInfoEO.getLawsSyqy();
break;
case "适用车型":
value = sarStandardsInfoEO.getLawsSycx();
break;
case "是否纳入认证清单":
value = sarStandardsInfoEO.getIsRelateAccess() != null ? (sarStandardsInfoEO.getIsRelateAccess().equals("1")?"":""): "";
break;
case "年度":
value = sarStandardsInfoEO.getLawsYear();
break;
case "福田转发通知文号":
value = sarStandardsInfoEO.getLawsNotisyncNum();
break;
case "信息简报":
value = sarStandardsInfoEO.getLawsBulletin();
break;
case "标签":
value = sarStandardsInfoEO.getLawsLabel();
break;
case "备注":
value = sarStandardsInfoEO.getLawsRemark();
break;
default:
String field = attrInfoMap.get(name);
if (attrValueMap != null) {
value = String.valueOf(attrValueMap.get(field));
}
break;
}
return value;
}
}
@@ -0,0 +1,259 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.adc.da.slrs.sarLawsFile.dao.SarLawsFileDao">
<!-- Result Map-->
<resultMap id="BaseResultMap" type="com.adc.da.slrs.sarLawsFile.entity.SarLawsFile" >
<id column="id" property="id" />
<result column="modify_time" property="modifyTime" />
<result column="creation_time" property="creationTime" />
<result column="valid_flag" property="validFlag" />
<result column="use_model" property="useModule" />
<result column="att_id" property="attId" />
<result column="ori_att_id" property="oriAttId" />
<result column="laws_id" property="lawsId" />
<result column="file_suffix" property="fileSuffix" />
<result column="file_name" property="fileName" />
<result column="laws_file_classify" property="lawsFileClassify" />
<result column="password" property="password" />
<result column="creation_user" property="creationUser" />
<result column="resId" property="resId" />
</resultMap>
<!-- SAR_LAWS_FILE table all fields -->
<sql id="Base_Column_List" >
modify_time, creation_time, valid_flag, use_model, att_id, laws_id, id,file_suffix,file_name,laws_file_classify,
password,creation_user,ori_att_id
</sql>
<!-- 查询条件 -->
<sql id="Base_Where_Clause">
where 1=1
<trim suffixOverrides="," >
<if test="modifyTime != null" >
and modify_time ${modifyTimeOperator} #{modifyTime}
</if>
<if test="modifyTime1 != null" >
and modify_time &gt;= #{modifyTime1}
</if>
<if test="modifyTime2 != null" >
and modify_time &lt;= #{modifyTime2}
</if>
<if test="creationTime != null" >
and creation_time ${creationTimeOperator} #{creationTime}
</if>
<if test="creationTime1 != null" >
and creation_time &gt;= #{creationTime1}
</if>
<if test="creationTime2 != null" >
and creation_time &lt;= #{creationTime2}
</if>
<if test="validFlag != null" >
and valid_flag ${validFlagOperator} #{validFlag}
</if>
<if test="useModule != null" >
and use_model ${useModuleOperator} #{useModule}
</if>
<if test="attId != null" >
and att_id ${attIdOperator} #{attId}
</if>
<if test="resId != null" >
and res_id ${resIdOperator} #{resId}
</if>
<if test="lawsId != null" >
and laws_id ${lawsIdOperator} #{lawsId}
</if>
<if test="id != null" >
and id ${idOperator} #{id}
</if>
</trim>
</sql>
<!-- 动态插入记录 主键是序列 -->
<insert id="insertSelective" parameterType="com.adc.da.slrs.sarLawsFile.entity.SarLawsFile" >
insert into SAR_LAWS_FILE
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="modifyTime != null" >modify_time,</if>
<if test="creationTime != null" >creation_time,</if>
<if test="validFlag != null" >valid_flag,</if>
<if test="useModule != null" >use_model,</if>
<if test="attId != null" >att_id,</if>
<if test="lawsId != null" >laws_id,</if>
<if test="id != null" >id,</if>
<if test="fileSuffix != null" >file_suffix,</if>
<if test="fileName != null" >file_name,</if>
<if test="lawsFileClassify != null" >laws_file_classify,</if>
<if test="password != null" >password,</if>
<if test="creationUser != null" >creation_user,</if>
<if test="oriAttId != null" >ori_att_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="modifyTime != null" >#{modifyTime, jdbcType=TIMESTAMP},</if>
<if test="creationTime != null" >#{creationTime, jdbcType=TIMESTAMP},</if>
<if test="validFlag != null" >#{validFlag, jdbcType=INTEGER},</if>
<if test="useModule != null" >#{useModule, jdbcType=VARCHAR},</if>
<if test="attId != null" >#{attId, jdbcType=VARCHAR},</if>
<if test="lawsId != null" >#{lawsId, jdbcType=VARCHAR},</if>
<if test="id != null" >#{id, jdbcType=VARCHAR},</if>
<if test="fileSuffix != null" >#{fileSuffix, jdbcType=VARCHAR},</if>
<if test="fileName != null" >#{fileName, jdbcType=VARCHAR},</if>
<if test="lawsFileClassify != null" >#{lawsFileClassify, jdbcType=VARCHAR},</if>
<if test="password != null" >#{password, jdbcType=VARCHAR},</if>
<if test="creationUser != null" >#{creationUser, jdbcType=VARCHAR},</if>
<if test="oriAttId != null" >#{oriAttId, jdbcType=VARCHAR},</if>
</trim>
</insert>
<!-- 修改记录,只修改只不为空的字段 -->
<update id="updateByPrimaryKeySelective" parameterType="com.adc.da.slrs.sarLawsFile.entity.SarLawsFile" >
update SAR_LAWS_FILE
<set >
<if test="oriAttId != null" >
ori_att_id = #{oriAttId},
</if>
<if test="modifyTime != null" >
modify_time = #{modifyTime},
</if>
<if test="creationTime != null" >
creation_time = #{creationTime},
</if>
<if test="validFlag != null" >
valid_flag = #{validFlag},
</if>
<if test="useModule != null" >
use_model = #{useModule},
</if>
<if test="attId != null" >
att_id = #{attId},
</if>
<if test="lawsId != null" >
laws_id = #{lawsId},
</if>
</set>
where id = #{id}
</update>
<!-- 根据id查询 SAR_LAWS_FILE -->
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select <include refid="Base_Column_List" />
from SAR_LAWS_FILE
where id = #{value} and valid_flag=0
</select>
<!-- 删除记录 -->
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from SAR_LAWS_FILE
where id = #{value}
</delete>
<!-- SAR_LAWS_FILE 列表总数-->
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
select count(1) from SAR_LAWS_FILE
<include refid="Base_Where_Clause"/>
</select>
<!-- 查询SAR_LAWS_FILE列表 -->
<select id="queryByPage" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select <include refid="Base_Column_List" /> from
(select tmp_tb.* from
(select <include refid="Base_Column_List" /> from SAR_LAWS_FILE
<include refid="Base_Where_Clause"/>
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
${pager.orderCondition}
</if>
) tmp_tb limit ${pager.startIndex-1},${pageSize}) a
</select>
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select <include refid="Base_Column_List"/> from SAR_LAWS_FILE
<include refid="Base_Where_Clause"/>
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
${pager.orderCondition}
</if>
</select>
<select id="selectFileBylawsId" resultMap="BaseResultMap" parameterType="java.lang.String">
select <include refid="Base_Column_List" />
from SAR_LAWS_FILE
where laws_id = #{value} and valid_flag = 0
</select>
<select id="selectFileBylawsIdAndId" resultMap="BaseResultMap" parameterType="java.lang.String">
select <include refid="Base_Column_List" />
from SAR_LAWS_FILE
where valid_flag = 0
<if test="lawsId != null" >
and laws_id = #{lawsId}
</if>
<if test="idList != null">
and id not in
<foreach collection="idList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
<select id="selectFileByAttId" resultMap="BaseResultMap" parameterType="java.lang.String">
select <include refid="Base_Column_List" />
from SAR_LAWS_FILE
where valid_flag = 0
and INSTR((
select GROUP_CONCAT(laws_id)
from SAR_LAWS_FILE
where att_id = #{value} and valid_flag = 0 and use_model = 'SOURCE_FILE'),laws_id
)
and use_model = 'WEB_FILE'
and ori_att_id = #{value}
order by modify_time desc
</select>
<select id="selectFileMsgByAttId" resultMap="BaseResultMap" parameterType="java.lang.String">
select <include refid="Base_Column_List" />
from SAR_LAWS_FILE
where valid_flag = 0
and att_id = #{value}
</select>
<!-- gaoyan 根据resid 查询 -->
<select id="selectFileByResId" resultMap="BaseResultMap" parameterType="com.adc.da.slrs.sarLawsFile.entity.SarLawsFile">
select <include refid="Base_Column_List" />
from SAR_LAWS_FILE
where use_model = 'SOURCE_FILE'
<if test="resId != null" >
and res_id = #{resId, jdbcType=VARCHAR}
</if>
<if test="modifyTime != null" >
and modify_time &lt;= #{modifyTime}
</if>
</select>
<delete id="deleteBylawsId" parameterType="java.lang.String">
delete from SAR_LAWS_FILE
where laws_id = #{value}
</delete>
<insert id="insertForeach" parameterType="java.util.List">
insert into SAR_LAWS_FILE
(<include refid="Base_Column_List" />)
values
<foreach collection="list" item="item" index="index" separator=",">
(#{item.modifyTime, jdbcType=TIMESTAMP},
#{item.creationTime, jdbcType=TIMESTAMP},
#{item.validFlag, jdbcType=INTEGER},
#{item.useModel, jdbcType=VARCHAR},
#{item.attId, jdbcType=VARCHAR},
#{item.lawsId, jdbcType=VARCHAR},
#{item.id, jdbcType=VARCHAR},
#{item.fileSuffix, jdbcType=VARCHAR},
#{item.fileName, jdbcType=VARCHAR},
#{item.lawsFileClassify, jdbcType=VARCHAR},
#{item.password, jdbcType=VARCHAR},
#{item.creationUser, jdbcType=VARCHAR},
#{item.oriAttId, jdbcType=VARCHAR})
</foreach>
</insert>
</mapper>
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.adc.da.slrs.sarLawsItemVal.dao.SarLawsItemValDao">
</mapper>
@@ -264,4 +264,13 @@
and file_type = #{fileType} and file_type = #{fileType}
</if> </if>
</select> </select>
<delete id="deleteByStandIdAndFileType" parameterType="java.lang.String">
delete from SAR_LAWS_ITEMS
where laws_id = #{standId}
<if test="fileType != null">
and file_type = #{fileType}
</if>
</delete>
</mapper> </mapper>
@@ -0,0 +1,196 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.adc.da.slrs.sarLawsMenu.dao.SarLawsMenuDao">
<!-- Result Map-->
<resultMap id="BaseResultMap" type="com.adc.da.slrs.sarLawsMenu.entity.SarLawsMenu" >
<id column="id" property="id" />
<result column="valid_flag" property="validFlag" />
<result column="menu_id" property="menuId" />
<result column="laws_id" property="lawsId" />
</resultMap>
<!-- SAR_LAWS_MENU table all fields -->
<sql id="Base_Column_List" >
valid_flag, menu_id, laws_id, id
</sql>
<!-- 查询条件 -->
<sql id="Base_Where_Clause">
where 1=1
<trim suffixOverrides="," >
<if test="validFlag != null" >
and valid_flag ${validFlagOperator} #{validFlag}
</if>
<if test="menuId != null" >
and menu_id ${menuIdOperator} #{menuId}
</if>
<if test="lawsId != null" >
and laws_id ${lawsIdOperator} #{lawsId}
</if>
<if test="id != null" >
and id ${idOperator} #{id}
</if>
</trim>
</sql>
<!-- 插入记录 -->
<insert id="insert" parameterType="com.adc.da.slrs.sarLawsMenu.entity.SarLawsMenu" >
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
SELECT SEQ_SAR_LAWS_MENU.NEXTVAL FROM DUAL
</selectKey> -->
insert into SAR_LAWS_MENU(<include refid="Base_Column_List" />)
values (#{validFlag, jdbcType=INTEGER}, #{menuId, jdbcType=VARCHAR}, #{lawsId, jdbcType=VARCHAR}, #{id, jdbcType=VARCHAR})
</insert>
<!-- 动态插入记录 主键是序列 -->
<insert id="insertSelective" parameterType="com.adc.da.slrs.sarLawsMenu.entity.SarLawsMenu" >
<!-- <selectKey resultType="java.lang.String" order="BEFORE" keyProperty="id">
SELECT SEQ_SAR_LAWS_MENU.NEXTVAL FROM DUAL
</selectKey> -->
insert into SAR_LAWS_MENU
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="validFlag != null" >valid_flag,</if>
<if test="menuId != null" >menu_id,</if>
<if test="lawsId != null" >laws_id,</if>
<if test="id != null" >id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="validFlag != null" >#{validFlag, jdbcType=INTEGER},</if>
<if test="menuId != null" >#{menuId, jdbcType=VARCHAR},</if>
<if test="lawsId != null" >#{lawsId, jdbcType=VARCHAR},</if>
<if test="id != null" >#{id, jdbcType=VARCHAR},</if>
</trim>
</insert>
<!-- 根据pk,修改记录-->
<update id="updateByPrimaryKey" parameterType="com.adc.da.slrs.sarLawsMenu.entity.SarLawsMenu" >
update SAR_LAWS_MENU
set valid_flag = #{validFlag},
menu_id = #{menuId},
laws_id = #{lawsId}
where id = #{id}
</update>
<!-- 修改记录,只修改只不为空的字段 -->
<update id="updateByPrimaryKeySelective" parameterType="com.adc.da.slrs.sarLawsMenu.entity.SarLawsMenu" >
update SAR_LAWS_MENU
<set >
<if test="validFlag != null" >
valid_flag = #{validFlag},
</if>
<if test="menuId != null" >
menu_id = #{menuId},
</if>
<if test="lawsId != null" >
laws_id = #{lawsId},
</if>
</set>
where id = #{id}
</update>
<update id="updateMenuidByMenuid" parameterType="com.adc.da.slrs.sarBussStandMenu.entity.NewmenuOldmenuVO" >
update SAR_LAWS_MENU
set menu_id = #{newMenuid}
where menu_id = #{oldMenuid}
</update>
<!-- 根据id查询 SAR_LAWS_MENU -->
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select <include refid="Base_Column_List" />
from SAR_LAWS_MENU
where id = #{value}
</select>
<!-- 删除记录 -->
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from SAR_LAWS_MENU
where id = #{value}
</delete>
<!-- SAR_LAWS_MENU 列表总数-->
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
select count(1) from SAR_LAWS_MENU
<include refid="Base_Where_Clause"/>
</select>
<!-- 查询SAR_LAWS_MENU列表 -->
<select id="queryByPage" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select <include refid="Base_Column_List" /> from
(select tmp_tb.* , rownum rn from
(select <include refid="Base_Column_List" /> from SAR_LAWS_MENU
<include refid="Base_Where_Clause"/>
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
${pager.orderCondition}
</if>
) tmp_tb where rownum &lt;= ${pager.endIndex})
where rn &gt;= ${pager.startIndex}
</select>
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select <include refid="Base_Column_List"/> from SAR_LAWS_MENU
<include refid="Base_Where_Clause"/>
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
${pager.orderCondition}
</if>
</select>
<!-- 根据id查询 SAR_LAWS_MENU -->
<select id="selectByLawsInfo" resultMap="BaseResultMap" parameterType="com.adc.da.slrs.sarLawsMenu.entity.SarLawsMenuEOPage">
select <include refid="Base_Column_List" />
from SAR_LAWS_MENU
<include refid="Base_Where_Clause"/>
</select>
<select id="selectByLawsId" resultMap="BaseResultMap" parameterType="java.lang.String">
select <include refid="Base_Column_List" />
from SAR_LAWS_MENU
where laws_id = #{value} and valid_flag=0
</select>
<delete id="deleteByLawsId" parameterType="java.lang.String">
delete from SAR_LAWS_MENU
where laws_id = #{value}
</delete>
<select id="selectMenuByMenuParentId" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select <include refid="Base_Column_List"/> from SAR_LAWS_MENU
where laws_id = #{lawsId} and valid_flag=0
and MENU_ID in (select SAR_MENU.id from SAR_MENU where VALID_FLAG=0 start with id=#{menuId} connect by prior id= parent_id)
</select>
<update id="updateByLawsIdAndMenuId" parameterType="com.adc.da.slrs.sarLawsMenu.entity.SarLawsMenu" >
update SAR_BUSS_STAND_MENU
<set >
<if test="menuId != null" >
menu_id = #{menuId},
</if>
</set>
where laws_id = #{lawsId}
and MENU_ID in
<foreach collection="menuIds" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</update>
<delete id="deleteByMenuId" parameterType="com.adc.da.slrs.sarLawsMenu.entity.SarLawsMenu">
delete from SAR_LAWS_MENU
where laws_id = #{lawsId}
and MENU_ID in (select SAR_MENU.id from SAR_MENU
where VALID_FLAG=0 start with id=#{oldMenuId} connect by prior id= parent_id)
</delete>
<select id="selectAllMenuByStandId" resultMap="BaseResultMap" parameterType="com.adc.da.slrs.sarLawsMenu.entity.SarLawsMenu">
select <include refid="Base_Column_List" />
from SAR_LAWS_MENU
where laws_id = #{lawsId} and valid_flag=0
</select>
<delete id="deleteByLawsIdAndMenuId" parameterType="com.adc.da.slrs.sarLawsMenu.entity.SarLawsMenu">
delete from SAR_LAWS_MENU
where laws_id = #{lawsId, jdbcType=VARCHAR} and MENU_ID = #{menuId, jdbcType=VARCHAR}
</delete>
</mapper>
@@ -0,0 +1,299 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.adc.da.slrs.sarLawsStandInfo.dao.SarLawsStandInfoDao">
<!-- Result Map-->
<resultMap id="BaseResultMap" type="com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfo" >
</resultMap>
<resultMap id="BaseResultMapExcel" type="com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfo" >
</resultMap>
<sql id="Base_Where_Clause">
where 1=1 and SAR_LAWS_STAND_INFO.valid_flag=0
<trim suffixOverrides="," >
<if test="id != null" >
and SAR_LAWS_STAND_INFO.id ${idOperator} #{id}
</if>
<!-- 基本搜索项 -->
<if test="lawsType != null and lawsType != ''">
and SAR_LAWS_STAND_INFO.LAWS_TYPE like concat(concat('%',#{lawsType}),'%')
</if>
<if test="lawsNumber != null and lawsNumber != ''">
and SAR_LAWS_STAND_INFO.LAWS_NUMBER like concat(concat('%',#{lawsNumber}),'%')
</if>
<if test="lawsName != null and lawsName != ''">
and LAWS_NAME like concat(concat('%',#{lawsName}),'%')
</if>
<if test="lawsEnName != null and lawsEnName != ''">
and SAR_LAWS_STAND_INFO.LAWS_EN_NAME like concat(concat('%',#{lawsEnName}),'%')
</if>
<if test="lawsNo != null and lawsNo != ''">
and SAR_LAWS_STAND_INFO.LAWS_NO like concat(concat('%',#{lawsNo}),'%')
</if>
<if test="issueTime != null and issueTime != ''">
and DATE_FORMAT(SAR_LAWS_STAND_INFO.ISSUE_TIME,'%Y-%m-%d') = #{issueTime}
</if>
<if test="issueCompany != null and issueCompany != ''">
and SAR_LAWS_STAND_INFO.ISSUE_COMPANY like concat(concat('%',#{issueCompany}),'%')
</if>
<if test="commentCycleStart != null and commentCycleStart != ''">
and DATE_FORMAT(SAR_LAWS_STAND_INFO.COMMENT_CYCLE_START ,'%Y-%m-%d') = DATE_FORMAT(#{commentCycleStart},'%Y-%m-%d')
</if>
<if test="commentCycleEnd != null and commentCycleEnd != ''">
and DATE_FORMAT(SAR_LAWS_STAND_INFO.COMMENT_CYCLE_END ,'%Y-%m-%d') = DATE_FORMAT(#{commentCycleEnd},'%Y-%m-%d')
</if>
<if test="lawsTextState != null and lawsTextState != ''">
and SAR_LAWS_STAND_INFO.LAWS_TYPE = #{lawsTextState}
</if>
<if test="lawsSyqy != null and lawsSyqy != ''">
and FIND_IN_SET(#{lawsSyqy},SAR_LAWS_STAND_INFO.LAWS_SYQY)
</if>
<if test="lawsSycx != null and lawsSycx != ''">
and FIND_IN_SET(#{lawsSycx},SAR_LAWS_STAND_INFO.LAWS_SYCX)
</if>
<if test="isRelateAccess != null and isRelateAccess != ''">
and SAR_LAWS_STAND_INFO.IS_RELATE_ACCESS = #{isRelateAccess}
</if>
<if test="lawsYear != null and lawsYear != ''">
and SAR_LAWS_STAND_INFO.LAWS_YEAR like concat(concat('%',#{lawsYear}),'%')
</if>
<if test="lawsNotisyncNum != null and lawsNotisyncNum != ''">
and SAR_LAWS_STAND_INFO.LAWS_NOTISYNC_NUM like concat(concat('%',#{lawsNotisyncNum}),'%')
</if>
<if test="lawsBulletin != null and lawsBulletin != ''">
and SAR_LAWS_STAND_INFO.LAWS_BULLETIN like concat(concat('%',#{lawsBulletin}),'%')
</if>
<if test="lawsLabel != null and lawsLabel != ''">
and SAR_LAWS_STAND_INFO.LAWS_LABEL like concat(concat('%',#{lawsLabel}),'%')
</if>
<if test="lawsRemark != null and lawsRemark != ''">
and SAR_LAWS_STAND_INFO.LAWS_REMARK like concat(concat('%',#{lawsRemark}),'%')
</if>
<!-- 国家、地区 -->
<if test="country != null and country != ''">
and SAR_LAWS_STAND_INFO.country = #{country}
</if>
</trim>
</sql>
<sql id="SarStandardsInfo_in_left">
left join SAR_STAND_MENU ON SAR_LAWS_STAND_INFO.id = SAR_STAND_MENU.stand_id
where 1=1 and SAR_LAWS_STAND_INFO.valid_flag=0
<trim suffixOverrides=",">
<!-- 基本搜索项 -->
<if test="lawsType != null and lawsType != ''">
and SAR_LAWS_STAND_INFO.LAWS_TYPE like concat(concat('%',#{lawsType}),'%')
</if>
<if test="lawsNumber != null and lawsNumber != ''">
and SAR_LAWS_STAND_INFO.LAWS_NUMBER like concat(concat('%',#{lawsNumber}),'%')
</if>
<if test="numberName != null and numberName != ''">
and (LAWS_NAME like concat(concat('%',#{numberName}),'%')
or SAR_LAWS_STAND_INFO.LAWS_EN_NAME like concat(concat('%',#{numberName}),'%'))
</if>
<if test="lawsName != null and lawsName != ''">
and LAWS_NAME like concat(concat('%',#{lawsName}),'%')
</if>
<if test="lawsEnName != null and lawsEnName != ''">
and SAR_LAWS_STAND_INFO.LAWS_EN_NAME like concat(concat('%',#{lawsEnName}),'%')
</if>
<if test="lawsNo != null and lawsNo != ''">
and SAR_LAWS_STAND_INFO.LAWS_NO like concat(concat('%',#{lawsNo}),'%')
</if>
<if test="issueTime != null and issueTime != ''">
and DATE_FORMAT(SAR_LAWS_STAND_INFO.ISSUE_TIME,'%Y-%m-%d') = #{issueTime}
</if>
<if test="issueCompany != null and issueCompany != ''">
and SAR_LAWS_STAND_INFO.ISSUE_COMPANY like concat(concat('%',#{issueCompany}),'%')
</if>
<if test="commentCycleStart != null and commentCycleStart != ''">
and DATE_FORMAT(SAR_LAWS_STAND_INFO.COMMENT_CYCLE_START ,'%Y-%m-%d') = DATE_FORMAT(#{commentCycleStart},'%Y-%m-%d')
</if>
<if test="commentCycleEnd != null and commentCycleEnd != ''">
and DATE_FORMAT(SAR_LAWS_STAND_INFO.COMMENT_CYCLE_END ,'%Y-%m-%d') = DATE_FORMAT(#{commentCycleEnd},'%Y-%m-%d')
</if>
<if test="lawsTextState != null and lawsTextState != ''">
and SAR_LAWS_STAND_INFO.LAWS_TEXT_STATE = #{lawsTextState}
</if>
<if test="lawsSyqy != null and lawsSyqy != ''">
and FIND_IN_SET(#{lawsSyqy},SAR_LAWS_STAND_INFO.LAWS_SYQY)
</if>
<if test="lawsSycx != null and lawsSycx != ''">
and FIND_IN_SET(#{lawsSycx},SAR_LAWS_STAND_INFO.LAWS_SYCX)
</if>
<if test="isRelateAccess != null and isRelateAccess != ''">
and SAR_LAWS_STAND_INFO.IS_RELATE_ACCESS = #{isRelateAccess}
</if>
<if test="lawsYear != null and lawsYear != ''">
and SAR_LAWS_STAND_INFO.LAWS_YEAR like concat(concat('%',#{lawsYear}),'%')
</if>
<if test="lawsNotisyncNum != null and lawsNotisyncNum != ''">
and SAR_LAWS_STAND_INFO.LAWS_NOTISYNC_NUM like concat(concat('%',#{lawsNotisyncNum}),'%')
</if>
<if test="lawsBulletin != null and lawsBulletin != ''">
and SAR_LAWS_STAND_INFO.LAWS_BULLETIN like concat(concat('%',#{lawsBulletin}),'%')
</if>
<if test="lawsLabel != null and lawsLabel != ''">
and SAR_LAWS_STAND_INFO.LAWS_LABEL like concat(concat('%',#{lawsLabel}),'%')
</if>
<if test="lawsRemark != null and lawsRemark != ''">
and SAR_LAWS_STAND_INFO.LAWS_REMARK like concat(concat('%',#{lawsRemark}),'%')
</if>
<!-- 国家、地区 -->
<if test="country != null and country != ''">
and SAR_LAWS_STAND_INFO.country = #{country}
</if>
<!-- 目录判断 -->
<if test="menuId != null and menuId !='nomenu' and menuAllChildrenIdList != null">
and SAR_STAND_MENU.MENU_ID in
<foreach collection="menuAllChildrenIdList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<!-- 新修改需求,根据角色查询有权限的菜单数据-->
<if test="menuRoleList != null">
and SAR_STAND_MENU.MENU_ID in
<foreach collection="menuRoleList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<!-- 导出数据过程中,选择的id -->
<if test="idlist != null">
and SAR_LAWS_STAND_INFO.id in
<foreach collection="idlist" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="collectMenuId != null and collectMenuId != ''">
and SAR_LAWS_STAND_INFO.id in (
select COLLECT_RES_ID from TS_PERSON_COLLECT where TS_PERSON_COLLECT.VALID_FLAG=0
and (collect_type='INLAND_STAND' or collect_type='FOREIGN_STAND')
and TS_PERSON_COLLECT.user_id=#{userId}
)
</if>
</trim>
</sql>
<sql id="SarStandardsInfo_out_left">
LEFT JOIN TS_DICTYPE dicstandTextStatus ON (
dicstandTextStatus.dic_type_code = a.LAWS_TEXT_STATE
AND dicstandTextStatus.dic_id IS NOT NULL
AND dicstandTextStatus.valid_flag = 0
)
left join SAR_LAWS_ATTR_INFO on (SAR_LAWS_ATTR_INFO.LAWS_ID = a.id and SAR_LAWS_ATTR_INFO.valid_flag=0)
where 1=1
<trim suffixOverrides=",">
<if test="advanceSearchStr != null and advanceSearchStr != ''">
and (${advanceSearchStr})
</if>
</trim>
</sql>
<sql id="Base_Column_List_Show" >
DISTINCT SAR_LAWS_STAND_INFO.ID,
SAR_LAWS_STAND_INFO.LAWS_TYPE,
SAR_LAWS_STAND_INFO.LAWS_NUMBER,
SAR_LAWS_STAND_INFO.LAWS_NAME,
SAR_LAWS_STAND_INFO.LAWS_EN_NAME,
SAR_LAWS_STAND_INFO.LAWS_NO,
SAR_LAWS_STAND_INFO.ISSUE_TIME,
SAR_LAWS_STAND_INFO.ISSUE_COMPANY,
SAR_LAWS_STAND_INFO.COMMENT_CYCLE_START,
SAR_LAWS_STAND_INFO.COMMENT_CYCLE_END,
SAR_LAWS_STAND_INFO.LAWS_TEXT_STATE,
SAR_LAWS_STAND_INFO.LAWS_SYQY,
SAR_LAWS_STAND_INFO.LAWS_SYCX,
SAR_LAWS_STAND_INFO.IS_RELATE_ACCESS,
SAR_LAWS_STAND_INFO.LAWS_YEAR,
SAR_LAWS_STAND_INFO.LAWS_NOTISYNC_NUM,
SAR_LAWS_STAND_INFO.LAWS_BULLETIN,
SAR_LAWS_STAND_INFO.LAWS_LABEL,
SAR_LAWS_STAND_INFO.LAWS_REMARK,
SAR_LAWS_STAND_INFO.COUNTRY,
SAR_LAWS_STAND_INFO.MODIFY_TIME
</sql>
<select id="selectStandardsInfoByKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List_Show"/>
,dicstandTextStatus.DIC_TYPE_NAME AS standStatusShow
from SAR_LAWS_STAND_INFO
LEFT JOIN TS_DICTYPE dicstandTextStatus ON (
dicstandTextStatus.dic_type_code = SAR_LAWS_STAND_INFO.LAWS_TEXT_STATE
AND dicstandTextStatus.dic_id IS NOT NULL
AND dicstandTextStatus.valid_flag = 0
)
left join SAR_STAND_MENU ON SAR_LAWS_STAND_INFO.id = SAR_STAND_MENU.stand_id
left join TS_RESOURCE on SAR_STAND_MENU.menu_id = TS_RESOURCE.id
where SAR_LAWS_STAND_INFO.id = #{id}
</select>
<!-- 查询SAR_LAWS_STAND_INFO列表 -->
<select id="getSarStandardsInfoPage" resultMap="BaseResultMap"
parameterType="com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfoPage">
select
a.*,
dicstandTextStatus.DIC_TYPE_NAME AS standStatusShow,
(
CASE
WHEN SAR_LAWS_ATTR_INFO.XCXSSRQLAWS ='' THEN '9999-01-01'
ELSE SAR_LAWS_ATTR_INFO.XCXSSRQLAWS
END
) AS XCXSSRQLAWS
from
(select tmp_tb.* from
(
SELECT
DISTINCT SAR_LAWS_STAND_INFO.ID,
SAR_LAWS_STAND_INFO.LAWS_TYPE,
SAR_LAWS_STAND_INFO.LAWS_NUMBER,
SAR_LAWS_STAND_INFO.LAWS_NAME,
SAR_LAWS_STAND_INFO.LAWS_EN_NAME,
SAR_LAWS_STAND_INFO.LAWS_NO,
SAR_LAWS_STAND_INFO.ISSUE_TIME,
SAR_LAWS_STAND_INFO.ISSUE_COMPANY,
SAR_LAWS_STAND_INFO.COMMENT_CYCLE_START,
SAR_LAWS_STAND_INFO.COMMENT_CYCLE_END,
SAR_LAWS_STAND_INFO.LAWS_TEXT_STATE,
SAR_LAWS_STAND_INFO.LAWS_SYQY,
SAR_LAWS_STAND_INFO.LAWS_SYCX,
SAR_LAWS_STAND_INFO.IS_RELATE_ACCESS,
SAR_LAWS_STAND_INFO.LAWS_YEAR,
SAR_LAWS_STAND_INFO.LAWS_NOTISYNC_NUM,
SAR_LAWS_STAND_INFO.LAWS_BULLETIN,
SAR_LAWS_STAND_INFO.LAWS_LABEL,
SAR_LAWS_STAND_INFO.LAWS_REMARK,
SAR_LAWS_STAND_INFO.COUNTRY,
SAR_LAWS_STAND_INFO.MODIFY_TIME
from SAR_LAWS_STAND_INFO
<include refid="SarStandardsInfo_in_left"/>
) tmp_tb limit ${pager.startIndex-1},${pageSize}) a
<include refid="SarStandardsInfo_out_left"/>
order by
${orderByA} ${order1},a.id
</select>
<select id="getSarStandardsInfoCount" resultType="java.lang.Integer"
parameterType="com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfoPage">
select count(1) from (select count(*) from SAR_LAWS_STAND_INFO
left join SAR_LAWS_ATTR_INFO on (SAR_LAWS_ATTR_INFO.LAWS_ID = SAR_LAWS_STAND_INFO.id and SAR_LAWS_ATTR_INFO.valid_flag=0)
<include refid="SarStandardsInfo_in_left"/>
GROUP BY SAR_LAWS_STAND_INFO.id) a
</select>
<select id="getSarStandardsExportInfo" resultMap="BaseResultMapExcel"
parameterType="com.adc.da.slrs.sarLawsStandInfo.entity.SarLawsStandInfoPage">
select
a.*,
dicstandTextStatus.DIC_TYPE_NAME AS standStatusShow
from (select <include refid="Base_Column_List_Show"/>
from SAR_LAWS_ATTR_INFO
<include refid="SarStandardsInfo_in_left"/>) a
<include refid="SarStandardsInfo_out_left"/>
order by a.issue_time is null,a.issue_time desc,a.id
</select>
</mapper>
@@ -0,0 +1,134 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.adc.da.slrs.sarLawsVal.dao.SarLawsValDao">
<!-- Result Map-->
<resultMap id="BaseResultMap" type="com.adc.da.slrs.sarLawsVal.entity.SarLawsVal" >
<result column="modify_time" property="modifyTime" />
<result column="creation_time" property="creationTime" />
<result column="valid_flag" property="validFlag" />
<result column="property_val" property="propertyVal" />
<result column="property_type" property="propertyType" />
<result column="LAWS_ID" property="lawsId" />
<result column="id" property="id" />
</resultMap>
<!-- SAR_LAWS_VAL table all fields -->
<sql id="Base_Column_List" >
modify_time, creation_time, valid_flag, property_val, property_type, laws_id, id
</sql>
<!-- 查询条件 -->
<sql id="Base_Where_Clause">
where 1=1
<trim suffixOverrides="," >
<if test="modifyTime != null" >
and modify_time ${modifyTimeOperator} #{modifyTime}
</if>
<if test="modifyTime1 != null" >
and modify_time &gt;= #{modifyTime1}
</if>
<if test="modifyTime2 != null" >
and modify_time &lt;= #{modifyTime2}
</if>
<if test="creationTime != null" >
and creation_time ${creationTimeOperator} #{creationTime}
</if>
<if test="creationTime1 != null" >
and creation_time &gt;= #{creationTime1}
</if>
<if test="creationTime2 != null" >
and creation_time &lt;= #{creationTime2}
</if>
<if test="validFlag != null" >
and valid_flag ${validFlagOperator} #{validFlag}
</if>
<if test="propertyVal != null" >
and property_val ${propertyValOperator} #{propertyVal}
</if>
<if test="propertyType != null" >
and property_type ${propertyTypeOperator} #{propertyType}
</if>
<if test="lawsId != null" >
and laws_id ${lawsIdOperator} #{lawsId}
</if>
<if test="id != null" >
and id ${idOperator} #{id}
</if>
</trim>
</sql>
<!-- 插入记录 -->
<insert id="insert" parameterType="com.adc.da.slrs.sarLawsVal.entity.SarLawsVal" >
insert into SAR_LAWS_VAL(<include refid="Base_Column_List" />)
values (#{modifyTime, jdbcType=TIMESTAMP}, #{creationTime, jdbcType=TIMESTAMP}, #{validFlag, jdbcType=INTEGER}, #{propertyVal, jdbcType=VARCHAR}, #{propertyType, jdbcType=VARCHAR}, #{lawsId, jdbcType=VARCHAR}, #{id, jdbcType=VARCHAR})
</insert>
<!-- 动态插入记录 主键是序列 -->
<insert id="insertSelective" parameterType="com.adc.da.slrs.sarLawsVal.entity.SarLawsVal" >
insert into SAR_LAWS_VAL
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="modifyTime != null" >modify_time,</if>
<if test="creationTime != null" >creation_time,</if>
<if test="validFlag != null" >valid_flag,</if>
<if test="propertyVal != null" >property_val,</if>
<if test="propertyType != null" >property_type,</if>
<if test="lawsId != null" >laws_id,</if>
<if test="id != null" >id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="modifyTime != null" >#{modifyTime, jdbcType=TIMESTAMP},</if>
<if test="creationTime != null" >#{creationTime, jdbcType=TIMESTAMP},</if>
<if test="validFlag != null" >#{validFlag, jdbcType=INTEGER},</if>
<if test="propertyVal != null" >#{propertyVal, jdbcType=VARCHAR},</if>
<if test="propertyType != null" >#{propertyType, jdbcType=VARCHAR},</if>
<if test="lawsId != null" >#{lawsId, jdbcType=VARCHAR},</if>
<if test="id != null" >#{id, jdbcType=VARCHAR},</if>
</trim>
</insert>
<!-- SAR_LAWS_VAL 列表总数-->
<select id="queryByCount" resultType="java.lang.Integer" parameterType="com.adc.da.base.page.BasePage">
select count(1) from SAR_LAWS_VAL
<include refid="Base_Where_Clause"/>
</select>
<!-- 查询SAR_LAWS_VAL列表 -->
<select id="queryByPage" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select <include refid="Base_Column_List" /> from
(select tmp_tb.* from
(select <include refid="Base_Column_List" /> from SAR_LAWS_VAL
<include refid="Base_Where_Clause"/>
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
${pager.orderCondition}
</if>
) tmp_tb limit ${pager.startIndex-1},${pageSize}}) a
</select>
<select id="queryByList" resultMap="BaseResultMap" parameterType="com.adc.da.base.page.BasePage">
select <include refid="Base_Column_List"/> from SAR_LAWS_VAL
<include refid="Base_Where_Clause"/>
<if test="pager.orderCondition != null and pager.orderCondition != ''" >
${pager.orderCondition}
</if>
</select>
<delete id="deleteDataBylawsId" parameterType="java.lang.String">
delete from SAR_LAWS_VAL
where laws_id = #{lawsId}
</delete>
<insert id="insertForeach" parameterType="java.util.List">
insert into SAR_LAWS_VAL
(<include refid="Base_Column_List" />)
values
<foreach collection="list" item="item" index="index" separator=",">
(#{item.modifyTime, jdbcType=TIMESTAMP},
#{item.creationTime, jdbcType=TIMESTAMP},
#{item.validFlag, jdbcType=INTEGER},
#{item.propertyVal, jdbcType=VARCHAR},
#{item.propertyType, jdbcType=VARCHAR},
#{item.lawsId, jdbcType=VARCHAR},
#{item.id, jdbcType=VARCHAR})
</foreach>
</insert>
</mapper>
@@ -687,17 +687,6 @@
and TS_PERSON_COLLECT.user_id=#{userId} and TS_PERSON_COLLECT.user_id=#{userId}
) )
</if> </if>
<if test='labelMenuId != null and labelMenuId == "gxhbq"'>
and SAR_STAND_ATTR_INFO.GXHBQ is not null
</if>
<if test='labelMenuId != null and labelMenuId != "gxhbq"'>
and SAR_STAND_ATTR_INFO.GXHBQ like concat(concat('%',#{labelMenuId}),'%')
</if>
<!--适用车型-->
<if test="applyArctic != null and applyArctic != ''">
and SAR_STAND_ATTR_INFO.CLLX = #{applyArctic}
</if>
</trim> </trim>
</sql> </sql>
<sql id="SarStandardsInfo_out_left"> <sql id="SarStandardsInfo_out_left">
@@ -710,6 +699,16 @@
) )
left join SAR_STAND_ATTR_INFO on (SAR_STAND_ATTR_INFO.stand_id = a.id and SAR_STAND_ATTR_INFO.valid_flag=0) left join SAR_STAND_ATTR_INFO on (SAR_STAND_ATTR_INFO.stand_id = a.id and SAR_STAND_ATTR_INFO.valid_flag=0)
where 1=1 where 1=1
<if test='labelMenuId != null and labelMenuId == "gxhbq"'>
and SAR_STAND_ATTR_INFO.GXHBQ is not null
</if>
<if test='labelMenuId != null and labelMenuId != "gxhbq"'>
and SAR_STAND_ATTR_INFO.GXHBQ like concat(concat('%',#{labelMenuId}),'%')
</if>
<!--适用车型-->
<if test="applyArctic != null and applyArctic != ''">
and SAR_STAND_ATTR_INFO.CLLX = #{applyArctic}
</if>
<trim suffixOverrides=","> <trim suffixOverrides=",">
<if test="advanceSearchStr != null and advanceSearchStr != ''"> <if test="advanceSearchStr != null and advanceSearchStr != ''">
and (${advanceSearchStr}) and (${advanceSearchStr})
@@ -43,10 +43,10 @@ public class PersonCollectEOController extends BaseController<TsPersonCollect> {
**/ **/
@ApiOperation(value = "|PersonCollectEO|分页查询") @ApiOperation(value = "|PersonCollectEO|分页查询")
@GetMapping("/page") @GetMapping("/page")
public ResponseMessage<IPage<TsPersonCollect>> page(Integer pageNo, Integer pageSize, String collectTitle, String userId) throws Exception { public ResponseMessage<IPage<TsPersonCollect>> page(Integer pageNo, Integer pageSize, String collectTitle, String modeType,String userId) throws Exception {
return personCollectEOService.queryCollectByWrapper(pageNo, pageSize,collectTitle,userId); return personCollectEOService.queryCollectByWrapper(pageNo, pageSize,collectTitle,modeType,userId);
} }
@@ -27,6 +27,6 @@ public interface IPersonCollectEOService extends IService<TsPersonCollect> {
int updateByPrimaryKeySelective(TsPersonCollect tsPersonCollect) throws Exception; int updateByPrimaryKeySelective(TsPersonCollect tsPersonCollect) throws Exception;
public ResponseMessage<IPage<TsPersonCollect>> queryCollectByWrapper(Integer pageNo, Integer pageSize, String modeType, String collectTitle); public ResponseMessage<IPage<TsPersonCollect>> queryCollectByWrapper(Integer pageNo, Integer pageSize, String collectTitle,String modeType, String userId);
} }
@@ -129,13 +129,15 @@ public class PersonCollectEOServiceImpl extends ServiceImpl<PersonCollectEODao,
@Override @Override
public ResponseMessage<IPage<TsPersonCollect>> queryCollectByWrapper(Integer pageNo, Integer pageSize, String collectTitle, String userId) { public ResponseMessage<IPage<TsPersonCollect>> queryCollectByWrapper(Integer pageNo, Integer pageSize, String collectTitle, String modeType,String userId) {
BasePage basePage = new BasePage(); BasePage basePage = new BasePage();
QueryWrapper<TsPersonCollect> wrapper = new QueryWrapper<>(); QueryWrapper<TsPersonCollect> wrapper = new QueryWrapper<>();
wrapper.eq("user_id",userId); wrapper.eq("user_id",userId);
if (collectTitle != null && !collectTitle.equals("")){ if (collectTitle != null && !collectTitle.equals("")){
wrapper.like("collect_title",collectTitle); wrapper.like("collect_title",collectTitle);
}
if (modeType != null && !modeType.equals("")){
wrapper.eq("collect_type",modeType);
} }
if (pageNo != null) { if (pageNo != null) {