Commit d1a8496e53152f653f1aca35a4e0d0db4e38a7ac

Authored by wxy
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 116 getSourceData();
117 117 log.info("来源数据入库时间" + (System.currentTimeMillis() - startTime4) / 1000 + "秒");
118 118 log.info("*********************************总用时" + (System.currentTimeMillis() - startTime) / 1000 + "秒");
  119 + resultMinor = null;//分析后未成年人的信息
  120 + resultSchools = null;//分析后学籍的信息
  121 + testIdCards = null;//存储户号
119 122 } catch (Exception e) {
120 123 e.printStackTrace();
121 124 log.info(String.valueOf(e));
... ... @@ -136,40 +139,29 @@ public class AnalyzeController extends JeecgController<GaDemographic, IGaDemogra
136 139 CompletableFuture<List<MrSchool>> f7 = CompletableFuture.supplyAsync(() -> highSchoolService.getList(), executor);
137 140 CompletableFuture<List<MrSchool>> f8 = CompletableFuture.supplyAsync(() -> primarySchoolService.getList(), executor);
138 141 //行政处罚数据
139   -// Map<String,GaPunishVo> gaPunishVos = gaPunishService.queryAll();
140 142 Map<String, GaPunishVo> gaPunishVos = new HashMap<>();
141 143 gaPunishVos.putAll(f1.get());
142   -// List<SpecialStudentVo> specialStudentVos = specialStudentService.queryList();
143 144 List<SpecialStudentVo> specialStudentVos = new ArrayList<>();
144 145 specialStudentVos.addAll(f2.get());
145 146 //孤儿数据
146   -// List<String> mzOrphans = mzOrphanService.getIdentityS();
147 147 List<String> mzOrphans = new ArrayList<>();
148 148 mzOrphans.addAll(f3.get());
149 149 //无人抚养
150   -// List<String> mzUnsupporteds = mzUnsupportedService.getIdentityS();
151 150 List<String> mzUnsupporteds = new ArrayList<>();
152 151 mzUnsupporteds.addAll(f4.get());
153 152 //留守儿童
154   -// List<String> mzLeftBehinds =mzLeftBehindChildrenService.getIdentityS();
155 153 List<String> mzLeftBehinds = new ArrayList<>();
156 154 mzLeftBehinds.addAll(f5.get());
157 155 //领养
158   -// List<String> mzAdoptions =mzAdoptionService.getIdentityS();
159 156 List<String> mzAdoptions = new ArrayList<>();
160 157 mzAdoptions.addAll(f6.get());
161 158 //获取初高中学生信息
162   -// List<MrSchool> highSchools = highSchoolService.getList();
163 159 List<MrSchool> highSchools = new ArrayList<>();
164 160 highSchools.addAll(f7.get());
165 161 //获取幼小学生信息
166   -// List<MrSchool> primarySchools = primarySchoolService.getList();
167 162 List<MrSchool> primarySchools = new ArrayList<>();
168 163 primarySchools.addAll(f8.get());
169 164 //人口基本信息小于18岁
170   -// Map<String,String> gaDemographics =gaDemographicService.getIdentityS();
171   -// Map<String,String> gaDemographics =new HashMap<>();
172   -// gaDemographics.putAll(f9.get());
173 165 //关闭线程池
174 166 pool.shutdown();
175 167 Map<String, String> gaDemographics = gaDemographicService.getIdentityS();
... ... @@ -177,7 +169,6 @@ public class AnalyzeController extends JeecgController&lt;GaDemographic, IGaDemogra
177 169 long startTime1 = System.currentTimeMillis();
178 170 //户籍信息
179 171 Map<String, Family> familyMap = gaHouseholdService.getGaHouseholds(gaDemographics);
180   -// Map<String,Family> familyMap = queryByThread();
181 172 log.info("户籍信息数据查询时间" + (System.currentTimeMillis() - startTime1) / 1000 + "秒");
182 173 log.info("判断初高中学生信息和人口基本信息的交集和差集开始时间" + (System.currentTimeMillis() - startTime) / 1000 + "秒");
183 174 judgeHighSchoolsAndDemographics(highSchools, gaDemographics, departs, specialStudentVos, mzUnsupporteds, mzLeftBehinds, mzAdoptions, familyMap, gaPunishVos, mzOrphans);
... ... @@ -406,7 +397,7 @@ public class AnalyzeController extends JeecgController&lt;GaDemographic, IGaDemogra
406 397 if (oConvertUtils.isNotEmpty(idCard) && oConvertUtils.isNotEmpty(gaHouseholds.get(idCard)) && IDNumberUtil.checkID(idCard)) {
407 398 Minor minor = new Minor();
408 399 minor.setSchool(Minor.SCHOOL_STATUS_YES);
409   - minor.setName(gaHouseholds.get(idCard).getName());
  400 + minor.setName(gaHouseholds.get(idCard).getName().trim());
410 401 minor.setGender(Integer.parseInt(IDNumberUtil.judgeGender(idCard)));
411 402 minor.setAddress(gaHouseholds.get(idCard).getAddress());
412 403 minor.setIdentity(idCard);
... ... @@ -477,7 +468,7 @@ public class AnalyzeController extends JeecgController&lt;GaDemographic, IGaDemogra
477 468 }
478 469 minor.setSchool(Minor.SCHOOL_STATUS_NO);
479 470 if (oConvertUtils.isNotEmpty(i.getName())) {
480   - minor.setName(i.getName());
  471 + minor.setName(i.getName().trim());
481 472 }
482 473 minor.setGender(Integer.valueOf(IDNumberUtil.judgeGender(i.getIdentity())));
483 474 if (oConvertUtils.isNotEmpty(i.getAddress())) {
... ... @@ -552,14 +543,14 @@ public class AnalyzeController extends JeecgController&lt;GaDemographic, IGaDemogra
552 543 }
553 544 minor.setSchool(Minor.SCHOOL_STATUS_NO);
554 545 if (oConvertUtils.isNotEmpty(m.getName())) {
555   - minor.setName(m.getName());
  546 + minor.setName(m.getName().trim());
556 547 }
557 548 minor.setGender(Integer.valueOf(IDNumberUtil.judgeGender(m.getIdentity())));
558 549 if (oConvertUtils.isNotEmpty(m.getAddress())) {
559 550 minor.setAddress(m.getAddress());
560 551 }
561 552 if (oConvertUtils.isNotEmpty(m.getSchool())) {
562   - minor.setSchoolName(m.getSchool());
  553 + minor.setSchoolName(m.getSchool().trim());
563 554 }
564 555 if (oConvertUtils.isNotEmpty(m.getAdmissionDate())) {
565 556 minor.setStartYear(m.getAdmissionDate());
... ... @@ -760,10 +751,10 @@ public class AnalyzeController extends JeecgController&lt;GaDemographic, IGaDemogra
760 751 if (oConvertUtils.isNotEmpty(gaPunishVos) && oConvertUtils.isNotEmpty(gaPunishVos.get(mapKey))) {
761 752 family.setCrime(Family.IS_CRIME);
762 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 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 759 } else {
769 760 family.setCrime(Family.IS_NOT_CRIME);
... ... @@ -771,7 +762,7 @@ public class AnalyzeController extends JeecgController&lt;GaDemographic, IGaDemogra
771 762 if (IDNumberUtil.checkID(mapKey)) {
772 763 family.setGender(Integer.valueOf(IDNumberUtil.judgeGender(mapKey)));
773 764 }
774   - family.setId(String.valueOf(id));
  765 +// family.setId(Math.toIntExact(id));
775 766 family.setCreateTime(createTime);
776 767 }
777 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 107 if(oConvertUtils.isNotEmpty(sysUser) && oConvertUtils.isNotEmpty(sysUser.getOrgCode())){
108 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 115 return Result.OK(pageList);
116 116 }
117 117  
... ... @@ -219,6 +219,20 @@ public class MinorController {
219 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 237 * 导出excel
224 238 *
... ... @@ -226,9 +240,19 @@ public class MinorController {
226 240 * @param minor
227 241 */
228 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 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 256 LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
233 257 String sysOrgCode="";
234 258 if(oConvertUtils.isNotEmpty(sysUser) && oConvertUtils.isNotEmpty(sysUser.getOrgCode())){
... ... @@ -237,18 +261,15 @@ public class MinorController {
237 261 IPage<Minor> pageList = minorService.queryPageList(page,minor.getName(),sysOrgCode,minor.getIsReason());
238 262 //Step.2 获取导出数据
239 263 List<Minor> queryList = pageList.getRecords();
240   - // 过滤选中数据
241   - String selections = request.getParameter("selections");
242 264 List<Minor> minorList = new ArrayList<Minor>();
243 265 if (oConvertUtils.isEmpty(selections)) {
244 266 minorList = queryList;
245 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 270 List<Family> familyList = new ArrayList<>();
250 271 for (Minor main : minorList) {
251   - familyList = familyService.selectByHouseholdNum(main.getHouseholdNum());
  272 + familyList .addAll(familyService.selectByHouseholdNum(main.getHouseholdNum()));
252 273 }
253 274 // Step.3 多sheet处理
254 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 30 public static final Integer IS_CRIME=1;//是
31 31 public static final Integer IS_NOT_CRIME=0;//否
32 32  
33   - @TableId(type = IdType.ASSIGN_ID)
  33 + @TableId(type = IdType.NONE)
34 34 @ApiModelProperty(value = "主键")
35   - private String id;
  35 + private Long id;
36 36 /**创建人*/
37 37 @ApiModelProperty(value = "创建人")
38 38 private String createBy;
... ... @@ -77,6 +77,7 @@ public class Family implements Serializable {
77 77 @ApiModelProperty(value = "与户主的关系")
78 78 private String relation;
79 79 /**行政区划*/
  80 + @Excel(name = "行政区划", width = 15)
80 81 @ApiModelProperty(value = "行政区划")
81 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 31 public class GaDemographic implements Serializable {
32 32 private static final long serialVersionUID = 1L;
33 33  
  34 +
34 35 /**人员编号*/
35 36 @Excel(name = "人员编号", width = 15)
36 37 @ApiModelProperty(value = "人员编号")
... ... @@ -40,6 +41,7 @@ public class GaDemographic implements Serializable {
40 41 @ApiModelProperty(value = "姓名")
41 42 private String xm;
42 43 /**身份证号*/
  44 + @TableId(type = IdType.NONE)
43 45 @Excel(name = "身份证号", width = 15)
44 46 @ApiModelProperty(value = "身份证号")
45 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 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 46 @ApiModelProperty(value = "主键")
47   - private String id;
  47 + private Long id;
48 48 /**创建人*/
49 49 @ApiModelProperty(value = "创建人")
50 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 32 private static final long serialVersionUID = 1L;
33 33  
34 34 /**主键*/
35   - @TableId(type = IdType.ASSIGN_ID)
  35 + @TableId(type = IdType.NONE)
36 36 @ApiModelProperty(value = "主键")
37   - private String id;
  37 + private Long id;
38 38 /**创建人*/
39 39 @ApiModelProperty(value = "创建人")
40 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 56 @ApiModelProperty(value = "出生日期")
57 57 private String birthday;
58 58 /**身份证号*/
  59 + @TableId(type = IdType.NONE)
59 60 @Excel(name = "身份证号", width = 15)
60 61 @ApiModelProperty(value = "身份证号")
61 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&lt;Family&gt; {
27 27 * @return
28 28 */
29 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&lt;Minor&gt; {
35 35 */
36 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 9 household_num = #{householdNum} </delete>
10 10  
11 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 13 FROM mr_family
14 14 WHERE
15 15 household_num = #{householdNum}
16 16 </select>
17 17  
18 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 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 22 </foreach>
23 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 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 43 <if test="sysOrgCode!=null and sysOrgCode!=''">
44 44 and sys_org_code like concat(#{sysOrgCode},'%')
45 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 57 ORDER BY create_time desc
50 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&lt;Family&gt; {
18 18  
19 19 public List<Family> selectByHouseholdNum(String householdNum);
20 20  
  21 + public List<Family> getFamilysByHouseholdNum(String householdNum);
21 22  
22 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&lt;Minor&gt; {
45 45  
46 46  
47 47 public Integer insertBatch(List<Minor> list);
48   -
  48 + /**
  49 + * 分页查询未成年人信息
  50 + * @param page
  51 + * @return
  52 + */
49 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 29 */
30 30 @Service
31 31 public class FamilyServiceImpl extends ServiceImpl<FamilyMapper, Family> implements IFamilyService {
32   -
  32 + private Integer random_number=00000000;
  33 +
33 34 @Resource
34 35 private FamilyMapper familyMapper;
35 36  
... ... @@ -44,7 +45,10 @@ public class FamilyServiceImpl extends ServiceImpl&lt;FamilyMapper, Family&gt; impleme
44 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&lt;GaHouseholdMapper, GaHou
32 32 try {
33 33 long startTime = System.currentTimeMillis();
34 34 List<Family> families = gaHouseholdMapper.getGaHouseholds();
35   - System.out.println("数据查询时间" + (System.currentTimeMillis() - startTime) / 1000 + "秒");
36 35 long startTime2 = System.currentTimeMillis();
37 36 if (oConvertUtils.isNotEmpty(families)) {
38 37 families.stream().forEach(g -> {
... ... @@ -41,7 +40,6 @@ public class GaHouseholdServiceImpl extends ServiceImpl&lt;GaHouseholdMapper, GaHou
41 40 }
42 41 });
43 42 }
44   - System.out.println("数据处理时间" + (System.currentTimeMillis() - startTime2) / 1000 + "秒");
45 43 } catch (Exception e) {
46 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 14 import org.jeecg.modules.system.mapper.FamilyMapper;
15 15 import org.jeecg.modules.system.mapper.MinorMapper;
16 16 import org.jeecg.modules.system.service.IMinorService;
  17 +import org.jeecg.modules.system.util.getRandomId;
17 18 import org.jeecg.modules.system.vo.MinorVo;
18 19 import org.springframework.jdbc.datasource.DataSourceTransactionManager;
19 20 import org.springframework.stereotype.Service;
... ... @@ -56,7 +57,7 @@ public class MinorServiceImpl extends ServiceImpl&lt;MinorMapper, Minor&gt; implements
56 57 @Override
57 58 @Transactional
58 59 public void saveMain(Minor minor, List<Family> familyList) {
59   -
  60 + getRandomId idWorker = new getRandomId(0, 0);
60 61 if(familyList!=null && familyList.size()>0) {
61 62 //判断家庭成员信息里的数据是否包含未成年人,默认包含
62 63 Boolean falg=true;
... ... @@ -71,12 +72,13 @@ public class MinorServiceImpl extends ServiceImpl&lt;MinorMapper, Minor&gt; implements
71 72 if(oConvertUtils.isNotEmpty(entity.getCrime()) && entity.getCrime().equals(Family.IS_CRIME)){
72 73 isCrime=true;
73 74 }
  75 + entity.setId(idWorker.nextId());
74 76 }
75 77 if(isCrime){
76 78 minor.setReason(String.valueOf(Minor.ATTENTION_REASON_CRIME));
77 79 }
78 80 }
79   -
  81 + minor.setId(idWorker.nextId());
80 82 familyMapper.insertBatch(familyList);
81 83 minorMapper.insert(minor);
82 84 }
... ... @@ -159,20 +161,37 @@ public class MinorServiceImpl extends ServiceImpl&lt;MinorMapper, Minor&gt; implements
159 161 if(oConvertUtils.isNotEmpty(list)){
160 162 for(int i=0;i<list.size();i++){
161 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 167 updateStudentWithThreads(list);
166 168 return list.size();
167 169 }
168 170  
  171 + /**
  172 + * 分页查询未成年人信息
  173 + * @param page
  174 + * @return
  175 + */
169 176 @Override
170 177 public IPage<Minor> queryPageList(Page<Minor> page,String name,String sysOrgCode,String isReason) {
171 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&lt;MinorMapper, Minor&gt; implements
185 204 sysOrgCode=sysUser.getOrgCode();
186 205 }
187 206 Date createTime=new Date();
  207 + getRandomId idWorker = new getRandomId(0, 0);
188 208 //存放户号和犯罪的某一个家庭成员信息
189 209 Map<String,Family> houseFamily=new HashMap<>();
190 210 if(oConvertUtils.isNotEmpty(familyList) ){
... ... @@ -196,6 +216,7 @@ public class MinorServiceImpl extends ServiceImpl&lt;MinorMapper, Minor&gt; implements
196 216 if(oConvertUtils.isNotEmpty(family.getCrime()) && family.getCrime().equals(Family.IS_CRIME) && oConvertUtils.isNotEmpty(family.getHouseholdNum())){
197 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&lt;MinorMapper, Minor&gt; implements
204 225 minors.stream().forEach(minor -> {
205 226 if(oConvertUtils.isNotEmpty(minor)){
206 227 minor.setCreateTime(createTime);
  228 + minor.setId(idWorker.nextId());
207 229 if(oConvertUtils.isNotEmpty(houseFamily) && oConvertUtils.isNotEmpty(minor.getHouseholdNum())){
208 230 String houseNum=minor.getHouseholdNum();
209 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&lt;MrSchoolMapper, MrSchool&gt; i
50 50 if(oConvertUtils.isNotEmpty(list)){
51 51 for(int i=0;i<list.size();i++){
52 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 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 18 /**
19 19 * 机器id所占的位数
20 20 */
21   - private final long workerIdBits = 5L;
  21 + private final long workerIdBits = 1L;
22 22  
23 23 /**
24 24 * 数据标识id所占的位数
25 25 */
26   - private final long datacenterIdBits = 5L;
  26 + private final long datacenterIdBits = 1L;
27 27  
28 28 /**
29 29 * 支持的最大机器id,结果是31 (这个移位算法可以很快的计算出几位二进制数所能表示的最大十进制数)
... ... @@ -38,7 +38,7 @@ public class getRandomId {
38 38 /**
39 39 * 序列在id中占的位数
40 40 */
41   - private final long sequenceBits = 12L;
  41 + private final long sequenceBits = 1L;
42 42  
43 43 /**
44 44 * 机器ID向左移12位
... ... @@ -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

16.6 KB | W: | H:

8.79 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
juvenile-prosecution-vue/src/components/page/GlobalFooter.vue
... ... @@ -3,7 +3,7 @@
3 3 <div class="copyright">
4 4 Copyright
5 5 <a-icon type="copyright"/>
6   - 2021 <span></span>
  6 + 2022 <span></span>
7 7 </div>
8 8 </div>
9 9 </template>
... ...
juvenile-prosecution-vue/src/views/business/MinorList.vue
... ... @@ -12,6 +12,7 @@
12 12 <a-col :md="6" :sm="12">
13 13 <a-form-item label="是否重点关注">
14 14 <a-select v-model="queryParam.isReason" placeholder="请选择" >
  15 + <a-select-option value="0">全部</a-select-option>
15 16 <a-select-option value="1">是</a-select-option>
16 17 <a-select-option value="2">否</a-select-option>
17 18 </a-select>
... ... @@ -234,7 +235,7 @@ export default {
234 235 deleteBatch: '/sys/minor/deleteBatch',
235 236 exportXlsUrl: '/sys/minor/exportXls',
236 237 importExcelUrl: 'sys/minor/importExcel',
237   - familys: '/sys/minor/queryFamilyByMainId'
  238 + familys: '/sys/minor/getFamilysByHouseholdNum'
238 239 },
239 240 dictOptions: {},
240 241 superFieldList: [],
... ... @@ -312,7 +313,11 @@ export default {
312 313 showQuickJumper: true,
313 314 total: 0
314 315 },
315   - familyLoading: false
  316 + familyLoading: false,
  317 + queryParam:{
  318 + name:'',
  319 + isReason:'0'
  320 + }
316 321 }
317 322 },
318 323 created() {
... ... @@ -324,6 +329,35 @@ export default {
324 329 }
325 330 },
326 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 361 getAgeByIdentity(identity) {
328 362 return GetAge(identity)
329 363 },
... ... @@ -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 382 initDictConfig() {
381 383 },
382 384 getSuperFieldList() {
... ...
juvenile-prosecution-vue/src/views/business/modules/MinorModal.vue
... ... @@ -301,6 +301,7 @@ export default {
301 301 },
302 302 edit(record) {
303 303 this.model = Object.assign({}, record)
  304 + this.dataSource=[]
304 305 this.visible = true
305 306 // 加载子表数据
306 307 if (this.model.householdNum) {
... ... @@ -310,9 +311,10 @@ export default {
310 311 },
311 312 /** 查询某个tab的数据 */
312 313 requestTableData(url, params) {
  314 + console.log("单一查询")
313 315 this.familyLoading = true
314 316 getAction(url, params).then(res => {
315   - console.log(this.dataSource)
  317 + console.log(res)
316 318 this.dataSource = res.result || []
317 319 console.log(this.dataSource)
318 320 }).finally(() => {
... ...
juvenile-prosecution-vue/src/views/system/DepartList.vue
... ... @@ -117,11 +117,11 @@
117 117 </a-card>
118 118 <a-card v-else >
119 119 <a-empty>
120   - <span slot="description"> 请先选择一个机构! </span>
  120 + <span slot="description"> 请先选择一个单位! </span>
121 121 </a-empty>
122 122 </a-card>
123 123 </a-tab-pane>
124   - <a-tab-pane tab="机构权限" key="2" forceRender>
  124 + <a-tab-pane tab="单位权限" key="2" forceRender>
125 125 <depart-auth-modal ref="departAuth"/>
126 126 </a-tab-pane>
127 127 </a-tabs>
... ...
juvenile-prosecution-vue/src/views/system/UserList.vue
... ... @@ -86,7 +86,6 @@
86 86 <a-icon type="down"/>
87 87 </a-button>
88 88 </a-dropdown>
89   - <j-super-query :fieldList="superQueryFieldList" @handleSuperQuery="handleSuperQuery"/>
90 89 <a-button @click="doAnalyze" type="primary" icon="control-outlined" >数据分析</a-button>
91 90 </div>
92 91  
... ...
juvenile-prosecution-vue/src/views/system/modules/DepartAuthModal.vue
... ... @@ -44,7 +44,7 @@
44 44 </template>
45 45 <a-card v-else :bordered="false" style="height:200px">
46 46 <a-empty>
47   - <span slot="description"> 请先选择一个部门! </span>
  47 + <span slot="description"> 请先选择一个单位! </span>
48 48 </a-empty>
49 49 </a-card>
50 50 <depart-datarule-modal ref="datarule"/>
... ...