修复了定时更新文本状态,由于海外标准的格式与不与国内相同,添加了新的标准号查询方法
This commit is contained in:
@@ -230,7 +230,10 @@ public class ScheduledJob {
|
||||
List<Map<String, Object>> replaceStandIdMaps = sarStandAttrInfoDao.selectMaps(columnForDTBJH);
|
||||
HashMap<String, Integer> replaceIdCountMap = new HashMap<>();
|
||||
// 格式为 T/CSAE 175-2021
|
||||
Pattern pattern = Pattern.compile("^\\S*\\s\\S*[\\u2014\\u002d\\s]\\d{4}$");
|
||||
/**
|
||||
* 国内外表准号格式不统一
|
||||
*/
|
||||
// Pattern pattern = Pattern.compile("^\\S*\\s\\S*[\\u2014\\u002d\\s]\\d{4}$");
|
||||
replaceStandIdMaps.forEach(item->{
|
||||
if (item!=null){
|
||||
//此标准代替的标准的标准号的数组
|
||||
@@ -241,30 +244,30 @@ public class ScheduledJob {
|
||||
String[] DTBJHArray = DTBJHStr.split(",");
|
||||
for (String DTBJH : DTBJHArray) {
|
||||
|
||||
if (!pattern.matcher(DTBJH).matches()){
|
||||
continue;
|
||||
}
|
||||
// if (!pattern.matcher(DTBJH).matches()){
|
||||
// continue;
|
||||
// }
|
||||
|
||||
String[] split = DTBJH.split("[\\u2014\\u002d\\s]");//以空格或'-'或'—'分割
|
||||
String sort = split[0];
|
||||
String number = split[1];
|
||||
String year = split[2];
|
||||
|
||||
QueryWrapper<SarStandardsInfo> infoWrapper = new QueryWrapper<>();
|
||||
infoWrapper.select("ID")
|
||||
.eq("STAND_SORT", sort)
|
||||
.eq("STAND_NUMBER", number)
|
||||
.eq("STAND_YEAR", year);
|
||||
// String[] split = DTBJH.split("[\\u2014\\u002d\\s]");//以空格或'-'或'—'分割
|
||||
// String sort = split[0];
|
||||
// String number = split[1];
|
||||
// String year = split[2];
|
||||
//
|
||||
// QueryWrapper<SarStandardsInfo> infoWrapper = new QueryWrapper<>();
|
||||
// infoWrapper.select("ID")
|
||||
// .eq("STAND_SORT", sort)
|
||||
// .eq("STAND_NUMBER", number)
|
||||
// .eq("STAND_YEAR", year);
|
||||
|
||||
|
||||
List<Map<String, Object>> idMaps = sarStandardsInfoDao.selectMaps(infoWrapper);
|
||||
if (idMaps.size() > 0) {
|
||||
String standId = idMaps.get(0).get("ID").toString();
|
||||
List<String> standId = sarStandardsInfoDao.selectIdFormDTBZH(DTBJH);
|
||||
if (standId.size() > 0) {
|
||||
|
||||
//如果代替标准id已存在则映射为2不存在则添加并映射为1
|
||||
if (replaceIdCountMap.containsKey(standId)) {
|
||||
replaceIdCountMap.replace(standId, 2);
|
||||
replaceIdCountMap.replace(standId.get(0), 2);
|
||||
} else {
|
||||
replaceIdCountMap.put(standId, 1);
|
||||
replaceIdCountMap.put(standId.get(0), 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
@@ -74,4 +74,7 @@ public interface SarStandardsInfoDao extends BaseMapper<SarStandardsInfo> {
|
||||
|
||||
int updateISRELATEACCESSById(@Param("IS_RELATE_ACCESS") String ACCESS,@Param("list") List<String> list);
|
||||
|
||||
|
||||
List<String> selectIdFormDTBZH(String DTBZHCode);
|
||||
|
||||
}
|
||||
|
||||
+28
@@ -1719,4 +1719,32 @@
|
||||
) tmp_tb limit ${pager.startIndex-1},${pageSize}) a
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectIdFormDTBZH" resultType="java.lang.String">
|
||||
SELECT ID FROM sar_standards_info as sarInfo
|
||||
WHERE
|
||||
(
|
||||
REPLACE (
|
||||
concat(
|
||||
sarInfo.STAND_SORT,
|
||||
' ',
|
||||
sarInfo.STAND_NUMBER,
|
||||
'-',
|
||||
sarInfo.STAND_YEAR
|
||||
),
|
||||
' ',
|
||||
''
|
||||
) = REPLACE ( #{DTBZHCode},' ', '')
|
||||
|
||||
AND sarInfo.STAND_YEAR != ''
|
||||
)
|
||||
OR (
|
||||
REPLACE (
|
||||
concat(sarInfo.STAND_SORT,sarInfo.STAND_NUMBER),
|
||||
' ',
|
||||
''
|
||||
) = REPLACE ( #{DTBZHCode},' ', '')
|
||||
)
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user