特殊人群导入功能

This commit is contained in:
wans 2021-03-19 19:13:09 +08:00
parent fe0d8127ad
commit 9247812ad2
27 changed files with 946 additions and 9 deletions

View File

@ -1,5 +1,6 @@
package com.cm.population.controller.apis.addicts;
import com.alibaba.excel.EasyExcel;
import com.cm.common.annotation.CheckRequestBodyAnnotation;
import com.cm.common.base.AbstractController;
import com.cm.common.component.SecurityComponent;
@ -15,10 +16,17 @@ import com.cm.common.result.SuccessResultList;
import com.cm.population.pojo.dtos.addicts.AddictsDTO;
import com.cm.population.pojo.vos.addicts.AddictsVO;
import com.cm.population.service.addicts.IAddictsService;
import com.cm.population.uploadexcellistener.addicts.AddictsUploadListener;
import com.cm.population.uploadexcellistener.mentaldisorders.MentalDisordersUploadListener;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -126,4 +134,40 @@ public class AddictsController extends AbstractController {
return securityComponent.getCurrentUserIdInfo();
}
@ApiOperation(value = "吸毒人员模板下载", notes = "吸毒人员Excel模板下载接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("downloadtemplate")
public void downLoadTemplate(HttpServletResponse response) throws SearchException, IOException {
response.setContentType("application/vnd.ms-excel");
String fileName = URLEncoder.encode("吸毒人员Excel模板", "UTF-8");
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
List<List<String>> listHeaders = new ArrayList<>();
String [] headers = {
"公民身份证(请勿出现科学计数法)","初次发现日期(2020-01-01)","管控情况","管控人姓名","管控人联系方式(请勿出现科学计数法)",
"帮扶情况","帮扶人姓名","帮扶人联系方式(请勿出现科学计数法)","是否有犯罪史","上次肇事肇祸日期","犯罪情况",
"吸毒原因","吸毒后果"
};
List<List<String>> listHeader = new ArrayList<>();
for (String item : headers){
List<String> title = new ArrayList<>();
title.add(item);
listHeader.add(title);
}
EasyExcel.write(response.getOutputStream()).sheet("吸毒人员").head(listHeader).doWrite(new ArrayList());
}
@ApiOperation(value = "吸毒人员信息导入", notes = "吸毒人员信息导入接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PostMapping("uploadtemplate")
public SuccessResultData uploadTemplate(@RequestParam(value = "file") MultipartFile file) throws SearchException, IOException {
try {
EasyExcel.read(file.getInputStream(),new AddictsUploadListener(addictsService)).sheet().doRead();
} catch (Exception e){
return new SuccessResultData("第{" + AddictsUploadListener.rowNumber
+ "}行数据未查询到人员基础信息,或数据格式有误: "
+ "公民身份证号:" + AddictsUploadListener.errorCardNumber);
}
return new SuccessResultData("导入完成");
}
}

View File

@ -1,5 +1,6 @@
package com.cm.population.controller.apis.aids;
import com.alibaba.excel.EasyExcel;
import com.cm.common.annotation.CheckRequestBodyAnnotation;
import com.cm.common.base.AbstractController;
import com.cm.common.component.SecurityComponent;
@ -15,10 +16,17 @@ import com.cm.common.result.SuccessResultList;
import com.cm.population.pojo.dtos.aids.AidsDTO;
import com.cm.population.pojo.vos.aids.AidsVO;
import com.cm.population.service.aids.IAidsService;
import com.cm.population.uploadexcellistener.addicts.AddictsUploadListener;
import com.cm.population.uploadexcellistener.aids.AidsUploadListener;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -126,4 +134,39 @@ public class AidsController extends AbstractController {
return securityComponent.getCurrentUserIdInfo();
}
@ApiOperation(value = "艾滋病危险人员模板下载", notes = "艾滋病危险人员Excel模板下载接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("downloadtemplate")
public void downLoadTemplate(HttpServletResponse response) throws SearchException, IOException {
response.setContentType("application/vnd.ms-excel");
String fileName = URLEncoder.encode("艾滋病危险人员Excel模板", "UTF-8");
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
List<List<String>> listHeaders = new ArrayList<>();
String [] headers = {
"公民身份证(请勿出现科学计数法)","感染途径","是否有违法犯罪史","违法犯罪情况","案件类别",
"关注类型","帮扶情况","帮扶人姓名","帮扶人联系方式(请勿出现科学计数法)","收治情况","收治机构名称"
};
List<List<String>> listHeader = new ArrayList<>();
for (String item : headers){
List<String> title = new ArrayList<>();
title.add(item);
listHeader.add(title);
}
EasyExcel.write(response.getOutputStream()).sheet("艾滋病危险人员").head(listHeader).doWrite(new ArrayList());
}
@ApiOperation(value = "艾滋病危险人员信息导入", notes = "艾滋病危险人员信息导入接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PostMapping("uploadtemplate")
public SuccessResultData uploadTemplate(@RequestParam(value = "file") MultipartFile file) throws SearchException, IOException {
try {
EasyExcel.read(file.getInputStream(),new AidsUploadListener(aidsService)).sheet().doRead();
} catch (Exception e){
return new SuccessResultData("第{" + AidsUploadListener.rowNumber
+ "}行数据未查询到人员基础信息,或数据格式有误: "
+ "公民身份证号:" + AidsUploadListener.errorCardNumber);
}
return new SuccessResultData("导入完成");
}
}

View File

@ -1,5 +1,6 @@
package com.cm.population.controller.apis.communitycorrection;
import com.alibaba.excel.EasyExcel;
import com.cm.common.annotation.CheckRequestBodyAnnotation;
import com.cm.common.base.AbstractController;
import com.cm.common.component.SecurityComponent;
@ -15,10 +16,17 @@ import com.cm.common.result.SuccessResultList;
import com.cm.population.pojo.dtos.communitycorrection.CommunityCorrectionDTO;
import com.cm.population.pojo.vos.communitycorrection.CommunityCorrectionVO;
import com.cm.population.service.communitycorrection.ICommunityCorrectionService;
import com.cm.population.uploadexcellistener.communitycorrection.CommunityCorrectionUploadListener;
import com.cm.population.uploadexcellistener.releaseAfterSentence.ReleaseAfterSentenceUploadListener;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -126,4 +134,42 @@ public class CommunityCorrectionController extends AbstractController {
return securityComponent.getCurrentUserIdInfo();
}
@ApiOperation(value = "社区矫正人员模板下载", notes = "社区矫正人员Excel模板下载接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("downloadtemplate")
public void downLoadTemplate(HttpServletResponse response) throws SearchException, IOException {
response.setContentType("application/vnd.ms-excel");
String fileName = URLEncoder.encode("社区矫正人员Excel模板", "UTF-8");
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
List<List<String>> listHeaders = new ArrayList<>();
String [] headers = {
"公民身份证(请勿出现科学计数法)","矫正人员编号(请勿出现科学计数法)","原羁押场所","矫正类型","案件类别","具体罪名","原判刑期","原判刑开始日期(2020-01-01)",
"原判刑结束日期(2020-01-01)","矫正开始日期(2020-01-01)","矫正结束日期(2020-01-01)","接收方式","四史情况",
"是否累犯","三涉情况","是否建立矫正小组","矫正小组人员组成情况","矫正解除(终止)类型","是否有脱管","脱管原因","检查监督脱管情况",
"脱管纠正情况","是否有漏管","漏管原因","检察监督漏管情况","漏管纠正情况","奖惩情况","刑满变更执行情况","是否重新犯罪",
"重新犯罪名称"
};
List<List<String>> listHeader = new ArrayList<>();
for (String item : headers){
List<String> title = new ArrayList<>();
title.add(item);
listHeader.add(title);
}
EasyExcel.write(response.getOutputStream()).sheet("社区矫正人员").head(listHeader).doWrite(new ArrayList());
}
@ApiOperation(value = "刑满释放人员信息导入", notes = "刑满释放人员信息导入接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PostMapping("uploadtemplate")
public SuccessResultData uploadTemplate(@RequestParam(value = "file") MultipartFile file) throws SearchException, IOException {
try {
EasyExcel.read(file.getInputStream(),new CommunityCorrectionUploadListener(communityCorrectionService)).sheet().doRead();
} catch (Exception e){
return new SuccessResultData("第{" + CommunityCorrectionUploadListener.rowNumber
+ "}行数据未查询到人员基础信息,或数据格式有误: "
+ "公民身份证号:" + CommunityCorrectionUploadListener.errorCardNumber);
}
return new SuccessResultData("导入完成");
}
}

View File

@ -1,5 +1,6 @@
package com.cm.population.controller.apis.mentaldisorders;
import com.alibaba.excel.EasyExcel;
import com.cm.common.annotation.CheckRequestBodyAnnotation;
import com.cm.common.base.AbstractController;
import com.cm.common.component.SecurityComponent;
@ -15,10 +16,17 @@ import com.cm.common.result.SuccessResultList;
import com.cm.population.pojo.dtos.mentaldisorders.MentalDisordersDTO;
import com.cm.population.pojo.vos.mentaldisorders.MentalDisordersVO;
import com.cm.population.service.mentaldisorders.IMentalDisordersService;
import com.cm.population.uploadexcellistener.communitycorrection.CommunityCorrectionUploadListener;
import com.cm.population.uploadexcellistener.mentaldisorders.MentalDisordersUploadListener;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -125,4 +133,41 @@ public class MentalDisordersController extends AbstractController {
return securityComponent.getCurrentUserIdInfo();
}
@ApiOperation(value = "肇事肇祸等严重精神障碍患者模板下载", notes = "肇事肇祸等严重精神障碍患者Excel模板下载接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("downloadtemplate")
public void downLoadTemplate(HttpServletResponse response) throws SearchException, IOException {
response.setContentType("application/vnd.ms-excel");
String fileName = URLEncoder.encode("肇事肇祸等严重精神障碍患者Excel模板", "UTF-8");
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
List<List<String>> listHeaders = new ArrayList<>();
String [] headers = {
"公民身份证(请勿出现科学计数法)","家庭经济状况","是否纳入低保","监护人公民身份证号码(请勿出现科学计数法)",
"监护人姓名","监护人联系方式(请勿出现科学计数法)","初次发病日期(2020-01-01)","目前诊断类型",
"是否有肇事肇祸史","肇事肇祸次数","上次肇事肇祸日期","目前危险性评估等级","治疗情况",
"治疗医院名称","实施住院治疗原因","接受康复训练机构名称","参与管理人员","帮扶情况"
};
List<List<String>> listHeader = new ArrayList<>();
for (String item : headers){
List<String> title = new ArrayList<>();
title.add(item);
listHeader.add(title);
}
EasyExcel.write(response.getOutputStream()).sheet("肇事肇祸等严重精神障碍患者").head(listHeader).doWrite(new ArrayList());
}
@ApiOperation(value = "刑满释放人员信息导入", notes = "刑满释放人员信息导入接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PostMapping("uploadtemplate")
public SuccessResultData uploadTemplate(@RequestParam(value = "file") MultipartFile file) throws SearchException, IOException {
try {
EasyExcel.read(file.getInputStream(),new MentalDisordersUploadListener(mentalDisordersService)).sheet().doRead();
} catch (Exception e){
return new SuccessResultData("第{" + MentalDisordersUploadListener.rowNumber
+ "}行数据未查询到人员基础信息,或数据格式有误: "
+ "公民身份证号:" + MentalDisordersUploadListener.errorCardNumber);
}
return new SuccessResultData("导入完成");
}
}

View File

@ -1,10 +1,12 @@
package com.cm.population.controller.apis.releaseaftersentence;
import com.alibaba.excel.EasyExcel;
import com.cm.common.annotation.CheckRequestBodyAnnotation;
import com.cm.common.base.AbstractController;
import com.cm.common.component.SecurityComponent;
import com.cm.common.constants.ISystemConstant;
import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SaveException;
import com.cm.common.exception.SearchException;
import com.cm.common.pojo.ListPage;
import com.cm.common.pojo.dtos.CurrentUserIdInfoDTO;
@ -15,10 +17,17 @@ import com.cm.common.result.SuccessResultList;
import com.cm.population.pojo.dtos.releaseaftersentence.ReleaseAfterSentenceDTO;
import com.cm.population.pojo.vos.releaseaftersentence.ReleaseAfterSentenceVO;
import com.cm.population.service.releaseaftersentence.IReleaseAfterSentenceService;
import com.cm.population.uploadexcellistener.populationbaseinfo.PopulationBaseInfoUploadListener;
import com.cm.population.uploadexcellistener.releaseAfterSentence.ReleaseAfterSentenceUploadListener;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -126,4 +135,40 @@ public class ReleaseAfterSentenceController extends AbstractController {
return securityComponent.getCurrentUserIdInfo();
}
@ApiOperation(value = "刑满释放人员模板下载", notes = "刑满释放人员模板下载Excel模板下载接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@GetMapping("downloadtemplate")
public void downLoadTemplate(HttpServletResponse response) throws SearchException, IOException {
response.setContentType("application/vnd.ms-excel");
String fileName = URLEncoder.encode("刑满释放人员Excel模板", "UTF-8");
response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
List<List<String>> listHeaders = new ArrayList<>();
String [] headers = {
"公民身份证(请勿出现科学计数法)","是否累犯","原罪名","原判刑期","服刑场所","释放日期(2020-01-01)","危险性评估类型",
"衔接日期(2020-01-01)","衔接情况","安置日期(2020-01-01)","安置情况","未安置原因","帮教情况","是否重新犯罪",
"重新犯罪罪名"
};
List<List<String>> listHeader = new ArrayList<>();
for (String item : headers){
List<String> title = new ArrayList<>();
title.add(item);
listHeader.add(title);
}
EasyExcel.write(response.getOutputStream()).sheet("刑满释放人员").head(listHeader).doWrite(new ArrayList());
}
@ApiOperation(value = "刑满释放人员信息导入", notes = "刑满释放人员信息导入接口")
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
@PostMapping("uploadtemplate")
public SuccessResultData uploadTemplate(@RequestParam(value = "file") MultipartFile file) throws SearchException, IOException {
try {
EasyExcel.read(file.getInputStream(),new ReleaseAfterSentenceUploadListener(releaseAfterSentenceService)).sheet().doRead();
} catch (Exception e){
return new SuccessResultData("第{" + ReleaseAfterSentenceUploadListener.rowNumber
+ "}行数据未查询到人员基础信息,或数据格式有误: "
+ "公民身份证号:" + ReleaseAfterSentenceUploadListener.errorCardNumber);
}
return new SuccessResultData("导入完成");
}
}

View File

@ -160,4 +160,10 @@ public interface IAddictsService {
* @throws SearchException
*/
AddictsDTO getAddictsInfo(Map<String, Object> params) throws SearchException;
/**
* 吸毒人员导入
* @param dataObj
*/
void saveAddictsImport(Map<String, Object> dataObj);
}

View File

@ -12,12 +12,15 @@ import com.cm.common.utils.HashMapUtil;
import com.cm.common.utils.UUIDUtil;
import com.cm.population.dao.addicts.IAddictsDao;
import com.cm.population.pojo.dtos.addicts.AddictsDTO;
import com.cm.population.pojo.dtos.basepopulationinfo.BasePopulationInfoDTO;
import com.cm.population.pojo.vos.addicts.AddictsVO;
import com.cm.population.service.addicts.IAddictsService;
import com.cm.population.service.basepopulationinfo.IBasePopulationInfoService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.*;
@ -34,6 +37,9 @@ public class AddictsServiceImpl extends AbstractService implements IAddictsServi
@Autowired
private IAddictsDao addictsDao;
@Autowired
private IBasePopulationInfoService basePopulationInfoService;
@Override
public SuccessResult saveAddicts(AddictsVO addictsVO) throws Exception {
saveAddictsInfo(null, addictsVO);
@ -88,6 +94,21 @@ public class AddictsServiceImpl extends AbstractService implements IAddictsServi
return addictsId;
}
@Override
public void saveAddictsImport(Map<String, Object> dataObj) {
BasePopulationInfoDTO baseInfo = basePopulationInfoService.getBasePopulationInfo(dataObj);
if(StringUtils.isEmpty(baseInfo.getIdCardNumber())){
throw new SaveException("未查询到人员的基础信息");
}
AddictsDTO addicts = addictsDao.getAddicts(dataObj);
if(addicts == null){
String addictsId = UUIDUtil.getUUID();
dataObj.put("addictsId", addictsId);
setSaveInfo(dataObj);
addictsDao.saveAddicts(dataObj);
}
}
@Override
public SuccessResult removeAddicts(String ids) throws RemoveException {
removeAddictsInfo(null, ids);

View File

@ -160,4 +160,10 @@ public interface IAidsService {
* @throws SearchException
*/
AidsDTO getAidsInfo(Map<String, Object> params) throws SearchException;
/**
* 艾滋病危险人员导入
* @param dataObj
*/
void saveAidsImport(Map<String, Object> dataObj);
}

View File

@ -12,12 +12,15 @@ import com.cm.common.utils.HashMapUtil;
import com.cm.common.utils.UUIDUtil;
import com.cm.population.dao.aids.IAidsDao;
import com.cm.population.pojo.dtos.aids.AidsDTO;
import com.cm.population.pojo.dtos.basepopulationinfo.BasePopulationInfoDTO;
import com.cm.population.pojo.vos.aids.AidsVO;
import com.cm.population.service.aids.IAidsService;
import com.cm.population.service.basepopulationinfo.IBasePopulationInfoService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.*;
@ -34,6 +37,9 @@ public class AidsServiceImpl extends AbstractService implements IAidsService {
@Autowired
private IAidsDao aidsDao;
@Autowired
private IBasePopulationInfoService basePopulationInfoService;
@Override
public SuccessResult saveAids(AidsVO aidsVO) throws Exception {
saveAidsInfo(null, aidsVO);
@ -88,6 +94,21 @@ public class AidsServiceImpl extends AbstractService implements IAidsService {
return aidsId;
}
@Override
public void saveAidsImport(Map<String, Object> dataObj) {
BasePopulationInfoDTO baseInfo = basePopulationInfoService.getBasePopulationInfo(dataObj);
if(StringUtils.isEmpty(baseInfo.getIdCardNumber())){
throw new SaveException("未查询到人员的基础信息");
}
AidsDTO aids = aidsDao.getAids(dataObj);
if(aids == null){
String aidsId = UUIDUtil.getUUID();
dataObj.put("aidsId", aidsId);
setSaveInfo(dataObj);
aidsDao.saveAids(dataObj);
}
}
@Override
public SuccessResult removeAids(String ids) throws RemoveException {
removeAidsInfo(null, ids);

View File

@ -160,4 +160,10 @@ public interface ICommunityCorrectionService {
* @throws SearchException
*/
CommunityCorrectionDTO getCommunityCorrectionInfo(Map<String, Object> params) throws SearchException;
/**
* 社区矫正人员导入
* @param dataObj
*/
void saveCommunityCorrectionImport(Map<String, Object> dataObj);
}

View File

@ -11,8 +11,10 @@ import com.cm.common.result.SuccessResultList;
import com.cm.common.utils.HashMapUtil;
import com.cm.common.utils.UUIDUtil;
import com.cm.population.dao.communitycorrection.ICommunityCorrectionDao;
import com.cm.population.pojo.dtos.basepopulationinfo.BasePopulationInfoDTO;
import com.cm.population.pojo.dtos.communitycorrection.CommunityCorrectionDTO;
import com.cm.population.pojo.vos.communitycorrection.CommunityCorrectionVO;
import com.cm.population.service.basepopulationinfo.IBasePopulationInfoService;
import com.cm.population.service.communitycorrection.ICommunityCorrectionService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@ -35,6 +37,9 @@ public class CommunityCorrectionServiceImpl extends AbstractService implements I
@Autowired
private ICommunityCorrectionDao communityCorrectionDao;
@Autowired
private IBasePopulationInfoService basePopulationInfoService;
@Override
public SuccessResult saveCommunityCorrection(CommunityCorrectionVO communityCorrectionVO) throws Exception {
saveCommunityCorrectionInfo(null, communityCorrectionVO);
@ -89,6 +94,21 @@ public class CommunityCorrectionServiceImpl extends AbstractService implements I
return communityCorrectionId;
}
@Override
public void saveCommunityCorrectionImport(Map<String, Object> dataObj) {
BasePopulationInfoDTO baseInfo = basePopulationInfoService.getBasePopulationInfo(dataObj);
if(StringUtils.isEmpty(baseInfo.getIdCardNumber())){
throw new SaveException("未查询到人员的基础信息");
}
CommunityCorrectionDTO communityCorrection = communityCorrectionDao.getCommunityCorrection(dataObj);
if(communityCorrection == null){
String communityCorrectionId = UUIDUtil.getUUID();
dataObj.put("communityCorrectionId", communityCorrectionId);
setSaveInfo(dataObj);
communityCorrectionDao.saveCommunityCorrection(dataObj);
}
}
@Override
public SuccessResult removeCommunityCorrection(String ids) throws RemoveException {
removeCommunityCorrectionInfo(null, ids);

View File

@ -159,4 +159,10 @@ public interface IMentalDisordersService {
* @throws SearchException
*/
MentalDisordersDTO getMentalDisordersInfo(Map<String, Object> params) throws SearchException;
/**
* 肇事肇祸等严重精神障碍患者导入
* @param dataObj
*/
void saveMentalDisordersImport(Map<String, Object> dataObj);
}

View File

@ -2,6 +2,7 @@ package com.cm.population.service.mentaldisorders.impl;
import com.cm.common.base.AbstractService;
import com.cm.common.exception.RemoveException;
import com.cm.common.exception.SaveException;
import com.cm.common.exception.SearchException;
import com.cm.common.pojo.ListPage;
import com.cm.common.result.SuccessResult;
@ -10,13 +11,16 @@ import com.cm.common.result.SuccessResultList;
import com.cm.common.utils.HashMapUtil;
import com.cm.common.utils.UUIDUtil;
import com.cm.population.dao.mentaldisorders.IMentalDisordersDao;
import com.cm.population.pojo.dtos.basepopulationinfo.BasePopulationInfoDTO;
import com.cm.population.pojo.dtos.mentaldisorders.MentalDisordersDTO;
import com.cm.population.pojo.vos.mentaldisorders.MentalDisordersVO;
import com.cm.population.service.basepopulationinfo.IBasePopulationInfoService;
import com.cm.population.service.mentaldisorders.IMentalDisordersService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.util.Arrays;
import java.util.List;
@ -35,6 +39,9 @@ public class MentalDisordersServiceImpl extends AbstractService implements IMent
@Autowired
private IMentalDisordersDao mentalDisordersDao;
@Autowired
private IBasePopulationInfoService basePopulationInfoService;
@Override
public SuccessResult saveMentalDisorders(MentalDisordersVO mentalDisordersVO) throws Exception {
saveMentalDisordersInfo(null, mentalDisordersVO);
@ -89,6 +96,21 @@ public class MentalDisordersServiceImpl extends AbstractService implements IMent
return mentalDisordersId;
}
@Override
public void saveMentalDisordersImport(Map<String, Object> dataObj) {
BasePopulationInfoDTO baseInfo = basePopulationInfoService.getBasePopulationInfo(dataObj);
if(StringUtils.isEmpty(baseInfo.getIdCardNumber())){
throw new SaveException("未查询到人员的基础信息");
}
MentalDisordersDTO mentalDisorders = mentalDisordersDao.getMentalDisorders(dataObj);
if(mentalDisorders == null){
String mentalDisordersId = UUIDUtil.getUUID();
dataObj.put("mentalDisordersId", mentalDisordersId);
setSaveInfo(dataObj);
mentalDisordersDao.saveMentalDisorders(dataObj);
}
}
@Override
public SuccessResult removeMentalDisorders(String ids) throws RemoveException {
removeMentalDisordersInfo(null, ids);

View File

@ -160,4 +160,10 @@ public interface IReleaseAfterSentenceService {
* @throws SearchException
*/
ReleaseAfterSentenceDTO getReleaseAfterSentenceInfo(Map<String, Object> params) throws SearchException;
/**
* 刑满释放人员导入
* @param dataObj
*/
void saveReleaseAfterSentenceImport(Map<String, Object> dataObj);
}

View File

@ -11,8 +11,10 @@ import com.cm.common.result.SuccessResultList;
import com.cm.common.utils.HashMapUtil;
import com.cm.common.utils.UUIDUtil;
import com.cm.population.dao.releaseaftersentence.IReleaseAfterSentenceDao;
import com.cm.population.pojo.dtos.basepopulationinfo.BasePopulationInfoDTO;
import com.cm.population.pojo.dtos.releaseaftersentence.ReleaseAfterSentenceDTO;
import com.cm.population.pojo.vos.releaseaftersentence.ReleaseAfterSentenceVO;
import com.cm.population.service.basepopulationinfo.IBasePopulationInfoService;
import com.cm.population.service.releaseaftersentence.IReleaseAfterSentenceService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@ -35,6 +37,9 @@ public class ReleaseAfterSentenceServiceImpl extends AbstractService implements
@Autowired
private IReleaseAfterSentenceDao releaseAfterSentenceDao;
@Autowired
private IBasePopulationInfoService basePopulationInfoService;
@Override
public SuccessResult saveReleaseAfterSentence(ReleaseAfterSentenceVO releaseAfterSentenceVO) throws Exception {
saveReleaseAfterSentenceInfo(null, releaseAfterSentenceVO);
@ -89,6 +94,21 @@ public class ReleaseAfterSentenceServiceImpl extends AbstractService implements
return releaseAfterSentenceId;
}
@Override
public void saveReleaseAfterSentenceImport(Map<String, Object> dataObj) {
BasePopulationInfoDTO baseInfo = basePopulationInfoService.getBasePopulationInfo(dataObj);
if(StringUtils.isEmpty(baseInfo.getIdCardNumber())){
throw new SaveException("未查询到人员的基础信息");
}
ReleaseAfterSentenceDTO releaseAfterSentence = releaseAfterSentenceDao.getReleaseAfterSentence(dataObj);
if(releaseAfterSentence == null){
String releaseAfterSentenceId = UUIDUtil.getUUID();
dataObj.put("releaseAfterSentenceId", releaseAfterSentenceId);
setSaveInfo(dataObj);
releaseAfterSentenceDao.saveReleaseAfterSentence(dataObj);
}
}
@Override
public SuccessResult removeReleaseAfterSentence(String ids) throws RemoveException {
removeReleaseAfterSentenceInfo(null, ids);

View File

@ -0,0 +1,58 @@
package com.cm.population.uploadexcellistener.addicts;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.cm.population.service.addicts.IAddictsService;
import com.cm.population.service.mentaldisorders.IMentalDisordersService;
import org.springframework.util.StringUtils;
import java.util.HashMap;
import java.util.Map;
/**
* @author xwangs
* @create 2021-03-18 17:26
* @description
*/
public class AddictsUploadListener extends AnalysisEventListener<Map<Integer, Object>> {
private static final int BATCH_COUNT = 3000;
private IAddictsService service;
public static String errorCardNumber = "";
public static int rowNumber = 1;
public AddictsUploadListener(IAddictsService serviceObj){
this.service = serviceObj;
}
@Override
public void invoke(Map<Integer, Object> data, AnalysisContext context) {
int columnCount = 11;
for (int i = 0; i <= columnCount; i++){
data.put(i,StringUtils.isEmpty(data.get(i)) ? "" : data.get(i).toString().trim());
}
errorCardNumber = data.get(0).toString();
Map<String, Object> dataObj = new HashMap<>(32);
dataObj.put("idCardNumber",data.get(0));
dataObj.put("discoveryDate",data.get(1));
dataObj.put("controlInfo",data.get(2));
dataObj.put("controlUserName",data.get(3));
dataObj.put("controlUserPhone",data.get(4));
dataObj.put("helpInfo",data.get(5));
dataObj.put("helpUserName",data.get(6));
dataObj.put("helpUserPhone",data.get(7));
dataObj.put("hasCrimeHis","".equals(data.get(8).toString()) ? "1" : "0");
dataObj.put("crimeInfo",data.get(9));
dataObj.put("drugReason",data.get(10));
dataObj.put("drugResult",data.get(11));
service.saveAddictsImport(dataObj);
rowNumber++;
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
rowNumber = 1;
errorCardNumber = "";
}
}

View File

@ -0,0 +1,57 @@
package com.cm.population.uploadexcellistener.aids;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.cm.population.service.addicts.IAddictsService;
import com.cm.population.service.aids.IAidsService;
import org.springframework.util.StringUtils;
import java.util.HashMap;
import java.util.Map;
/**
* @author xwangs
* @create 2021-03-18 17:26
* @description
*/
public class AidsUploadListener extends AnalysisEventListener<Map<Integer, Object>> {
private static final int BATCH_COUNT = 3000;
private IAidsService service;
public static String errorCardNumber = "";
public static int rowNumber = 1;
public AidsUploadListener(IAidsService serviceObj){
this.service = serviceObj;
}
@Override
public void invoke(Map<Integer, Object> data, AnalysisContext context) {
int columnCount = 10;
for (int i = 0; i <= columnCount; i++){
data.put(i,StringUtils.isEmpty(data.get(i)) ? "" : data.get(i).toString().trim());
}
errorCardNumber = data.get(0).toString();
Map<String, Object> dataObj = new HashMap<>(32);
dataObj.put("idCardNumber",data.get(0));
dataObj.put("infectionRoute",data.get(1));
dataObj.put("hasCrimeHis","".equals(data.get(2).toString()) ? "1" : "0");
dataObj.put("crimeInfo",data.get(3));
dataObj.put("caseCategory",data.get(4));
dataObj.put("attentionType",data.get(5));
dataObj.put("helpInfo",data.get(6));
dataObj.put("helpUserName",data.get(7));
dataObj.put("helpUserPhone",data.get(8));
dataObj.put("treatmentInfo",data.get(9));
dataObj.put("treatmentOrg",data.get(10));
service.saveAidsImport(dataObj);
rowNumber++;
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
rowNumber = 1;
errorCardNumber = "";
}
}

View File

@ -0,0 +1,105 @@
package com.cm.population.uploadexcellistener.communitycorrection;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.cm.population.service.communitycorrection.ICommunityCorrectionService;
import com.cm.population.service.releaseaftersentence.IReleaseAfterSentenceService;
import org.springframework.util.StringUtils;
import java.util.HashMap;
import java.util.Map;
/**
* @author xwangs
* @create 2021-03-18 17:26
* @description
*/
public class CommunityCorrectionUploadListener extends AnalysisEventListener<Map<Integer, Object>> {
private static final int BATCH_COUNT = 3000;
private ICommunityCorrectionService service;
public static String errorCardNumber = "";
public static int rowNumber = 1;
public CommunityCorrectionUploadListener(ICommunityCorrectionService serviceObj){
this.service = serviceObj;
}
@Override
public void invoke(Map<Integer, Object> data, AnalysisContext context) {
int columnCount = 29;
for (int i = 0; i <= columnCount; i++){
data.put(i,StringUtils.isEmpty(data.get(i)) ? "" : data.get(i).toString().trim());
}
errorCardNumber = data.get(0).toString();
Map<String, Object> dataObj = new HashMap<>(32);
dataObj.put("idCardNumber",data.get(0));
// 矫正人员编号
dataObj.put("correctionUserNum",data.get(1));
// 原羁押场所
dataObj.put("originalCustodyPlace",data.get(2));
// 矫正类型
dataObj.put("correctionCategory",data.get(3));
// 案件类别
dataObj.put("caseCategory",data.get(4));
// 具体罪名
dataObj.put("specificCharges",data.get(5));
// 原判刑期
dataObj.put("originalSentence",data.get(6));
// 原判刑期开始时间
dataObj.put("originalSentenceStr",data.get(7));
// 原判刑期结束时间
dataObj.put("originalSentenceEnd",data.get(8));
// 矫正开始时间
dataObj.put("correctStrDate",data.get(9));
// 矫正结束时间
dataObj.put("correctEndDate",data.get(10));
// 接收方式
dataObj.put("receiveWay",data.get(11));
// 四史情况
dataObj.put("fourHistoryInfo",data.get(12));
// 是否累犯
dataObj.put("isRecidivist","".equals(data.get(13).toString()) ? "1" : "0");
// 三涉情况
dataObj.put("threeInvolveInfo",data.get(14));
// 是否建立矫正小组
dataObj.put("isCreateCorrectGroup","".equals(data.get(15).toString()) ? "1" : "0");
// 矫正小组人员组成情况
dataObj.put("correctGroupUserInfo",data.get(16));
// 矫正解除(终止)类型
dataObj.put("correctRelieveType",data.get(17));
// 是否有脱管
dataObj.put("isRidOfControl","".equals(data.get(18).toString()) ? "1" : "0");
// 脱管原因
dataObj.put("ridOfControlReason",data.get(19));
// 检查监督脱管情况
dataObj.put("checkRidOfControl",data.get(20));
// 脱管纠正情况
dataObj.put("ridOfControlCorrection",data.get(21));
// 是否有漏管
dataObj.put("isOmitControl","".equals(data.get(22).toString()) ? "1" : "0");
// 漏管原因
dataObj.put("omitControlReason",data.get(23));
// 检察监督漏管情况
dataObj.put("checkOmitControl",data.get(24));
// 漏管纠正情况
dataObj.put("omitControlCorrection",data.get(25));
// 奖惩情况
dataObj.put("rewardPunishment",data.get(26));
// 刑罚变更执行情况
dataObj.put("executionPenaltyAlteration",data.get(27));
// 是否重新犯罪
dataObj.put("isCrimeAgain","".equals(data.get(28).toString()) ? "1" : "0");
// 重新犯罪罪名
dataObj.put("crimeAgainCharge",data.get(29));
service.saveCommunityCorrectionImport(dataObj);
rowNumber++;
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
rowNumber = 1;
errorCardNumber = "";
}
}

View File

@ -0,0 +1,64 @@
package com.cm.population.uploadexcellistener.mentaldisorders;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.cm.population.service.communitycorrection.ICommunityCorrectionService;
import com.cm.population.service.mentaldisorders.IMentalDisordersService;
import org.springframework.util.StringUtils;
import java.util.HashMap;
import java.util.Map;
/**
* @author xwangs
* @create 2021-03-18 17:26
* @description
*/
public class MentalDisordersUploadListener extends AnalysisEventListener<Map<Integer, Object>> {
private static final int BATCH_COUNT = 3000;
private IMentalDisordersService service;
public static String errorCardNumber = "";
public static int rowNumber = 1;
public MentalDisordersUploadListener(IMentalDisordersService serviceObj){
this.service = serviceObj;
}
@Override
public void invoke(Map<Integer, Object> data, AnalysisContext context) {
int columnCount = 17;
for (int i = 0; i <= columnCount; i++){
data.put(i,StringUtils.isEmpty(data.get(i)) ? "" : data.get(i).toString().trim());
}
errorCardNumber = data.get(0).toString();
Map<String, Object> dataObj = new HashMap<>(32);
dataObj.put("idCardNumber",data.get(0));
dataObj.put("familyEconomy",data.get(1));
dataObj.put("isSubsistence","".equals(data.get(2).toString()) ? "1" : "0");
dataObj.put("guardianIdCard",data.get(3));
dataObj.put("guardianName",data.get(4));
dataObj.put("guardianPhone",data.get(5));
dataObj.put("firstOnsetDate",data.get(6));
dataObj.put("diagnosisType",data.get(7));
dataObj.put("hasCausTrouble",data.get(8));
dataObj.put("troubleNumber",data.get(9));
dataObj.put("lastTroubleDate",data.get(10));
dataObj.put("riskLevel",data.get(11));
dataObj.put("treatment",data.get(12));
dataObj.put("hospitalName",data.get(13));
dataObj.put("hospitalization",data.get(14));
dataObj.put("receiveOrgName",data.get(15));
dataObj.put("manageUser",data.get(16));
dataObj.put("helpInfo",data.get(17));
service.saveMentalDisordersImport(dataObj);
rowNumber++;
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
rowNumber = 1;
errorCardNumber = "";
}
}

View File

@ -2,6 +2,8 @@ package com.cm.population.uploadexcellistener.populationbaseinfo;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.cm.common.exception.SaveException;
import com.cm.common.result.SuccessResultData;
import com.cm.common.utils.UUIDUtil;
import com.cm.population.service.basepopulationinfo.IBasePopulationInfoService;
import org.springframework.util.StringUtils;
@ -17,6 +19,9 @@ public class PopulationBaseInfoUploadListener extends AnalysisEventListener<Map<
private static final int BATCH_COUNT = 3000;
private IBasePopulationInfoService service;
public static String errorCardNumber = "";
public static String errorName = "";
public static int rowNumber = 1;
public PopulationBaseInfoUploadListener(IBasePopulationInfoService serviceObj){
@ -29,6 +34,10 @@ public class PopulationBaseInfoUploadListener extends AnalysisEventListener<Map<
for (int i = 0; i < columnCount; i++){
data.put(i,StringUtils.isEmpty(data.get(i)) ? "" : data.get(i).toString().trim());
}
errorCardNumber = "";
errorName = "";
errorCardNumber = data.get(0).toString();
errorName = data.get(1).toString();
Map<String, Object> dataObj = new HashMap<>(32);
dataObj.put("idCardNumber",data.get(0));
dataObj.put("fullName",data.get(1));
@ -48,10 +57,13 @@ public class PopulationBaseInfoUploadListener extends AnalysisEventListener<Map<
dataObj.put("registeredResidenceAddr",data.get(15).toString() + data.get(16).toString());
dataObj.put("currentResidenceAddr",data.get(17).toString() + data.get(18).toString());
service.saveBasePopulationInfoImport(dataObj);
rowNumber++;
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
errorCardNumber = "";
errorName = "";
rowNumber = 1;
}
}

View File

@ -0,0 +1,63 @@
package com.cm.population.uploadexcellistener.releaseAfterSentence;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.cm.common.exception.SaveException;
import com.cm.population.pojo.dtos.releaseaftersentence.ReleaseAfterSentenceDTO;
import com.cm.population.service.basepopulationinfo.IBasePopulationInfoService;
import com.cm.population.service.releaseaftersentence.IReleaseAfterSentenceService;
import org.springframework.util.StringUtils;
import java.util.HashMap;
import java.util.Map;
/**
* @author xwangs
* @create 2021-03-18 17:26
* @description
*/
public class ReleaseAfterSentenceUploadListener extends AnalysisEventListener<Map<Integer, Object>> {
private static final int BATCH_COUNT = 3000;
private IReleaseAfterSentenceService service;
public static String errorCardNumber = "";
public static int rowNumber = 1;
public ReleaseAfterSentenceUploadListener(IReleaseAfterSentenceService serviceObj){
this.service = serviceObj;
}
@Override
public void invoke(Map<Integer, Object> data, AnalysisContext context) {
int columnCount = 14;
for (int i = 0; i <= columnCount; i++){
data.put(i,StringUtils.isEmpty(data.get(i)) ? "" : data.get(i).toString().trim());
}
errorCardNumber = data.get(0).toString();
Map<String, Object> dataObj = new HashMap<>(32);
dataObj.put("idCardNumber",data.get(0));
dataObj.put("isCumulativeCrime","".equals(data.get(1).toString()) ? "1" : "0");
dataObj.put("nameOfOriginalSin",data.get(2));
dataObj.put("originalSentenceData",data.get(3));
dataObj.put("servingSentencePlace",data.get(4));
dataObj.put("releaseDate",data.get(5));
dataObj.put("assessmentRiskType",data.get(6));
dataObj.put("linkUpDate",data.get(7));
dataObj.put("linkUpSituation",data.get(8));
dataObj.put("placementDate",data.get(9));
dataObj.put("placementSituation",data.get(10));
dataObj.put("unPlacementReason",data.get(11));
dataObj.put("helpAndEducate",data.get(12));
dataObj.put("isCrimeAgain","".equals(data.get(13).toString()) ? "1" : "0");
dataObj.put("crimeAgainCharge",data.get(14));
service.saveReleaseAfterSentenceImport(dataObj);
rowNumber++;
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
rowNumber = 1;
errorCardNumber = "";
}
}

View File

@ -23,6 +23,12 @@
<button type="button" id="search" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-search"></i> 搜索
</button>
<button type="button" id="downloadTemplate" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-download"></i> 下载模板
</button>
<button type="button" id="uploadTemplate" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-upload"></i> 导入数据
</button>
</div>
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
<!-- 表头按钮组 -->
@ -50,13 +56,14 @@
base: 'assets/layuiadmin/'
}).extend({
index: 'lib/index'
}).use(['index', 'table', 'laydate', 'common'], function() {
}).use(['index', 'table', 'laydate', 'common' ,'upload'], function() {
var $ = layui.$;
var $win = $(window);
var table = layui.table;
var admin = layui.admin;
var laydate = layui.laydate;
var common = layui.common;
var upload = layui.upload;
var resizeTimeout = null;
var tableUrl = 'api/addicts/listpageaddicts';
@ -279,6 +286,40 @@
}
initTable();
initDate();
var uploadInst = upload.render({
elem: '#uploadTemplate' //绑定元素
,url: 'api/addicts/uploadtemplate' //上传接口
,exts: 'xlsx'
,done: function(res){
top.dialog.msg(res.data, {
time: 0,
btn: [top.dataMessage.button.yes],
shade: 0.3,
yes: function (index) {
top.dialog.close(index);
}
});
reloadTable(1);
}
,error: function() {
top.dialog.msg("导入失败,请检查数据是否有误", {
time: 0,
btn: [top.dataMessage.button.yes],
shade: 0.3,
yes: function (index) {
top.dialog.close(index);
}
});
}
});
// 下载模板
$(document).on('click', '#downloadTemplate', function() {
window.open('api/addicts/downloadtemplate');
return;
});
// 事件 - 页面变化
$win.on('resize', function() {
clearTimeout(resizeTimeout);

View File

@ -29,6 +29,12 @@
<button type="button" id="search" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-search"></i> 搜索
</button>
<button type="button" id="downloadTemplate" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-download"></i> 下载模板
</button>
<button type="button" id="uploadTemplate" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-upload"></i> 导入数据
</button>
</div>
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
<!-- 表头按钮组 -->
@ -56,13 +62,14 @@
base: 'assets/layuiadmin/'
}).extend({
index: 'lib/index'
}).use(['index', 'table', 'laydate', 'common'], function() {
}).use(['index', 'table', 'laydate', 'common', 'upload'], function() {
var $ = layui.$;
var $win = $(window);
var table = layui.table;
var admin = layui.admin;
var laydate = layui.laydate;
var common = layui.common;
var upload = layui.upload;
var resizeTimeout = null;
var tableUrl = 'api/aids/listpageaids';
@ -283,6 +290,40 @@
}
initTable();
initDate();
var uploadInst = upload.render({
elem: '#uploadTemplate' //绑定元素
,url: 'api/aids/uploadtemplate' //上传接口
,exts: 'xlsx'
,done: function(res){
top.dialog.msg(res.data, {
time: 0,
btn: [top.dataMessage.button.yes],
shade: 0.3,
yes: function (index) {
top.dialog.close(index);
}
});
reloadTable(1);
}
,error: function() {
top.dialog.msg("导入失败,请检查数据是否有误", {
time: 0,
btn: [top.dataMessage.button.yes],
shade: 0.3,
yes: function (index) {
top.dialog.close(index);
}
});
}
});
// 下载模板
$(document).on('click', '#downloadTemplate', function() {
window.open('api/aids/downloadtemplate');
return;
});
// 事件 - 页面变化
$win.on('resize', function() {
clearTimeout(resizeTimeout);

View File

@ -73,11 +73,25 @@
,url: 'api/basepopulationinfo/uploadtemplate' //上传接口
,exts: 'xlsx'
,done: function(res){
layer.msg(res.data);
top.dialog.msg(res.data, {
time: 0,
btn: [top.dataMessage.button.yes],
shade: 0.3,
yes: function (index) {
top.dialog.close(index);
}
});
reloadTable(1);
}
,error: function(){
console.log("error");
,error: function() {
top.dialog.msg("导入失败,请检查数据是否有误", {
time: 0,
btn: [top.dataMessage.button.yes],
shade: 0.3,
yes: function (index) {
top.dialog.close(index);
}
});
}
});
@ -252,6 +266,7 @@
// 下载模板
$(document).on('click', '#downloadTemplate', function() {
window.open('api/basepopulationinfo/downloadtemplate');
return;
});
// 事件 - 增删改

View File

@ -23,6 +23,12 @@
<button type="button" id="search" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-search"></i> 搜索
</button>
<button type="button" id="downloadTemplate" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-download"></i> 下载模板
</button>
<button type="button" id="uploadTemplate" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-upload"></i> 导入数据
</button>
</div>
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
<!-- 表头按钮组 -->
@ -51,13 +57,14 @@
base: 'assets/layuiadmin/'
}).extend({
index: 'lib/index'
}).use(['index', 'table', 'laydate', 'common'], function() {
}).use(['index', 'table', 'laydate', 'common', 'upload'], function() {
var $ = layui.$;
var $win = $(window);
var table = layui.table;
var admin = layui.admin;
var laydate = layui.laydate;
var common = layui.common;
var upload = layui.upload;
var resizeTimeout = null;
var tableUrl = 'api/communitycorrection/listpagecommunitycorrection';
@ -347,6 +354,40 @@
}
initTable();
initDate();
var uploadInst = upload.render({
elem: '#uploadTemplate' //绑定元素
,url: 'api/communitycorrection/uploadtemplate' //上传接口
,exts: 'xlsx'
,done: function(res){
top.dialog.msg(res.data, {
time: 0,
btn: [top.dataMessage.button.yes],
shade: 0.3,
yes: function (index) {
top.dialog.close(index);
}
});
reloadTable(1);
}
,error: function() {
top.dialog.msg("导入失败,请检查数据是否有误", {
time: 0,
btn: [top.dataMessage.button.yes],
shade: 0.3,
yes: function (index) {
top.dialog.close(index);
}
});
}
});
// 下载模板
$(document).on('click', '#downloadTemplate', function() {
window.open('api/communitycorrection/downloadtemplate');
return;
});
// 事件 - 页面变化
$win.on('resize', function() {
clearTimeout(resizeTimeout);

View File

@ -23,6 +23,12 @@
<button type="button" id="search" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-search"></i> 搜索
</button>
<button type="button" id="downloadTemplate" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-download"></i> 下载模板
</button>
<button type="button" id="uploadTemplate" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-upload"></i> 导入数据
</button>
</div>
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
<!-- 表头按钮组 -->
@ -51,13 +57,14 @@
base: 'assets/layuiadmin/'
}).extend({
index: 'lib/index'
}).use(['index', 'table', 'laydate', 'common'], function() {
}).use(['index', 'table', 'laydate', 'common' , 'upload'], function() {
var $ = layui.$;
var $win = $(window);
var table = layui.table;
var admin = layui.admin;
var laydate = layui.laydate;
var common = layui.common;
var upload = layui.upload;
var resizeTimeout = null;
var tableUrl = 'api/mentaldisorders/listpagementaldisorders';
@ -337,6 +344,40 @@
}
initTable();
initDate();
var uploadInst = upload.render({
elem: '#uploadTemplate' //绑定元素
,url: 'api/mentaldisorders/uploadtemplate' //上传接口
,exts: 'xlsx'
,done: function(res){
top.dialog.msg(res.data, {
time: 0,
btn: [top.dataMessage.button.yes],
shade: 0.3,
yes: function (index) {
top.dialog.close(index);
}
});
reloadTable(1);
}
,error: function() {
top.dialog.msg("导入失败,请检查数据是否有误", {
time: 0,
btn: [top.dataMessage.button.yes],
shade: 0.3,
yes: function (index) {
top.dialog.close(index);
}
});
}
});
// 下载模板
$(document).on('click', '#downloadTemplate', function() {
window.open('api/mentaldisorders/downloadtemplate');
return;
});
// 事件 - 页面变化
$win.on('resize', function() {
clearTimeout(resizeTimeout);

View File

@ -23,6 +23,12 @@
<button type="button" id="search" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-search"></i> 搜索
</button>
<button type="button" id="downloadTemplate" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-download"></i> 下载模板
</button>
<button type="button" id="uploadTemplate" class="layui-btn layui-btn-sm">
<i class="fa fa-lg fa-upload"></i> 导入数据
</button>
</div>
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
<!-- 表头按钮组 -->
@ -51,7 +57,7 @@
base: 'assets/layuiadmin/'
}).extend({
index: 'lib/index'
}).use(['index', 'table', 'laydate', 'common'], function() {
}).use(['index', 'table', 'laydate', 'common', 'upload'], function() {
var $ = layui.$;
var $win = $(window);
var table = layui.table;
@ -59,6 +65,7 @@
var laydate = layui.laydate;
var common = layui.common;
var resizeTimeout = null;
var upload = layui.upload;
var tableUrl = 'api/releaseaftersentence/listpagereleaseaftersentence';
// 初始化表格
@ -283,6 +290,41 @@
}
initTable();
initDate();
var uploadInst = upload.render({
elem: '#uploadTemplate' //绑定元素
,url: 'api/releaseaftersentence/uploadtemplate' //上传接口
,exts: 'xlsx'
,done: function(res){
top.dialog.msg(res.data, {
time: 0,
btn: [top.dataMessage.button.yes],
shade: 0.3,
yes: function (index) {
top.dialog.close(index);
}
});
reloadTable(1);
}
,error: function() {
top.dialog.msg("导入失败,请检查数据是否有误", {
time: 0,
btn: [top.dataMessage.button.yes],
shade: 0.3,
yes: function (index) {
top.dialog.close(index);
}
});
}
});
// 下载模板
$(document).on('click', '#downloadTemplate', function() {
window.open('api/releaseaftersentence/downloadtemplate');
return;
});
// 事件 - 页面变化
$win.on('resize', function() {
clearTimeout(resizeTimeout);