@ -24,6 +24,7 @@ import java.math.BigDecimal;
import java.math.RoundingMode ;
import java.text.SimpleDateFormat ;
import java.time.Instant ;
import java.time.LocalDate ;
import java.time.LocalDateTime ;
import java.time.ZoneId ;
import java.time.format.DateTimeFormatter ;
@ -279,8 +280,8 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
String thingDesc = modelClue . getThingDesc ( ) ;
modelClue . setThingDesc ( "该" + data . get ( "AJBZmc" )
+ "案件编号为" + data . get ( "AJBH" )
+ ",报案日期为" + getDateString ( data . get ( "BARQ" ) )
+ ",受理日期为" + getDateString ( data . get ( "SLRQ" ) )
+ ",报案日期为" + getDateMinute String ( data . get ( "BARQ" ) )
+ ",受理日期为" + getDateMinute String ( data . get ( "SLRQ" ) )
+ ",当前案件状态为“" + data . get ( "AJZTmc" )
+ "”,已经超过" + "30"
+ "日仍未受理。" + thingDesc ) ;
@ -304,52 +305,52 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
if ( calculateDays ! = null ) {
modelClue . setThingDesc (
"发现编号为" + getAjbh ( data )
+ "的" + data . get ( "AJBZmc" ) + "案件,报案日期为" + getDateString ( data . get ( "BARQ" ) )
+ ",但受理日期为" + getDateString ( data . get ( "SLRQ" ) )
+ "的" + data . get ( "AJBZmc" ) + "案件,报案日期为" + getDateMinute String ( data . get ( "BARQ" ) )
+ ",但受理日期为" + getDateMinute String ( data . get ( "SLRQ" ) )
+ ",受理时间超过了报案日期" + calculateDaysBetween ( data . get ( "BARQ" ) , data . get ( "SLRQ" ) )
+ "日,当前案件状态为“" + data . get ( "AJZTmc" ) + "”,存在案件受理不及时的问题。" ) ;
} else {
modelClue . setThingDesc (
"发现编号为" + getAjbh ( data )
+ "的" + data . get ( "AJBZmc" ) + "案件,报案日期为" + getDateString ( data . get ( "BARQ" ) )
+ ",但受理日期为" + getDateString ( data . get ( "SLRQ" ) )
+ "的" + data . get ( "AJBZmc" ) + "案件,报案日期为" + getDateMinute String ( data . get ( "BARQ" ) )
+ ",但受理日期为" + getDateMinute String ( data . get ( "SLRQ" ) )
+ ",受理时间超过了报案日期,当前案件状态为“" + data . get ( "AJZTmc" ) + "”,存在案件受理不及时的问题。" ) ;
}
} else if ( modelId = = 11 ) { // 11号模型:立案不及时的异常数据(7天)
modelClue . setThingDesc ( "该" + data . get ( "AJBZmc" )
+ "案件编号为" + getAjbh ( data )
+ ",受理日期为" + getDateString ( data . get ( "SLRQ" ) )
+ ",立案日期为" + getDateString ( data . get ( "LARQ" ) )
+ ",受理日期为" + getDateMinute String ( data . get ( "SLRQ" ) )
+ ",立案日期为" + getDateMinute String ( data . get ( "LARQ" ) )
+ ",当前案件状态为“" + data . get ( "AJZTmc" )
+ "”,超过" + "7"
+ "日未受理。" ) ;
} else if ( modelId = = 12 ) { // 12号模型:立案不及时的异常数据(30天)
modelClue . setThingDesc ( "该" + data . get ( "AJBZmc" )
+ "案件编号为" + getAjbh ( data )
+ ",受理日期为" + getDateString ( data . get ( "SLRQ" ) )
+ ",立案日期为" + getDateString ( data . get ( "LARQ" ) )
+ ",受理日期为" + getDateMinute String ( data . get ( "SLRQ" ) )
+ ",立案日期为" + getDateMinute String ( data . get ( "LARQ" ) )
+ ",当前案件状态为“" + data . get ( "AJZTmc" )
+ "”,超过" + "30"
+ "日未受理。" ) ;
} else if ( modelId = = 13 ) { // 13号模型:立案不及时的异常数据(60天)
modelClue . setThingDesc ( "该" + data . get ( "AJBZmc" )
+ "案件编号为" + getAjbh ( data )
+ ",受理日期为" + getDateString ( data . get ( "SLRQ" ) )
+ ",立案日期为" + getDateString ( data . get ( "LARQ" ) )
+ ",受理日期为" + getDateMinute String ( data . get ( "SLRQ" ) )
+ ",立案日期为" + getDateMinute String ( data . get ( "LARQ" ) )
+ ",当前案件状态为“" + data . get ( "AJZTmc" )
+ "”,超过" + "60"
+ "日未受理。" ) ;
} else if ( modelId = = 14 ) { // 14号模型:立案不及时的异常数据(无数据)
modelClue . setThingDesc ( "该" + data . get ( "AJBZmc" )
+ "案件编号为" + getAjbh ( data )
+ ",受理日期为" + getDateString ( data . get ( "SLRQ" ) )
+ ",受理日期为" + getDateMinute String ( data . get ( "SLRQ" ) )
+ ",立案日期 无数据"
+ ",当前案件状态为“" + data . get ( "AJZTmc" )
+ "”,立案不及时。" ) ;
} else if ( modelId = = 15 ) { // 15号模型:未录入受害人员的异常数据
modelClue . setThingDesc ( "该" + data . get ( "AJBZmc" )
+ "案件编号为" + getAjbh ( data )
+ ",受理日期为" + getDateString ( data . get ( "SLRQ" ) )
+ ",受理日期为" + getDateMinute String ( data . get ( "SLRQ" ) )
+ ",没有录入受害人。" ) ;
}
}
@ -468,7 +469,7 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
private void getModelCluesForModel16 ( String param , List < ModelClue > modelClues ) {
System . out . println ( "模型16开始查询数据库" ) ;
List < String > params = parseSqlForModel2 ( param ) ;
String selectSfzh = "SELECT count(sfzh) as num, sfzh FROM dwd_wp_zfba_qbhsjds WHERE STR_TO_DATE(pzrq, '%Y%m%d%H%i%s') BETWEEN '" + params . get ( 0 ) + " 00:00:00' AND '" + params . get ( 1 ) + " 00:00:00' GROUP BY sfzh, ajbh HAVING count(sfz h) > 2;" ;
String selectSfzh = "SELECT COUNT(DISTINCT ajbh) AS num, sfzh FROM dwd_wp_zfba_qbhsjds WHERE STR_TO_DATE(pzrq, '%Y%m%d%H%i%s') BETWEEN '" + params . get ( 0 ) + " 00:00:00' AND '" + params . get ( 1 ) + " 00:00:00' GROUP BY sfzh HAVING COUNT(DISTINCT ajb h) > 2;" ;
List < Map < String , Object > > sfzhList = modelClueDataMapper . selectByUniqueKeys ( selectSfzh ) ;
Map < String , Long > sfzhMap = sfzhList . stream ( ) . filter ( map - > map . get ( "sfzh" ) ! = null ) . collect ( Collectors . toMap (
map - > ( String ) map . get ( "sfzh" ) ,
@ -526,7 +527,7 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
}
newModelClue . setData ( JSONObject . toJSONString ( modelClue ) ) ;
newModelClue . setStatus ( 0 ) ;
newModelClue . setThingDesc ( "在" + params . get ( 0 ) + "到" + params . get ( 1 ) + "之间,"
newModelClue . setThingDesc ( "在" + getDateString ( params . get ( 0 ) ) + "到" + getDateString ( params . get ( 1 ) ) + "之间,"
+ modelClue . get ( "xm" )
+ "(身份证号:" + modelClue . get ( "sfzh" ) + ")的取保次数为"
+ sfzhMap . get ( ( String ) modelClue . get ( "sfzh" ) ) + "次,大于2次,属于多次取保异常数据。" ) ;
@ -597,7 +598,7 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
jqxz = summarizeAttribute ( data , jqxz ) ;
modelClue . setThingDesc ( "该" + jqxz
+ "警情接警单编号为" + data . get ( "jjdbh" )
+ ",报案时间为" + getDateString ( data . get ( "bjsj" ) )
+ ",报案时间为" + getDateMinute String ( data . get ( "bjsj" ) )
+ ",没有匹配到立案时间,受立案不及时。" ) ;
break ;
}
@ -623,7 +624,7 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
jqxz = summarizeAttribute ( data , jqxz ) ;
modelClue . setThingDesc ( "该" + jqxz
+ "警情接警单编号为" + data . get ( "jjdbh" )
+ ",报案时间为" + getDateString ( data . get ( "bjsj" ) )
+ ",报案时间为" + getDateMinute String ( data . get ( "bjsj" ) )
+ ",案件编号为" + data . get ( "ajbh" )
+ ",立案时间为" + formatStringDate ( ( String ) data . get ( "lasj" ) )
+ ",报案时间与立案时间超过7天,受立案不及时。" ) ;
@ -660,7 +661,18 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
System . out . println ( "模型2查询数据库完毕,数量为:" + modelClues . size ( ) ) ;
}
private static String getDateString ( Object param ) {
private static String getDateString ( String dateString ) {
try {
DateTimeFormatter inputFormatter = DateTimeFormatter . ofPattern ( "yyyy-MM-dd" ) ;
LocalDate date = LocalDate . parse ( dateString , inputFormatter ) ;
DateTimeFormatter outputFormatter = DateTimeFormatter . ofPattern ( "yyyy年MM月dd日" ) ;
return date . format ( outputFormatter ) ;
} catch ( Exception e ) {
throw new RuntimeException ( e ) ;
}
}
private static String getDateMinuteString ( Object param ) {
if ( param ! = null ) {
String time = null ;
try {