@ -72,6 +72,8 @@ public class PointServiceImpl implements PointService {
private final WdpcXdryRepository xdryRepository ;
private final WdpcXdryRepository xdryRepository ;
private final GBaseJJDRepository jjdRepository ;
@Override
@Override
public void personPullAndSave ( LocalDateTime start , LocalDateTime end ) {
public void personPullAndSave ( LocalDateTime start , LocalDateTime end ) {
riskPersonalService . formatAndSave ( getPersons ( ) , Default . POINT_POEPLE ) ;
riskPersonalService . formatAndSave ( getPersons ( ) , Default . POINT_POEPLE ) ;
@ -603,6 +605,60 @@ public class PointServiceImpl implements PointService {
taskRepository . updateById ( updateTask ) ;
taskRepository . updateById ( updateTask ) ;
}
}
@Override
public void syncFiliation ( TaskParamDomain domain ) {
RiskTask task = createTask ( domain . getPersons ( ) . size ( ) , 123 ) ;
taskRepository . save ( task ) ;
Map < String , RiskModelTaskClue > oldMap = domain . getOldMap ( task . getModelId ( ) , true ) ;
Map < String , Integer > idCode = new HashMap < > ( ) ;
List < GBaseJJD > list = new ArrayList < > ( ) ;
log . info ( "模型123开始查询" ) ;
for ( List < String > idCard : domain . getIdCards ( ) ) {
list . addAll ( jjdRepository . getBaseMapper ( ) . selectFiliation ( idCard ) ) ;
}
log . info ( "模型123查询结果数:{}" , list . size ( ) ) ;
Map < String , RiskPersonal > personalMap = domain . getPersons ( ) . stream ( ) . collect ( Collectors . toMap ( RiskPersonal : : getIdCode , Function . identity ( ) , ( old , newVal ) - > newVal ) ) ;
List < RiskModelTaskClue > toInsert = new ArrayList < > ( ) ;
for ( GBaseJJD domicileType : list ) {
RiskPersonal personal = personalMap . get ( domicileType . getBjrzjhm ( ) ) ;
if ( personal = = null ) continue ;
if ( idCode . get ( domicileType . getBjrzjhm ( ) ) ! = null ) continue ;
if ( oldMap . get ( domicileType . getBjrzjhm ( ) ) ! = null ) continue ;
idCode . put ( domicileType . getBjrzjhm ( ) , 1 ) ;
String content = "" ;
if ( domicileType . getBjnr ( ) ! = null ) {
content = content + ",报警内容为“" + domicileType . getBjnr ( ) + "”" ;
}
if ( domicileType . getCjqk ( ) ! = null ) {
content = content + ",处警情况为“" + domicileType . getCjqk ( ) + "”" ;
}
ClueData data = ClueData . builder ( )
. name ( personal . getName ( ) )
. id ( personal . getId ( ) . toString ( ) )
. idCode ( personal . getIdCode ( ) )
. tag ( "与子女关系" )
. eventTime ( LocalDateTime . now ( ) )
. personId ( personal . getId ( ) )
. sourceData ( "发现该人员于" + getDateMinuteString ( domicileType . getBjsj ( ) )
+ "报警,关联接警单单号" + domicileType . getJjdbh ( ) + content
+ ",增加风险分5分" )
. build ( ) ;
toInsert . add ( createClue ( task . getModelId ( ) , 5 , task . getId ( ) , data ) ) ;
}
if ( ! toInsert . isEmpty ( ) ) {
modelTaskClueService . saveClues ( toInsert , Default . FILIATION ) ;
}
RiskTask updateTask = new RiskTask ( ) ;
updateTask . setId ( task . getId ( ) ) ;
updateTask . setInsertSize ( toInsert . size ( ) ) ;
updateTask . setUpdateSize ( 0 ) ;
updateTask . setState ( 1 ) ;
updateTask . setEndTime ( LocalDateTime . now ( ) ) ;
taskRepository . updateById ( updateTask ) ;
}
@Override
@Override
public void syncChildNo ( TaskParamDomain domain ) {
public void syncChildNo ( TaskParamDomain domain ) {
RiskTask task = createTask ( domain . getPersons ( ) . size ( ) , 121 ) ;
RiskTask task = createTask ( domain . getPersons ( ) . size ( ) , 121 ) ;
@ -989,8 +1045,6 @@ public class PointServiceImpl implements PointService {
taskRepository . updateById ( updateTask ) ;
taskRepository . updateById ( updateTask ) ;
}
}
private final GBaseJJDRepository jjdRepository ;
private final RiskTestRepository riskTestRepository ;
private final RiskTestRepository riskTestRepository ;
@Override
@Override
@ -1533,4 +1587,36 @@ public class PointServiceImpl implements PointService {
}
}
return " 无时间数据 " ;
return " 无时间数据 " ;
}
}
private static String getDateMinuteString ( Object param ) {
if ( param ! = null ) {
String time = null ;
try {
time = String . valueOf ( param ) ;
LocalDateTime localDateTime = LocalDateTime . parse ( time , DateTimeFormatter . ofPattern ( "yyyy-MM-dd'T'HH:mm:ss" ) ) ;
return localDateTime . format ( DateTimeFormatter . ofPattern ( "yyyy年MM月dd日HH时mm分" ) ) ;
} catch ( Exception e ) {
try {
time = String . valueOf ( param ) ;
LocalDateTime localDateTime = LocalDateTime . parse ( time , DateTimeFormatter . ofPattern ( "yyyy-MM-dd HH:mm:ss.S" ) ) ;
return localDateTime . format ( DateTimeFormatter . ofPattern ( "yyyy年MM月dd日HH时mm分" ) ) ;
} catch ( Exception ex ) {
try {
time = String . valueOf ( param ) ;
LocalDateTime localDateTime = LocalDateTime . parse ( time , DateTimeFormatter . ofPattern ( "yyyyMMddHHmmss" ) ) ;
return localDateTime . format ( DateTimeFormatter . ofPattern ( "yyyy年MM月dd日HH时mm分" ) ) ;
} catch ( Exception exx ) {
try {
time = String . valueOf ( param ) ;
LocalDateTime localDateTime = LocalDateTime . parse ( time , DateTimeFormatter . ofPattern ( "yyyy-MM-dd HH:mm:ss" ) ) ;
return localDateTime . format ( DateTimeFormatter . ofPattern ( "yyyy年MM月dd日HH时mm分" ) ) ;
} catch ( Exception exxx ) {
log . info ( "日期转换异常{}" , time , ex ) ;
}
}
}
}
}
return " 无时间数据 " ;
}
}
}