@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.supervision.mapper.* ;
import com.biutag.supervision.pojo.entity.BusinessLog ;
import com.biutag.supervision.pojo.entity.BusinessPolice ;
import com.biutag.supervision.pojo.entity.GBaseAJJBXX ;
import com.biutag.supervision.pojo.entity.GBaseCJD ;
import com.biutag.supervision.pojo.model.BusinessPoliceModel ;
import com.biutag.supervision.pojo.param.BusinessQueryParam ;
@ -18,7 +19,11 @@ import org.springframework.stereotype.Service;
import java.security.MessageDigest ;
import java.security.NoSuchAlgorithmException ;
import java.text.SimpleDateFormat ;
import java.time.LocalDate ;
import java.time.LocalDateTime ;
import java.time.ZoneId ;
import java.time.format.DateTimeFormatter ;
import java.util.* ;
import java.util.stream.Collectors ;
@ -37,32 +42,32 @@ public class BusinessPoliceService extends ServiceImpl<BusinessPoliceMapper, Bus
private final BusinessDepartService businessDepartService ;
public final ModelClueDataMapper modelClueDataMapper ;
private final SupDepartMapper supDepartMapper ;
public Page < BusinessPoliceModel > page ( BusinessQueryParam businessQueryParam ) {
// if (businessQueryParam.getDepartName()!=null && businessQueryParam.getDepartName().equals("开始导入今年所有的数据")) {
// LocalDate start = LocalDate.parse("2024-01-01");
// LocalDate end = LocalDate.parse("2024-10-14");
//
// for (LocalDate date = start; !date.isAfter(end); date = date.plusDays(1)) {
// List<Date> happenTime = new ArrayList<>();
// Date startDate = Date.from(date.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant());
// Date endDate = Date.from(date.atTime(23, 59, 59).atZone(ZoneId.systemDefault()).toInstant());
// happenTime.add(startDate);
// happenTime.add(endDate);
// generate(happenTime);
// log.info("已经导入{}的个人数据", date.format(DateTimeFormatter.ofPattern("yyyy年M月d日")));
// businessDepartService.generate(happenTime);
// log.info("已经导入{}的单位数据", date.format(DateTimeFormatter.ofPattern("yyyy年M月d日")));
// }
// } else if (businessQueryParam.getDepartName() != null && businessQueryParam.getDepartName().equals("开始导入今天所有的数据")) {
// List<Date> happenTime = new ArrayList<>();
// Date start = Date.from(LocalDateTime.parse("2024-01-01T00:00:00", DateTimeFormatter.ISO_DATE_TIME).atZone(ZoneId.systemDefault()).toInstant());
// Date end = Date.from(LocalDateTime.parse("2024-01-01T09:59:59", DateTimeFormatter.ISO_DATE_TIME).atZone(ZoneId.systemDefault()).toInstant());
// happenTime.add(start);
// happenTime.add(end);
// generate(happenTime);
// }
if ( businessQueryParam . getDepartName ( ) ! = null & & businessQueryParam . getDepartName ( ) . equals ( "开始导入今年所有的数据" ) ) {
LocalDate start = LocalDate . parse ( "2024-01-01" ) ;
LocalDate end = LocalDate . parse ( "2024-10-31" ) ;
for ( LocalDate date = start ; ! date . isAfter ( end ) ; date = date . plusDays ( 1 ) ) {
List < Date > happenTime = new ArrayList < > ( ) ;
Date startDate = Date . from ( date . atStartOfDay ( ) . atZone ( ZoneId . systemDefault ( ) ) . toInstant ( ) ) ;
Date endDate = Date . from ( date . atTime ( 23 , 59 , 59 ) . atZone ( ZoneId . systemDefault ( ) ) . toInstant ( ) ) ;
happenTime . add ( startDate ) ;
happenTime . add ( endDate ) ;
generate ( happenTime ) ;
businessDepartService . generate ( happenTime ) ;
log . info ( "已经导入{}的个人数据" , date . format ( DateTimeFormatter . ofPattern ( "yyyy年M月d日" ) ) ) ;
}
} else if ( businessQueryParam . getDepartName ( ) ! = null & & businessQueryParam . getDepartName ( ) . equals ( "开始导入今天所有的数据" ) ) {
List < Date > happenTime = new ArrayList < > ( ) ;
Date start = Date . from ( LocalDateTime . parse ( "2024-09-02T00:00:00" , DateTimeFormatter . ISO_DATE_TIME ) . atZone ( ZoneId . systemDefault ( ) ) . toInstant ( ) ) ;
Date end = Date . from ( LocalDateTime . parse ( "2024-10-14T09:59:59" , DateTimeFormatter . ISO_DATE_TIME ) . atZone ( ZoneId . systemDefault ( ) ) . toInstant ( ) ) ;
happenTime . add ( start ) ;
happenTime . add ( end ) ;
generate ( happenTime ) ;
}
String empNo = "" ;
if ( businessQueryParam . getEmpNo ( ) ! = null & & ! businessQueryParam . getEmpNo ( ) . isEmpty ( ) ) {
empNo = businessQueryParam . getEmpNo ( ) ;
@ -82,13 +87,24 @@ public class BusinessPoliceService extends ServiceImpl<BusinessPoliceMapper, Bus
public void generate ( List < Date > happenTime ) {
List < BusinessPolice > businessPoliceList = new ArrayList < > ( ) ;
// 110、122
List < GBaseCJD > gBaseCJDSList = selectCJDList ( happenTime ) ;
if ( gBaseCJDSList . isEmpty ( ) ) {
// 执法办案
ZFBAResult zfbaresult = getZfbaResult ( happenTime ) ;
if ( gBaseCJDSList . isEmpty ( ) & & zfbaresult . bar1 ( ) . isEmpty ( ) & & zfbaresult . bar2 ( ) . isEmpty ( ) & & zfbaresult . bar3 ( ) . isEmpty ( ) & & zfbaresult . bar4 ( ) . isEmpty ( ) & & zfbaresult . bar5 ( ) . isEmpty ( ) & & zfbaresult . bar6 ( ) . isEmpty ( ) ) {
log . info ( "{}没有个人数据" , happenTime . get ( 0 ) ) ;
businessLogMapper . insert ( new BusinessLog ( ) . setType ( "个人业务数据" ) . setNum ( 0 ) . setCreateTime ( LocalDateTime . now ( ) ) ) ;
return ;
}
List < String > departIds = gBaseCJDSList . stream ( ) . map ( GBaseCJD : : getCjdxssdwdm ) . collect ( Collectors . toList ( ) ) ;
Map < String , GBaseAJJBXX > gBaseAJJBXXMapSR = new HashMap < > ( ) ;
Map < String , GBaseAJJBXX > gBaseAJJBXXMapLR = new HashMap < > ( ) ;
Map < String , GBaseAJJBXX > gBaseAJJBXXMapPR = new HashMap < > ( ) ;
setAJJBXXMap ( zfbaresult , gBaseAJJBXXMapSR , gBaseAJJBXXMapLR , gBaseAJJBXXMapPR ) ;
List < String > departIds = new ArrayList < > ( ) ;
setDepartIds ( gBaseCJDSList , departIds , zfbaresult ) ;
if ( departIds . isEmpty ( ) ) {
return ;
}
List < Map < String , Object > > idsByDepartIds = supDepartMapper . getIdsByDepartIds ( departIds ) ; // 430100221100-1011
List < Map < String , Object > > idsByCode = supDepartMapper . getIdsByCode ( departIds ) ;
Map < String , String > resultMap2 = idsByDepartIds . stream ( ) . collect ( Collectors . toMap ( map - > ( String ) map . get ( "domain_name" ) , map - > ( String ) map . get ( "id" ) ) ) ;
@ -104,15 +120,7 @@ public class BusinessPoliceService extends ServiceImpl<BusinessPoliceMapper, Bus
Map < String , Long > resultMap4 = resultList2 . stream ( ) . collect ( Collectors . toMap ( map - > ( String ) map . get ( "departId" ) , map - > ( Long ) map . get ( "groupId" ) ) ) ;
List < Long > groupIds = new ArrayList < > ( ) ;
for ( GBaseCJD gBaseCJD : gBaseCJDSList ) {
Long groupId = resultMap . get ( resultMap2 . get ( gBaseCJD . getCjdxssdwdm ( ) ) ) ;
if ( groupId = = null ) {
groupId = resultMap4 . get ( resultMap2 . get ( gBaseCJD . getCjdxssdwdm ( ) ) ) ;
}
groupIds . add ( groupId ) ;
BusinessPolice businessPolice = getBusinessPolice ( happenTime , gBaseCJD , groupId ) ;
businessPoliceList . add ( businessPolice ) ;
}
setBusinessPoliceList ( happenTime , gBaseCJDSList , resultMap , resultMap2 , resultMap4 , groupIds , businessPoliceList , gBaseAJJBXXMapSR , gBaseAJJBXXMapLR , gBaseAJJBXXMapPR ) ;
List < Map < Long , Object > > nameList = statisticsGroupMapper . getNameByGroupIds ( groupIds ) ;
Map < Long , String > names = nameList . stream ( ) . collect ( Collectors . toMap (
map - > ( Long ) map . get ( "groupId" ) ,
@ -129,7 +137,223 @@ public class BusinessPoliceService extends ServiceImpl<BusinessPoliceMapper, Bus
businessLogMapper . insert ( new BusinessLog ( ) . setType ( "个人业务数据" ) . setNum ( gBaseCJDSList . size ( ) ) . setActualNum ( actualNum ) . setCreateTime ( LocalDateTime . now ( ) ) ) ;
}
private static BusinessPolice getBusinessPolice ( List < Date > happenTime , GBaseCJD gBaseCJD , Long groupId ) {
private static void setBusinessPoliceList ( List < Date > happenTime , List < GBaseCJD > gBaseCJDSList , Map < String , Long > resultMap , Map < String , String > resultMap2 , Map < String , Long > resultMap4 , List < Long > groupIds , List < BusinessPolice > businessPoliceList , Map < String , GBaseAJJBXX > gBaseAJJBXXMapSR , Map < String , GBaseAJJBXX > gBaseAJJBXXMapLR , Map < String , GBaseAJJBXX > gBaseAJJBXXMapPR ) {
for ( GBaseCJD gBaseCJD : gBaseCJDSList ) {
Long groupId = resultMap . get ( resultMap2 . get ( gBaseCJD . getCjdxssdwdm ( ) ) ) ;
if ( groupId = = null ) {
groupId = resultMap4 . get ( resultMap2 . get ( gBaseCJD . getCjdxssdwdm ( ) ) ) ;
}
groupIds . add ( groupId ) ;
BusinessPolice businessPolice = getJJDBusinessPolice ( happenTime , gBaseCJD , groupId ) ;
businessPoliceList . add ( businessPolice ) ;
}
for ( GBaseAJJBXX gBaseAJJBXX : gBaseAJJBXXMapSR . values ( ) ) {
Long groupId = resultMap . get ( resultMap2 . get ( gBaseAJJBXX . getBADWIDdm ( ) ) ) ;
if ( groupId = = null ) {
groupId = resultMap4 . get ( resultMap2 . get ( gBaseAJJBXX . getBADWIDdm ( ) ) ) ;
}
groupIds . add ( groupId ) ;
BusinessPolice businessPolice = getAJJBXXBusinessPolice ( happenTime , gBaseAJJBXX , groupId , 4 ) ;
businessPoliceList . add ( businessPolice ) ;
}
for ( GBaseAJJBXX gBaseAJJBXX : gBaseAJJBXXMapLR . values ( ) ) {
Long groupId = resultMap . get ( resultMap2 . get ( gBaseAJJBXX . getBADWIDdm ( ) ) ) ;
if ( groupId = = null ) {
groupId = resultMap4 . get ( resultMap2 . get ( gBaseAJJBXX . getBADWIDdm ( ) ) ) ;
}
groupIds . add ( groupId ) ;
BusinessPolice businessPolice = getAJJBXXBusinessPolice ( happenTime , gBaseAJJBXX , groupId , 5 ) ;
businessPoliceList . add ( businessPolice ) ;
}
for ( GBaseAJJBXX gBaseAJJBXX : gBaseAJJBXXMapPR . values ( ) ) {
Long groupId = resultMap . get ( resultMap2 . get ( gBaseAJJBXX . getBADWIDdm ( ) ) ) ;
if ( groupId = = null ) {
groupId = resultMap4 . get ( resultMap2 . get ( gBaseAJJBXX . getBADWIDdm ( ) ) ) ;
}
groupIds . add ( groupId ) ;
BusinessPolice businessPolice = getAJJBXXBusinessPolice ( happenTime , gBaseAJJBXX , groupId , 6 ) ;
businessPoliceList . add ( businessPolice ) ;
}
}
private static void setDepartIds ( List < GBaseCJD > gBaseCJDSList , List < String > departIds , ZFBAResult zfbaresult ) {
List < String > collect = gBaseCJDSList . stream ( ) . map ( GBaseCJD : : getCjdxssdwdm ) . toList ( ) ;
if ( ! collect . isEmpty ( ) ) {
departIds . addAll ( collect ) ;
}
List < String > badwiDdm1 = zfbaresult . bar1 ( ) . stream ( ) . map ( map - > ( String ) map . get ( "BADWIDdm" ) ) . toList ( ) ;
if ( ! badwiDdm1 . isEmpty ( ) ) {
departIds . addAll ( badwiDdm1 ) ;
}
List < String > badwiDdm2 = zfbaresult . bar2 ( ) . stream ( ) . map ( map - > ( String ) map . get ( "BADWIDdm" ) ) . toList ( ) ;
if ( ! badwiDdm2 . isEmpty ( ) ) {
departIds . addAll ( badwiDdm2 ) ;
}
List < String > badwiDdm3 = zfbaresult . bar3 ( ) . stream ( ) . map ( map - > ( String ) map . get ( "BADWIDdm" ) ) . toList ( ) ;
if ( ! badwiDdm3 . isEmpty ( ) ) {
departIds . addAll ( badwiDdm3 ) ;
}
List < String > badwiDdm4 = zfbaresult . bar4 ( ) . stream ( ) . map ( map - > ( String ) map . get ( "BADWIDdm" ) ) . toList ( ) ;
if ( ! badwiDdm4 . isEmpty ( ) ) {
departIds . addAll ( badwiDdm4 ) ;
}
}
private static void setAJJBXXMap ( ZFBAResult zfbaresult , Map < String , GBaseAJJBXX > gBaseAJJBXXMapSR , Map < String , GBaseAJJBXX > gBaseAJJBXXMapLR , Map < String , GBaseAJJBXX > gBaseAJJBXXMapPR ) {
for ( Map < String , Object > bar : zfbaresult . bar1 ( ) ) {
if ( bar . get ( "BAR1ID" ) = = null ) {
continue ;
}
if ( gBaseAJJBXXMapSR . containsKey ( ( String ) bar . get ( "BAR1ID" ) ) ) {
GBaseAJJBXX gBaseAJJBXX = gBaseAJJBXXMapSR . get ( ( String ) bar . get ( "BAR1ID" ) ) ;
gBaseAJJBXX . setBARNum ( gBaseAJJBXX . getBARNum ( ) + Math . toIntExact ( ( Long ) bar . get ( "num" ) ) ) ;
gBaseAJJBXXMapSR . put ( gBaseAJJBXX . getBARID ( ) , gBaseAJJBXX ) ;
} else {
GBaseAJJBXX gBaseAJJBXX = new GBaseAJJBXX ( ) ;
gBaseAJJBXX . setBARID ( ( String ) bar . get ( "BAR1ID" ) ) ;
gBaseAJJBXX . setBADWIDdm ( ( String ) bar . get ( "BADWIDdm" ) ) ;
gBaseAJJBXX . setBADWIDmc ( ( String ) bar . get ( "BADWIDmc" ) ) ;
gBaseAJJBXX . setXM ( ( String ) bar . get ( "XM" ) ) ;
gBaseAJJBXX . setBARNum ( Math . toIntExact ( ( Long ) bar . get ( "num" ) ) ) ;
gBaseAJJBXXMapSR . put ( gBaseAJJBXX . getBARID ( ) , gBaseAJJBXX ) ;
}
}
for ( Map < String , Object > bar : zfbaresult . bar2 ( ) ) {
if ( bar . get ( "BAR2ID" ) = = null ) {
continue ;
}
if ( gBaseAJJBXXMapSR . containsKey ( ( String ) bar . get ( "BAR2ID" ) ) ) {
GBaseAJJBXX gBaseAJJBXX = gBaseAJJBXXMapSR . get ( ( String ) bar . get ( "BAR2ID" ) ) ;
gBaseAJJBXX . setBARNum ( gBaseAJJBXX . getBARNum ( ) + Math . toIntExact ( ( Long ) bar . get ( "num" ) ) ) ;
gBaseAJJBXXMapSR . put ( gBaseAJJBXX . getBARID ( ) , gBaseAJJBXX ) ;
} else {
GBaseAJJBXX gBaseAJJBXX = new GBaseAJJBXX ( ) ;
gBaseAJJBXX . setBARID ( ( String ) bar . get ( "BAR2ID" ) ) ;
gBaseAJJBXX . setBADWIDdm ( ( String ) bar . get ( "BADWIDdm" ) ) ;
gBaseAJJBXX . setBADWIDmc ( ( String ) bar . get ( "BADWIDmc" ) ) ;
gBaseAJJBXX . setXM ( ( String ) bar . get ( "XM" ) ) ;
gBaseAJJBXX . setBARNum ( Math . toIntExact ( ( Long ) bar . get ( "num" ) ) ) ;
gBaseAJJBXXMapSR . put ( gBaseAJJBXX . getBARID ( ) , gBaseAJJBXX ) ;
}
}
for ( Map < String , Object > bar : zfbaresult . bar3 ( ) ) {
if ( bar . get ( "BAR1ID" ) = = null ) {
continue ;
}
if ( gBaseAJJBXXMapLR . containsKey ( ( String ) bar . get ( "BAR1ID" ) ) ) {
GBaseAJJBXX gBaseAJJBXX = gBaseAJJBXXMapLR . get ( ( String ) bar . get ( "BAR1ID" ) ) ;
gBaseAJJBXX . setBARNum ( gBaseAJJBXX . getBARNum ( ) + Math . toIntExact ( ( Long ) bar . get ( "num" ) ) ) ;
gBaseAJJBXXMapLR . put ( gBaseAJJBXX . getBARID ( ) , gBaseAJJBXX ) ;
} else {
GBaseAJJBXX gBaseAJJBXX = new GBaseAJJBXX ( ) ;
gBaseAJJBXX . setBARID ( ( String ) bar . get ( "BAR1ID" ) ) ;
gBaseAJJBXX . setBADWIDdm ( ( String ) bar . get ( "BADWIDdm" ) ) ;
gBaseAJJBXX . setBADWIDmc ( ( String ) bar . get ( "BADWIDmc" ) ) ;
gBaseAJJBXX . setXM ( ( String ) bar . get ( "XM" ) ) ;
gBaseAJJBXX . setBARNum ( Math . toIntExact ( ( Long ) bar . get ( "num" ) ) ) ;
gBaseAJJBXXMapLR . put ( gBaseAJJBXX . getBARID ( ) , gBaseAJJBXX ) ;
}
}
for ( Map < String , Object > bar : zfbaresult . bar4 ( ) ) {
if ( bar . get ( "BAR2ID" ) = = null ) {
continue ;
}
if ( gBaseAJJBXXMapLR . containsKey ( ( String ) bar . get ( "BAR2ID" ) ) ) {
GBaseAJJBXX gBaseAJJBXX = gBaseAJJBXXMapLR . get ( ( String ) bar . get ( "BAR2ID" ) ) ;
gBaseAJJBXX . setBARNum ( gBaseAJJBXX . getBARNum ( ) + Math . toIntExact ( ( Long ) bar . get ( "num" ) ) ) ;
gBaseAJJBXXMapLR . put ( gBaseAJJBXX . getBARID ( ) , gBaseAJJBXX ) ;
} else {
GBaseAJJBXX gBaseAJJBXX = new GBaseAJJBXX ( ) ;
gBaseAJJBXX . setBARID ( ( String ) bar . get ( "BAR2ID" ) ) ;
gBaseAJJBXX . setBADWIDdm ( ( String ) bar . get ( "BADWIDdm" ) ) ;
gBaseAJJBXX . setBADWIDmc ( ( String ) bar . get ( "BADWIDmc" ) ) ;
gBaseAJJBXX . setXM ( ( String ) bar . get ( "XM" ) ) ;
gBaseAJJBXX . setBARNum ( Math . toIntExact ( ( Long ) bar . get ( "num" ) ) ) ;
gBaseAJJBXXMapLR . put ( gBaseAJJBXX . getBARID ( ) , gBaseAJJBXX ) ;
}
}
for ( Map < String , Object > bar : zfbaresult . bar5 ( ) ) {
if ( bar . get ( "BAR1ID" ) = = null ) {
continue ;
}
if ( gBaseAJJBXXMapPR . containsKey ( ( String ) bar . get ( "BAR1ID" ) ) ) {
GBaseAJJBXX gBaseAJJBXX = gBaseAJJBXXMapPR . get ( ( String ) bar . get ( "BAR1ID" ) ) ;
gBaseAJJBXX . setBARNum ( gBaseAJJBXX . getBARNum ( ) + Math . toIntExact ( ( Long ) bar . get ( "num" ) ) ) ;
gBaseAJJBXXMapPR . put ( gBaseAJJBXX . getBARID ( ) , gBaseAJJBXX ) ;
} else {
GBaseAJJBXX gBaseAJJBXX = new GBaseAJJBXX ( ) ;
gBaseAJJBXX . setBARID ( ( String ) bar . get ( "BAR1ID" ) ) ;
gBaseAJJBXX . setBADWIDdm ( ( String ) bar . get ( "BADWIDdm" ) ) ;
gBaseAJJBXX . setBADWIDmc ( ( String ) bar . get ( "BADWIDmc" ) ) ;
gBaseAJJBXX . setXM ( ( String ) bar . get ( "XM" ) ) ;
gBaseAJJBXX . setBARNum ( Math . toIntExact ( ( Long ) bar . get ( "num" ) ) ) ;
gBaseAJJBXXMapPR . put ( gBaseAJJBXX . getBARID ( ) , gBaseAJJBXX ) ;
}
}
for ( Map < String , Object > bar : zfbaresult . bar6 ( ) ) {
if ( bar . get ( "BAR2ID" ) = = null ) {
continue ;
}
if ( gBaseAJJBXXMapPR . containsKey ( ( String ) bar . get ( "BAR2ID" ) ) ) {
GBaseAJJBXX gBaseAJJBXX = gBaseAJJBXXMapPR . get ( ( String ) bar . get ( "BAR2ID" ) ) ;
gBaseAJJBXX . setBARNum ( gBaseAJJBXX . getBARNum ( ) + Math . toIntExact ( ( Long ) bar . get ( "num" ) ) ) ;
gBaseAJJBXXMapPR . put ( gBaseAJJBXX . getBARID ( ) , gBaseAJJBXX ) ;
} else {
GBaseAJJBXX gBaseAJJBXX = new GBaseAJJBXX ( ) ;
gBaseAJJBXX . setBARID ( ( String ) bar . get ( "BAR2ID" ) ) ;
gBaseAJJBXX . setBADWIDdm ( ( String ) bar . get ( "BADWIDdm" ) ) ;
gBaseAJJBXX . setBADWIDmc ( ( String ) bar . get ( "BADWIDmc" ) ) ;
gBaseAJJBXX . setXM ( ( String ) bar . get ( "XM" ) ) ;
gBaseAJJBXX . setBARNum ( Math . toIntExact ( ( Long ) bar . get ( "num" ) ) ) ;
gBaseAJJBXXMapPR . put ( gBaseAJJBXX . getBARID ( ) , gBaseAJJBXX ) ;
}
}
}
private ZFBAResult getZfbaResult ( List < Date > happenTime ) {
SimpleDateFormat formatter = new SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss" ) ;
// 4:受案
List < Map < String , Object > > bar1 = modelClueDataMapper . selectByUniqueKeys ( "select COUNT(a.BAR1ID) as num, a.BAR1ID, a.BADWIDdm, a.BADWIDmc, b.XM " +
"FROM dwd_asj_zfba_ajjbxx a " +
"LEFT JOIN dwd_ry_zfba_baryxx b ON a.BAR1ID = b.ZJ " +
"WHERE a.SLRQ BETWEEN '" + formatter . format ( happenTime . get ( 0 ) ) + "' AND '" + formatter . format ( happenTime . get ( 1 ) ) + "' AND a.AJBZdm !=3 " +
"GROUP BY a.BAR1ID, a.BADWIDdm, a.BADWIDmc, b.XM;" ) ;
List < Map < String , Object > > bar2 = modelClueDataMapper . selectByUniqueKeys ( "select COUNT(a.BAR2ID) as num, a.BAR2ID, a.BADWIDdm, a.BADWIDmc, b.XM " +
"FROM dwd_asj_zfba_ajjbxx a " +
"LEFT JOIN dwd_ry_zfba_baryxx b ON a.BAR2ID = b.ZJ " +
"WHERE a.SLRQ BETWEEN '" + formatter . format ( happenTime . get ( 0 ) ) + "' AND '" + formatter . format ( happenTime . get ( 1 ) ) + "' AND a.AJBZdm !=3 " +
"GROUP BY a.BAR2ID, a.BADWIDdm, a.BADWIDmc, b.XM;" ) ;
// 5:立案
List < Map < String , Object > > bar3 = modelClueDataMapper . selectByUniqueKeys ( "select COUNT(a.BAR1ID) as num, a.BAR1ID, a.BADWIDdm, a.BADWIDmc, b.XM " +
"FROM dwd_asj_zfba_ajjbxx a " +
"LEFT JOIN dwd_ry_zfba_baryxx b ON a.BAR1ID = b.ZJ " +
"WHERE a.LARQ BETWEEN '" + formatter . format ( happenTime . get ( 0 ) ) + "' AND '" + formatter . format ( happenTime . get ( 1 ) ) + "' AND a.AJBZdm !=3 " +
"GROUP BY a.BAR1ID, a.BADWIDdm, a.BADWIDmc, b.XM;" ) ;
List < Map < String , Object > > bar4 = modelClueDataMapper . selectByUniqueKeys ( "select COUNT(a.BAR2ID) as num, a.BAR2ID, a.BADWIDdm, a.BADWIDmc, b.XM " +
"FROM dwd_asj_zfba_ajjbxx a " +
"LEFT JOIN dwd_ry_zfba_baryxx b ON a.BAR2ID = b.ZJ " +
"WHERE a.LARQ BETWEEN '" + formatter . format ( happenTime . get ( 0 ) ) + "' AND '" + formatter . format ( happenTime . get ( 1 ) ) + "' AND a.AJBZdm !=3 " +
"GROUP BY a.BAR2ID, a.BADWIDdm, a.BADWIDmc, b.XM;" ) ;
// 6:破案
List < Map < String , Object > > bar5 = modelClueDataMapper . selectByUniqueKeys ( "select COUNT(a.BAR1ID) as num, a.BAR1ID, a.BADWIDdm, a.BADWIDmc, b.XM " +
"FROM dwd_asj_zfba_ajjbxx a " +
"LEFT JOIN dwd_ry_zfba_baryxx b ON a.BAR1ID = b.ZJ " +
"WHERE a.PARQ BETWEEN '" + formatter . format ( happenTime . get ( 0 ) ) + "' AND '" + formatter . format ( happenTime . get ( 1 ) ) + "' AND a.AJBZdm !=3 " +
"GROUP BY a.BAR1ID, a.BADWIDdm, a.BADWIDmc, b.XM;" ) ;
List < Map < String , Object > > bar6 = modelClueDataMapper . selectByUniqueKeys ( "select COUNT(a.BAR2ID) as num, a.BAR2ID, a.BADWIDdm, a.BADWIDmc, b.XM " +
"FROM dwd_asj_zfba_ajjbxx a " +
"LEFT JOIN dwd_ry_zfba_baryxx b ON a.BAR2ID = b.ZJ " +
"WHERE a.PARQ BETWEEN '" + formatter . format ( happenTime . get ( 0 ) ) + "' AND '" + formatter . format ( happenTime . get ( 1 ) ) + "' AND a.AJBZdm !=3 " +
"GROUP BY a.BAR2ID, a.BADWIDdm, a.BADWIDmc, b.XM;" ) ;
ZFBAResult zfbaresult = new ZFBAResult ( bar1 , bar2 , bar3 , bar4 , bar5 , bar6 ) ;
return zfbaresult ;
}
private record ZFBAResult ( List < Map < String , Object > > bar1 , List < Map < String , Object > > bar2 , List < Map < String , Object > > bar3 , List < Map < String , Object > > bar4 , List < Map < String , Object > > bar5 , List < Map < String , Object > > bar6 ) {
}
private static BusinessPolice getJJDBusinessPolice ( List < Date > happenTime , GBaseCJD gBaseCJD , Long groupId ) {
BusinessPolice businessPolice = new BusinessPolice ( ) ;
businessPolice . setDate ( happenTime . get ( 0 ) ) ;
businessPolice . setDepartId ( gBaseCJD . getCjdxssdwdm ( ) ) ;
@ -151,6 +375,29 @@ public class BusinessPoliceService extends ServiceImpl<BusinessPoliceMapper, Bus
return businessPolice ;
}
private static BusinessPolice getAJJBXXBusinessPolice ( List < Date > happenTime , GBaseAJJBXX gBaseAJJBXX , Long groupId , int type ) {
BusinessPolice businessPolice = new BusinessPolice ( ) ;
businessPolice . setDate ( happenTime . get ( 0 ) ) ;
businessPolice . setDepartId ( gBaseAJJBXX . getBADWIDdm ( ) ) ;
businessPolice . setDepartName ( gBaseAJJBXX . getBADWIDmc ( ) ) ;
businessPolice . setGroupId ( groupId ) ;
businessPolice . setNumber ( gBaseAJJBXX . getBARNum ( ) ) ;
businessPolice . setPoliceName ( gBaseAJJBXX . getXM ( ) ) ;
businessPolice . setEmpNo ( gBaseAJJBXX . getBARID ( ) ) ;
businessPolice . setPoliceIdCode ( hashConcatenatedStrings ( businessPolice . getPoliceName ( ) , businessPolice . getEmpNo ( ) ) ) ;
if ( type = = 4 ) {
businessPolice . setBusinessType ( "4" ) ;
businessPolice . setBusinessTypeName ( "执法办案(受案)" ) ;
} else if ( type = = 5 ) {
businessPolice . setBusinessType ( "5" ) ;
businessPolice . setBusinessTypeName ( "执法办案(立案)" ) ;
} else if ( type = = 6 ) {
businessPolice . setBusinessType ( "6" ) ;
businessPolice . setBusinessTypeName ( "执法办案(破案)" ) ;
}
return businessPolice ;
}
@DS ( "slave2" )
public List < GBaseCJD > selectCJDList ( List < Date > happenTime ) {
QueryWrapper < GBaseCJD > queryWrapper = new QueryWrapper < > ( ) ;