|
@@ -3,6 +3,7 @@ package com.boman.web.core.service.czrk;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.boman.common.core.exception.BaseException;
|
|
import com.boman.common.core.exception.BaseException;
|
|
|
|
+import com.boman.common.core.exception.CustomException;
|
|
import com.boman.common.core.utils.DateUtils;
|
|
import com.boman.common.core.utils.DateUtils;
|
|
import com.boman.common.core.utils.StringUtils;
|
|
import com.boman.common.core.utils.StringUtils;
|
|
import com.boman.common.core.utils.constant.HttpStatus;
|
|
import com.boman.common.core.utils.constant.HttpStatus;
|
|
@@ -15,6 +16,7 @@ import com.boman.common.core.web.page.TableSupport;
|
|
import com.boman.common.redis.service.RedisService;
|
|
import com.boman.common.redis.service.RedisService;
|
|
import com.boman.common.security.service.TokenService;
|
|
import com.boman.common.security.service.TokenService;
|
|
import com.boman.domain.*;
|
|
import com.boman.domain.*;
|
|
|
|
+import com.boman.domain.constant.CacheConstants;
|
|
import com.boman.domain.dto.AjaxResult;
|
|
import com.boman.domain.dto.AjaxResult;
|
|
import com.boman.domain.utils.ThreadPoolService;
|
|
import com.boman.domain.utils.ThreadPoolService;
|
|
import com.boman.system.api.RemoteDeptService;
|
|
import com.boman.system.api.RemoteDeptService;
|
|
@@ -25,10 +27,12 @@ import com.boman.web.core.domain.JsonRequest;
|
|
import com.boman.web.core.mapper.CzrkChangeMapper;
|
|
import com.boman.web.core.mapper.CzrkChangeMapper;
|
|
import com.boman.web.core.mapper.CzrkMapper;
|
|
import com.boman.web.core.mapper.CzrkMapper;
|
|
import com.boman.web.core.mapper.GridInfoMapper;
|
|
import com.boman.web.core.mapper.GridInfoMapper;
|
|
|
|
+import com.boman.web.core.mapper.ThirdPartInfoMapper;
|
|
import com.boman.web.core.service.ip.IpTimesService;
|
|
import com.boman.web.core.service.ip.IpTimesService;
|
|
import com.boman.web.core.utils.*;
|
|
import com.boman.web.core.utils.*;
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageHelper;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.apache.poi.hssf.usermodel.HSSFDateUtil;
|
|
import org.apache.tomcat.util.buf.HexUtils;
|
|
import org.apache.tomcat.util.buf.HexUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
@@ -81,6 +85,9 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
@Autowired
|
|
@Autowired
|
|
private TokenService tokenService;
|
|
private TokenService tokenService;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ private ThirdPartInfoMapper thirdPartInfoMapper;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 2022/3/24修复人员认领接口列表,逻辑:所有人都能看到所有没有确认,没有认领的人员
|
|
* 2022/3/24修复人员认领接口列表,逻辑:所有人都能看到所有没有确认,没有认领的人员
|
|
*
|
|
*
|
|
@@ -1080,6 +1087,122 @@ public class CzrkServiceImpl implements ICzrkService {
|
|
return czrkList;
|
|
return czrkList;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
+ public String importUser(List<ThirdPartInfo> thirdPartInfoList) {
|
|
|
|
+ if (StringUtils.isNull(thirdPartInfoList) || thirdPartInfoList.size() == 0) {
|
|
|
|
+ throw new CustomException("导入数据不能为空!");
|
|
|
|
+ }
|
|
|
|
+ //获取登录人员
|
|
|
|
+ SysUser sysUser = AuthUtils.getLoginUser().getSysUser();
|
|
|
|
+ int successNum = 0;
|
|
|
|
+ int failureNum = 0;
|
|
|
|
+ StringBuilder successMsg = new StringBuilder();
|
|
|
|
+ StringBuilder failureMsg = new StringBuilder();
|
|
|
|
+ try{
|
|
|
|
+ for (ThirdPartInfo thirdPartInfo : thirdPartInfoList) {
|
|
|
|
+
|
|
|
|
+ //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
+ //String str = sdf.format(DateUtils.formatDate(thirdPartInfo.getCremationTime()));
|
|
|
|
+
|
|
|
|
+ //将ThirdPartInfo对象所有字段赋值
|
|
|
|
+ //ThirdPartInfoUtils.setValue(thirdPartInfo);
|
|
|
|
+ // 防止有空行,IdCard是必须要有的
|
|
|
|
+ if (StringUtils.isEmpty(thirdPartInfo.getIdCard())) {
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+ //将信息存入ThirdPartInfo表
|
|
|
|
+ thirdPartInfo.setStatus("4");
|
|
|
|
+ thirdPartInfo.setCreateBy(sysUser.getUserName());
|
|
|
|
+ thirdPartInfo.setUpdateBy(sysUser.getUserName());
|
|
|
|
+ thirdPartInfo.setIsDel("N");
|
|
|
|
+ thirdPartInfo.setProvinceId("12");
|
|
|
|
+ thirdPartInfo.setProvince("安徽省");
|
|
|
|
+ thirdPartInfo.setCityId("340800000000");
|
|
|
|
+ thirdPartInfo.setCity("安庆市");
|
|
|
|
+ thirdPartInfo.setRegionId("340882000000");
|
|
|
|
+ thirdPartInfo.setRegion("潜山市");
|
|
|
|
+ thirdPartInfo.setVillageTownsId("");
|
|
|
|
+ thirdPartInfo.setVillageTowns("");
|
|
|
|
+ thirdPartInfo.setVillageId("");
|
|
|
|
+ thirdPartInfo.setVillage("");
|
|
|
|
+ //从redis中取出部门数据
|
|
|
|
+ List<SysDept> allDepts = redisService.getCacheList(CacheConstants.DEPT_LIST);
|
|
|
|
+ thirdPartInfo.setIsLocal("否");
|
|
|
|
+ //去数据库根据人员身份证号查询人员
|
|
|
|
+ Czrk czrkSjk = czrkMapper.getCzrkByIdCard(thirdPartInfo.getIdCard());
|
|
|
|
+ if(ObjectUtils.isNotEmpty(czrkSjk)){
|
|
|
|
+ //数据库存在该人员
|
|
|
|
+ czrkSjk.setStatus("4");
|
|
|
|
+ czrkSjk.setChangUser(sysUser.getPhonenumber());
|
|
|
|
+ czrkSjk.setChangNikeUser(sysUser.getNickName());
|
|
|
|
+ czrkMapper.changeCzrk(czrkSjk);
|
|
|
|
+ thirdPartInfo.setIsLocal("是");
|
|
|
|
+ if(StringUtils.isNotEmpty(czrkSjk.getVillageTownsId())){
|
|
|
|
+ thirdPartInfo.setVillageTownsId(czrkSjk.getVillageTownsId());
|
|
|
|
+ }
|
|
|
|
+ if(StringUtils.isNotEmpty(czrkSjk.getVillageTowns())){
|
|
|
|
+ thirdPartInfo.setVillageTowns(czrkSjk.getVillageTowns());
|
|
|
|
+ }
|
|
|
|
+ if(StringUtils.isNotEmpty(czrkSjk.getVillageId())){
|
|
|
|
+ thirdPartInfo.setVillageId(czrkSjk.getVillageId());
|
|
|
|
+ }
|
|
|
|
+ if(StringUtils.isNotEmpty(czrkSjk.getVillage())){
|
|
|
|
+ thirdPartInfo.setVillage(czrkSjk.getVillage());
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ //获取乡镇
|
|
|
|
+ //乡镇deptId
|
|
|
|
+ Long deptId = null;
|
|
|
|
+ if(isNotEmpty(thirdPartInfo.getTownship())){
|
|
|
|
+ for (SysDept allDept : allDepts) {
|
|
|
|
+ if(allDept.getDeptName().equals(thirdPartInfo.getTownship()+"乡") || allDept.getDeptName().equals(thirdPartInfo.getTownship()+"镇")){
|
|
|
|
+ thirdPartInfo.setVillageTownsId(allDept.getAreaId());
|
|
|
|
+ thirdPartInfo.setVillageTowns(allDept.getDeptName());
|
|
|
|
+ deptId = allDept.getId();
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //获取村
|
|
|
|
+ if(isEmpty(deptId) && isNotEmpty(thirdPartInfo.getVillageGroup()) && thirdPartInfo.getVillageGroup().contains("村")){
|
|
|
|
+ String cun = thirdPartInfo.getVillageGroup().substring(0,thirdPartInfo.getVillageGroup().indexOf("村"));
|
|
|
|
+ for (SysDept allDept : allDepts) {
|
|
|
|
+ if(allDept.getParentId().equals(deptId) && allDept.getDeptName().contains(cun)){
|
|
|
|
+ thirdPartInfo.setVillageId(allDept.getAreaId());
|
|
|
|
+ thirdPartInfo.setVillage(allDept.getDeptName());
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ thirdPartInfoMapper.insertThirdPartInfoList(thirdPartInfoList);
|
|
|
|
+
|
|
|
|
+ return "导入成功";
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ return "导入失败";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<ThirdPartInfo> listDie(ThirdPartInfo thirdPartInfo) {
|
|
|
|
+ SysUser sysUser = AuthUtils.getLoginUser().getSysUser();
|
|
|
|
+ log.info("{}于{}查询非正常人员人员列表,查询条件:{}"
|
|
|
|
+ , sysUser.getUserName(), DateUtils.dateTimeNow(), JSON.toJSONString(thirdPartInfo));
|
|
|
|
+ //设置权限
|
|
|
|
+ setQueryRoleDie(thirdPartInfo, sysUser);
|
|
|
|
+ long startTimeSql = System.currentTimeMillis();
|
|
|
|
+ startPage();
|
|
|
|
+ List<ThirdPartInfo> thirdPartInfoList = thirdPartInfoMapper.queryList(thirdPartInfo);
|
|
|
|
+ long endTimeSql = System.currentTimeMillis() - startTimeSql;
|
|
|
|
+ log.info("执行查询死亡人员sql语句时间:" + endTimeSql + "ms");
|
|
|
|
+ return thirdPartInfoList;
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public Czrk getById(Long id) {
|
|
public Czrk getById(Long id) {
|
|
if (isEmpty(id)) {
|
|
if (isEmpty(id)) {
|