Commit d1a8496e53152f653f1aca35a4e0d0db4e38a7ac
1 parent
d5531b6c
批量导出
Showing
25 changed files
with
190 additions
and
189 deletions
juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/AnalyzeController.java
@@ -116,6 +116,9 @@ public class AnalyzeController extends JeecgController<GaDemographic, IGaDemogra | @@ -116,6 +116,9 @@ public class AnalyzeController extends JeecgController<GaDemographic, IGaDemogra | ||
116 | getSourceData(); | 116 | getSourceData(); |
117 | log.info("来源数据入库时间" + (System.currentTimeMillis() - startTime4) / 1000 + "秒"); | 117 | log.info("来源数据入库时间" + (System.currentTimeMillis() - startTime4) / 1000 + "秒"); |
118 | log.info("*********************************总用时" + (System.currentTimeMillis() - startTime) / 1000 + "秒"); | 118 | log.info("*********************************总用时" + (System.currentTimeMillis() - startTime) / 1000 + "秒"); |
119 | + resultMinor = null;//分析后未成年人的信息 | ||
120 | + resultSchools = null;//分析后学籍的信息 | ||
121 | + testIdCards = null;//存储户号 | ||
119 | } catch (Exception e) { | 122 | } catch (Exception e) { |
120 | e.printStackTrace(); | 123 | e.printStackTrace(); |
121 | log.info(String.valueOf(e)); | 124 | log.info(String.valueOf(e)); |
@@ -136,40 +139,29 @@ public class AnalyzeController extends JeecgController<GaDemographic, IGaDemogra | @@ -136,40 +139,29 @@ public class AnalyzeController extends JeecgController<GaDemographic, IGaDemogra | ||
136 | CompletableFuture<List<MrSchool>> f7 = CompletableFuture.supplyAsync(() -> highSchoolService.getList(), executor); | 139 | CompletableFuture<List<MrSchool>> f7 = CompletableFuture.supplyAsync(() -> highSchoolService.getList(), executor); |
137 | CompletableFuture<List<MrSchool>> f8 = CompletableFuture.supplyAsync(() -> primarySchoolService.getList(), executor); | 140 | CompletableFuture<List<MrSchool>> f8 = CompletableFuture.supplyAsync(() -> primarySchoolService.getList(), executor); |
138 | //行政处罚数据 | 141 | //行政处罚数据 |
139 | -// Map<String,GaPunishVo> gaPunishVos = gaPunishService.queryAll(); | ||
140 | Map<String, GaPunishVo> gaPunishVos = new HashMap<>(); | 142 | Map<String, GaPunishVo> gaPunishVos = new HashMap<>(); |
141 | gaPunishVos.putAll(f1.get()); | 143 | gaPunishVos.putAll(f1.get()); |
142 | -// List<SpecialStudentVo> specialStudentVos = specialStudentService.queryList(); | ||
143 | List<SpecialStudentVo> specialStudentVos = new ArrayList<>(); | 144 | List<SpecialStudentVo> specialStudentVos = new ArrayList<>(); |
144 | specialStudentVos.addAll(f2.get()); | 145 | specialStudentVos.addAll(f2.get()); |
145 | //孤儿数据 | 146 | //孤儿数据 |
146 | -// List<String> mzOrphans = mzOrphanService.getIdentityS(); | ||
147 | List<String> mzOrphans = new ArrayList<>(); | 147 | List<String> mzOrphans = new ArrayList<>(); |
148 | mzOrphans.addAll(f3.get()); | 148 | mzOrphans.addAll(f3.get()); |
149 | //无人抚养 | 149 | //无人抚养 |
150 | -// List<String> mzUnsupporteds = mzUnsupportedService.getIdentityS(); | ||
151 | List<String> mzUnsupporteds = new ArrayList<>(); | 150 | List<String> mzUnsupporteds = new ArrayList<>(); |
152 | mzUnsupporteds.addAll(f4.get()); | 151 | mzUnsupporteds.addAll(f4.get()); |
153 | //留守儿童 | 152 | //留守儿童 |
154 | -// List<String> mzLeftBehinds =mzLeftBehindChildrenService.getIdentityS(); | ||
155 | List<String> mzLeftBehinds = new ArrayList<>(); | 153 | List<String> mzLeftBehinds = new ArrayList<>(); |
156 | mzLeftBehinds.addAll(f5.get()); | 154 | mzLeftBehinds.addAll(f5.get()); |
157 | //领养 | 155 | //领养 |
158 | -// List<String> mzAdoptions =mzAdoptionService.getIdentityS(); | ||
159 | List<String> mzAdoptions = new ArrayList<>(); | 156 | List<String> mzAdoptions = new ArrayList<>(); |
160 | mzAdoptions.addAll(f6.get()); | 157 | mzAdoptions.addAll(f6.get()); |
161 | //获取初高中学生信息 | 158 | //获取初高中学生信息 |
162 | -// List<MrSchool> highSchools = highSchoolService.getList(); | ||
163 | List<MrSchool> highSchools = new ArrayList<>(); | 159 | List<MrSchool> highSchools = new ArrayList<>(); |
164 | highSchools.addAll(f7.get()); | 160 | highSchools.addAll(f7.get()); |
165 | //获取幼小学生信息 | 161 | //获取幼小学生信息 |
166 | -// List<MrSchool> primarySchools = primarySchoolService.getList(); | ||
167 | List<MrSchool> primarySchools = new ArrayList<>(); | 162 | List<MrSchool> primarySchools = new ArrayList<>(); |
168 | primarySchools.addAll(f8.get()); | 163 | primarySchools.addAll(f8.get()); |
169 | //人口基本信息小于18岁 | 164 | //人口基本信息小于18岁 |
170 | -// Map<String,String> gaDemographics =gaDemographicService.getIdentityS(); | ||
171 | -// Map<String,String> gaDemographics =new HashMap<>(); | ||
172 | -// gaDemographics.putAll(f9.get()); | ||
173 | //关闭线程池 | 165 | //关闭线程池 |
174 | pool.shutdown(); | 166 | pool.shutdown(); |
175 | Map<String, String> gaDemographics = gaDemographicService.getIdentityS(); | 167 | Map<String, String> gaDemographics = gaDemographicService.getIdentityS(); |
@@ -177,7 +169,6 @@ public class AnalyzeController extends JeecgController<GaDemographic, IGaDemogra | @@ -177,7 +169,6 @@ public class AnalyzeController extends JeecgController<GaDemographic, IGaDemogra | ||
177 | long startTime1 = System.currentTimeMillis(); | 169 | long startTime1 = System.currentTimeMillis(); |
178 | //户籍信息 | 170 | //户籍信息 |
179 | Map<String, Family> familyMap = gaHouseholdService.getGaHouseholds(gaDemographics); | 171 | Map<String, Family> familyMap = gaHouseholdService.getGaHouseholds(gaDemographics); |
180 | -// Map<String,Family> familyMap = queryByThread(); | ||
181 | log.info("户籍信息数据查询时间" + (System.currentTimeMillis() - startTime1) / 1000 + "秒"); | 172 | log.info("户籍信息数据查询时间" + (System.currentTimeMillis() - startTime1) / 1000 + "秒"); |
182 | log.info("判断初高中学生信息和人口基本信息的交集和差集开始时间" + (System.currentTimeMillis() - startTime) / 1000 + "秒"); | 173 | log.info("判断初高中学生信息和人口基本信息的交集和差集开始时间" + (System.currentTimeMillis() - startTime) / 1000 + "秒"); |
183 | judgeHighSchoolsAndDemographics(highSchools, gaDemographics, departs, specialStudentVos, mzUnsupporteds, mzLeftBehinds, mzAdoptions, familyMap, gaPunishVos, mzOrphans); | 174 | judgeHighSchoolsAndDemographics(highSchools, gaDemographics, departs, specialStudentVos, mzUnsupporteds, mzLeftBehinds, mzAdoptions, familyMap, gaPunishVos, mzOrphans); |
@@ -406,7 +397,7 @@ public class AnalyzeController extends JeecgController<GaDemographic, IGaDemogra | @@ -406,7 +397,7 @@ public class AnalyzeController extends JeecgController<GaDemographic, IGaDemogra | ||
406 | if (oConvertUtils.isNotEmpty(idCard) && oConvertUtils.isNotEmpty(gaHouseholds.get(idCard)) && IDNumberUtil.checkID(idCard)) { | 397 | if (oConvertUtils.isNotEmpty(idCard) && oConvertUtils.isNotEmpty(gaHouseholds.get(idCard)) && IDNumberUtil.checkID(idCard)) { |
407 | Minor minor = new Minor(); | 398 | Minor minor = new Minor(); |
408 | minor.setSchool(Minor.SCHOOL_STATUS_YES); | 399 | minor.setSchool(Minor.SCHOOL_STATUS_YES); |
409 | - minor.setName(gaHouseholds.get(idCard).getName()); | 400 | + minor.setName(gaHouseholds.get(idCard).getName().trim()); |
410 | minor.setGender(Integer.parseInt(IDNumberUtil.judgeGender(idCard))); | 401 | minor.setGender(Integer.parseInt(IDNumberUtil.judgeGender(idCard))); |
411 | minor.setAddress(gaHouseholds.get(idCard).getAddress()); | 402 | minor.setAddress(gaHouseholds.get(idCard).getAddress()); |
412 | minor.setIdentity(idCard); | 403 | minor.setIdentity(idCard); |
@@ -477,7 +468,7 @@ public class AnalyzeController extends JeecgController<GaDemographic, IGaDemogra | @@ -477,7 +468,7 @@ public class AnalyzeController extends JeecgController<GaDemographic, IGaDemogra | ||
477 | } | 468 | } |
478 | minor.setSchool(Minor.SCHOOL_STATUS_NO); | 469 | minor.setSchool(Minor.SCHOOL_STATUS_NO); |
479 | if (oConvertUtils.isNotEmpty(i.getName())) { | 470 | if (oConvertUtils.isNotEmpty(i.getName())) { |
480 | - minor.setName(i.getName()); | 471 | + minor.setName(i.getName().trim()); |
481 | } | 472 | } |
482 | minor.setGender(Integer.valueOf(IDNumberUtil.judgeGender(i.getIdentity()))); | 473 | minor.setGender(Integer.valueOf(IDNumberUtil.judgeGender(i.getIdentity()))); |
483 | if (oConvertUtils.isNotEmpty(i.getAddress())) { | 474 | if (oConvertUtils.isNotEmpty(i.getAddress())) { |
@@ -552,14 +543,14 @@ public class AnalyzeController extends JeecgController<GaDemographic, IGaDemogra | @@ -552,14 +543,14 @@ public class AnalyzeController extends JeecgController<GaDemographic, IGaDemogra | ||
552 | } | 543 | } |
553 | minor.setSchool(Minor.SCHOOL_STATUS_NO); | 544 | minor.setSchool(Minor.SCHOOL_STATUS_NO); |
554 | if (oConvertUtils.isNotEmpty(m.getName())) { | 545 | if (oConvertUtils.isNotEmpty(m.getName())) { |
555 | - minor.setName(m.getName()); | 546 | + minor.setName(m.getName().trim()); |
556 | } | 547 | } |
557 | minor.setGender(Integer.valueOf(IDNumberUtil.judgeGender(m.getIdentity()))); | 548 | minor.setGender(Integer.valueOf(IDNumberUtil.judgeGender(m.getIdentity()))); |
558 | if (oConvertUtils.isNotEmpty(m.getAddress())) { | 549 | if (oConvertUtils.isNotEmpty(m.getAddress())) { |
559 | minor.setAddress(m.getAddress()); | 550 | minor.setAddress(m.getAddress()); |
560 | } | 551 | } |
561 | if (oConvertUtils.isNotEmpty(m.getSchool())) { | 552 | if (oConvertUtils.isNotEmpty(m.getSchool())) { |
562 | - minor.setSchoolName(m.getSchool()); | 553 | + minor.setSchoolName(m.getSchool().trim()); |
563 | } | 554 | } |
564 | if (oConvertUtils.isNotEmpty(m.getAdmissionDate())) { | 555 | if (oConvertUtils.isNotEmpty(m.getAdmissionDate())) { |
565 | minor.setStartYear(m.getAdmissionDate()); | 556 | minor.setStartYear(m.getAdmissionDate()); |
@@ -760,10 +751,10 @@ public class AnalyzeController extends JeecgController<GaDemographic, IGaDemogra | @@ -760,10 +751,10 @@ public class AnalyzeController extends JeecgController<GaDemographic, IGaDemogra | ||
760 | if (oConvertUtils.isNotEmpty(gaPunishVos) && oConvertUtils.isNotEmpty(gaPunishVos.get(mapKey))) { | 751 | if (oConvertUtils.isNotEmpty(gaPunishVos) && oConvertUtils.isNotEmpty(gaPunishVos.get(mapKey))) { |
761 | family.setCrime(Family.IS_CRIME); | 752 | family.setCrime(Family.IS_CRIME); |
762 | if (oConvertUtils.isNotEmpty(gaPunishVos.get(mapKey).getAjmc())) { | 753 | if (oConvertUtils.isNotEmpty(gaPunishVos.get(mapKey).getAjmc())) { |
763 | - family.setOther(gaPunishVos.get(mapKey).getAjmc()); | 754 | + family.setOther(gaPunishVos.get(mapKey).getAjmc().trim()); |
764 | } | 755 | } |
765 | if (oConvertUtils.isNotEmpty(gaPunishVos.get(mapKey).getSldwmc())) { | 756 | if (oConvertUtils.isNotEmpty(gaPunishVos.get(mapKey).getSldwmc())) { |
766 | - family.setReason(gaPunishVos.get(mapKey).getSldwmc()); | 757 | + family.setReason(gaPunishVos.get(mapKey).getSldwmc().trim()); |
767 | } | 758 | } |
768 | } else { | 759 | } else { |
769 | family.setCrime(Family.IS_NOT_CRIME); | 760 | family.setCrime(Family.IS_NOT_CRIME); |
@@ -771,7 +762,7 @@ public class AnalyzeController extends JeecgController<GaDemographic, IGaDemogra | @@ -771,7 +762,7 @@ public class AnalyzeController extends JeecgController<GaDemographic, IGaDemogra | ||
771 | if (IDNumberUtil.checkID(mapKey)) { | 762 | if (IDNumberUtil.checkID(mapKey)) { |
772 | family.setGender(Integer.valueOf(IDNumberUtil.judgeGender(mapKey))); | 763 | family.setGender(Integer.valueOf(IDNumberUtil.judgeGender(mapKey))); |
773 | } | 764 | } |
774 | - family.setId(String.valueOf(id)); | 765 | +// family.setId(Math.toIntExact(id)); |
775 | family.setCreateTime(createTime); | 766 | family.setCreateTime(createTime); |
776 | } | 767 | } |
777 | if (oConvertUtils.isNotEmpty(family) && oConvertUtils.isNotEmpty(family.getHouseholdNum()) && oConvertUtils.isNotEmpty(family.getIdentity())) { | 768 | if (oConvertUtils.isNotEmpty(family) && oConvertUtils.isNotEmpty(family.getHouseholdNum()) && oConvertUtils.isNotEmpty(family.getIdentity())) { |
juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/MinorController.java
@@ -107,11 +107,11 @@ public class MinorController { | @@ -107,11 +107,11 @@ public class MinorController { | ||
107 | if(oConvertUtils.isNotEmpty(sysUser) && oConvertUtils.isNotEmpty(sysUser.getOrgCode())){ | 107 | if(oConvertUtils.isNotEmpty(sysUser) && oConvertUtils.isNotEmpty(sysUser.getOrgCode())){ |
108 | sysOrgCode=sysUser.getOrgCode(); | 108 | sysOrgCode=sysUser.getOrgCode(); |
109 | } | 109 | } |
110 | - String isReason=""; | ||
111 | - if(oConvertUtils.isNotEmpty(minor) && oConvertUtils.isNotEmpty(minor.getIsReason()) && minor.getIsReason().equals("1")){ | ||
112 | - isReason=minor.getIsReason(); | ||
113 | - } | ||
114 | - IPage<Minor> pageList = minorService.queryPageList(page,minor.getName(),sysOrgCode,isReason); | 110 | +// String isReason=""; |
111 | +// if(oConvertUtils.isNotEmpty(minor) && oConvertUtils.isNotEmpty(minor.getIsReason()) && minor.getIsReason().equals("1")){ | ||
112 | +// isReason=minor.getIsReason(); | ||
113 | +// } | ||
114 | + IPage<Minor> pageList = minorService.queryPageList(page,minor.getName(),sysOrgCode,minor.getIsReason()); | ||
115 | return Result.OK(pageList); | 115 | return Result.OK(pageList); |
116 | } | 116 | } |
117 | 117 | ||
@@ -219,6 +219,20 @@ public class MinorController { | @@ -219,6 +219,20 @@ public class MinorController { | ||
219 | return Result.OK(familyList); | 219 | return Result.OK(familyList); |
220 | } | 220 | } |
221 | 221 | ||
222 | + /** | ||
223 | + * 通过householdNum查询 | ||
224 | + * | ||
225 | + * @param householdNum | ||
226 | + * @return | ||
227 | + */ | ||
228 | + @AutoLog(value = "家庭成员表通过主表householdNum查询") | ||
229 | + @ApiOperation(value = "家庭成员表主表householdNum查询", notes = "家庭成员表-通主表householdNum查询") | ||
230 | + @GetMapping(value = "/getFamilysByHouseholdNum") | ||
231 | + public Result<?> getFamilysByHouseholdNum(@RequestParam(name = "householdNum", required = true) String householdNum) { | ||
232 | + List<Family> familyList = familyService.getFamilysByHouseholdNum(householdNum); | ||
233 | + return Result.OK(familyList); | ||
234 | + } | ||
235 | + | ||
222 | /** | 236 | /** |
223 | * 导出excel | 237 | * 导出excel |
224 | * | 238 | * |
@@ -226,9 +240,19 @@ public class MinorController { | @@ -226,9 +240,19 @@ public class MinorController { | ||
226 | * @param minor | 240 | * @param minor |
227 | */ | 241 | */ |
228 | @RequestMapping(value = "/exportXls") | 242 | @RequestMapping(value = "/exportXls") |
229 | - public ModelAndView exportXls(HttpServletRequest request, Minor minor) { | 243 | + public ModelAndView exportXls(HttpServletRequest request, Minor minor, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
244 | + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { | ||
230 | // Step.1 组装查询条件查询数据 | 245 | // Step.1 组装查询条件查询数据 |
231 | - Page<Minor> page = new Page<Minor>(1, 1); | 246 | + // 过滤选中数据 |
247 | + String selections = request.getParameter("selections"); | ||
248 | + List<Long> ids=new ArrayList<>(); | ||
249 | + if(oConvertUtils.isEmpty(selections)){ | ||
250 | + pageSize=1; | ||
251 | + }else { | ||
252 | + List<String> selectionList = Arrays.asList(selections.split(",")); | ||
253 | + selectionList.stream().forEach(s -> ids.add(Long.valueOf(s))); | ||
254 | + } | ||
255 | + Page<Minor> page = new Page<Minor>(pageNo, pageSize); | ||
232 | LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); | 256 | LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
233 | String sysOrgCode=""; | 257 | String sysOrgCode=""; |
234 | if(oConvertUtils.isNotEmpty(sysUser) && oConvertUtils.isNotEmpty(sysUser.getOrgCode())){ | 258 | if(oConvertUtils.isNotEmpty(sysUser) && oConvertUtils.isNotEmpty(sysUser.getOrgCode())){ |
@@ -237,18 +261,15 @@ public class MinorController { | @@ -237,18 +261,15 @@ public class MinorController { | ||
237 | IPage<Minor> pageList = minorService.queryPageList(page,minor.getName(),sysOrgCode,minor.getIsReason()); | 261 | IPage<Minor> pageList = minorService.queryPageList(page,minor.getName(),sysOrgCode,minor.getIsReason()); |
238 | //Step.2 获取导出数据 | 262 | //Step.2 获取导出数据 |
239 | List<Minor> queryList = pageList.getRecords(); | 263 | List<Minor> queryList = pageList.getRecords(); |
240 | - // 过滤选中数据 | ||
241 | - String selections = request.getParameter("selections"); | ||
242 | List<Minor> minorList = new ArrayList<Minor>(); | 264 | List<Minor> minorList = new ArrayList<Minor>(); |
243 | if (oConvertUtils.isEmpty(selections)) { | 265 | if (oConvertUtils.isEmpty(selections)) { |
244 | minorList = queryList; | 266 | minorList = queryList; |
245 | } else { | 267 | } else { |
246 | - List<String> selectionList = Arrays.asList(selections.split(",")); | ||
247 | - minorList = queryList.stream().filter(item -> selectionList.contains(item.getId())).collect(Collectors.toList()); | 268 | + minorList = queryList.stream().filter(item -> ids.contains(item.getId())).collect(Collectors.toList()); |
248 | } | 269 | } |
249 | List<Family> familyList = new ArrayList<>(); | 270 | List<Family> familyList = new ArrayList<>(); |
250 | for (Minor main : minorList) { | 271 | for (Minor main : minorList) { |
251 | - familyList = familyService.selectByHouseholdNum(main.getHouseholdNum()); | 272 | + familyList .addAll(familyService.selectByHouseholdNum(main.getHouseholdNum())); |
252 | } | 273 | } |
253 | // Step.3 多sheet处理 | 274 | // Step.3 多sheet处理 |
254 | List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>(); | 275 | List<Map<String, Object>> listMap = new ArrayList<Map<String, Object>>(); |
juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/entity/Family.java
@@ -30,9 +30,9 @@ public class Family implements Serializable { | @@ -30,9 +30,9 @@ public class Family implements Serializable { | ||
30 | public static final Integer IS_CRIME=1;//是 | 30 | public static final Integer IS_CRIME=1;//是 |
31 | public static final Integer IS_NOT_CRIME=0;//否 | 31 | public static final Integer IS_NOT_CRIME=0;//否 |
32 | 32 | ||
33 | - @TableId(type = IdType.ASSIGN_ID) | 33 | + @TableId(type = IdType.NONE) |
34 | @ApiModelProperty(value = "主键") | 34 | @ApiModelProperty(value = "主键") |
35 | - private String id; | 35 | + private Long id; |
36 | /**创建人*/ | 36 | /**创建人*/ |
37 | @ApiModelProperty(value = "创建人") | 37 | @ApiModelProperty(value = "创建人") |
38 | private String createBy; | 38 | private String createBy; |
@@ -77,6 +77,7 @@ public class Family implements Serializable { | @@ -77,6 +77,7 @@ public class Family implements Serializable { | ||
77 | @ApiModelProperty(value = "与户主的关系") | 77 | @ApiModelProperty(value = "与户主的关系") |
78 | private String relation; | 78 | private String relation; |
79 | /**行政区划*/ | 79 | /**行政区划*/ |
80 | + @Excel(name = "行政区划", width = 15) | ||
80 | @ApiModelProperty(value = "行政区划") | 81 | @ApiModelProperty(value = "行政区划") |
81 | private String division; | 82 | private String division; |
82 | /**现住址*/ | 83 | /**现住址*/ |
juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/entity/GaDemographic.java
@@ -31,6 +31,7 @@ import lombok.experimental.Accessors; | @@ -31,6 +31,7 @@ import lombok.experimental.Accessors; | ||
31 | public class GaDemographic implements Serializable { | 31 | public class GaDemographic implements Serializable { |
32 | private static final long serialVersionUID = 1L; | 32 | private static final long serialVersionUID = 1L; |
33 | 33 | ||
34 | + | ||
34 | /**人员编号*/ | 35 | /**人员编号*/ |
35 | @Excel(name = "人员编号", width = 15) | 36 | @Excel(name = "人员编号", width = 15) |
36 | @ApiModelProperty(value = "人员编号") | 37 | @ApiModelProperty(value = "人员编号") |
@@ -40,6 +41,7 @@ public class GaDemographic implements Serializable { | @@ -40,6 +41,7 @@ public class GaDemographic implements Serializable { | ||
40 | @ApiModelProperty(value = "姓名") | 41 | @ApiModelProperty(value = "姓名") |
41 | private String xm; | 42 | private String xm; |
42 | /**身份证号*/ | 43 | /**身份证号*/ |
44 | + @TableId(type = IdType.NONE) | ||
43 | @Excel(name = "身份证号", width = 15) | 45 | @Excel(name = "身份证号", width = 15) |
44 | @ApiModelProperty(value = "身份证号") | 46 | @ApiModelProperty(value = "身份证号") |
45 | private String gmsfhm; | 47 | private String gmsfhm; |
juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/entity/Minor.java
@@ -42,9 +42,9 @@ public class Minor implements Serializable { | @@ -42,9 +42,9 @@ public class Minor implements Serializable { | ||
42 | public static final Integer ATTENTION_REASON_STUDENT=6;//特殊学生 | 42 | public static final Integer ATTENTION_REASON_STUDENT=6;//特殊学生 |
43 | 43 | ||
44 | /**主键*/ | 44 | /**主键*/ |
45 | - @TableId(type = IdType.ASSIGN_ID) | 45 | + @TableId(type = IdType.NONE) |
46 | @ApiModelProperty(value = "主键") | 46 | @ApiModelProperty(value = "主键") |
47 | - private String id; | 47 | + private Long id; |
48 | /**创建人*/ | 48 | /**创建人*/ |
49 | @ApiModelProperty(value = "创建人") | 49 | @ApiModelProperty(value = "创建人") |
50 | private String createBy; | 50 | private String createBy; |
juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/entity/MrSchool.java
@@ -32,9 +32,9 @@ public class MrSchool implements Serializable { | @@ -32,9 +32,9 @@ public class MrSchool implements Serializable { | ||
32 | private static final long serialVersionUID = 1L; | 32 | private static final long serialVersionUID = 1L; |
33 | 33 | ||
34 | /**主键*/ | 34 | /**主键*/ |
35 | - @TableId(type = IdType.ASSIGN_ID) | 35 | + @TableId(type = IdType.NONE) |
36 | @ApiModelProperty(value = "主键") | 36 | @ApiModelProperty(value = "主键") |
37 | - private String id; | 37 | + private Long id; |
38 | /**创建人*/ | 38 | /**创建人*/ |
39 | @ApiModelProperty(value = "创建人") | 39 | @ApiModelProperty(value = "创建人") |
40 | private String createBy; | 40 | private String createBy; |
juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/entity/MzUnsupported.java
@@ -56,6 +56,7 @@ public class MzUnsupported implements Serializable { | @@ -56,6 +56,7 @@ public class MzUnsupported implements Serializable { | ||
56 | @ApiModelProperty(value = "出生日期") | 56 | @ApiModelProperty(value = "出生日期") |
57 | private String birthday; | 57 | private String birthday; |
58 | /**身份证号*/ | 58 | /**身份证号*/ |
59 | + @TableId(type = IdType.NONE) | ||
59 | @Excel(name = "身份证号", width = 15) | 60 | @Excel(name = "身份证号", width = 15) |
60 | @ApiModelProperty(value = "身份证号") | 61 | @ApiModelProperty(value = "身份证号") |
61 | private String identity; | 62 | private String identity; |
juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/FamilyMapper.java
@@ -27,4 +27,6 @@ public interface FamilyMapper extends BaseMapper<Family> { | @@ -27,4 +27,6 @@ public interface FamilyMapper extends BaseMapper<Family> { | ||
27 | * @return | 27 | * @return |
28 | */ | 28 | */ |
29 | public Integer insertBatch(List<Family> list); | 29 | public Integer insertBatch(List<Family> list); |
30 | + | ||
31 | + public List<Family> getFamilysByHouseholdNum(@Param("householdNum") String householdNum); | ||
30 | } | 32 | } |
juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/MinorMapper.java
@@ -35,4 +35,12 @@ public interface MinorMapper extends BaseMapper<Minor> { | @@ -35,4 +35,12 @@ public interface MinorMapper extends BaseMapper<Minor> { | ||
35 | */ | 35 | */ |
36 | Integer getMinorByIdCard(@Param("identity") String identity); | 36 | Integer getMinorByIdCard(@Param("identity") String identity); |
37 | 37 | ||
38 | + /** | ||
39 | + * 查询未成年人信息 | ||
40 | + * @param name | ||
41 | + * @param sysOrgCode | ||
42 | + * @param isReason | ||
43 | + * @return | ||
44 | + */ | ||
45 | + List<Minor> queryPageList(@Param("name") String name,@Param("sysOrgCode") String sysOrgCode,@Param("isReason")String isReason); | ||
38 | } | 46 | } |
juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/xml/FamilyMapper.xml
@@ -9,17 +9,24 @@ | @@ -9,17 +9,24 @@ | ||
9 | household_num = #{householdNum} </delete> | 9 | household_num = #{householdNum} </delete> |
10 | 10 | ||
11 | <select id="selectByHouseholdNum" parameterType="java.lang.String" resultType="org.jeecg.modules.system.entity.Family"> | 11 | <select id="selectByHouseholdNum" parameterType="java.lang.String" resultType="org.jeecg.modules.system.entity.Family"> |
12 | - SELECT * | 12 | + SELECT household_num as householdNum,number,name,identity,relation,address,crime,reason,other,division |
13 | FROM mr_family | 13 | FROM mr_family |
14 | WHERE | 14 | WHERE |
15 | household_num = #{householdNum} | 15 | household_num = #{householdNum} |
16 | </select> | 16 | </select> |
17 | 17 | ||
18 | <insert id="insertBatch" > | 18 | <insert id="insertBatch" > |
19 | - INSERT INTO mr_family (id,create_time,sys_org_code,household_num,number,name,identity,gender,relation,address,crime,reason,other)VALUES | 19 | + INSERT INTO mr_family (id,create_time,sys_org_code,household_num,number,name,identity,gender,relation,address,crime,reason,other,division)VALUES |
20 | <foreach collection="list" item="b" separator=","> | 20 | <foreach collection="list" item="b" separator=","> |
21 | - (#{b.id},#{b.createTime},#{b.sysOrgCode},#{b.householdNum},#{b.number},#{b.name},#{b.identity},#{b.gender},#{b.relation},#{b.address},#{b.crime},#{b.reason},#{b.other}) | 21 | + (#{b.id},#{b.createTime},#{b.sysOrgCode},#{b.householdNum},#{b.number},#{b.name},#{b.identity},#{b.gender},#{b.relation},#{b.address},#{b.crime},#{b.reason},#{b.other},#{b.division}) |
22 | </foreach> | 22 | </foreach> |
23 | </insert> | 23 | </insert> |
24 | 24 | ||
25 | + <select id="getFamilysByHouseholdNum" parameterType="java.lang.String" resultType="org.jeecg.modules.system.entity.Family"> | ||
26 | + SELECT id,household_num as householdNum,number,name,identity,relation,address,crime,reason,other,division | ||
27 | + FROM mr_family | ||
28 | + WHERE | ||
29 | + household_num = #{householdNum} | ||
30 | + </select> | ||
31 | + | ||
25 | </mapper> | 32 | </mapper> |
juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/xml/MinorMapper.xml
@@ -43,9 +43,17 @@ | @@ -43,9 +43,17 @@ | ||
43 | <if test="sysOrgCode!=null and sysOrgCode!=''"> | 43 | <if test="sysOrgCode!=null and sysOrgCode!=''"> |
44 | and sys_org_code like concat(#{sysOrgCode},'%') | 44 | and sys_org_code like concat(#{sysOrgCode},'%') |
45 | </if> | 45 | </if> |
46 | - <if test="isReason!=null and isReason!=''"> | ||
47 | - and reason !='' | ||
48 | - </if> | 46 | + <choose> |
47 | + <when test='isReason=="1"'> | ||
48 | + and reason !='' | ||
49 | + </when> | ||
50 | + <when test='isReason=="2"'> | ||
51 | + and ISNULL(reason) | ||
52 | + </when> | ||
53 | + <otherwise> | ||
54 | + | ||
55 | + </otherwise> | ||
56 | + </choose> | ||
49 | ORDER BY create_time desc | 57 | ORDER BY create_time desc |
50 | </select> | 58 | </select> |
51 | 59 |
juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/IFamilyService.java
@@ -18,6 +18,7 @@ public interface IFamilyService extends IService<Family> { | @@ -18,6 +18,7 @@ public interface IFamilyService extends IService<Family> { | ||
18 | 18 | ||
19 | public List<Family> selectByHouseholdNum(String householdNum); | 19 | public List<Family> selectByHouseholdNum(String householdNum); |
20 | 20 | ||
21 | + public List<Family> getFamilysByHouseholdNum(String householdNum); | ||
21 | 22 | ||
22 | public Integer insertBatch(List<Family> list); | 23 | public Integer insertBatch(List<Family> list); |
23 | } | 24 | } |
juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/IMinorService.java
@@ -45,10 +45,23 @@ public interface IMinorService extends IService<Minor> { | @@ -45,10 +45,23 @@ public interface IMinorService extends IService<Minor> { | ||
45 | 45 | ||
46 | 46 | ||
47 | public Integer insertBatch(List<Minor> list); | 47 | public Integer insertBatch(List<Minor> list); |
48 | - | 48 | + /** |
49 | + * 分页查询未成年人信息 | ||
50 | + * @param page | ||
51 | + * @return | ||
52 | + */ | ||
49 | IPage<Minor> queryPageList(Page<Minor> page,String name,String sysOrgCode,String isReason); | 53 | IPage<Minor> queryPageList(Page<Minor> page,String name,String sysOrgCode,String isReason); |
50 | 54 | ||
51 | /** | 55 | /** |
56 | + * 查询未成年人信息 | ||
57 | + * @param name | ||
58 | + * @param sysOrgCode | ||
59 | + * @param isReason | ||
60 | + * @return | ||
61 | + */ | ||
62 | + List<Minor> queryList(String name, String sysOrgCode, String isReason); | ||
63 | + | ||
64 | + /** | ||
52 | * 添加多对多 | 65 | * 添加多对多 |
53 | * | 66 | * |
54 | */ | 67 | */ |
juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/FamilyServiceImpl.java
@@ -29,7 +29,8 @@ import javax.annotation.Resource; | @@ -29,7 +29,8 @@ import javax.annotation.Resource; | ||
29 | */ | 29 | */ |
30 | @Service | 30 | @Service |
31 | public class FamilyServiceImpl extends ServiceImpl<FamilyMapper, Family> implements IFamilyService { | 31 | public class FamilyServiceImpl extends ServiceImpl<FamilyMapper, Family> implements IFamilyService { |
32 | - | 32 | + private Integer random_number=00000000; |
33 | + | ||
33 | @Resource | 34 | @Resource |
34 | private FamilyMapper familyMapper; | 35 | private FamilyMapper familyMapper; |
35 | 36 | ||
@@ -44,7 +45,10 @@ public class FamilyServiceImpl extends ServiceImpl<FamilyMapper, Family> impleme | @@ -44,7 +45,10 @@ public class FamilyServiceImpl extends ServiceImpl<FamilyMapper, Family> impleme | ||
44 | return familyMapper.selectByHouseholdNum(householdNum); | 45 | return familyMapper.selectByHouseholdNum(householdNum); |
45 | } | 46 | } |
46 | 47 | ||
47 | - private Integer random_number=00000000; | 48 | + @Override |
49 | + public List<Family> getFamilysByHouseholdNum(String householdNum) { | ||
50 | + return familyMapper.getFamilysByHouseholdNum(householdNum); | ||
51 | + } | ||
48 | 52 | ||
49 | /** | 53 | /** |
50 | * 批量新增 | 54 | * 批量新增 |
juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/GaHouseholdServiceImpl.java
@@ -32,7 +32,6 @@ public class GaHouseholdServiceImpl extends ServiceImpl<GaHouseholdMapper, GaHou | @@ -32,7 +32,6 @@ public class GaHouseholdServiceImpl extends ServiceImpl<GaHouseholdMapper, GaHou | ||
32 | try { | 32 | try { |
33 | long startTime = System.currentTimeMillis(); | 33 | long startTime = System.currentTimeMillis(); |
34 | List<Family> families = gaHouseholdMapper.getGaHouseholds(); | 34 | List<Family> families = gaHouseholdMapper.getGaHouseholds(); |
35 | - System.out.println("数据查询时间" + (System.currentTimeMillis() - startTime) / 1000 + "秒"); | ||
36 | long startTime2 = System.currentTimeMillis(); | 35 | long startTime2 = System.currentTimeMillis(); |
37 | if (oConvertUtils.isNotEmpty(families)) { | 36 | if (oConvertUtils.isNotEmpty(families)) { |
38 | families.stream().forEach(g -> { | 37 | families.stream().forEach(g -> { |
@@ -41,7 +40,6 @@ public class GaHouseholdServiceImpl extends ServiceImpl<GaHouseholdMapper, GaHou | @@ -41,7 +40,6 @@ public class GaHouseholdServiceImpl extends ServiceImpl<GaHouseholdMapper, GaHou | ||
41 | } | 40 | } |
42 | }); | 41 | }); |
43 | } | 42 | } |
44 | - System.out.println("数据处理时间" + (System.currentTimeMillis() - startTime2) / 1000 + "秒"); | ||
45 | } catch (Exception e) { | 43 | } catch (Exception e) { |
46 | e.printStackTrace(); | 44 | e.printStackTrace(); |
47 | } | 45 | } |
juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/MinorServiceImpl.java
@@ -14,6 +14,7 @@ import org.jeecg.modules.system.entity.SysDepart; | @@ -14,6 +14,7 @@ import org.jeecg.modules.system.entity.SysDepart; | ||
14 | import org.jeecg.modules.system.mapper.FamilyMapper; | 14 | import org.jeecg.modules.system.mapper.FamilyMapper; |
15 | import org.jeecg.modules.system.mapper.MinorMapper; | 15 | import org.jeecg.modules.system.mapper.MinorMapper; |
16 | import org.jeecg.modules.system.service.IMinorService; | 16 | import org.jeecg.modules.system.service.IMinorService; |
17 | +import org.jeecg.modules.system.util.getRandomId; | ||
17 | import org.jeecg.modules.system.vo.MinorVo; | 18 | import org.jeecg.modules.system.vo.MinorVo; |
18 | import org.springframework.jdbc.datasource.DataSourceTransactionManager; | 19 | import org.springframework.jdbc.datasource.DataSourceTransactionManager; |
19 | import org.springframework.stereotype.Service; | 20 | import org.springframework.stereotype.Service; |
@@ -56,7 +57,7 @@ public class MinorServiceImpl extends ServiceImpl<MinorMapper, Minor> implements | @@ -56,7 +57,7 @@ public class MinorServiceImpl extends ServiceImpl<MinorMapper, Minor> implements | ||
56 | @Override | 57 | @Override |
57 | @Transactional | 58 | @Transactional |
58 | public void saveMain(Minor minor, List<Family> familyList) { | 59 | public void saveMain(Minor minor, List<Family> familyList) { |
59 | - | 60 | + getRandomId idWorker = new getRandomId(0, 0); |
60 | if(familyList!=null && familyList.size()>0) { | 61 | if(familyList!=null && familyList.size()>0) { |
61 | //判断家庭成员信息里的数据是否包含未成年人,默认包含 | 62 | //判断家庭成员信息里的数据是否包含未成年人,默认包含 |
62 | Boolean falg=true; | 63 | Boolean falg=true; |
@@ -71,12 +72,13 @@ public class MinorServiceImpl extends ServiceImpl<MinorMapper, Minor> implements | @@ -71,12 +72,13 @@ public class MinorServiceImpl extends ServiceImpl<MinorMapper, Minor> implements | ||
71 | if(oConvertUtils.isNotEmpty(entity.getCrime()) && entity.getCrime().equals(Family.IS_CRIME)){ | 72 | if(oConvertUtils.isNotEmpty(entity.getCrime()) && entity.getCrime().equals(Family.IS_CRIME)){ |
72 | isCrime=true; | 73 | isCrime=true; |
73 | } | 74 | } |
75 | + entity.setId(idWorker.nextId()); | ||
74 | } | 76 | } |
75 | if(isCrime){ | 77 | if(isCrime){ |
76 | minor.setReason(String.valueOf(Minor.ATTENTION_REASON_CRIME)); | 78 | minor.setReason(String.valueOf(Minor.ATTENTION_REASON_CRIME)); |
77 | } | 79 | } |
78 | } | 80 | } |
79 | - | 81 | + minor.setId(idWorker.nextId()); |
80 | familyMapper.insertBatch(familyList); | 82 | familyMapper.insertBatch(familyList); |
81 | minorMapper.insert(minor); | 83 | minorMapper.insert(minor); |
82 | } | 84 | } |
@@ -159,20 +161,37 @@ public class MinorServiceImpl extends ServiceImpl<MinorMapper, Minor> implements | @@ -159,20 +161,37 @@ public class MinorServiceImpl extends ServiceImpl<MinorMapper, Minor> implements | ||
159 | if(oConvertUtils.isNotEmpty(list)){ | 161 | if(oConvertUtils.isNotEmpty(list)){ |
160 | for(int i=0;i<list.size();i++){ | 162 | for(int i=0;i<list.size();i++){ |
161 | String id=System.currentTimeMillis()+String.valueOf((random_number+i)); | 163 | String id=System.currentTimeMillis()+String.valueOf((random_number+i)); |
162 | - list.get(i).setId(id); | 164 | + list.get(i).setId(Long.valueOf(id)); |
163 | } | 165 | } |
164 | } | 166 | } |
165 | updateStudentWithThreads(list); | 167 | updateStudentWithThreads(list); |
166 | return list.size(); | 168 | return list.size(); |
167 | } | 169 | } |
168 | 170 | ||
171 | + /** | ||
172 | + * 分页查询未成年人信息 | ||
173 | + * @param page | ||
174 | + * @return | ||
175 | + */ | ||
169 | @Override | 176 | @Override |
170 | public IPage<Minor> queryPageList(Page<Minor> page,String name,String sysOrgCode,String isReason) { | 177 | public IPage<Minor> queryPageList(Page<Minor> page,String name,String sysOrgCode,String isReason) { |
171 | return minorMapper.queryPageList(page,name,sysOrgCode,isReason); | 178 | return minorMapper.queryPageList(page,name,sysOrgCode,isReason); |
172 | } | 179 | } |
173 | 180 | ||
174 | - | ||
175 | /** | 181 | /** |
182 | + * 查询未成年人信息 | ||
183 | + * @param name | ||
184 | + * @param sysOrgCode | ||
185 | + * @param isReason | ||
186 | + * @return | ||
187 | + */ | ||
188 | + @Override | ||
189 | + public List<Minor> queryList(String name, String sysOrgCode, String isReason) { | ||
190 | + return minorMapper.queryPageList(name,sysOrgCode,isReason); | ||
191 | + } | ||
192 | + | ||
193 | + | ||
194 | + /** | ||
176 | * 添加多对多 | 195 | * 添加多对多 |
177 | * | 196 | * |
178 | */ | 197 | */ |
@@ -185,6 +204,7 @@ public class MinorServiceImpl extends ServiceImpl<MinorMapper, Minor> implements | @@ -185,6 +204,7 @@ public class MinorServiceImpl extends ServiceImpl<MinorMapper, Minor> implements | ||
185 | sysOrgCode=sysUser.getOrgCode(); | 204 | sysOrgCode=sysUser.getOrgCode(); |
186 | } | 205 | } |
187 | Date createTime=new Date(); | 206 | Date createTime=new Date(); |
207 | + getRandomId idWorker = new getRandomId(0, 0); | ||
188 | //存放户号和犯罪的某一个家庭成员信息 | 208 | //存放户号和犯罪的某一个家庭成员信息 |
189 | Map<String,Family> houseFamily=new HashMap<>(); | 209 | Map<String,Family> houseFamily=new HashMap<>(); |
190 | if(oConvertUtils.isNotEmpty(familyList) ){ | 210 | if(oConvertUtils.isNotEmpty(familyList) ){ |
@@ -196,6 +216,7 @@ public class MinorServiceImpl extends ServiceImpl<MinorMapper, Minor> implements | @@ -196,6 +216,7 @@ public class MinorServiceImpl extends ServiceImpl<MinorMapper, Minor> implements | ||
196 | if(oConvertUtils.isNotEmpty(family.getCrime()) && family.getCrime().equals(Family.IS_CRIME) && oConvertUtils.isNotEmpty(family.getHouseholdNum())){ | 216 | if(oConvertUtils.isNotEmpty(family.getCrime()) && family.getCrime().equals(Family.IS_CRIME) && oConvertUtils.isNotEmpty(family.getHouseholdNum())){ |
197 | houseFamily.put(family.getHouseholdNum(),family); | 217 | houseFamily.put(family.getHouseholdNum(),family); |
198 | } | 218 | } |
219 | + family.setId(idWorker.nextId()); | ||
199 | } | 220 | } |
200 | }); | 221 | }); |
201 | } | 222 | } |
@@ -204,6 +225,7 @@ public class MinorServiceImpl extends ServiceImpl<MinorMapper, Minor> implements | @@ -204,6 +225,7 @@ public class MinorServiceImpl extends ServiceImpl<MinorMapper, Minor> implements | ||
204 | minors.stream().forEach(minor -> { | 225 | minors.stream().forEach(minor -> { |
205 | if(oConvertUtils.isNotEmpty(minor)){ | 226 | if(oConvertUtils.isNotEmpty(minor)){ |
206 | minor.setCreateTime(createTime); | 227 | minor.setCreateTime(createTime); |
228 | + minor.setId(idWorker.nextId()); | ||
207 | if(oConvertUtils.isNotEmpty(houseFamily) && oConvertUtils.isNotEmpty(minor.getHouseholdNum())){ | 229 | if(oConvertUtils.isNotEmpty(houseFamily) && oConvertUtils.isNotEmpty(minor.getHouseholdNum())){ |
208 | String houseNum=minor.getHouseholdNum(); | 230 | String houseNum=minor.getHouseholdNum(); |
209 | Family family=houseFamily.get(houseNum); | 231 | Family family=houseFamily.get(houseNum); |
juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/MrSchoolServiceImpl.java
@@ -50,7 +50,7 @@ public class MrSchoolServiceImpl extends ServiceImpl<MrSchoolMapper, MrSchool> i | @@ -50,7 +50,7 @@ public class MrSchoolServiceImpl extends ServiceImpl<MrSchoolMapper, MrSchool> i | ||
50 | if(oConvertUtils.isNotEmpty(list)){ | 50 | if(oConvertUtils.isNotEmpty(list)){ |
51 | for(int i=0;i<list.size();i++){ | 51 | for(int i=0;i<list.size();i++){ |
52 | String id=System.currentTimeMillis()+String.valueOf((random_number+i)); | 52 | String id=System.currentTimeMillis()+String.valueOf((random_number+i)); |
53 | - list.get(i).setId(id); | 53 | + list.get(i).setId(Long.valueOf(id)); |
54 | } | 54 | } |
55 | } | 55 | } |
56 | updateStudentWithThreads(list); | 56 | updateStudentWithThreads(list); |
juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/util/getRandomId.java
@@ -18,12 +18,12 @@ public class getRandomId { | @@ -18,12 +18,12 @@ public class getRandomId { | ||
18 | /** | 18 | /** |
19 | * 机器id所占的位数 | 19 | * 机器id所占的位数 |
20 | */ | 20 | */ |
21 | - private final long workerIdBits = 5L; | 21 | + private final long workerIdBits = 1L; |
22 | 22 | ||
23 | /** | 23 | /** |
24 | * 数据标识id所占的位数 | 24 | * 数据标识id所占的位数 |
25 | */ | 25 | */ |
26 | - private final long datacenterIdBits = 5L; | 26 | + private final long datacenterIdBits = 1L; |
27 | 27 | ||
28 | /** | 28 | /** |
29 | * 支持的最大机器id,结果是31 (这个移位算法可以很快的计算出几位二进制数所能表示的最大十进制数) | 29 | * 支持的最大机器id,结果是31 (这个移位算法可以很快的计算出几位二进制数所能表示的最大十进制数) |
@@ -38,7 +38,7 @@ public class getRandomId { | @@ -38,7 +38,7 @@ public class getRandomId { | ||
38 | /** | 38 | /** |
39 | * 序列在id中占的位数 | 39 | * 序列在id中占的位数 |
40 | */ | 40 | */ |
41 | - private final long sequenceBits = 12L; | 41 | + private final long sequenceBits = 1L; |
42 | 42 | ||
43 | /** | 43 | /** |
44 | * 机器ID向左移12位 | 44 | * 机器ID向左移12位 |
@@ -167,98 +167,17 @@ public class getRandomId { | @@ -167,98 +167,17 @@ public class getRandomId { | ||
167 | /** | 167 | /** |
168 | * 测试 | 168 | * 测试 |
169 | */ | 169 | */ |
170 | -// public static void main(String[] args) { | ||
171 | -// long startTime = System.currentTimeMillis(); | ||
172 | -// Set<Family> familys = new HashSet<>(); | ||
173 | -// //存放已经被放入minor里面的户号,避免数据重复 | ||
174 | -// Set<String> houseSet=new HashSet<>(); | ||
175 | -// Map<String, Minor> minors=getMinors(); | ||
176 | -// Map<String, List<Family>> familyMaps=getFamilyMaps(); | ||
177 | -// if (oConvertUtils.isNotEmpty(minors)) { | ||
178 | -// for (Map.Entry<String, Minor> m : minors.entrySet()) { | ||
179 | -// String idCard = m.getKey(); | ||
180 | -// Minor minor = m.getValue(); | ||
181 | -// Set<Family> f=new HashSet<>(); | ||
182 | -// //判断是否是一个家庭的人员 | ||
183 | -// if (oConvertUtils.isNotEmpty(minor.getHouseholdNum())) { | ||
184 | -// String houseNum = minor.getHouseholdNum(); | ||
185 | -// if(oConvertUtils.isNotEmpty(familyMaps) && oConvertUtils.isNotEmpty(familyMaps.get(houseNum)) ){ | ||
186 | -// if(!houseSet.contains(houseNum) ){ | ||
187 | -// familys.addAll(familyMaps.get(houseNum)); | ||
188 | -// houseSet.add(houseNum); | ||
189 | -// } | ||
190 | -// } | ||
191 | -// minor.setFamilies(f); | ||
192 | -// } | ||
193 | -// } | ||
194 | -// } | ||
195 | -// long endTime = System.currentTimeMillis(); | ||
196 | -// | ||
197 | -// System.out.println("endTime-startTime:" + (endTime - startTime)); | ||
198 | -// } | ||
199 | -// public static Map<String, List<Family>> getFamilyMaps(){ | ||
200 | -// Map<String, List<Family>> familyMaps=new HashMap<>(); | ||
201 | -// List<Family> familys=getFamilys(); | ||
202 | -// for(int i=0;i<familys.size();i++){ | ||
203 | -// Family family=familys.get(i); | ||
204 | -// if(oConvertUtils.isNotEmpty(family.getHouseholdNum())){ | ||
205 | -// if(oConvertUtils.isNotEmpty(familyMaps) && oConvertUtils.isNotEmpty(familyMaps.get(family.getHouseholdNum()))){ | ||
206 | -// familyMaps.get(family.getHouseholdNum()).add(family); | ||
207 | -// }else { | ||
208 | -// List<Family> list = new ArrayList<>(); | ||
209 | -// list.add(family); | ||
210 | -// familyMaps.put(family.getHouseholdNum(),list); | ||
211 | -// } | ||
212 | -// | ||
213 | -// } | ||
214 | -// } | ||
215 | -// return familyMaps; | ||
216 | -// | ||
217 | -// } | ||
218 | -// | ||
219 | -// public static List<Family> getFamilys(){ | ||
220 | -// List<Family> familys=new ArrayList<>(); | ||
221 | -// for(int i=0;i<25;i++){ | ||
222 | -// Family f=new Family(); | ||
223 | -// if(i<5){ | ||
224 | -// f.setIdentity("#####################"+i); | ||
225 | -// f.setHouseholdNum("**************house"+0); | ||
226 | -// }else if(i<10){ | ||
227 | -// f.setIdentity("#####################"+i); | ||
228 | -// f.setHouseholdNum("**************house"+1); | ||
229 | -// }else if(i<15){ | ||
230 | -// f.setIdentity("#####################"+i); | ||
231 | -// f.setHouseholdNum("**************house"+2); | ||
232 | -// }else if(i<20){ | ||
233 | -// f.setIdentity("#####################"+i); | ||
234 | -// f.setHouseholdNum("**************house"+3); | ||
235 | -// }else if(i<25){ | ||
236 | -// f.setIdentity("#####################"+i); | ||
237 | -// f.setHouseholdNum("**************house"+4); | ||
238 | -// } | ||
239 | -// familys.add(f); | ||
240 | -// } | ||
241 | -// return familys; | ||
242 | -// | ||
243 | -// } | ||
244 | -// | ||
245 | -// public static Map<String, Minor> getMinors(){ | ||
246 | -// Map<String, Minor> minors=new HashMap<>(); | ||
247 | -// for(int i=0;i<10;i++){ | ||
248 | -// if(i<5){ | ||
249 | -// Minor m=new Minor(); | ||
250 | -// m.setIdentity("**************id"+i); | ||
251 | -// m.setHouseholdNum("**************house"+i); | ||
252 | -// minors.put("**************id"+i,m); | ||
253 | -// }else if(i<10){ | ||
254 | -// Minor m=new Minor(); | ||
255 | -// m.setIdentity("**************id"+i); | ||
256 | -// m.setHouseholdNum("**************house"+(i-5)); | ||
257 | -// minors.put("**************id"+i,m); | ||
258 | -// } | ||
259 | -// } | ||
260 | -// return minors; | ||
261 | -// | ||
262 | -// } | 170 | + public static void main(String[] args) { |
171 | + long startTime = System.currentTimeMillis(); | ||
172 | + Set<Long> ids=new HashSet<>(); | ||
173 | + getRandomId idWorker = new getRandomId(0, 0); | ||
174 | + for(int i=0;i<100;i++){ | ||
175 | + ids.add(idWorker.nextId()); | ||
176 | + } | ||
177 | + System.out.println(ids.size()); | ||
178 | + long endTime = System.currentTimeMillis(); | ||
179 | + | ||
180 | + System.out.println("endTime-startTime:" + (endTime - startTime)); | ||
181 | + } | ||
263 | 182 | ||
264 | } | 183 | } |
juvenile-prosecution-vue/public/logo.png
juvenile-prosecution-vue/src/components/page/GlobalFooter.vue
juvenile-prosecution-vue/src/views/business/MinorList.vue
@@ -12,6 +12,7 @@ | @@ -12,6 +12,7 @@ | ||
12 | <a-col :md="6" :sm="12"> | 12 | <a-col :md="6" :sm="12"> |
13 | <a-form-item label="是否重点关注"> | 13 | <a-form-item label="是否重点关注"> |
14 | <a-select v-model="queryParam.isReason" placeholder="请选择" > | 14 | <a-select v-model="queryParam.isReason" placeholder="请选择" > |
15 | + <a-select-option value="0">全部</a-select-option> | ||
15 | <a-select-option value="1">是</a-select-option> | 16 | <a-select-option value="1">是</a-select-option> |
16 | <a-select-option value="2">否</a-select-option> | 17 | <a-select-option value="2">否</a-select-option> |
17 | </a-select> | 18 | </a-select> |
@@ -234,7 +235,7 @@ export default { | @@ -234,7 +235,7 @@ export default { | ||
234 | deleteBatch: '/sys/minor/deleteBatch', | 235 | deleteBatch: '/sys/minor/deleteBatch', |
235 | exportXlsUrl: '/sys/minor/exportXls', | 236 | exportXlsUrl: '/sys/minor/exportXls', |
236 | importExcelUrl: 'sys/minor/importExcel', | 237 | importExcelUrl: 'sys/minor/importExcel', |
237 | - familys: '/sys/minor/queryFamilyByMainId' | 238 | + familys: '/sys/minor/getFamilysByHouseholdNum' |
238 | }, | 239 | }, |
239 | dictOptions: {}, | 240 | dictOptions: {}, |
240 | superFieldList: [], | 241 | superFieldList: [], |
@@ -312,7 +313,11 @@ export default { | @@ -312,7 +313,11 @@ export default { | ||
312 | showQuickJumper: true, | 313 | showQuickJumper: true, |
313 | total: 0 | 314 | total: 0 |
314 | }, | 315 | }, |
315 | - familyLoading: false | 316 | + familyLoading: false, |
317 | + queryParam:{ | ||
318 | + name:'', | ||
319 | + isReason:'0' | ||
320 | + } | ||
316 | } | 321 | } |
317 | }, | 322 | }, |
318 | created() { | 323 | created() { |
@@ -324,6 +329,35 @@ export default { | @@ -324,6 +329,35 @@ export default { | ||
324 | } | 329 | } |
325 | }, | 330 | }, |
326 | methods: { | 331 | methods: { |
332 | + handleExportXls(fileName){ | ||
333 | + if(!fileName || typeof fileName != "string"){ | ||
334 | + fileName = "导出文件" | ||
335 | + } | ||
336 | + let param = this.getQueryParams(); | ||
337 | + if(this.selectedRowKeys && this.selectedRowKeys.length>0){ | ||
338 | + param['selections'] = this.selectedRowKeys.join(",") | ||
339 | + } | ||
340 | + console.log("导出参数",param) | ||
341 | + downFile(this.url.exportXlsUrl,param).then((data)=>{ | ||
342 | + if (!data) { | ||
343 | + this.$message.warning("文件下载失败") | ||
344 | + return | ||
345 | + } | ||
346 | + if (typeof window.navigator.msSaveBlob !== 'undefined') { | ||
347 | + window.navigator.msSaveBlob(new Blob([data],{type: 'application/vnd.ms-excel'}), fileName+'.xls') | ||
348 | + }else{ | ||
349 | + let url = window.URL.createObjectURL(new Blob([data],{type: 'application/vnd.ms-excel'})) | ||
350 | + let link = document.createElement('a') | ||
351 | + link.style.display = 'none' | ||
352 | + link.href = url | ||
353 | + link.setAttribute('download', fileName+'.xls') | ||
354 | + document.body.appendChild(link) | ||
355 | + link.click() | ||
356 | + document.body.removeChild(link); //下载完成移除元素 | ||
357 | + window.URL.revokeObjectURL(url); //释放掉blob对象 | ||
358 | + } | ||
359 | + }) | ||
360 | + }, | ||
327 | getAgeByIdentity(identity) { | 361 | getAgeByIdentity(identity) { |
328 | return GetAge(identity) | 362 | return GetAge(identity) |
329 | }, | 363 | }, |
@@ -345,38 +379,6 @@ export default { | @@ -345,38 +379,6 @@ export default { | ||
345 | }) | 379 | }) |
346 | } | 380 | } |
347 | }, | 381 | }, |
348 | - handleImportModel: function(name, type) { | ||
349 | - if (!name || typeof name != 'string') { | ||
350 | - name = '导出文件' | ||
351 | - } | ||
352 | - let param = { 'fileName': name, 'type': type } | ||
353 | - console.log('导出参数', param) | ||
354 | - downFile(this.url.exportXlsUrl, param).then((data) => { | ||
355 | - console.log(data) | ||
356 | - if (!data) { | ||
357 | - this.$message.warning('文件下载失败') | ||
358 | - return | ||
359 | - } | ||
360 | - console.log(window.navigator.msSaveBlob) | ||
361 | - if (typeof window.navigator.msSaveBlob !== 'undefined') { | ||
362 | - window.navigator.msSaveBlob(new Blob([data]), name + '.xlsx') | ||
363 | - } else { | ||
364 | - let url = window.URL.createObjectURL(new Blob([data])) | ||
365 | - console.log(url) | ||
366 | - let link = document.createElement('a') | ||
367 | - console.log(link) | ||
368 | - link.style.display = 'none' | ||
369 | - link.href = url | ||
370 | - link.setAttribute('download', name + '.xlsx') | ||
371 | - console.log(link) | ||
372 | - document.body.appendChild(link) | ||
373 | - link.click() | ||
374 | - console.log(link) | ||
375 | - document.body.removeChild(link) //下载完成移除元素 | ||
376 | - window.URL.revokeObjectURL(url) //释放掉blob对象 | ||
377 | - } | ||
378 | - }) | ||
379 | - }, | ||
380 | initDictConfig() { | 382 | initDictConfig() { |
381 | }, | 383 | }, |
382 | getSuperFieldList() { | 384 | getSuperFieldList() { |
juvenile-prosecution-vue/src/views/business/modules/MinorModal.vue
@@ -301,6 +301,7 @@ export default { | @@ -301,6 +301,7 @@ export default { | ||
301 | }, | 301 | }, |
302 | edit(record) { | 302 | edit(record) { |
303 | this.model = Object.assign({}, record) | 303 | this.model = Object.assign({}, record) |
304 | + this.dataSource=[] | ||
304 | this.visible = true | 305 | this.visible = true |
305 | // 加载子表数据 | 306 | // 加载子表数据 |
306 | if (this.model.householdNum) { | 307 | if (this.model.householdNum) { |
@@ -310,9 +311,10 @@ export default { | @@ -310,9 +311,10 @@ export default { | ||
310 | }, | 311 | }, |
311 | /** 查询某个tab的数据 */ | 312 | /** 查询某个tab的数据 */ |
312 | requestTableData(url, params) { | 313 | requestTableData(url, params) { |
314 | + console.log("单一查询") | ||
313 | this.familyLoading = true | 315 | this.familyLoading = true |
314 | getAction(url, params).then(res => { | 316 | getAction(url, params).then(res => { |
315 | - console.log(this.dataSource) | 317 | + console.log(res) |
316 | this.dataSource = res.result || [] | 318 | this.dataSource = res.result || [] |
317 | console.log(this.dataSource) | 319 | console.log(this.dataSource) |
318 | }).finally(() => { | 320 | }).finally(() => { |
juvenile-prosecution-vue/src/views/system/DepartList.vue
@@ -117,11 +117,11 @@ | @@ -117,11 +117,11 @@ | ||
117 | </a-card> | 117 | </a-card> |
118 | <a-card v-else > | 118 | <a-card v-else > |
119 | <a-empty> | 119 | <a-empty> |
120 | - <span slot="description"> 请先选择一个机构! </span> | 120 | + <span slot="description"> 请先选择一个单位! </span> |
121 | </a-empty> | 121 | </a-empty> |
122 | </a-card> | 122 | </a-card> |
123 | </a-tab-pane> | 123 | </a-tab-pane> |
124 | - <a-tab-pane tab="机构权限" key="2" forceRender> | 124 | + <a-tab-pane tab="单位权限" key="2" forceRender> |
125 | <depart-auth-modal ref="departAuth"/> | 125 | <depart-auth-modal ref="departAuth"/> |
126 | </a-tab-pane> | 126 | </a-tab-pane> |
127 | </a-tabs> | 127 | </a-tabs> |
juvenile-prosecution-vue/src/views/system/UserList.vue
@@ -86,7 +86,6 @@ | @@ -86,7 +86,6 @@ | ||
86 | <a-icon type="down"/> | 86 | <a-icon type="down"/> |
87 | </a-button> | 87 | </a-button> |
88 | </a-dropdown> | 88 | </a-dropdown> |
89 | - <j-super-query :fieldList="superQueryFieldList" @handleSuperQuery="handleSuperQuery"/> | ||
90 | <a-button @click="doAnalyze" type="primary" icon="control-outlined" >数据分析</a-button> | 89 | <a-button @click="doAnalyze" type="primary" icon="control-outlined" >数据分析</a-button> |
91 | </div> | 90 | </div> |
92 | 91 |
juvenile-prosecution-vue/src/views/system/modules/DepartAuthModal.vue
@@ -44,7 +44,7 @@ | @@ -44,7 +44,7 @@ | ||
44 | </template> | 44 | </template> |
45 | <a-card v-else :bordered="false" style="height:200px"> | 45 | <a-card v-else :bordered="false" style="height:200px"> |
46 | <a-empty> | 46 | <a-empty> |
47 | - <span slot="description"> 请先选择一个部门! </span> | 47 | + <span slot="description"> 请先选择一个单位! </span> |
48 | </a-empty> | 48 | </a-empty> |
49 | </a-card> | 49 | </a-card> |
50 | <depart-datarule-modal ref="datarule"/> | 50 | <depart-datarule-modal ref="datarule"/> |