feat: 迁移国内标准法规部分5 标准号验证 导入 导出
This commit is contained in:
+59
@@ -0,0 +1,59 @@
|
||||
package com.adc.da.slrs.sarLawsInfo.controller;
|
||||
|
||||
|
||||
import cn.hutool.core.util.ZipUtil;
|
||||
import com.adc.da.http.PageInfo;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarLawsInfo.page.SarLawsInfoEOPage;
|
||||
import com.adc.da.slrs.sarLawsInfo.service.ISarLawsInfoService;
|
||||
import com.adc.da.util.LoginUserUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
|
||||
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
|
||||
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.adc.da.slrs.sarLawsInfo.entity.SarLawsInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "福田标准法规--标准法规库--法规信息")
|
||||
@RequestMapping("/sarLawsInfo/sar-laws-info")
|
||||
public class SarLawsInfoController extends BaseController<SarLawsInfo> {
|
||||
private static final Logger logger = LoggerFactory.getLogger(SarLawsInfoController.class);
|
||||
|
||||
@Autowired
|
||||
private ISarLawsInfoService sarLawsInfoEOService;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.adc.da.slrs.sarLawsInfo.dao;
|
||||
|
||||
import com.adc.da.slrs.sarLawsInfo.entity.SarLawsInfo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
public interface SarLawsInfoDao extends BaseMapper<SarLawsInfo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package com.adc.da.slrs.sarLawsInfo.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(value="SarLawsInfo对象", description="")
|
||||
public class SarLawsInfo extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId("ID")
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "法规分类(INLAND国内,FOREIGN国外)")
|
||||
@TableField("LAWS_TYPE")
|
||||
private String lawsType;
|
||||
|
||||
@ApiModelProperty(value = "国家地区")
|
||||
@TableField("COUNTRY")
|
||||
private String country;
|
||||
|
||||
@ApiModelProperty(value = "文件性质")
|
||||
@TableField("LAWS_PROPERTY")
|
||||
private String lawsProperty;
|
||||
|
||||
@ApiModelProperty(value = "文件号")
|
||||
@TableField("LAWS_NUMBER")
|
||||
private String lawsNumber;
|
||||
|
||||
@ApiModelProperty(value = "文件名称")
|
||||
@TableField("LAWS_NAME")
|
||||
private String lawsName;
|
||||
|
||||
@ApiModelProperty(value = "文件状态")
|
||||
@TableField("LAWS_STATE")
|
||||
private String lawsState;
|
||||
|
||||
@ApiModelProperty(value = "发布日期")
|
||||
@TableField("ISSUE_TIME")
|
||||
private String issueTime;
|
||||
|
||||
@ApiModelProperty(value = "实施日期")
|
||||
@TableField("PUT_TIME")
|
||||
private LocalDateTime putTime;
|
||||
|
||||
@ApiModelProperty(value = "代替文件号")
|
||||
@TableField("REPLACE_LAWS_NUM")
|
||||
private String replaceLawsNum;
|
||||
|
||||
@ApiModelProperty(value = "文件英文名称")
|
||||
@TableField("LAWS_EN_NAME")
|
||||
private String lawsEnName;
|
||||
|
||||
@ApiModelProperty(value = "被代替文件号")
|
||||
@TableField("REPLACED_LAWS_NUM")
|
||||
private String replacedLawsNum;
|
||||
|
||||
@TableField("CREATION_USER")
|
||||
private String creationUser;
|
||||
|
||||
@ApiModelProperty(value = "是否有效")
|
||||
@TableField("VALID_FLAG")
|
||||
private BigDecimal validFlag;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField("CREATION_TIME")
|
||||
private LocalDateTime creationTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@TableField("MODIFY_TIME")
|
||||
private LocalDateTime modifyTime;
|
||||
|
||||
@ApiModelProperty(value = "内容摘要")
|
||||
@TableField("SYNOPSIS")
|
||||
private String synopsis;
|
||||
|
||||
@ApiModelProperty(value = "引用标准")
|
||||
@TableField("CITE_STAND")
|
||||
private String citeStand;
|
||||
|
||||
@ApiModelProperty(value = "被引用标准")
|
||||
@TableField("CITED_STAND")
|
||||
private String citedStand;
|
||||
|
||||
@ApiModelProperty(value = "是否法规清单相关(0否 1是)")
|
||||
@TableField("IS_RELATE_ACCESS")
|
||||
private String isRelateAccess;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package com.adc.da.slrs.sarLawsInfo.page;
|
||||
|
||||
import com.adc.da.base.page.BasePage;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel(value="SarLawsInfo分页对象", description="")
|
||||
public class SarLawsInfoEOPage extends BasePage {
|
||||
|
||||
private Date modifyTime;
|
||||
private Date modifyTime1;
|
||||
private Date modifyTime2;
|
||||
private String modifyTimeOperator = "=";
|
||||
private Date creationTime;
|
||||
private Date creationTime1;
|
||||
private Date creationTime2;
|
||||
private String creationTimeOperator = "=";
|
||||
private String validFlag;
|
||||
private String validFlagOperator = "=";
|
||||
private String creationUser;
|
||||
private String creationUserOperator = "=";
|
||||
private String relevanceFile;
|
||||
private String relevanceFileOperator = "=";
|
||||
private String opinionFile;
|
||||
private String opinionFileOperator = "=";
|
||||
private String lawsFile;
|
||||
private String lawsFileOperator = "=";
|
||||
private String linkUri;
|
||||
private String linkUriOperator = "=";
|
||||
private String responsibleUnit;
|
||||
private String responsibleUnitOperator = "=";
|
||||
private String applyAuth;
|
||||
private String applyAuthOperator = "like";
|
||||
private String energyKind;
|
||||
private String energyKindOperator = "like";
|
||||
private String applyArctic;
|
||||
private String applyArcticOperator = "like";
|
||||
private String replaceLawsNum;
|
||||
private String replacedLawsNum;
|
||||
//需求变动,特此修改(byl),原 private String replaceLawsNumOperator = "=";
|
||||
private String replaceLawsNumOperator = "like";
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date putTime;
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date putTime1;
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date putTime2;
|
||||
private String putTimeOperator = "=";
|
||||
private String issueTime;
|
||||
private String issueTime1;
|
||||
private String issueTime2;
|
||||
private String issueTimeOperator = "=";
|
||||
private String lawsState;
|
||||
private String lawsStateOperator = "=";
|
||||
private String issueUnit;
|
||||
private String issueUnitOperator = "=";
|
||||
private String lawsName;
|
||||
private String lawsNameOperator = "like";
|
||||
private String lawsNumber;
|
||||
private String lawsNumberOperator = "like";
|
||||
private String lawsProperty;
|
||||
private String lawsPropertyOperator = "=";
|
||||
private String country;
|
||||
private String countryOperator = "=";
|
||||
private String lawsType;
|
||||
private String lawsTypeOperator = "=";
|
||||
private String id;
|
||||
private String idOperator = "=";
|
||||
private String menuId;
|
||||
private List<String> menuIdList;
|
||||
//为了在sql中区分修改操作
|
||||
private String updateFlag;
|
||||
//新加字段
|
||||
private String synopsis;
|
||||
private String lawsEnName;
|
||||
private String category;
|
||||
private String[] replaceLawsNumList;
|
||||
private String[] applyArcticList;
|
||||
private String[] energyKindList;
|
||||
private String[] applyAuthList;
|
||||
private List<String> menuRoleList;
|
||||
private String numberName;
|
||||
private String synchronId;
|
||||
private String[] idlist;
|
||||
// 树结构增加搜索条件
|
||||
private String collectMenuId;
|
||||
private String labelMenuId;
|
||||
private String advanceSearchVOStr;
|
||||
private String advanceSearchStr;
|
||||
private String isRelateAccess;
|
||||
private String ids;
|
||||
private String proType;
|
||||
private String userId;
|
||||
private Integer nowOrder;
|
||||
private Integer nowOrderBy;
|
||||
private String orderBy1 = "SAR_LAWS_INFO.issue_time";
|
||||
private String order1 = "desc";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.adc.da.slrs.sarLawsInfo.page;
|
||||
|
||||
import com.adc.da.base.page.BasePage;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel(value="", description="")
|
||||
public class SarLawsItemValEOPage extends BasePage {
|
||||
|
||||
private String modifyTime;
|
||||
private String modifyTime1;
|
||||
private String modifyTime2;
|
||||
private String modifyTimeOperator = "=";
|
||||
private String creationTime;
|
||||
private String creationTime1;
|
||||
private String creationTime2;
|
||||
private String creationTimeOperator = "=";
|
||||
private String validFlag;
|
||||
private String validFlagOperator = "=";
|
||||
private String propertyVal;
|
||||
private String propertyValOperator = "=";
|
||||
private String propertyType;
|
||||
private String propertyTypeOperator = "=";
|
||||
private String lawsItemId;
|
||||
private String lawsItemIdOperator = "=";
|
||||
private String id;
|
||||
private String idOperator = "=";
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.adc.da.slrs.sarLawsInfo.page;
|
||||
|
||||
import com.adc.da.base.page.BasePage;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel(value="", description="")
|
||||
public class SarLawsItemsEOPage extends BasePage {
|
||||
|
||||
private String modifyTime;
|
||||
private String modifyTime1;
|
||||
private String modifyTime2;
|
||||
private String modifyTimeOperator = "=";
|
||||
private String creationTime;
|
||||
private String creationTime1;
|
||||
private String creationTime2;
|
||||
private String creationTimeOperator = "=";
|
||||
private String creationUser;
|
||||
private String creationUserOperator = "=";
|
||||
private String validFlag;
|
||||
private String validFlagOperator = "=";
|
||||
private String remarks;
|
||||
private String remarksOperator = "=";
|
||||
private String responsibleUnit;
|
||||
private String responsibleUnitOperator = "like";
|
||||
private String energyKind;
|
||||
private String energyKindOperator = "=";
|
||||
private String applyArctic;
|
||||
private String applyArcticOperator = "=";
|
||||
private String tackTime;
|
||||
private String tackTime1;
|
||||
private String tackTime2;
|
||||
private String tackTimeOperator = "=";
|
||||
private String parts;
|
||||
private String partsOperator = "=";
|
||||
private String itemsName;
|
||||
private String itemsNameOperator = "=";
|
||||
private String itemsNum;
|
||||
private String itemsNumOperator = "=";
|
||||
private String lawsId;
|
||||
private String lawsIdOperator = "=";
|
||||
private String id;
|
||||
private String idOperator = "=";
|
||||
private String updateFlag;
|
||||
private String processFlag;
|
||||
private String nameOrRequest;
|
||||
private String[] idlist;
|
||||
private String fileType;
|
||||
private String proType;
|
||||
private String productId;
|
||||
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package com.adc.da.slrs.sarLawsInfo.service;
|
||||
|
||||
import com.adc.da.person.entity.PersonMsgEO;
|
||||
import com.adc.da.slrs.sarLawsInfo.entity.SarLawsInfo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
public interface ISarLawsInfoService extends IService<SarLawsInfo> {
|
||||
|
||||
boolean isRowEmpty(Row row);
|
||||
}
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
package com.adc.da.slrs.sarLawsInfo.service.impl;
|
||||
|
||||
import com.adc.da.common.SelectionTypeEnum;
|
||||
import com.adc.da.person.entity.PersonMsgEO;
|
||||
import com.adc.da.person.service.IPersonMsgEOService;
|
||||
import com.adc.da.slrs.sarLawsInfo.entity.SarLawsInfo;
|
||||
import com.adc.da.slrs.sarLawsInfo.dao.SarLawsInfoDao;
|
||||
import com.adc.da.slrs.sarLawsInfo.page.SarLawsInfoEOPage;
|
||||
import com.adc.da.slrs.sarLawsInfo.service.ISarLawsInfoService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.CellType;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.sql.Clob;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-06-01
|
||||
*/
|
||||
@Service
|
||||
public class SarLawsInfoServiceImpl extends ServiceImpl<SarLawsInfoDao, SarLawsInfo> implements ISarLawsInfoService {
|
||||
|
||||
@Autowired
|
||||
private SarLawsInfoDao dao;
|
||||
|
||||
@Autowired
|
||||
private IPersonMsgEOService personMsgEOService;
|
||||
|
||||
//判断row是否为空 空返回true
|
||||
public boolean isRowEmpty(Row row) {
|
||||
if (null == row) {
|
||||
return true;
|
||||
}
|
||||
int firstCellNum = row.getFirstCellNum(); //第一个列位置
|
||||
int lastCellNum = row.getLastCellNum(); //最后一列位置
|
||||
int nullCellNum = 0; //空列数量
|
||||
for (int c = firstCellNum; c < lastCellNum; c++) {
|
||||
Cell cell = row.getCell(c);
|
||||
if (null == cell || CellType.BLANK == cell.getCellType()) {
|
||||
nullCellNum ++;
|
||||
continue;
|
||||
}
|
||||
String value = "";
|
||||
switch (cell.getCellType()) {
|
||||
case NUMERIC: // 数字
|
||||
//如果为时间格式的内容
|
||||
value = String.valueOf(cell.getNumericCellValue());
|
||||
break;
|
||||
case STRING: // 字符串
|
||||
value = cell.getStringCellValue();
|
||||
break;
|
||||
case BOOLEAN: // Boolean
|
||||
value = cell.getBooleanCellValue() + "";
|
||||
break;
|
||||
case FORMULA: // 公式
|
||||
value = cell.getCellFormula() + "";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (StringUtils.isEmpty(value)) {
|
||||
nullCellNum ++;
|
||||
}
|
||||
}
|
||||
//所有列都为空
|
||||
if (nullCellNum == (lastCellNum - firstCellNum)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user