Commit d207eac94a37e0a64fac0806b4ff393a25a7b219

Authored by wxy
1 parent d1a8496e

添加根据身份证号、学校、家庭住址、重点关注原因、性别、年龄范围查询

juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/handle/service/SparkEtlService.java
@@ -88,8 +88,8 @@ public class SparkEtlService implements Serializable { @@ -88,8 +88,8 @@ public class SparkEtlService implements Serializable {
88 //家庭成员数据 88 //家庭成员数据
89 List<Family> families = new ArrayList<Family>(); 89 List<Family> families = new ArrayList<Family>();
90 for (Minor minor : minors) { 90 for (Minor minor : minors) {
91 - if (null != minor.getFamilies() && !minor.getFamilies().isEmpty()) {  
92 - families.addAll(minor.getFamilies()); 91 + if (null != minor.getFamilyList() && !minor.getFamilyList().isEmpty()) {
  92 + families.addAll(minor.getFamilyList());
93 } 93 }
94 } 94 }
95 this.saveMinor(minors); 95 this.saveMinor(minors);
juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/AnalyzeController.java
@@ -742,9 +742,7 @@ public class AnalyzeController extends JeecgController&lt;GaDemographic, IGaDemogra @@ -742,9 +742,7 @@ public class AnalyzeController extends JeecgController&lt;GaDemographic, IGaDemogra
742 Map<String, Family> guardians = new HashMap<>(); 742 Map<String, Family> guardians = new HashMap<>();
743 Date createTime = new Date(); 743 Date createTime = new Date();
744 if (oConvertUtils.isNotEmpty(gaHouseholds)) { 744 if (oConvertUtils.isNotEmpty(gaHouseholds)) {
745 - getRandomId idWorker = new getRandomId(0, 0);  
746 for (Map.Entry<String, Family> m : gaHouseholds.entrySet()) { 745 for (Map.Entry<String, Family> m : gaHouseholds.entrySet()) {
747 - long id = idWorker.nextId();  
748 String mapKey = m.getKey(); 746 String mapKey = m.getKey();
749 Family family = m.getValue(); 747 Family family = m.getValue();
750 if (oConvertUtils.isNotEmpty(family)) { 748 if (oConvertUtils.isNotEmpty(family)) {
@@ -830,7 +828,7 @@ public class AnalyzeController extends JeecgController&lt;GaDemographic, IGaDemogra @@ -830,7 +828,7 @@ public class AnalyzeController extends JeecgController&lt;GaDemographic, IGaDemogra
830 testIdCards.add(houseNum); 828 testIdCards.add(houseNum);
831 } 829 }
832 } 830 }
833 - minor.setFamilies(f); 831 + minor.setFamilyList(f);
834 //获取监护人 832 //获取监护人
835 if (oConvertUtils.isNotEmpty(houseNum) && oConvertUtils.isNotEmpty(guardians) && oConvertUtils.isNotEmpty(guardians.get(houseNum))) { 833 if (oConvertUtils.isNotEmpty(houseNum) && oConvertUtils.isNotEmpty(guardians) && oConvertUtils.isNotEmpty(guardians.get(houseNum))) {
836 minor.setGuardian(guardians.get(houseNum).getName()); 834 minor.setGuardian(guardians.get(houseNum).getName());
juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/controller/MinorController.java
@@ -98,7 +98,8 @@ public class MinorController { @@ -98,7 +98,8 @@ public class MinorController {
98 public Result<?> queryPageList(Minor minor, 98 public Result<?> queryPageList(Minor minor,
99 @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, 99 @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
100 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, 100 @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
101 - HttpServletRequest req) { 101 + HttpServletRequest req,@RequestParam(name = "column", defaultValue = "age") String column,
  102 + @RequestParam(name = "order", defaultValue = "asc") String order) {
102 QueryWrapper<Minor> queryWrapper = QueryGenerator.initQueryWrapper(minor, req.getParameterMap()); 103 QueryWrapper<Minor> queryWrapper = QueryGenerator.initQueryWrapper(minor, req.getParameterMap());
103 Page<Minor> page = new Page<Minor>(pageNo, pageSize); 104 Page<Minor> page = new Page<Minor>(pageNo, pageSize);
104 // IPage<Minor> pageList = minorService.page(page, queryWrapper); 105 // IPage<Minor> pageList = minorService.page(page, queryWrapper);
@@ -111,32 +112,23 @@ public class MinorController { @@ -111,32 +112,23 @@ public class MinorController {
111 // if(oConvertUtils.isNotEmpty(minor) && oConvertUtils.isNotEmpty(minor.getIsReason()) && minor.getIsReason().equals("1")){ 112 // if(oConvertUtils.isNotEmpty(minor) && oConvertUtils.isNotEmpty(minor.getIsReason()) && minor.getIsReason().equals("1")){
112 // isReason=minor.getIsReason(); 113 // isReason=minor.getIsReason();
113 // } 114 // }
114 - IPage<Minor> pageList = minorService.queryPageList(page,minor.getName(),sysOrgCode,minor.getIsReason()); 115 + IPage<Minor> pageList = minorService.queryPageList(page,minor.getName(),sysOrgCode,minor.getIsReason(),minor.getIdentity(),minor.getSchoolName(),
  116 + minor.getGender(),minor.getReason(),minor.getAddress(),minor.getAge(),column,order);
115 return Result.OK(pageList); 117 return Result.OK(pageList);
116 } 118 }
117 119
118 /** 120 /**
119 * 添加 121 * 添加
120 * 122 *
121 - * @param minorPage 123 + * @param minor
122 * @return 124 * @return
123 */ 125 */
124 @AutoLog(value = "未成年人-添加") 126 @AutoLog(value = "未成年人-添加")
125 @ApiOperation(value = "未成年人-添加", notes = "未成年人-添加") 127 @ApiOperation(value = "未成年人-添加", notes = "未成年人-添加")
126 @PostMapping(value = "/add") 128 @PostMapping(value = "/add")
127 - public Result<?> add(@RequestBody MinorPage minorPage) {  
128 -// Integer count=0;  
129 -// if(oConvertUtils.isNotEmpty(minorPage) && oConvertUtils.isNotEmpty(minorPage.getIdentity())){  
130 -// count=minorService.getMinorByIdCard(minorPage.getIdentity());  
131 -// }  
132 -// if(count==0){  
133 - Minor minor = new Minor();  
134 - BeanUtils.copyProperties(minorPage, minor);  
135 - minorService.saveMain(minor, minorPage.getFamilyList()); 129 + public Result<?> add(@RequestBody Minor minor) {
  130 + minorService.saveMain(minor, minor.getFamilyList());
136 return Result.OK("添加成功!"); 131 return Result.OK("添加成功!");
137 -// }else {  
138 -// return Result.error("身份证号重复!");  
139 -// }  
140 } 132 }
141 133
142 /** 134 /**
@@ -151,7 +143,7 @@ public class MinorController { @@ -151,7 +143,7 @@ public class MinorController {
151 public Result<?> edit(@RequestBody MinorPage minorPage) { 143 public Result<?> edit(@RequestBody MinorPage minorPage) {
152 Minor minor = new Minor(); 144 Minor minor = new Minor();
153 BeanUtils.copyProperties(minorPage, minor); 145 BeanUtils.copyProperties(minorPage, minor);
154 - Minor minorEntity = minorService.getById(minor.getId()); 146 + Minor minorEntity = minorService.getById(minorPage.getId());
155 if (minorEntity == null) { 147 if (minorEntity == null) {
156 return Result.error("未找到对应数据"); 148 return Result.error("未找到对应数据");
157 } 149 }
@@ -215,7 +207,7 @@ public class MinorController { @@ -215,7 +207,7 @@ public class MinorController {
215 @ApiOperation(value = "家庭成员表主表householdNum查询", notes = "家庭成员表-通主表householdNum查询") 207 @ApiOperation(value = "家庭成员表主表householdNum查询", notes = "家庭成员表-通主表householdNum查询")
216 @GetMapping(value = "/queryFamilyByMainId") 208 @GetMapping(value = "/queryFamilyByMainId")
217 public Result<?> queryFamilyListByMainId(@RequestParam(name = "householdNum", required = true) String householdNum) { 209 public Result<?> queryFamilyListByMainId(@RequestParam(name = "householdNum", required = true) String householdNum) {
218 - List<Family> familyList = familyService.selectByHouseholdNum(householdNum); 210 + List<Family> familyList = familyService.getFamilysByHouseholdNum(householdNum);
219 return Result.OK(familyList); 211 return Result.OK(familyList);
220 } 212 }
221 213
@@ -241,7 +233,8 @@ public class MinorController { @@ -241,7 +233,8 @@ public class MinorController {
241 */ 233 */
242 @RequestMapping(value = "/exportXls") 234 @RequestMapping(value = "/exportXls")
243 public ModelAndView exportXls(HttpServletRequest request, Minor minor, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, 235 public ModelAndView exportXls(HttpServletRequest request, Minor minor, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
244 - @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize) { 236 + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,@RequestParam(name = "column", defaultValue = "age") String column,
  237 + @RequestParam(name = "order", defaultValue = "asc") String order) {
245 // Step.1 组装查询条件查询数据 238 // Step.1 组装查询条件查询数据
246 // 过滤选中数据 239 // 过滤选中数据
247 String selections = request.getParameter("selections"); 240 String selections = request.getParameter("selections");
@@ -258,7 +251,8 @@ public class MinorController { @@ -258,7 +251,8 @@ public class MinorController {
258 if(oConvertUtils.isNotEmpty(sysUser) && oConvertUtils.isNotEmpty(sysUser.getOrgCode())){ 251 if(oConvertUtils.isNotEmpty(sysUser) && oConvertUtils.isNotEmpty(sysUser.getOrgCode())){
259 sysOrgCode=sysUser.getOrgCode(); 252 sysOrgCode=sysUser.getOrgCode();
260 } 253 }
261 - IPage<Minor> pageList = minorService.queryPageList(page,minor.getName(),sysOrgCode,minor.getIsReason()); 254 + IPage<Minor> pageList = minorService.queryPageList(page,minor.getName(),sysOrgCode,minor.getIsReason(),minor.getIdentity(),minor.getSchoolName(),
  255 + minor.getGender(),minor.getReason(),minor.getAddress(),minor.getAge(),column,order);
262 //Step.2 获取导出数据 256 //Step.2 获取导出数据
263 List<Minor> queryList = pageList.getRecords(); 257 List<Minor> queryList = pageList.getRecords();
264 List<Minor> minorList = new ArrayList<Minor>(); 258 List<Minor> minorList = new ArrayList<Minor>();
juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/entity/Family.java
@@ -13,6 +13,9 @@ import org.jeecgframework.poi.excel.annotation.Excel; @@ -13,6 +13,9 @@ import org.jeecgframework.poi.excel.annotation.Excel;
13 import java.util.Date; 13 import java.util.Date;
14 import io.swagger.annotations.ApiModel; 14 import io.swagger.annotations.ApiModel;
15 import io.swagger.annotations.ApiModelProperty; 15 import io.swagger.annotations.ApiModelProperty;
  16 +import shaded.parquet.com.fasterxml.jackson.databind.annotation.JsonSerialize;
  17 +import shaded.parquet.com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
  18 +
16 import java.io.UnsupportedEncodingException; 19 import java.io.UnsupportedEncodingException;
17 20
18 /** 21 /**
@@ -32,7 +35,7 @@ public class Family implements Serializable { @@ -32,7 +35,7 @@ public class Family implements Serializable {
32 35
33 @TableId(type = IdType.NONE) 36 @TableId(type = IdType.NONE)
34 @ApiModelProperty(value = "主键") 37 @ApiModelProperty(value = "主键")
35 - private Long id; 38 + private String id;
36 /**创建人*/ 39 /**创建人*/
37 @ApiModelProperty(value = "创建人") 40 @ApiModelProperty(value = "创建人")
38 private String createBy; 41 private String createBy;
juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/entity/Minor.java
@@ -43,8 +43,9 @@ public class Minor implements Serializable { @@ -43,8 +43,9 @@ public class Minor implements Serializable {
43 43
44 /**主键*/ 44 /**主键*/
45 @TableId(type = IdType.NONE) 45 @TableId(type = IdType.NONE)
  46 + @JsonFormat(shape = JsonFormat.Shape.STRING)
46 @ApiModelProperty(value = "主键") 47 @ApiModelProperty(value = "主键")
47 - private Long id; 48 + private String id;
48 /**创建人*/ 49 /**创建人*/
49 @ApiModelProperty(value = "创建人") 50 @ApiModelProperty(value = "创建人")
50 private String createBy; 51 private String createBy;
@@ -135,11 +136,17 @@ public class Minor implements Serializable { @@ -135,11 +136,17 @@ public class Minor implements Serializable {
135 private String division; 136 private String division;
136 137
137 @TableField(exist = false) 138 @TableField(exist = false)
138 - private List<Family> families; 139 + private List<Family> familyList;
139 140
140 @TableField(exist = false) 141 @TableField(exist = false)
141 private String age; 142 private String age;
142 143
143 @TableField(exist = false) 144 @TableField(exist = false)
144 private String isReason; 145 private String isReason;
  146 +
  147 + @TableField(exist = false)
  148 + private String column;
  149 +
  150 + @TableField(exist = false)
  151 + private String order;
145 } 152 }
juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/MinorMapper.java
@@ -26,7 +26,9 @@ public interface MinorMapper extends BaseMapper&lt;Minor&gt; { @@ -26,7 +26,9 @@ public interface MinorMapper extends BaseMapper&lt;Minor&gt; {
26 * @param page 26 * @param page
27 * @return 27 * @return
28 */ 28 */
29 - IPage<Minor> queryPageList(Page page,@Param("name") String name,@Param("sysOrgCode") String sysOrgCode,@Param("isReason")String isReason); 29 + IPage<Minor> queryPageList(Page page,@Param("name") String name,@Param("sysOrgCode") String sysOrgCode,@Param("isReason")String isReason,
  30 + @Param("identity") String identity,@Param("schoolName") String schoolName,@Param("gender")Integer gender,@Param("reason") String reason,
  31 + @Param("address") String address,@Param("age")String age,@Param("column") String column,@Param("order")String order);
30 32
31 /** 33 /**
32 * 根据身份证号查询总数 34 * 根据身份证号查询总数
juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/mapper/xml/MinorMapper.xml
@@ -40,6 +40,21 @@ @@ -40,6 +40,21 @@
40 <if test="name!=null and name!=''"> 40 <if test="name!=null and name!=''">
41 and name like concat('%',#{name},'%') 41 and name like concat('%',#{name},'%')
42 </if> 42 </if>
  43 + <if test="identity!=null and identity!=''">
  44 + and identity =#{identity}
  45 + </if>
  46 + <if test="schoolName!=null and schoolName!=''">
  47 + and school_name like concat('%',#{schoolName},'%')
  48 + </if>
  49 + <if test="gender!=null">
  50 + and gender =#{gender}
  51 + </if>
  52 + <if test="reason!=null and reason!=''">
  53 + and reason like concat('%',#{reason},'%')
  54 + </if>
  55 + <if test="address!=null and address!=''">
  56 + and address like concat('%',#{address},'%')
  57 + </if>
43 <if test="sysOrgCode!=null and sysOrgCode!=''"> 58 <if test="sysOrgCode!=null and sysOrgCode!=''">
44 and sys_org_code like concat(#{sysOrgCode},'%') 59 and sys_org_code like concat(#{sysOrgCode},'%')
45 </if> 60 </if>
@@ -54,7 +69,44 @@ @@ -54,7 +69,44 @@
54 69
55 </otherwise> 70 </otherwise>
56 </choose> 71 </choose>
57 - ORDER BY create_time desc 72 + <choose>
  73 + <when test='age=="6"'>
  74 + and ((timestampdiff(year, substring(identity, 7, 8), now())) <![CDATA[>=]]> 0 and (timestampdiff(year, substring(identity, 7, 8), now())) <![CDATA[<=]]> 6)
  75 + </when>
  76 + <when test='age=="12"'>
  77 + and ((timestampdiff(year, substring(identity, 7, 8), now())) <![CDATA[>=]]> 6 and (timestampdiff(year, substring(identity, 7, 8), now())) <![CDATA[<=]]> 12)
  78 + </when>
  79 + <when test='age=="18"'>
  80 + and ((timestampdiff(year, substring(identity, 7, 8), now())) <![CDATA[>=]]> 12 and (timestampdiff(year, substring(identity, 7, 8), now())) <![CDATA[<=]]> 18)
  81 + </when>
  82 + </choose>
  83 + <choose>
  84 + <when test='column!=null and column!="" and order!=null and order!="" and column =="age" and order=="asc"'>
  85 + ORDER BY (timestampdiff(year, substring(identity, 7, 8), now())) asc
  86 + </when>
  87 + <when test='column!=null and column!="" and order!=null and order!="" and column =="age" and order=="desc"'>
  88 + ORDER BY (timestampdiff(year, substring(identity, 7, 8), now())) desc
  89 + </when>
  90 + <when test='column!=null and column!="" and order!=null and order!="" and column =="schoolName" and order=="asc"'>
  91 + ORDER BY (timestampdiff(year, substring(identity, 7, 8), now())) asc,school_name asc
  92 + </when>
  93 + <when test='column!=null and column!="" and order!=null and order!="" and column =="schoolName" and order=="desc"'>
  94 + ORDER BY (timestampdiff(year, substring(identity, 7, 8), now())) asc,school_name desc
  95 + </when>
  96 + <when test='column!=null and column!="" and order!=null and order!="" and column =="address" and order=="asc"'>
  97 + ORDER BY (timestampdiff(year, substring(identity, 7, 8), now())) asc,address asc
  98 + </when>
  99 + <when test='column!=null and column!="" and order!=null and order!="" and column =="address" and order=="desc"'>
  100 + ORDER BY (timestampdiff(year, substring(identity, 7, 8), now())) asc,address desc
  101 + </when>
  102 + <when test='column!=null and column!="" and order!=null and order!="" and column =="reason" and order=="asc"'>
  103 + ORDER BY (timestampdiff(year, substring(identity, 7, 8), now())) asc,reason asc
  104 + </when>
  105 + <when test='column!=null and column!="" and order!=null and order!="" and column =="reason" and order=="desc"'>
  106 + ORDER BY (timestampdiff(year, substring(identity, 7, 8), now())) asc,reason desc
  107 + </when>
  108 + </choose>
  109 +
58 </select> 110 </select>
59 111
60 <select id="getMinorByIdCard" parameterType="java.lang.String" > 112 <select id="getMinorByIdCard" parameterType="java.lang.String" >
juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/IMinorService.java
@@ -50,7 +50,8 @@ public interface IMinorService extends IService&lt;Minor&gt; { @@ -50,7 +50,8 @@ public interface IMinorService extends IService&lt;Minor&gt; {
50 * @param page 50 * @param page
51 * @return 51 * @return
52 */ 52 */
53 - 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,String identity,String schoolName,Integer gender,String reason,
  54 + String address,String age,String column,String order);
54 55
55 /** 56 /**
56 * 查询未成年人信息 57 * 查询未成年人信息
juvenile-prosecution-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/system/service/impl/MinorServiceImpl.java
@@ -58,6 +58,7 @@ public class MinorServiceImpl extends ServiceImpl&lt;MinorMapper, Minor&gt; implements @@ -58,6 +58,7 @@ public class MinorServiceImpl extends ServiceImpl&lt;MinorMapper, Minor&gt; implements
58 @Transactional 58 @Transactional
59 public void saveMain(Minor minor, List<Family> familyList) { 59 public void saveMain(Minor minor, List<Family> familyList) {
60 getRandomId idWorker = new getRandomId(0, 0); 60 getRandomId idWorker = new getRandomId(0, 0);
  61 + String reason="";
61 if(familyList!=null && familyList.size()>0) { 62 if(familyList!=null && familyList.size()>0) {
62 //判断家庭成员信息里的数据是否包含未成年人,默认包含 63 //判断家庭成员信息里的数据是否包含未成年人,默认包含
63 Boolean falg=true; 64 Boolean falg=true;
@@ -72,13 +73,18 @@ public class MinorServiceImpl extends ServiceImpl&lt;MinorMapper, Minor&gt; implements @@ -72,13 +73,18 @@ public class MinorServiceImpl extends ServiceImpl&lt;MinorMapper, Minor&gt; implements
72 if(oConvertUtils.isNotEmpty(entity.getCrime()) && entity.getCrime().equals(Family.IS_CRIME)){ 73 if(oConvertUtils.isNotEmpty(entity.getCrime()) && entity.getCrime().equals(Family.IS_CRIME)){
73 isCrime=true; 74 isCrime=true;
74 } 75 }
75 - entity.setId(idWorker.nextId()); 76 + entity.setId(String.valueOf(idWorker.nextId()));
76 } 77 }
77 if(isCrime){ 78 if(isCrime){
78 - minor.setReason(String.valueOf(Minor.ATTENTION_REASON_CRIME)); 79 + if(oConvertUtils.isNotEmpty(minor.getReason()) && minor.getReason().contains("家庭成员有犯罪记录")){
  80 + reason=minor.getReason()+","+"家庭成员有犯罪记录";
  81 + }else {
  82 + reason="家庭成员有犯罪记录";
  83 + }
79 } 84 }
80 } 85 }
81 - minor.setId(idWorker.nextId()); 86 + minor.setReason(reason);
  87 + minor.setId(String.valueOf(idWorker.nextId()));
82 familyMapper.insertBatch(familyList); 88 familyMapper.insertBatch(familyList);
83 minorMapper.insert(minor); 89 minorMapper.insert(minor);
84 } 90 }
@@ -106,25 +112,13 @@ public class MinorServiceImpl extends ServiceImpl&lt;MinorMapper, Minor&gt; implements @@ -106,25 +112,13 @@ public class MinorServiceImpl extends ServiceImpl&lt;MinorMapper, Minor&gt; implements
106 isCrime=true; 112 isCrime=true;
107 } 113 }
108 } 114 }
109 -// if(!falg){  
110 -// Family family=new Family();  
111 -// family.setCrime(Family.IS_NOT_CRIME);  
112 -// family.setName(minor.getName());  
113 -// family.setHouseholdNum(minor.getHouseholdNum());  
114 -// family.setIdentity(minor.getIdentity());  
115 -// family.setNumber(minor.getNumber());  
116 -// family.setGender(minor.getGender());  
117 -// family.setAddress(minor.getAddress());  
118 -// family.setRelation(minor.getRelation());  
119 -// families.add(family);  
120 -// }  
121 if(isCrime){ 115 if(isCrime){
122 if(oConvertUtils.isNotEmpty(minor.getReason())){ 116 if(oConvertUtils.isNotEmpty(minor.getReason())){
123 if(!minor.getReason().contains(String.valueOf(Minor.ATTENTION_REASON_CRIME))){ 117 if(!minor.getReason().contains(String.valueOf(Minor.ATTENTION_REASON_CRIME))){
124 - minor.setReason(minor.getReason()+","+Minor.ATTENTION_REASON_CRIME); 118 + minor.setReason(minor.getReason()+","+"家庭成员有犯罪记录");
125 } 119 }
126 }else { 120 }else {
127 - minor.setReason(String.valueOf(Minor.ATTENTION_REASON_CRIME)); 121 + minor.setReason("家庭成员有犯罪记录");
128 } 122 }
129 } 123 }
130 familyMapper.insertBatch(familyList); 124 familyMapper.insertBatch(familyList);
@@ -161,7 +155,7 @@ public class MinorServiceImpl extends ServiceImpl&lt;MinorMapper, Minor&gt; implements @@ -161,7 +155,7 @@ public class MinorServiceImpl extends ServiceImpl&lt;MinorMapper, Minor&gt; implements
161 if(oConvertUtils.isNotEmpty(list)){ 155 if(oConvertUtils.isNotEmpty(list)){
162 for(int i=0;i<list.size();i++){ 156 for(int i=0;i<list.size();i++){
163 String id=System.currentTimeMillis()+String.valueOf((random_number+i)); 157 String id=System.currentTimeMillis()+String.valueOf((random_number+i));
164 - list.get(i).setId(Long.valueOf(id)); 158 + list.get(i).setId(id);
165 } 159 }
166 } 160 }
167 updateStudentWithThreads(list); 161 updateStudentWithThreads(list);
@@ -174,8 +168,9 @@ public class MinorServiceImpl extends ServiceImpl&lt;MinorMapper, Minor&gt; implements @@ -174,8 +168,9 @@ public class MinorServiceImpl extends ServiceImpl&lt;MinorMapper, Minor&gt; implements
174 * @return 168 * @return
175 */ 169 */
176 @Override 170 @Override
177 - public IPage<Minor> queryPageList(Page<Minor> page,String name,String sysOrgCode,String isReason) {  
178 - return minorMapper.queryPageList(page,name,sysOrgCode,isReason); 171 + public IPage<Minor> queryPageList(Page<Minor> page,String name,String sysOrgCode,String isReason,String identity,String schoolName,Integer gender,String reason,
  172 + String address,String age,String column,String order) {
  173 + return minorMapper.queryPageList(page,name,sysOrgCode,isReason,identity,schoolName,gender,reason,address,age,column,order);
179 } 174 }
180 175
181 /** 176 /**
@@ -216,7 +211,7 @@ public class MinorServiceImpl extends ServiceImpl&lt;MinorMapper, Minor&gt; implements @@ -216,7 +211,7 @@ public class MinorServiceImpl extends ServiceImpl&lt;MinorMapper, Minor&gt; implements
216 if(oConvertUtils.isNotEmpty(family.getCrime()) && family.getCrime().equals(Family.IS_CRIME) && oConvertUtils.isNotEmpty(family.getHouseholdNum())){ 211 if(oConvertUtils.isNotEmpty(family.getCrime()) && family.getCrime().equals(Family.IS_CRIME) && oConvertUtils.isNotEmpty(family.getHouseholdNum())){
217 houseFamily.put(family.getHouseholdNum(),family); 212 houseFamily.put(family.getHouseholdNum(),family);
218 } 213 }
219 - family.setId(idWorker.nextId()); 214 + family.setId(String.valueOf(idWorker.nextId()));
220 } 215 }
221 }); 216 });
222 } 217 }
@@ -225,7 +220,7 @@ public class MinorServiceImpl extends ServiceImpl&lt;MinorMapper, Minor&gt; implements @@ -225,7 +220,7 @@ public class MinorServiceImpl extends ServiceImpl&lt;MinorMapper, Minor&gt; implements
225 minors.stream().forEach(minor -> { 220 minors.stream().forEach(minor -> {
226 if(oConvertUtils.isNotEmpty(minor)){ 221 if(oConvertUtils.isNotEmpty(minor)){
227 minor.setCreateTime(createTime); 222 minor.setCreateTime(createTime);
228 - minor.setId(idWorker.nextId()); 223 + minor.setId(String.valueOf(idWorker.nextId()));
229 if(oConvertUtils.isNotEmpty(houseFamily) && oConvertUtils.isNotEmpty(minor.getHouseholdNum())){ 224 if(oConvertUtils.isNotEmpty(houseFamily) && oConvertUtils.isNotEmpty(minor.getHouseholdNum())){
230 String houseNum=minor.getHouseholdNum(); 225 String houseNum=minor.getHouseholdNum();
231 Family family=houseFamily.get(houseNum); 226 Family family=houseFamily.get(houseNum);
@@ -264,9 +259,9 @@ public class MinorServiceImpl extends ServiceImpl&lt;MinorMapper, Minor&gt; implements @@ -264,9 +259,9 @@ public class MinorServiceImpl extends ServiceImpl&lt;MinorMapper, Minor&gt; implements
264 list.forEach(s -> { 259 list.forEach(s -> {
265 if(oConvertUtils.isNotEmpty(s)){ 260 if(oConvertUtils.isNotEmpty(s)){
266 minorMapper.insert(s); 261 minorMapper.insert(s);
267 - if(oConvertUtils.isNotEmpty(s.getFamilies())){  
268 - if(s.getFamilies().size()>0){  
269 - familyMapper.insertBatch(s.getFamilies()); 262 + if(oConvertUtils.isNotEmpty(s.getFamilyList())){
  263 + if(s.getFamilyList().size()>0){
  264 + familyMapper.insertBatch(s.getFamilyList());
270 } 265 }
271 } 266 }
272 } 267 }
juvenile-prosecution-vue/src/views/business/MinorList.vue
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <a-card :bordered="false"> 2 <a-card :bordered="false">
3 <!-- 查询区域 --> 3 <!-- 查询区域 -->
4 <div class="table-page-search-wrapper"> 4 <div class="table-page-search-wrapper">
5 - <a-form layout="inline" @keyup.enter.native="searchQuery"> 5 + <a-form layout="inline" @keyup.enter.native="searchQuery" :label-col="labelCol" labelAlign="right">
6 <a-row :gutter="24"> 6 <a-row :gutter="24">
7 <a-col :md="6" :sm="12"> 7 <a-col :md="6" :sm="12">
8 <a-form-item label="姓名"> 8 <a-form-item label="姓名">
@@ -10,7 +10,17 @@ @@ -10,7 +10,17 @@
10 </a-form-item> 10 </a-form-item>
11 </a-col> 11 </a-col>
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-input placeholder="输入身份证号查询" v-model="queryParam.identity"></a-input>
  15 + </a-form-item>
  16 + </a-col>
  17 + <a-col :md="6" :sm="8">
  18 + <a-form-item label="性别">
  19 + <j-dict-select-tag v-model="queryParam.gender" dictCode="sex" placeholder="请选择性别" />
  20 + </a-form-item>
  21 + </a-col>
  22 + <a-col :md="6" :sm="12">
  23 + <a-form-item label="重点关注" :label-col="labelCol2">
14 <a-select v-model="queryParam.isReason" placeholder="请选择" > 24 <a-select v-model="queryParam.isReason" placeholder="请选择" >
15 <a-select-option value="0">全部</a-select-option> 25 <a-select-option value="0">全部</a-select-option>
16 <a-select-option value="1">是</a-select-option> 26 <a-select-option value="1">是</a-select-option>
@@ -18,21 +28,42 @@ @@ -18,21 +28,42 @@
18 </a-select> 28 </a-select>
19 </a-form-item> 29 </a-form-item>
20 </a-col> 30 </a-col>
21 - <a-col :md="6" :sm="8">  
22 - <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">  
23 - <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>  
24 - </span> 31 + <a-col :md="6" :sm="12">
  32 + <a-form-item label="学校">
  33 + <a-input placeholder="输入学校名称查询" v-model="queryParam.schoolName"></a-input>
  34 + </a-form-item>
  35 + </a-col>
  36 + <a-col :md="6" :sm="12">
  37 + <a-form-item label="家庭住址">
  38 + <a-input placeholder="输入家庭住址查询" v-model="queryParam.address"></a-input>
  39 + </a-form-item>
  40 + </a-col>
  41 + <a-col :md="6" :sm="12">
  42 + <a-form-item label="年龄">
  43 + <a-select v-model="queryParam.age" placeholder="请选择" >
  44 + <a-select-option value="0">全部</a-select-option>
  45 + <a-select-option value="6">6岁以下</a-select-option>
  46 + <a-select-option value="12">6岁-12岁</a-select-option>
  47 + <a-select-option value="18">12岁-18岁</a-select-option>
  48 + </a-select>
  49 + </a-form-item>
  50 + </a-col>
  51 + <a-col :md="6" :sm="12">
  52 + <a-form-item label="重点关注原因" :label-col="labelCol2">
  53 + <a-input placeholder="输入重点关注原因查询" v-model="queryParam.reason"></a-input>
  54 + </a-form-item>
25 </a-col> 55 </a-col>
26 </a-row> 56 </a-row>
27 </a-form> 57 </a-form>
28 58
29 - <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button> 59 + <a-button @click="handleAdd" type="primary" icon="plus" >新增</a-button>
30 <a-button type="primary" icon="download" @click="handleExportXls('未检人员模板')" style="margin-left:8px;">模板导出 60 <a-button type="primary" icon="download" @click="handleExportXls('未检人员模板')" style="margin-left:8px;">模板导出
31 </a-button> 61 </a-button>
32 <a-upload style="margin-left:8px;" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" 62 <a-upload style="margin-left:8px;" name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader"
33 :action="importExcelUrl" @change="handleImportExcel"> 63 :action="importExcelUrl" @change="handleImportExcel">
34 <a-button type="primary" icon="import">导入</a-button> 64 <a-button type="primary" icon="import">导入</a-button>
35 </a-upload> 65 </a-upload>
  66 + <a-button type="primary" @click="searchQuery" icon="search" style="margin-left:8px;">查询</a-button>
36 <a-dropdown v-if="selectedRowKeys.length > 0" style="margin-left:8px;"> 67 <a-dropdown v-if="selectedRowKeys.length > 0" style="margin-left:8px;">
37 <a-menu slot="overlay"> 68 <a-menu slot="overlay">
38 <a-menu-item key="1" @click="batchDel"> 69 <a-menu-item key="1" @click="batchDel">
@@ -72,10 +103,10 @@ @@ -72,10 +103,10 @@
72 <j-ellipsis :value="text" :length="15" /> 103 <j-ellipsis :value="text" :length="15" />
73 </span> 104 </span>
74 <span slot="action" slot-scope="text, record"> 105 <span slot="action" slot-scope="text, record">
75 - <a @click="handleEdit(record)">编辑</a>  
76 - <a-divider type="vertical" />  
77 <a @click="handleDetail(record)">查看</a> 106 <a @click="handleDetail(record)">查看</a>
78 <a-divider type="vertical" /> 107 <a-divider type="vertical" />
  108 + <a @click="handleEdit(record)">编辑</a>
  109 + <a-divider type="vertical" />
79 <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)"> 110 <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
80 <a>删除</a> 111 <a>删除</a>
81 </a-popconfirm> 112 </a-popconfirm>
@@ -140,6 +171,8 @@ export default { @@ -140,6 +171,8 @@ export default {
140 }, 171 },
141 data() { 172 data() {
142 return { 173 return {
  174 + labelCol: { style: { width: '70px' } },
  175 + labelCol2: { style: { width: '100px' } },
143 activeKey: '1', 176 activeKey: '1',
144 infoVisible: false, 177 infoVisible: false,
145 info: {}, 178 info: {},
@@ -170,7 +203,8 @@ export default { @@ -170,7 +203,8 @@ export default {
170 dataIndex: 'age', 203 dataIndex: 'age',
171 customRender: function(text, record) { 204 customRender: function(text, record) {
172 return GetAge(record.identity) 205 return GetAge(record.identity)
173 - } 206 + },
  207 + sorter: true
174 }, 208 },
175 { 209 {
176 title: '性别', 210 title: '性别',
@@ -181,7 +215,8 @@ export default { @@ -181,7 +215,8 @@ export default {
181 title: '学校名称', 215 title: '学校名称',
182 align: 'center', 216 align: 'center',
183 dataIndex: 'schoolName', 217 dataIndex: 'schoolName',
184 - scopedSlots: { customRender: 'longText' } 218 + scopedSlots: { customRender: 'longText' },
  219 + sorter: true
185 }, 220 },
186 { 221 {
187 title: '入学年份', 222 title: '入学年份',
@@ -197,7 +232,8 @@ export default { @@ -197,7 +232,8 @@ export default {
197 title: '家庭住址', 232 title: '家庭住址',
198 align: 'center', 233 align: 'center',
199 dataIndex: 'address', 234 dataIndex: 'address',
200 - scopedSlots: { customRender: 'longText' } 235 + scopedSlots: { customRender: 'longText' },
  236 + sorter: true
201 }, 237 },
202 { 238 {
203 title: '身份证号', 239 title: '身份证号',
@@ -218,7 +254,8 @@ export default { @@ -218,7 +254,8 @@ export default {
218 title: '重点关注原因', 254 title: '重点关注原因',
219 align: 'center', 255 align: 'center',
220 dataIndex: 'reason', 256 dataIndex: 'reason',
221 - scopedSlots: { customRender: 'longText' } 257 + scopedSlots: { customRender: 'longText' },
  258 + sorter: true
222 }, 259 },
223 { 260 {
224 title: '操作', 261 title: '操作',
@@ -229,6 +266,15 @@ export default { @@ -229,6 +266,15 @@ export default {
229 scopedSlots: { customRender: 'action' } 266 scopedSlots: { customRender: 'action' }
230 } 267 }
231 ], 268 ],
  269 + queryParam:{
  270 + name:'',
  271 + isReason:'0',
  272 + reason:'',
  273 + identity:'',
  274 + schoolName:'',
  275 + address:'',
  276 + age:'0',
  277 + },
232 url: { 278 url: {
233 list: '/sys/minor/list', 279 list: '/sys/minor/list',
234 delete: '/sys/minor/delete', 280 delete: '/sys/minor/delete',
@@ -265,6 +311,7 @@ export default { @@ -265,6 +311,7 @@ export default {
265 align: 'center', 311 align: 'center',
266 width: 120, 312 width: 120,
267 dataIndex: 'division', 313 dataIndex: 'division',
  314 + ellipsis: true,
268 scopedSlots: { customRender: 'longText' } 315 scopedSlots: { customRender: 'longText' }
269 }, 316 },
270 { 317 {
@@ -314,10 +361,11 @@ export default { @@ -314,10 +361,11 @@ export default {
314 total: 0 361 total: 0
315 }, 362 },
316 familyLoading: false, 363 familyLoading: false,
317 - queryParam:{  
318 - name:'',  
319 - isReason:'0'  
320 - } 364 + /* 排序参数 */
  365 + isorter:{
  366 + column: 'age',
  367 + order: 'asc',
  368 + },
321 } 369 }
322 }, 370 },
323 created() { 371 created() {
@@ -329,6 +377,17 @@ export default { @@ -329,6 +377,17 @@ export default {
329 } 377 }
330 }, 378 },
331 methods: { 379 methods: {
  380 + // handleTableChange(pagination, filters, sorter) {
  381 + // //分页、排序、筛选变化时触发
  382 + // //TODO 筛选
  383 + // console.log(pagination)
  384 + // if (Object.keys(sorter).length > 0) {
  385 + // this.isorter.column = sorter.field;
  386 + // this.isorter.order = "ascend" == sorter.order ? "asc" : "desc"
  387 + // }
  388 + // this.ipagination = pagination;
  389 + // this.loadData();
  390 + // },
332 handleExportXls(fileName){ 391 handleExportXls(fileName){
333 if(!fileName || typeof fileName != "string"){ 392 if(!fileName || typeof fileName != "string"){
334 fileName = "导出文件" 393 fileName = "导出文件"