Browse Source

1、修改基础数据单位取值

2、修改单位关联表的来源字段
main
sjh 1 year ago
parent
commit
baebdc5dd4
  1. 2
      src/main/java/com/biutag/supervision/mapper/SupExternalDepartMapper.java
  2. 28
      src/main/java/com/biutag/supervision/service/BusinessDepartService.java
  3. 28
      src/main/java/com/biutag/supervision/service/BusinessPoliceService.java
  4. 6
      src/main/java/com/biutag/supervision/service/ModelClueService.java
  5. 6
      src/main/java/com/biutag/supervision/service/SupExternalDepartService.java

2
src/main/java/com/biutag/supervision/mapper/SupExternalDepartMapper.java

@ -10,7 +10,7 @@ import java.util.Map;
public interface SupExternalDepartMapper extends BaseMapper<SupExternalDepart> {
@Select("<script>"
+ "SELECT DISTINCT external_id, internal_id FROM sup_external_depart WHERE external_id IN "
+ "SELECT DISTINCT external_id, internal_id, internal_short_name FROM sup_external_depart WHERE external_id IN "
+ "<foreach item='item' index='index' collection='list' open='(' separator=',' close=')'>"
+ "#{item}"
+ "</foreach>"

28
src/main/java/com/biutag/supervision/service/BusinessDepartService.java

@ -126,6 +126,10 @@ public class BusinessDepartService extends ServiceImpl<BusinessDepartMapper, Bus
map -> map.get("internal_id") == null ? "" : (String) map.get("internal_id")
));
List<String> values = resultMap2.values().stream().filter(Objects::nonNull).toList();// 1011
Map<String, String> resultMap3 = idsByDepartIds.stream().filter(map -> map.get("external_id") != null).collect(Collectors.toMap(
map -> (String) map.get("external_id"),
map -> map.get("internal_short_name") == null ? "" : (String) map.get("internal_short_name")
));
List<Map<String, Object>> resultList = new ArrayList<>();
if (!values.isEmpty()) {
resultList = statisticsDepartMapper.getGroupIdsByDepartIds(values);
@ -137,7 +141,7 @@ public class BusinessDepartService extends ServiceImpl<BusinessDepartMapper, Bus
}
Map<String, Long> resultMap = resultList.stream().collect(Collectors.toMap(map -> (String) map.get("departId"), map -> (Long) map.get("groupId")));
List<Long> groupIds = new ArrayList<>();
generateBusinessDepartList(happenTime, gBaseJJDSList, resultMap, resultMap2, groupIds, businessDepartList, gBaseAJJBXXListSA, gBaseAJJBXXListLA, gBaseAJJBXXListPA);
generateBusinessDepartList(happenTime, gBaseJJDSList, resultMap, resultMap2, resultMap3, groupIds, businessDepartList, gBaseAJJBXXListSA, gBaseAJJBXXListLA, gBaseAJJBXXListPA);
List<Map<Long, Object>> nameList = statisticsGroupMapper.getNameByGroupIds(groupIds);
Map<Long, String> names = nameList.stream().collect(Collectors.toMap(map -> (Long) map.get("groupId"), map -> (String) map.get("name")));
for (BusinessDepart businessDepart : businessDepartList) {
@ -151,14 +155,14 @@ public class BusinessDepartService extends ServiceImpl<BusinessDepartMapper, Bus
businessLogMapper.insert(new BusinessLog().setType("单位业务数据").setNum(gBaseJJDSList.size() + gBaseAJJBXXListSA.size() + gBaseAJJBXXListLA.size() + gBaseAJJBXXListPA.size()).setActualNum(actualNum).setCreateTime(LocalDateTime.now()));
}
private static void generateBusinessDepartList(List<Date> happenTime, List<GBaseJJD> gBaseJJDSList, Map<String, Long> resultMap, Map<String, String> resultMap2, List<Long> groupIds, List<BusinessDepart> businessDepartList, List<GBaseAJJBXX> gBaseAJJBXXListSA, List<GBaseAJJBXX> gBaseAJJBXXListLA, List<GBaseAJJBXX> gBaseAJJBXXListPA) {
private static void generateBusinessDepartList(List<Date> happenTime, List<GBaseJJD> gBaseJJDSList, Map<String, Long> resultMap, Map<String, String> resultMap2, Map<String, String> resultMap3, List<Long> groupIds, List<BusinessDepart> businessDepartList, List<GBaseAJJBXX> gBaseAJJBXXListSA, List<GBaseAJJBXX> gBaseAJJBXXListLA, List<GBaseAJJBXX> gBaseAJJBXXListPA) {
for (GBaseJJD gBaseJJD : gBaseJJDSList) {
Long groupId = resultMap.get(resultMap2.get(gBaseJJD.getGxdwdm()));
if (groupId == null) {
continue;
}
groupIds.add(groupId);
BusinessDepart businessDepart = getJJDBusinessDepart(happenTime, gBaseJJD, groupId);
BusinessDepart businessDepart = getJJDBusinessDepart(happenTime, gBaseJJD, groupId, resultMap2, resultMap3);
businessDepartList.add(businessDepart);
}
for (GBaseAJJBXX gBaseAJJBXX : gBaseAJJBXXListSA) {
@ -167,7 +171,7 @@ public class BusinessDepartService extends ServiceImpl<BusinessDepartMapper, Bus
continue;
}
groupIds.add(groupId);
BusinessDepart businessDepart = getAJJBXXBusinessDepart(happenTime, gBaseAJJBXX, groupId, 1);
BusinessDepart businessDepart = getAJJBXXBusinessDepart(happenTime, gBaseAJJBXX, groupId, 1, resultMap2, resultMap3);
businessDepartList.add(businessDepart);
}
for (GBaseAJJBXX gBaseAJJBXX : gBaseAJJBXXListLA) {
@ -176,7 +180,7 @@ public class BusinessDepartService extends ServiceImpl<BusinessDepartMapper, Bus
continue;
}
groupIds.add(groupId);
BusinessDepart businessDepart = getAJJBXXBusinessDepart(happenTime, gBaseAJJBXX, groupId, 2);
BusinessDepart businessDepart = getAJJBXXBusinessDepart(happenTime, gBaseAJJBXX, groupId, 2, resultMap2, resultMap3);
businessDepartList.add(businessDepart);
}
for (GBaseAJJBXX gBaseAJJBXX : gBaseAJJBXXListPA) {
@ -185,7 +189,7 @@ public class BusinessDepartService extends ServiceImpl<BusinessDepartMapper, Bus
continue;
}
groupIds.add(groupId);
BusinessDepart businessDepart = getAJJBXXBusinessDepart(happenTime, gBaseAJJBXX, groupId, 3);
BusinessDepart businessDepart = getAJJBXXBusinessDepart(happenTime, gBaseAJJBXX, groupId, 3, resultMap2, resultMap3);
businessDepartList.add(businessDepart);
}
}
@ -205,11 +209,11 @@ public class BusinessDepartService extends ServiceImpl<BusinessDepartMapper, Bus
}
}
private static BusinessDepart getJJDBusinessDepart(List<Date> happenTime, GBaseJJD gBaseJJD, Long groupId) {
private static BusinessDepart getJJDBusinessDepart(List<Date> happenTime, GBaseJJD gBaseJJD, Long groupId, Map<String, String> resultMap2, Map<String, String> resultMap3) {
BusinessDepart businessDepart = new BusinessDepart();
businessDepart.setDate(happenTime.get(0));
businessDepart.setDepartId(gBaseJJD.getGxdwdm());
businessDepart.setDepartName(gBaseJJD.getGxdwmc());
businessDepart.setDepartId(resultMap2.get(gBaseJJD.getGxdwdm()));
businessDepart.setDepartName(resultMap3.get(gBaseJJD.getGxdwdm()));
businessDepart.setGroupId(groupId);
businessDepart.setNumber(gBaseJJD.getJjdbhTotal());
if (groupId != null) {
@ -224,11 +228,11 @@ public class BusinessDepartService extends ServiceImpl<BusinessDepartMapper, Bus
return businessDepart;
}
private static BusinessDepart getAJJBXXBusinessDepart(List<Date> happenTime, GBaseAJJBXX gBasAJJBXX, Long groupId, int type) {
private static BusinessDepart getAJJBXXBusinessDepart(List<Date> happenTime, GBaseAJJBXX gBasAJJBXX, Long groupId, int type, Map<String, String> resultMap2, Map<String, String> resultMap3) {
BusinessDepart businessDepart = new BusinessDepart();
businessDepart.setDate(happenTime.get(0));
businessDepart.setDepartId(gBasAJJBXX.getBADWIDdm());
businessDepart.setDepartName(gBasAJJBXX.getBADWIDmc());
businessDepart.setDepartId(resultMap2.get(gBasAJJBXX.getBADWIDdm()));
businessDepart.setDepartName(resultMap3.get(gBasAJJBXX.getBADWIDdm()));
businessDepart.setGroupId(groupId);
businessDepart.setNumber(gBasAJJBXX.getBADWNum());
if (type == 1) {

28
src/main/java/com/biutag/supervision/service/BusinessPoliceService.java

@ -113,13 +113,17 @@ public class BusinessPoliceService extends ServiceImpl<BusinessPoliceMapper, Bus
map -> map.get("internal_id") == null ? "" : (String) map.get("internal_id")
));
List<String> values = resultMap2.values().stream().filter(Objects::nonNull).toList();// 1011
Map<String, String> resultMap3 = idsByDepartIds.stream().filter(map -> map.get("external_id") != null).collect(Collectors.toMap(
map -> (String) map.get("external_id"),
map -> map.get("internal_short_name") == null ? "" : (String) map.get("internal_short_name")
));
List<Map<String, Object>> resultList = statisticsDepartMapper.getGroupIdsByDepartIds(values);
Map<String, Long> resultMap = resultList.stream().collect(Collectors.toMap(
map -> (String) map.get("departId"),
map -> (Long) map.get("groupId")
));
List<Long> groupIds = new ArrayList<>();
generateBusinessPoliceList(happenTime, gBaseCJDSList, resultMap, resultMap2, groupIds, businessPoliceList, gBaseAJJBXXMapSR, gBaseAJJBXXMapLR, gBaseAJJBXXMapPR);
generateBusinessPoliceList(happenTime, gBaseCJDSList, resultMap, resultMap2, resultMap3, 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"),
@ -136,14 +140,14 @@ public class BusinessPoliceService extends ServiceImpl<BusinessPoliceMapper, Bus
businessLogMapper.insert(new BusinessLog().setType("个人业务数据").setNum(gBaseCJDSList.size()).setActualNum(actualNum).setCreateTime(LocalDateTime.now()));
}
private static void generateBusinessPoliceList(List<Date> happenTime, List<GBaseCJD> gBaseCJDSList, Map<String, Long> resultMap, Map<String, String> resultMap2, List<Long> groupIds, List<BusinessPolice> businessPoliceList, Map<String, GBaseAJJBXX> gBaseAJJBXXMapSR, Map<String, GBaseAJJBXX> gBaseAJJBXXMapLR, Map<String, GBaseAJJBXX> gBaseAJJBXXMapPR) {
private static void generateBusinessPoliceList(List<Date> happenTime, List<GBaseCJD> gBaseCJDSList, Map<String, Long> resultMap, Map<String, String> resultMap2, Map<String, String> resultMap3, 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) {
continue;
}
groupIds.add(groupId);
BusinessPolice businessPolice = getJJDBusinessPolice(happenTime, gBaseCJD, groupId);
BusinessPolice businessPolice = getJJDBusinessPolice(happenTime, gBaseCJD, groupId, resultMap2, resultMap3);
businessPoliceList.add(businessPolice);
}
for (GBaseAJJBXX gBaseAJJBXX : gBaseAJJBXXMapSR.values()) {
@ -152,7 +156,7 @@ public class BusinessPoliceService extends ServiceImpl<BusinessPoliceMapper, Bus
continue;
}
groupIds.add(groupId);
BusinessPolice businessPolice = getAJJBXXBusinessPolice(happenTime, gBaseAJJBXX, groupId, 4);
BusinessPolice businessPolice = getAJJBXXBusinessPolice(happenTime, gBaseAJJBXX, groupId, 4, resultMap2, resultMap3);
businessPoliceList.add(businessPolice);
}
for (GBaseAJJBXX gBaseAJJBXX : gBaseAJJBXXMapLR.values()) {
@ -161,7 +165,7 @@ public class BusinessPoliceService extends ServiceImpl<BusinessPoliceMapper, Bus
continue;
}
groupIds.add(groupId);
BusinessPolice businessPolice = getAJJBXXBusinessPolice(happenTime, gBaseAJJBXX, groupId, 5);
BusinessPolice businessPolice = getAJJBXXBusinessPolice(happenTime, gBaseAJJBXX, groupId, 5, resultMap2, resultMap3);
businessPoliceList.add(businessPolice);
}
for (GBaseAJJBXX gBaseAJJBXX : gBaseAJJBXXMapPR.values()) {
@ -170,7 +174,7 @@ public class BusinessPoliceService extends ServiceImpl<BusinessPoliceMapper, Bus
continue;
}
groupIds.add(groupId);
BusinessPolice businessPolice = getAJJBXXBusinessPolice(happenTime, gBaseAJJBXX, groupId, 6);
BusinessPolice businessPolice = getAJJBXXBusinessPolice(happenTime, gBaseAJJBXX, groupId, 6, resultMap2, resultMap3);
businessPoliceList.add(businessPolice);
}
}
@ -351,11 +355,11 @@ public class BusinessPoliceService extends ServiceImpl<BusinessPoliceMapper, Bus
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) {
private static BusinessPolice getJJDBusinessPolice(List<Date> happenTime, GBaseCJD gBaseCJD, Long groupId, Map<String, String> resultMap2, Map<String, String> resultMap3) {
BusinessPolice businessPolice = new BusinessPolice();
businessPolice.setDate(happenTime.get(0));
businessPolice.setDepartId(gBaseCJD.getCjdxssdwdm());
businessPolice.setDepartName(gBaseCJD.getCjdxssdwmc());
businessPolice.setDepartId(resultMap2.get(gBaseCJD.getCjdxssdwdm()));
businessPolice.setDepartName(resultMap3.get(gBaseCJD.getCjdxssdwdm()));
businessPolice.setGroupId(groupId);
businessPolice.setNumber(gBaseCJD.getClwbrxmTotal());
businessPolice.setPoliceName(gBaseCJD.getClwbrxm());
@ -373,11 +377,11 @@ public class BusinessPoliceService extends ServiceImpl<BusinessPoliceMapper, Bus
return businessPolice;
}
private static BusinessPolice getAJJBXXBusinessPolice(List<Date> happenTime, GBaseAJJBXX gBaseAJJBXX, Long groupId, int type) {
private static BusinessPolice getAJJBXXBusinessPolice(List<Date> happenTime, GBaseAJJBXX gBaseAJJBXX, Long groupId, int type, Map<String, String> resultMap2, Map<String, String> resultMap3) {
BusinessPolice businessPolice = new BusinessPolice();
businessPolice.setDate(happenTime.get(0));
businessPolice.setDepartId(gBaseAJJBXX.getBADWIDdm());
businessPolice.setDepartName(gBaseAJJBXX.getBADWIDmc());
businessPolice.setDepartId(resultMap2.get(gBaseAJJBXX.getBADWIDdm()));
businessPolice.setDepartName(resultMap3.get(gBaseAJJBXX.getBADWIDdm()));
businessPolice.setGroupId(groupId);
businessPolice.setNumber(gBaseAJJBXX.getBARNum());
businessPolice.setPoliceName(gBaseAJJBXX.getXM());

6
src/main/java/com/biutag/supervision/service/ModelClueService.java

@ -242,7 +242,7 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
+ "登记进入" + data.get("csmc")
+ ",没有离开时间。");
}
} else if (modelId == 10) {
} else if (modelId == 10) { // 10号模型:案件受理不及时的异常数据
modelClue.setThingDesc("该" + data.get("AJBZmc")
+ "案件编号为" + data.get("AJBH")
+ ",报案日期为" + getDateString(data.get("BARQ"))
@ -579,7 +579,7 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
}
}
}
return " ";
return "";
}
public static String generateNewSql(String originalSql, List<String> uniqueKeys) {
@ -622,7 +622,7 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
log.info("日期转换异常", ex);
}
}
return " ";
return "";
}
public static String getNowTime() {

6
src/main/java/com/biutag/supervision/service/SupExternalDepartService.java

@ -88,12 +88,12 @@ public class SupExternalDepartService extends ServiceImpl<SupExternalDepartMappe
List<Map<String, Object>> jjdmaps = modelClueDataMapper.selectByUniqueKeys("SELECT DISTINCT csid, csmc FROM dwd_ry_zfba_zfqywfryb WHERE STR_TO_DATE(djsj, '%Y%m%d%H%i%s') > '2022-10-01';");
if (!jjdmaps.isEmpty()) {
jjdmaps.forEach(item -> {
if (item != null && (String)item.get("csid") != null && !Objects.equals(item.get("csid"), "") && !dms.contains((String)item.get("csid"))) {
if (item != null && item.get("csid") != null && !Objects.equals(item.get("csid"), "") && !dms.contains((String)item.get("csid"))) {
SupExternalDepart supExternalDepart = new SupExternalDepart();
supExternalDepart.setExternalId((String)item.get("csid"));
supExternalDepart.setExternalName(item.get("csmc") == null ? "" : (String)item.get("csmc"));
dms.add((String)item.get("csid"));
supExternalDepart.setSource("情指行");
supExternalDepart.setSource("执法办案");
supExternalDeparts.add(supExternalDepart);
}
});
@ -129,7 +129,7 @@ public class SupExternalDepartService extends ServiceImpl<SupExternalDepartMappe
supExternalDepart.setExternalName(item.getBADWIDmc() == null ? "" : item.getBADWIDmc());
dms.add(item.getBADWIDdm());
}
supExternalDepart.setSource("情指行");
supExternalDepart.setSource("执法办案");
result.add(supExternalDepart);
}
});

Loading…
Cancel
Save