|
@@ -2,8 +2,10 @@ package com.bootdo.datas.service.impl;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.bootdo.common.config.BootdoConfig;
|
|
import com.bootdo.common.config.BootdoConfig;
|
|
-import com.bootdo.common.utils.*;
|
|
|
|
-import com.bootdo.datas.domain.ExpertOpinionDO;
|
|
|
|
|
|
+import com.bootdo.common.utils.BDException;
|
|
|
|
+import com.bootdo.common.utils.FileUtil;
|
|
|
|
+import com.bootdo.common.utils.ShiroUtils;
|
|
|
|
+import com.bootdo.common.utils.StringUtils;
|
|
import com.bootdo.datas.dao.GyDataDao;
|
|
import com.bootdo.datas.dao.GyDataDao;
|
|
import com.bootdo.datas.dao.GyUnitDao;
|
|
import com.bootdo.datas.dao.GyUnitDao;
|
|
import com.bootdo.datas.domain.*;
|
|
import com.bootdo.datas.domain.*;
|
|
@@ -12,7 +14,6 @@ import com.bootdo.datas.dto.GyDataImportDTO;
|
|
import com.bootdo.datas.service.ExamineLogService;
|
|
import com.bootdo.datas.service.ExamineLogService;
|
|
import com.bootdo.datas.service.GyDataService;
|
|
import com.bootdo.datas.service.GyDataService;
|
|
import com.bootdo.datas.service.MessageHuNanService;
|
|
import com.bootdo.datas.service.MessageHuNanService;
|
|
-import com.bootdo.datas.service.MessageService;
|
|
|
|
import com.bootdo.datas.tools.ExcelUtils;
|
|
import com.bootdo.datas.tools.ExcelUtils;
|
|
import com.bootdo.datas.tools.gm.FileCryptTool;
|
|
import com.bootdo.datas.tools.gm.FileCryptTool;
|
|
import com.bootdo.system.domain.RoleDO;
|
|
import com.bootdo.system.domain.RoleDO;
|
|
@@ -32,7 +33,10 @@ import org.springframework.util.ObjectUtils;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
-import java.io.*;
|
|
|
|
|
|
+import java.io.File;
|
|
|
|
+import java.io.FileInputStream;
|
|
|
|
+import java.io.IOException;
|
|
|
|
+import java.io.InputStream;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
@Service
|
|
@Service
|
|
@@ -52,7 +56,7 @@ public class GyDataServiceImpl implements GyDataService {
|
|
@Value("${deployType:#{null}}")
|
|
@Value("${deployType:#{null}}")
|
|
public String deployType;
|
|
public String deployType;
|
|
|
|
|
|
- @Value("${sysProvince:#{null}}")
|
|
|
|
|
|
+ @Value("${sysProvince:#{null}}")
|
|
public String sysProvince;
|
|
public String sysProvince;
|
|
|
|
|
|
@Value("${sysCity:#{null}}")
|
|
@Value("${sysCity:#{null}}")
|
|
@@ -73,19 +77,21 @@ public class GyDataServiceImpl implements GyDataService {
|
|
log.info("currUser:" + currUser.toString());
|
|
log.info("currUser:" + currUser.toString());
|
|
if (!managerValue.contains(currUser.getDeptId().toString())) {
|
|
if (!managerValue.contains(currUser.getDeptId().toString())) {
|
|
String province = currUser.getProvince();
|
|
String province = currUser.getProvince();
|
|
- if(StringUtils.isEmpty(province)){
|
|
|
|
|
|
+ if (StringUtils.isEmpty(province)) {
|
|
province = sysProvince;
|
|
province = sysProvince;
|
|
}
|
|
}
|
|
- if(!ObjectUtils.isEmpty(province)) {
|
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(province)) {
|
|
map.put("unitProvince", province);
|
|
map.put("unitProvince", province);
|
|
}
|
|
}
|
|
|
|
|
|
String city = currUser.getCity();
|
|
String city = currUser.getCity();
|
|
- if(StringUtils.isEmpty(city)){
|
|
|
|
|
|
+ if (StringUtils.isEmpty(city)) {
|
|
city = sysCity;
|
|
city = sysCity;
|
|
}
|
|
}
|
|
|
|
|
|
- if(!ObjectUtils.isEmpty(city)){
|
|
|
|
|
|
+ String gyUnitId = currUser.getGyUnitId();
|
|
|
|
+ map.put("gyUnitId", gyUnitId);
|
|
|
|
+ if (!ObjectUtils.isEmpty(city)) {
|
|
map.put("unitCity", city);
|
|
map.put("unitCity", city);
|
|
map.put("auditStage", "1");
|
|
map.put("auditStage", "1");
|
|
} else {
|
|
} else {
|
|
@@ -93,7 +99,7 @@ public class GyDataServiceImpl implements GyDataService {
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ log.info("map:" + map.toString());
|
|
return gyDataDao.list(map);
|
|
return gyDataDao.list(map);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -105,26 +111,27 @@ public class GyDataServiceImpl implements GyDataService {
|
|
if (!managerValue.contains(currUser.getDeptId().toString())) {
|
|
if (!managerValue.contains(currUser.getDeptId().toString())) {
|
|
|
|
|
|
String province = currUser.getProvince();
|
|
String province = currUser.getProvince();
|
|
- if(StringUtils.isEmpty(province)){
|
|
|
|
|
|
+ if (StringUtils.isEmpty(province)) {
|
|
province = sysProvince;
|
|
province = sysProvince;
|
|
}
|
|
}
|
|
- if(!ObjectUtils.isEmpty(province)) {
|
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(province)) {
|
|
map.put("unitProvince", province);
|
|
map.put("unitProvince", province);
|
|
}
|
|
}
|
|
|
|
|
|
String city = currUser.getCity();
|
|
String city = currUser.getCity();
|
|
- if(StringUtils.isEmpty(city)){
|
|
|
|
|
|
+ if (StringUtils.isEmpty(city)) {
|
|
city = sysCity;
|
|
city = sysCity;
|
|
}
|
|
}
|
|
-
|
|
|
|
- if(!ObjectUtils.isEmpty(city)){
|
|
|
|
|
|
+ String gyUnitId = currUser.getGyUnitId();
|
|
|
|
+ map.put("gyUnitId", gyUnitId);
|
|
|
|
+ if (!ObjectUtils.isEmpty(city)) {
|
|
map.put("unitCity", city);
|
|
map.put("unitCity", city);
|
|
map.put("auditStage", "1");
|
|
map.put("auditStage", "1");
|
|
} else {
|
|
} else {
|
|
map.put("auditStage", "2");
|
|
map.put("auditStage", "2");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ log.info("map:" + map.toString());
|
|
return gyDataDao.countTotal(map);
|
|
return gyDataDao.countTotal(map);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -164,21 +171,21 @@ public class GyDataServiceImpl implements GyDataService {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * @description: 密文导入
|
|
|
|
|
|
+ * @description: 密文导入
|
|
* @param:
|
|
* @param:
|
|
* @return: int
|
|
* @return: int
|
|
* @author xhl
|
|
* @author xhl
|
|
* @date: 2022/9/7 14:28
|
|
* @date: 2022/9/7 14:28
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public String cipherTextImport(String decFlg,int type) throws Exception {
|
|
|
|
|
|
+ public String cipherTextImport(String decFlg, int type) throws Exception {
|
|
File file = new File(decFlg);
|
|
File file = new File(decFlg);
|
|
String result = null;
|
|
String result = null;
|
|
|
|
|
|
InputStream is = null;
|
|
InputStream is = null;
|
|
try {
|
|
try {
|
|
is = new FileInputStream(file);
|
|
is = new FileInputStream(file);
|
|
- result = imp(is,type);
|
|
|
|
|
|
+ result = imp(is, type);
|
|
// 清除临时数据
|
|
// 清除临时数据
|
|
FileUtil.deleteFile(decFlg);
|
|
FileUtil.deleteFile(decFlg);
|
|
} finally {
|
|
} finally {
|
|
@@ -194,21 +201,22 @@ public class GyDataServiceImpl implements GyDataService {
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
- * @description: 明文导入
|
|
|
|
|
|
+ * @description: 明文导入
|
|
* @param: file
|
|
* @param: file
|
|
* @return: java.lang.String
|
|
* @return: java.lang.String
|
|
* @author xhl
|
|
* @author xhl
|
|
* @date: 2022/9/7 14:23
|
|
* @date: 2022/9/7 14:23
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public String plainTextImport(MultipartFile file,int type) throws Exception {
|
|
|
|
|
|
+ public String plainTextImport(MultipartFile file, int type) throws Exception {
|
|
|
|
|
|
String result = null;
|
|
String result = null;
|
|
InputStream is = null;
|
|
InputStream is = null;
|
|
try {
|
|
try {
|
|
is = file.getInputStream();
|
|
is = file.getInputStream();
|
|
- result = imp(is,type);
|
|
|
|
|
|
+ result = imp(is, type);
|
|
} finally {
|
|
} finally {
|
|
try {
|
|
try {
|
|
is.close();
|
|
is.close();
|
|
@@ -221,7 +229,7 @@ public class GyDataServiceImpl implements GyDataService {
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
- private String imp(InputStream is,int type) throws Exception {
|
|
|
|
|
|
+ private String imp(InputStream is, int type) throws Exception {
|
|
int otherProvince = 0;
|
|
int otherProvince = 0;
|
|
int otherCity = 0;
|
|
int otherCity = 0;
|
|
int auditPass = 0;
|
|
int auditPass = 0;
|
|
@@ -237,22 +245,22 @@ public class GyDataServiceImpl implements GyDataService {
|
|
// 用户信息
|
|
// 用户信息
|
|
UserDO currUser = ShiroUtils.getUser();
|
|
UserDO currUser = ShiroUtils.getUser();
|
|
log.info("currUser:" + currUser.toString());
|
|
log.info("currUser:" + currUser.toString());
|
|
- if(null == currUser){
|
|
|
|
|
|
+ if (null == currUser) {
|
|
throw new BDException("当前用户没登录");
|
|
throw new BDException("当前用户没登录");
|
|
}
|
|
}
|
|
String userProvince = null;
|
|
String userProvince = null;
|
|
- String userCity= null;
|
|
|
|
|
|
+ String userCity = null;
|
|
|
|
|
|
if (managerValue.contains(currUser.getDeptId().toString())) {
|
|
if (managerValue.contains(currUser.getDeptId().toString())) {
|
|
userProvince = sysProvince;
|
|
userProvince = sysProvince;
|
|
userCity = sysCity;
|
|
userCity = sysCity;
|
|
} else {
|
|
} else {
|
|
userProvince = currUser.getProvince();
|
|
userProvince = currUser.getProvince();
|
|
- if(StringUtils.isEmpty(userProvince)){
|
|
|
|
|
|
+ if (StringUtils.isEmpty(userProvince)) {
|
|
userProvince = sysProvince;
|
|
userProvince = sysProvince;
|
|
}
|
|
}
|
|
userCity = currUser.getCity();
|
|
userCity = currUser.getCity();
|
|
- if(StringUtils.isEmpty(userCity)){
|
|
|
|
|
|
+ if (StringUtils.isEmpty(userCity)) {
|
|
userCity = sysCity;
|
|
userCity = sysCity;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -261,13 +269,13 @@ public class GyDataServiceImpl implements GyDataService {
|
|
Row firstRow = xssfSheet.getRow(0);
|
|
Row firstRow = xssfSheet.getRow(0);
|
|
Cell firstRowCell = firstRow.getCell(0);
|
|
Cell firstRowCell = firstRow.getCell(0);
|
|
int beginDataRowIndex = 0;
|
|
int beginDataRowIndex = 0;
|
|
- if("序号".equals(firstRowCell.getStringCellValue())){
|
|
|
|
|
|
+ if ("序号".equals(firstRowCell.getStringCellValue())) {
|
|
beginDataRowIndex = 1;
|
|
beginDataRowIndex = 1;
|
|
} else {
|
|
} else {
|
|
beginDataRowIndex = 4;
|
|
beginDataRowIndex = 4;
|
|
}
|
|
}
|
|
|
|
|
|
- if(xssfSheet.getLastRowNum() < beginDataRowIndex){ //getLastRowNum返回最后一行的索引,即 比行总数小1
|
|
|
|
|
|
+ if (xssfSheet.getLastRowNum() < beginDataRowIndex) { //getLastRowNum返回最后一行的索引,即 比行总数小1
|
|
throw new BDException("excel文件无数据");
|
|
throw new BDException("excel文件无数据");
|
|
}
|
|
}
|
|
// 遍历
|
|
// 遍历
|
|
@@ -278,7 +286,7 @@ public class GyDataServiceImpl implements GyDataService {
|
|
if (row.getCell(1) == null) {
|
|
if (row.getCell(1) == null) {
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- if(row.getLastCellNum()<52){ //getLastCellNum返回的是最后一列的列数,即 等于总列数
|
|
|
|
|
|
+ if (row.getLastCellNum() < 52) { //getLastCellNum返回的是最后一列的列数,即 等于总列数
|
|
throw new BDException("excel文件列数不正确");
|
|
throw new BDException("excel文件列数不正确");
|
|
}
|
|
}
|
|
//所属省份
|
|
//所属省份
|
|
@@ -307,30 +315,30 @@ public class GyDataServiceImpl implements GyDataService {
|
|
|
|
|
|
GyUnitDO tmpGyUnitDO = gyUnitDao.getGyUnitByCreditCode(row.getCell(17).getStringCellValue());
|
|
GyUnitDO tmpGyUnitDO = gyUnitDao.getGyUnitByCreditCode(row.getCell(17).getStringCellValue());
|
|
//判断是否已经在gu_unit表中添加企业信息
|
|
//判断是否已经在gu_unit表中添加企业信息
|
|
- if (ObjectUtils.isEmpty(tmpGyUnitDO) ) {
|
|
|
|
|
|
+ if (ObjectUtils.isEmpty(tmpGyUnitDO)) {
|
|
//没有添加企业信息, 需要进行企业信息的添加,审核状态为【未审核】
|
|
//没有添加企业信息, 需要进行企业信息的添加,审核状态为【未审核】
|
|
try {
|
|
try {
|
|
this.createGyUnitDO(gyUnitDO, row);
|
|
this.createGyUnitDO(gyUnitDO, row);
|
|
gyUnitDO.setCreateTime(new Date());
|
|
gyUnitDO.setCreateTime(new Date());
|
|
gyUnitDO.setAuditStatus("0");
|
|
gyUnitDO.setAuditStatus("0");
|
|
gyUnitDao.save(gyUnitDO);
|
|
gyUnitDao.save(gyUnitDO);
|
|
- log.info("========first_load_data======create_gy_unit======sucess:"+gyUnitDO.toString());
|
|
|
|
|
|
+ log.info("========first_load_data======create_gy_unit======sucess:" + gyUnitDO.toString());
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
log.error("error enterprise-only : {}", e.getMessage());
|
|
log.error("error enterprise-only : {}", e.getMessage());
|
|
}
|
|
}
|
|
unitNoAudit++;
|
|
unitNoAudit++;
|
|
break;
|
|
break;
|
|
} else {
|
|
} else {
|
|
- if ( !"1".equals(tmpGyUnitDO.getAuditStatus()) ){
|
|
|
|
|
|
+ if (!"1".equals(tmpGyUnitDO.getAuditStatus())) {
|
|
unitNoAudit++;
|
|
unitNoAudit++;
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
//无数据导出
|
|
//无数据导出
|
|
- if ("/".equals(row.getCell(1).getStringCellValue()) && row.getCell(16).getStringCellValue() !=null && !"/".equals(row.getCell(16).getStringCellValue())) {
|
|
|
|
|
|
+ if ("/".equals(row.getCell(1).getStringCellValue()) && row.getCell(16).getStringCellValue() != null && !"/".equals(row.getCell(16).getStringCellValue())) {
|
|
|
|
|
|
- int count = gyUnitDao.getGyUnit(this.createGyUnitDO(gyUnitDO,row));
|
|
|
|
|
|
+ int count = gyUnitDao.getGyUnit(this.createGyUnitDO(gyUnitDO, row));
|
|
if (count == 0) {
|
|
if (count == 0) {
|
|
try {
|
|
try {
|
|
gyUnitDO.setCreateTime(new Date());
|
|
gyUnitDO.setCreateTime(new Date());
|
|
@@ -348,8 +356,8 @@ public class GyDataServiceImpl implements GyDataService {
|
|
gyDataDO.setDataTypeBase(row.getCell(2).getStringCellValue());//数据分类分级规范
|
|
gyDataDO.setDataTypeBase(row.getCell(2).getStringCellValue());//数据分类分级规范
|
|
gyDataDO.setDataTypeOne(row.getCell(3).getStringCellValue());//数据一级类别
|
|
gyDataDO.setDataTypeOne(row.getCell(3).getStringCellValue());//数据一级类别
|
|
gyDataDO.setDataTypeTwo(row.getCell(4).getStringCellValue());//数据二级类别
|
|
gyDataDO.setDataTypeTwo(row.getCell(4).getStringCellValue());//数据二级类别
|
|
- gyDataDO.setDataTypeThree(row.getCell(5)==null?null:row.getCell(5).getStringCellValue());//数据三级类别
|
|
|
|
- gyDataDO.setDataTypeFour(row.getCell(6)==null?null:row.getCell(6).getStringCellValue());//数据四级类别
|
|
|
|
|
|
+ gyDataDO.setDataTypeThree(row.getCell(5) == null ? null : row.getCell(5).getStringCellValue());//数据三级类别
|
|
|
|
+ gyDataDO.setDataTypeFour(row.getCell(6) == null ? null : row.getCell(6).getStringCellValue());//数据四级类别
|
|
gyDataDO.setDataLevel(row.getCell(7).getStringCellValue());//数据级别
|
|
gyDataDO.setDataLevel(row.getCell(7).getStringCellValue());//数据级别
|
|
gyDataDO.setDataCarrier(row.getCell(8).getStringCellValue());//数据载体
|
|
gyDataDO.setDataCarrier(row.getCell(8).getStringCellValue());//数据载体
|
|
gyDataDO.setDataSource(row.getCell(9).getStringCellValue());//数据来源
|
|
gyDataDO.setDataSource(row.getCell(9).getStringCellValue());//数据来源
|
|
@@ -361,7 +369,7 @@ public class GyDataServiceImpl implements GyDataService {
|
|
gyDataDO.setDataPrecisionDes(row.getCell(15).getStringCellValue());//数据精度描述
|
|
gyDataDO.setDataPrecisionDes(row.getCell(15).getStringCellValue());//数据精度描述
|
|
|
|
|
|
//添加企业信息
|
|
//添加企业信息
|
|
- gyUnitList.add(this.createGyUnitDO(gyUnitDO,row));
|
|
|
|
|
|
+ gyUnitList.add(this.createGyUnitDO(gyUnitDO, row));
|
|
|
|
|
|
gyDataDO.setDataHandleType(row.getCell(26).getStringCellValue());//数据处理方式
|
|
gyDataDO.setDataHandleType(row.getCell(26).getStringCellValue());//数据处理方式
|
|
gyDataDO.setDataResult(row.getCell(27).getStringCellValue());//数据目的
|
|
gyDataDO.setDataResult(row.getCell(27).getStringCellValue());//数据目的
|
|
@@ -395,12 +403,12 @@ public class GyDataServiceImpl implements GyDataService {
|
|
gyDataDO.setSendVerify("0");// 送审状态 0:未送审 1:已送审
|
|
gyDataDO.setSendVerify("0");// 送审状态 0:未送审 1:已送审
|
|
gyDataDO.setDataStatus("0"); // 状态 0:待审核 1:删除 2:已上报 3:通过审核 4:驳回
|
|
gyDataDO.setDataStatus("0"); // 状态 0:待审核 1:删除 2:已上报 3:通过审核 4:驳回
|
|
gyDataDO.setDeleteStatus("0"); // 状态 0:正常 1:删除
|
|
gyDataDO.setDeleteStatus("0"); // 状态 0:正常 1:删除
|
|
- if("1".equals(deployType)){ //市级单独部署
|
|
|
|
|
|
+ if ("1".equals(deployType)) { //市级单独部署
|
|
gyDataDO.setAuditStage("1");
|
|
gyDataDO.setAuditStage("1");
|
|
- } else if("2".equals(deployType)){ //省级单独部署
|
|
|
|
|
|
+ } else if ("2".equals(deployType)) { //省级单独部署
|
|
gyDataDO.setAuditStage("2");
|
|
gyDataDO.setAuditStage("2");
|
|
- } else if("3".equals(deployType)){ //省市一体部署
|
|
|
|
- if(StringUtils.isNotEmpty(currUser.getCity())){ //市级人员操作
|
|
|
|
|
|
+ } else if ("3".equals(deployType)) { //省市一体部署
|
|
|
|
+ if (StringUtils.isNotEmpty(currUser.getCity())) { //市级人员操作
|
|
gyDataDO.setAuditStage("1");
|
|
gyDataDO.setAuditStage("1");
|
|
} else { //省级人员
|
|
} else { //省级人员
|
|
if (managerValue.contains(currUser.getDeptId().toString())) { //机构是管理员
|
|
if (managerValue.contains(currUser.getDeptId().toString())) { //机构是管理员
|
|
@@ -410,16 +418,16 @@ public class GyDataServiceImpl implements GyDataService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- } else if(type == 2){ //数据目录导入
|
|
|
|
|
|
+ } else if (type == 2) { //数据目录导入
|
|
gyDataDO.setSendVerify("1");// 送审状态 0:未送审 1:已送审
|
|
gyDataDO.setSendVerify("1");// 送审状态 0:未送审 1:已送审
|
|
gyDataDO.setDataStatus("3"); // 状态 0:待审核 1:删除 2:已上报 3:通过审核 4:驳回
|
|
gyDataDO.setDataStatus("3"); // 状态 0:待审核 1:删除 2:已上报 3:通过审核 4:驳回
|
|
gyDataDO.setDeleteStatus("0"); // 状态 0:正常 1:删除
|
|
gyDataDO.setDeleteStatus("0"); // 状态 0:正常 1:删除
|
|
- if("1".equals(deployType)){ //市级单独部署
|
|
|
|
|
|
+ if ("1".equals(deployType)) { //市级单独部署
|
|
throw new BDException("不支持该操作,请到“报送到省级”列表操作");
|
|
throw new BDException("不支持该操作,请到“报送到省级”列表操作");
|
|
- } else if("2".equals(deployType)){ //省级单独部署
|
|
|
|
|
|
+ } else if ("2".equals(deployType)) { //省级单独部署
|
|
gyDataDO.setAuditStage("2");
|
|
gyDataDO.setAuditStage("2");
|
|
- } else if("3".equals(deployType)){ //省市一体部署
|
|
|
|
- if(StringUtils.isNotEmpty(currUser.getCity())){ //市级人员操作
|
|
|
|
|
|
+ } else if ("3".equals(deployType)) { //省市一体部署
|
|
|
|
+ if (StringUtils.isNotEmpty(currUser.getCity())) { //市级人员操作
|
|
throw new BDException("市级人员无权操作");
|
|
throw new BDException("市级人员无权操作");
|
|
} else {
|
|
} else {
|
|
gyDataDO.setAuditStage("2");
|
|
gyDataDO.setAuditStage("2");
|
|
@@ -430,12 +438,12 @@ public class GyDataServiceImpl implements GyDataService {
|
|
gyDataDO.setSendVerify("1");// 送审状态 0:未送审 1:已送审
|
|
gyDataDO.setSendVerify("1");// 送审状态 0:未送审 1:已送审
|
|
gyDataDO.setDataStatus("3"); // 状态 0:待审核 1:删除 2:已上报 3:通过审核 4:驳回
|
|
gyDataDO.setDataStatus("3"); // 状态 0:待审核 1:删除 2:已上报 3:通过审核 4:驳回
|
|
gyDataDO.setDeleteStatus("0"); // 状态 0:正常 1:删除
|
|
gyDataDO.setDeleteStatus("0"); // 状态 0:正常 1:删除
|
|
- if("1".equals(deployType)){ //市级单独部署
|
|
|
|
|
|
+ if ("1".equals(deployType)) { //市级单独部署
|
|
gyDataDO.setAuditStage("1");
|
|
gyDataDO.setAuditStage("1");
|
|
- } else if("2".equals(deployType)){ //省级单独部署
|
|
|
|
|
|
+ } else if ("2".equals(deployType)) { //省级单独部署
|
|
throw new BDException("不支持该操作,请到“数据目录”列表操作");
|
|
throw new BDException("不支持该操作,请到“数据目录”列表操作");
|
|
- } else if("3".equals(deployType)){ //省市一体部署
|
|
|
|
- if(StringUtils.isNotEmpty(currUser.getCity())){ //市级人员操作
|
|
|
|
|
|
+ } else if ("3".equals(deployType)) { //省市一体部署
|
|
|
|
+ if (StringUtils.isNotEmpty(currUser.getCity())) { //市级人员操作
|
|
gyDataDO.setAuditStage("1");
|
|
gyDataDO.setAuditStage("1");
|
|
} else {
|
|
} else {
|
|
if (managerValue.contains(currUser.getDeptId().toString())) { //机构是管理员
|
|
if (managerValue.contains(currUser.getDeptId().toString())) { //机构是管理员
|
|
@@ -454,13 +462,13 @@ public class GyDataServiceImpl implements GyDataService {
|
|
params.put("gyUnitId", gyDataDO.getGyUnitId());// 单位
|
|
params.put("gyUnitId", gyDataDO.getGyUnitId());// 单位
|
|
//判断数据是否已经上传过
|
|
//判断数据是否已经上传过
|
|
List<GyDataImportDTO> listInfo = gyDataDao.listId(params);
|
|
List<GyDataImportDTO> listInfo = gyDataDao.listId(params);
|
|
- if (listInfo !=null && listInfo.size()>0) {
|
|
|
|
|
|
+ if (listInfo != null && listInfo.size() > 0) {
|
|
GyDataImportDTO gyDataImportDTO = listInfo.get(0);
|
|
GyDataImportDTO gyDataImportDTO = listInfo.get(0);
|
|
- if("3".equals(gyDataImportDTO.getDataStatus())){ //审核通过数据不导入
|
|
|
|
|
|
+ if ("3".equals(gyDataImportDTO.getDataStatus())) { //审核通过数据不导入
|
|
log.info("审核通过数据id:" + gyDataImportDTO.getId());
|
|
log.info("审核通过数据id:" + gyDataImportDTO.getId());
|
|
auditPass++;
|
|
auditPass++;
|
|
continue;
|
|
continue;
|
|
- } else{
|
|
|
|
|
|
+ } else {
|
|
// 删除数据
|
|
// 删除数据
|
|
log.info("删除数据id:" + gyDataImportDTO.getId());
|
|
log.info("删除数据id:" + gyDataImportDTO.getId());
|
|
gyDataDao.remove(gyDataImportDTO.getId());
|
|
gyDataDao.remove(gyDataImportDTO.getId());
|
|
@@ -519,7 +527,7 @@ public class GyDataServiceImpl implements GyDataService {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- private GyUnitDO createGyUnitDO(GyUnitDO gyUnitDO, Row row){
|
|
|
|
|
|
+ private GyUnitDO createGyUnitDO(GyUnitDO gyUnitDO, Row row) {
|
|
gyUnitDO.setReporterUnit(row.getCell(16).getStringCellValue());// 数据处理者名称
|
|
gyUnitDO.setReporterUnit(row.getCell(16).getStringCellValue());// 数据处理者名称
|
|
gyUnitDO.setCreditCode(row.getCell(17).getStringCellValue());// 统一社会信用代码(机构代码 )
|
|
gyUnitDO.setCreditCode(row.getCell(17).getStringCellValue());// 统一社会信用代码(机构代码 )
|
|
gyUnitDO.setUnitProvince(row.getCell(18).getStringCellValue());//所在地区(省)
|
|
gyUnitDO.setUnitProvince(row.getCell(18).getStringCellValue());//所在地区(省)
|
|
@@ -550,7 +558,7 @@ public class GyDataServiceImpl implements GyDataService {
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public void updateStatus(GyDataImportDTO data,String opinion) {
|
|
|
|
|
|
+ public void updateStatus(GyDataImportDTO data, String opinion) {
|
|
int effect = gyDataDao.updateStatus(data);
|
|
int effect = gyDataDao.updateStatus(data);
|
|
|
|
|
|
if ("2".equalsIgnoreCase(data.getDataStatus()) && effect > 0) {
|
|
if ("2".equalsIgnoreCase(data.getDataStatus()) && effect > 0) {
|
|
@@ -585,39 +593,39 @@ public class GyDataServiceImpl implements GyDataService {
|
|
dto.setOpinion(opinion);
|
|
dto.setOpinion(opinion);
|
|
examineLogService.save(dto);
|
|
examineLogService.save(dto);
|
|
}
|
|
}
|
|
- if("湖南".equals(this.sysProvince)){
|
|
|
|
|
|
+ if ("湖南".equals(this.sysProvince)) {
|
|
//通过数据id,查询数据信息
|
|
//通过数据id,查询数据信息
|
|
GyDataImportDTO importDTO = gyDataDao.get(data.getId());
|
|
GyDataImportDTO importDTO = gyDataDao.get(data.getId());
|
|
- if(Objects.nonNull(importDTO)){
|
|
|
|
|
|
+ if (Objects.nonNull(importDTO)) {
|
|
//发送短息
|
|
//发送短息
|
|
- if("2".equals(importDTO.getAuditStage())){
|
|
|
|
- log.info("=====================发送短信了===数据信息查询==="+importDTO.toString());
|
|
|
|
|
|
+ if ("2".equals(importDTO.getAuditStage())) {
|
|
|
|
+ log.info("=====================发送短信了===数据信息查询===" + importDTO.toString());
|
|
//审核阶段: 1:市级,2:省级
|
|
//审核阶段: 1:市级,2:省级
|
|
GyUnitDO gyUnitDO = gyUnitDao.getGyUnitByCreditCode(importDTO.getGyUnitId());
|
|
GyUnitDO gyUnitDO = gyUnitDao.getGyUnitByCreditCode(importDTO.getGyUnitId());
|
|
- log.info("=====================发送短信了===企业信息查询==="+gyUnitDO.toString());
|
|
|
|
- if(Objects.nonNull(gyUnitDO)){
|
|
|
|
|
|
+ log.info("=====================发送短信了===企业信息查询===" + gyUnitDO.toString());
|
|
|
|
+ if (Objects.nonNull(gyUnitDO)) {
|
|
try {
|
|
try {
|
|
- log.info("=====================发送短信了===start==="+gyUnitDO.toString());
|
|
|
|
- messageHuNanService.sendMessage(gyUnitDO.getDataSecurityWay()+","+gyUnitDO.getMobilePhone(),
|
|
|
|
|
|
+ log.info("=====================发送短信了===start===" + gyUnitDO.toString());
|
|
|
|
+ messageHuNanService.sendMessage(gyUnitDO.getDataSecurityWay() + "," + gyUnitDO.getMobilePhone(),
|
|
importDTO.getDataName());
|
|
importDTO.getDataName());
|
|
- log.info("=====================发送短信了===end==="+gyUnitDO.toString());
|
|
|
|
|
|
+ log.info("=====================发送短信了===end===" + gyUnitDO.toString());
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- log.error("=============messageHuNanService.sendMessage=======error======="+e.getMessage());
|
|
|
|
|
|
+ log.error("=============messageHuNanService.sendMessage=======error=======" + e.getMessage());
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
- log.info("=========企业的组织机构代码:"+importDTO.getGyUnitId()+",查询不到对应的企业信息===========");
|
|
|
|
|
|
+ } else {
|
|
|
|
+ log.info("=========企业的组织机构代码:" + importDTO.getGyUnitId() + ",查询不到对应的企业信息===========");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }else {
|
|
|
|
- log.error("=========数据id:"+data.getId()+",查询不到对应的数据信息===========");
|
|
|
|
|
|
+ } else {
|
|
|
|
+ log.error("=========数据id:" + data.getId() + ",查询不到对应的数据信息===========");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public void addExpertOpinion(ExpertOpinionDO expertOpinionDO){
|
|
|
|
|
|
+ public void addExpertOpinion(ExpertOpinionDO expertOpinionDO) {
|
|
GyDataImportDTO gyDataImportDTO = get(expertOpinionDO.getId());
|
|
GyDataImportDTO gyDataImportDTO = get(expertOpinionDO.getId());
|
|
RoleDO roleDO = roleService.get(gyDataImportDTO.getRoleId());
|
|
RoleDO roleDO = roleService.get(gyDataImportDTO.getRoleId());
|
|
if (roleDO != null) {
|
|
if (roleDO != null) {
|
|
@@ -661,20 +669,21 @@ public class GyDataServiceImpl implements GyDataService {
|
|
if (!managerValue.contains(currUser.getDeptId().toString())) {
|
|
if (!managerValue.contains(currUser.getDeptId().toString())) {
|
|
|
|
|
|
String province = currUser.getProvince();
|
|
String province = currUser.getProvince();
|
|
- if(StringUtils.isEmpty(province)){
|
|
|
|
|
|
+ if (StringUtils.isEmpty(province)) {
|
|
province = sysProvince;
|
|
province = sysProvince;
|
|
}
|
|
}
|
|
- if(!ObjectUtils.isEmpty(province)) {
|
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(province)) {
|
|
map.put("unitProvince", province);
|
|
map.put("unitProvince", province);
|
|
}
|
|
}
|
|
|
|
|
|
String city = currUser.getCity();
|
|
String city = currUser.getCity();
|
|
- if(StringUtils.isEmpty(city)){
|
|
|
|
|
|
+ if (StringUtils.isEmpty(city)) {
|
|
city = sysCity;
|
|
city = sysCity;
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
- if(!ObjectUtils.isEmpty(city)){
|
|
|
|
|
|
+ String gyUnitId = currUser.getGyUnitId();
|
|
|
|
+ map.put("gyUnitId", gyUnitId);
|
|
|
|
+ if (!ObjectUtils.isEmpty(city)) {
|
|
map.put("unitCity", city);
|
|
map.put("unitCity", city);
|
|
map.put("auditStage", "1");
|
|
map.put("auditStage", "1");
|
|
} else {
|
|
} else {
|
|
@@ -692,19 +701,20 @@ public class GyDataServiceImpl implements GyDataService {
|
|
if (!managerValue.contains(currUser.getDeptId().toString())) {
|
|
if (!managerValue.contains(currUser.getDeptId().toString())) {
|
|
|
|
|
|
String province = currUser.getProvince();
|
|
String province = currUser.getProvince();
|
|
- if(StringUtils.isEmpty(province)){
|
|
|
|
|
|
+ if (StringUtils.isEmpty(province)) {
|
|
province = sysProvince;
|
|
province = sysProvince;
|
|
}
|
|
}
|
|
- if(!ObjectUtils.isEmpty(province)) {
|
|
|
|
|
|
+ if (!ObjectUtils.isEmpty(province)) {
|
|
map.put("unitProvince", province);
|
|
map.put("unitProvince", province);
|
|
}
|
|
}
|
|
|
|
|
|
String city = currUser.getCity();
|
|
String city = currUser.getCity();
|
|
- if(StringUtils.isEmpty(city)){
|
|
|
|
|
|
+ if (StringUtils.isEmpty(city)) {
|
|
city = sysCity;
|
|
city = sysCity;
|
|
}
|
|
}
|
|
-
|
|
|
|
- if(!ObjectUtils.isEmpty(city)){
|
|
|
|
|
|
+ String gyUnitId = currUser.getGyUnitId();
|
|
|
|
+ map.put("gyUnitId", gyUnitId);
|
|
|
|
+ if (!ObjectUtils.isEmpty(city)) {
|
|
map.put("unitCity", city);
|
|
map.put("unitCity", city);
|
|
map.put("auditStage", "1");
|
|
map.put("auditStage", "1");
|
|
} else {
|
|
} else {
|
|
@@ -718,7 +728,7 @@ public class GyDataServiceImpl implements GyDataService {
|
|
@Override
|
|
@Override
|
|
public int recover(Long id) {
|
|
public int recover(Long id) {
|
|
GyDataImportDTO gyDataImportDTO = gyDataDao.getRecoverData(id);
|
|
GyDataImportDTO gyDataImportDTO = gyDataDao.getRecoverData(id);
|
|
- if("1".equals(gyDataImportDTO.getDeleteStatus())){ //属于删除数据
|
|
|
|
|
|
+ if ("1".equals(gyDataImportDTO.getDeleteStatus())) { //属于删除数据
|
|
Map<String, Object> params = new HashMap<>();
|
|
Map<String, Object> params = new HashMap<>();
|
|
params.put("dataName", gyDataImportDTO.getDataName());// 数据名称
|
|
params.put("dataName", gyDataImportDTO.getDataName());// 数据名称
|
|
params.put("gyUnitId", gyDataImportDTO.getGyUnitId());// 单位
|
|
params.put("gyUnitId", gyDataImportDTO.getGyUnitId());// 单位
|
|
@@ -729,17 +739,17 @@ public class GyDataServiceImpl implements GyDataService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
UserDO currUser = ShiroUtils.getUser();
|
|
UserDO currUser = ShiroUtils.getUser();
|
|
- String auditStage =null;
|
|
|
|
- if("1".equals(deployType)){ //市级单独部署
|
|
|
|
|
|
+ String auditStage = null;
|
|
|
|
+ if ("1".equals(deployType)) { //市级单独部署
|
|
auditStage = "1";
|
|
auditStage = "1";
|
|
- } else if("2".equals(deployType)){ //省级单独部署
|
|
|
|
|
|
+ } else if ("2".equals(deployType)) { //省级单独部署
|
|
auditStage = "2";
|
|
auditStage = "2";
|
|
- } else if("3".equals(deployType)){ //省市一体部署
|
|
|
|
|
|
+ } else if ("3".equals(deployType)) { //省市一体部署
|
|
if (managerValue.contains(currUser.getDeptId().toString())) { //机构是管理员
|
|
if (managerValue.contains(currUser.getDeptId().toString())) { //机构是管理员
|
|
auditStage = "1";
|
|
auditStage = "1";
|
|
} else {
|
|
} else {
|
|
String city = currUser.getCity();
|
|
String city = currUser.getCity();
|
|
- if(StringUtils.isEmpty(city)){ //一般省级人员
|
|
|
|
|
|
+ if (StringUtils.isEmpty(city)) { //一般省级人员
|
|
auditStage = "2";
|
|
auditStage = "2";
|
|
} else { //一般市级人员
|
|
} else { //一般市级人员
|
|
auditStage = "1";
|
|
auditStage = "1";
|
|
@@ -760,7 +770,7 @@ public class GyDataServiceImpl implements GyDataService {
|
|
@Override
|
|
@Override
|
|
public void encryptExports(HttpServletResponse responses, String idValue) throws Exception {
|
|
public void encryptExports(HttpServletResponse responses, String idValue) throws Exception {
|
|
List<GyDataExcelDO> list = new ArrayList<>();
|
|
List<GyDataExcelDO> list = new ArrayList<>();
|
|
- JSONArray json = (JSONArray)JSONArray.parse(idValue);
|
|
|
|
|
|
+ JSONArray json = (JSONArray) JSONArray.parse(idValue);
|
|
for (int i = 0; i < json.size(); i++) {
|
|
for (int i = 0; i < json.size(); i++) {
|
|
String id = String.valueOf(json.get(i));
|
|
String id = String.valueOf(json.get(i));
|
|
log.info("批量导出 id:" + json.get(i));
|
|
log.info("批量导出 id:" + json.get(i));
|
|
@@ -773,30 +783,81 @@ public class GyDataServiceImpl implements GyDataService {
|
|
String decFile = bootdoConfig.getUploadPath() + "数据备案导出信息.xlsx";
|
|
String decFile = bootdoConfig.getUploadPath() + "数据备案导出信息.xlsx";
|
|
String encFile = bootdoConfig.getUploadPath() + "数据备案加密导出信息.xlsx";
|
|
String encFile = bootdoConfig.getUploadPath() + "数据备案加密导出信息.xlsx";
|
|
|
|
|
|
- ExcelUtils.encryptExport(responses, EncryptExcelDO.class,list,bootdoConfig.getCrtPrival(),decFile,encFile);
|
|
|
|
|
|
+ ExcelUtils.encryptExport(responses, EncryptExcelDO.class, list, bootdoConfig.getCrtPrival(), decFile, encFile);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public int countAaAssData(Long id){
|
|
|
|
|
|
+ public int countAaAssData(Long id) {
|
|
return gyDataDao.countAaAssData(id);
|
|
return gyDataDao.countAaAssData(id);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public List<GyDataImportDTO> dataEntryList(Map<String, Object> map) {
|
|
public List<GyDataImportDTO> dataEntryList(Map<String, Object> map) {
|
|
- return gyDataDao.list(map);
|
|
|
|
|
|
+ UserDO currUser = ShiroUtils.getUser();
|
|
|
|
+ log.info("currUser:" + currUser.toString());
|
|
|
|
+ if (!managerValue.contains(currUser.getDeptId().toString())) {
|
|
|
|
+ String province = currUser.getProvince();
|
|
|
|
+ if (StringUtils.isEmpty(province)) {
|
|
|
|
+ province = sysProvince;
|
|
|
|
+ }
|
|
|
|
+ if (!ObjectUtils.isEmpty(province)) {
|
|
|
|
+ map.put("unitProvince", province);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ String city = currUser.getCity();
|
|
|
|
+ if (StringUtils.isEmpty(city)) {
|
|
|
|
+ city = sysCity;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ String gyUnitId = currUser.getGyUnitId();
|
|
|
|
+ map.put("gyUnitId", gyUnitId);
|
|
|
|
+ if (!ObjectUtils.isEmpty(city)) {
|
|
|
|
+ map.put("unitCity", city);
|
|
|
|
+ map.put("auditStage", "1");
|
|
|
|
+ } else {
|
|
|
|
+ map.put("auditStage", "2");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ return gyDataDao.list(map);
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public int dataEntryCountTotal(Map<String, Object> map) {
|
|
public int dataEntryCountTotal(Map<String, Object> map) {
|
|
|
|
+ UserDO currUser = ShiroUtils.getUser();
|
|
|
|
+ log.info("currUser:" + currUser.toString());
|
|
|
|
+ if (!managerValue.contains(currUser.getDeptId().toString())) {
|
|
|
|
+
|
|
|
|
+ String province = currUser.getProvince();
|
|
|
|
+ if (StringUtils.isEmpty(province)) {
|
|
|
|
+ province = sysProvince;
|
|
|
|
+ }
|
|
|
|
+ if (!ObjectUtils.isEmpty(province)) {
|
|
|
|
+ map.put("unitProvince", province);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ String city = currUser.getCity();
|
|
|
|
+ if (StringUtils.isEmpty(city)) {
|
|
|
|
+ city = sysCity;
|
|
|
|
+ }
|
|
|
|
+ String gyUnitId = currUser.getGyUnitId();
|
|
|
|
+ map.put("gyUnitId", gyUnitId);
|
|
|
|
+ if (!ObjectUtils.isEmpty(city)) {
|
|
|
|
+ map.put("unitCity", city);
|
|
|
|
+ map.put("auditStage", "1");
|
|
|
|
+ } else {
|
|
|
|
+ map.put("auditStage", "2");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
return gyDataDao.countTotal(map);
|
|
return gyDataDao.countTotal(map);
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
|
|
+ * @param multiFile
|
|
|
|
+ * @param fileName
|
|
* @Description: MultipartFile转file
|
|
* @Description: MultipartFile转file
|
|
* @Author: wangp
|
|
* @Author: wangp
|
|
* @Date: 2022/2/25 9:15
|
|
* @Date: 2022/2/25 9:15
|
|
- * @param multiFile
|
|
|
|
- * @param fileName
|
|
|
|
* @Return: File
|
|
* @Return: File
|
|
*/
|
|
*/
|
|
public static File MultipartFileToFile(MultipartFile multiFile, String fileName) {
|
|
public static File MultipartFileToFile(MultipartFile multiFile, String fileName) {
|
|
@@ -823,7 +884,6 @@ public class GyDataServiceImpl implements GyDataService {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
public static void main(String[] args) {
|
|
public static void main(String[] args) {
|
|
FileCryptTool.encryptFile("F:/dev-dys/sm2/sm2_client_enc_cert.crt", "F:/dev-dys/res/测试导入-河南.xlsx",
|
|
FileCryptTool.encryptFile("F:/dev-dys/sm2/sm2_client_enc_cert.crt", "F:/dev-dys/res/测试导入-河南.xlsx",
|
|
"F:/dev-dys/res/enc-测试导入加密文件-河南.xlsx");
|
|
"F:/dev-dys/res/enc-测试导入加密文件-河南.xlsx");
|