fix(asms): 标准性质判断

This commit is contained in:
yjz
2024-03-05 16:59:34 +08:00
parent e7f9808969
commit 9412870585
6 changed files with 50 additions and 2 deletions
@@ -95,4 +95,6 @@ public interface ILawsAsmsOpenApiService extends IService<LawsAsmsOpenApi> {
void removeDictItemBatch(List<String> idList);
void disposeItemVal(LawsDocumentSplit lawsDocumentSplit, String articleContent);
String judgeStandardProperty(String standardNumber);
}
@@ -52,6 +52,7 @@ import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.*;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service;
@@ -120,6 +121,11 @@ public class LawsAsmsOpenApiServiceImpl extends ServiceImpl<LawsAsmsOpenApiMappe
private static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
private static SimpleDateFormat oldDateFormat = new SimpleDateFormat("yyyy年MM月dd日");
@Value("#{'${standardProperty.recommend:}'.split(',')}")
private List<String> recommendList;
@Value("#{'${standardProperty.admittance:}'.split(',')}")
private List<String> admittanceList;
/**
* 分页查询
*
@@ -517,7 +523,8 @@ public class LawsAsmsOpenApiServiceImpl extends ServiceImpl<LawsAsmsOpenApiMappe
// 标准性质
/*itemValues = getItemValues(lawsAsmsDomestic.getStandardNature(),
"1695010513489833985", sysDictItemList);*/
lawsDomesticStandard.setStandardProperty("SN002");
// 标准性质判断
lawsDomesticStandard.setStandardProperty(judgeStandardProperty(lawsDomesticStandard.getStandardNumber()));
// 标准状态
itemValues = getItemValues(lawsAsmsDomestic.getStandardStatus(),
"1695991936599715842", sysDictItemList);
@@ -841,6 +848,23 @@ public class LawsAsmsOpenApiServiceImpl extends ServiceImpl<LawsAsmsOpenApiMappe
updateBatchById(lawsAsmsOpenApiList);
}
@Override
public String judgeStandardProperty(String standardNumber) {
for (String recommend : recommendList) {
// 推荐性判断
if (recommend.equals(standardNumber) || Pattern.matches(recommend, standardNumber)){
return "SN002";
}
}
for (String admittance : admittanceList) {
// 准入性判断
if (admittance.equals(standardNumber) || Pattern.matches(admittance, standardNumber)){
return "SN001";
}
}
return "SN002";
}
private boolean duplicateCheck(LawsDocumentSplit lawsDocumentSplit, String articleContent) {
LawsDocumentSplit lawsDocumentSplits = lawsDocumentSplitMapper.selectOne(
new LambdaQueryWrapper<LawsDocumentSplit>()
@@ -236,7 +236,8 @@ public class SynchronizationAsmsService {
// 标准性质
/*itemValues = getItemValues(lawsAsmsDomestic.getStandardNature(),
"1695010513489833985", sysDictItemList);*/
lawsDomesticStandard.setStandardProperty("SN002");
// 标准性质判断
lawsDomesticStandard.setStandardProperty(lawsAsmsOpenApiService.judgeStandardProperty(lawsDomesticStandard.getStandardNumber()));
// 标准状态
itemValues = getItemValues(lawsAsmsDomestic.getStandardStatus(),
"1695991936599715842", sysDictItemList);
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long