feat: 迁移国内标准法规部分1
This commit is contained in:
+124
-4
@@ -1,11 +1,45 @@
|
||||
package com.adc.da.slrs.sarStandardsInfo.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||
import cn.hutool.core.util.ZipUtil;
|
||||
import com.adc.da.att.entity.AttFileEO;
|
||||
import com.adc.da.common.FileUnZip;
|
||||
import com.adc.da.common.ReadExcel;
|
||||
import com.adc.da.exception.AdcDaBaseException;
|
||||
import com.adc.da.http.PageInfo;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.*;
|
||||
import com.adc.da.slrs.sarStandardsInfo.service.ISarStandardsInfoService;
|
||||
import com.adc.da.util.LoginUserUtil;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.adc.da.utils.util.*;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.apache.poi.util.IOUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
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.*;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -16,8 +50,94 @@ import com.adc.da.base.web.BaseController;
|
||||
* @since 2021-05-31
|
||||
*/
|
||||
@RestController
|
||||
@Api(description = "|SarStandardsInfo|")
|
||||
@Api(tags = "福田标准法规--标准法规库--国内标准法规")
|
||||
@RequestMapping("/sarStandardsInfo/sar-standards-info")
|
||||
public class SarStandardsInfoController extends BaseController<SarStandardsInfo> {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(SarStandardsInfoController.class);
|
||||
|
||||
@Autowired
|
||||
private ISarStandardsInfoService sarStandardsInfoEOService;
|
||||
|
||||
|
||||
@Value("${file.path}")
|
||||
private String filePath;
|
||||
|
||||
@Value("${file.downloadUrl}")
|
||||
private String fileDownloadPath;
|
||||
|
||||
@ApiOperation(value = "|SarStandardsInfoEO|自定义分页查询")
|
||||
@GetMapping("/getSarStandardsInfoPage")
|
||||
//@RequiresPermissions("lawss:sarStandardsInfo:getSarStandardsInfoPage")
|
||||
public ResponseMessage<PageInfo<SarStandardsInfo>> getSarStandardsInfoPage(SarStandardsInfoEOPage page) throws Exception {
|
||||
int isNull = -1;
|
||||
if (null != page.getNowOrderBy()) {
|
||||
switch (page.getNowOrderBy()) {
|
||||
case 1:
|
||||
page.setOrderBy1("issueTime");
|
||||
break;
|
||||
case 2:
|
||||
page.setOrderBy1("XCXSSRQPAIXU");
|
||||
break;
|
||||
case 3:
|
||||
page.setOrderBy1("ZCCSSRQPAIXU");
|
||||
break;
|
||||
case 4:
|
||||
page.setOrderBy1("standStateShow");
|
||||
break;
|
||||
case 5:
|
||||
page.setOrderBy1("paixu");
|
||||
break;
|
||||
default:
|
||||
page.setNowOrder(null);
|
||||
break;
|
||||
}
|
||||
if (null != page.getNowOrder()) {
|
||||
switch (page.getNowOrder()) {
|
||||
case 1:
|
||||
page.setOrder1("desc");
|
||||
break;
|
||||
case 2:
|
||||
page.setOrder1("asc");
|
||||
default:
|
||||
page.setOrder1(null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(page.getAdvanceSearchVOStr())) {
|
||||
List<SarAdvanceSearchVO> searchList = JSONObject.parseArray(page.getAdvanceSearchVOStr(),SarAdvanceSearchVO.class);
|
||||
int i = 0;
|
||||
for (SarAdvanceSearchVO sarAdvanceSearchVO:searchList){
|
||||
if ("SVPPS".equals(sarAdvanceSearchVO.getField()) && StringUtils.isBlank(sarAdvanceSearchVO.getValue())){
|
||||
isNull = i;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
if (-1 != isNull) {
|
||||
searchList.remove(isNull);
|
||||
}
|
||||
if (isNull == 0 && searchList.size() > 0){
|
||||
searchList.get(0).setConnect("");
|
||||
}
|
||||
String advanceStr = SarAdvanceSearchUtil.createSql(searchList);
|
||||
if (null != advanceStr) {
|
||||
advanceStr = advanceStr.replace("stand_number", "concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',SAR_STANDARDS_INFO.STAND_YEAR)");
|
||||
}
|
||||
if (-1 != isNull && StringUtils.isBlank(advanceStr)){
|
||||
advanceStr = advanceStr + " SVPPS is null";
|
||||
}else if (-1 != isNull && StringUtils.isNotBlank(advanceStr)){
|
||||
advanceStr = advanceStr + " and SVPPS is null";
|
||||
}
|
||||
if (StringUtils.isNotBlank(advanceStr)) {
|
||||
page.setAdvanceSearchStr(advanceStr);
|
||||
} else {
|
||||
page.setAdvanceSearchStr(null);
|
||||
}
|
||||
}
|
||||
page.setUserId(LoginUserUtil.getUserId());
|
||||
List<SarStandardsInfo> rows = sarStandardsInfoEOService.getSarStandardsInfoPage(page);
|
||||
return Result.success(getPageInfo(page.getPager(), rows));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+50
@@ -1,7 +1,12 @@
|
||||
package com.adc.da.slrs.sarStandardsInfo.dao;
|
||||
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.RecommendVO;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -13,4 +18,49 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
*/
|
||||
public interface SarStandardsInfoDao extends BaseMapper<SarStandardsInfo> {
|
||||
|
||||
List<SarStandardsInfo> getSarStandardsInfoPage(SarStandardsInfoEOPage page);
|
||||
|
||||
int getSarStandardsInfoCount(SarStandardsInfoEOPage page);
|
||||
|
||||
SarStandardsInfo selectByPrimaryKeyAndModifyTime(SarStandardsInfo page);
|
||||
|
||||
List<SarStandardsInfo> selectStandardsByStandnumber(SarStandardsInfo sarStandardsInfoEO);
|
||||
|
||||
Integer selectStandColumn(@Param("columnName") String columnName);
|
||||
|
||||
Integer selectCounterStandardsCount(SarStandardsInfo sarStandardsInfoEO);
|
||||
|
||||
int deleteByPrimaryKeyFlag(String id);
|
||||
|
||||
int updateByStandNum(SarStandardsInfo standardsInfoEO);
|
||||
|
||||
List<SarStandardsInfo> selectStandardsInfoByIdAndRole(SarStandardsInfoEOPage standEO);
|
||||
|
||||
int updateReplacedNumById(SarStandardsInfo sarStandardsInfoEO);
|
||||
|
||||
int updateCitedStandById(SarStandardsInfo sarStandardsInfoEO);
|
||||
|
||||
List<SarStandardsInfo> getSarStandardsExportInfo(SarStandardsInfoEOPage page);
|
||||
|
||||
List<SarStandardsInfo> selectStandardsInfoByKey(String id);
|
||||
|
||||
List<RecommendVO> selectRecommendStand(SarStandardsInfoEOPage pagenew);
|
||||
|
||||
List<String> countReplaceMsg(@Param("standNum") String standNum);
|
||||
|
||||
List<SarStandardsInfo> selectStandToUpState(@Param("stateName") String stateName);
|
||||
|
||||
List<SarStandardsInfo> selectStandToUpRepState();
|
||||
|
||||
List<SarStandardsInfo> selectStandToUpRepAndTime();
|
||||
|
||||
int updateStateById(@Param("state") String state,@Param("list") List<String> list);
|
||||
|
||||
int selectIsExit(@Param("id") String id);
|
||||
|
||||
//添加一个查询标准,但是不判断标准是否删除
|
||||
List<SarStandardsInfo> selectStandardsInfoByIdAndRoleAll(SarStandardsInfoEOPage standEO);
|
||||
|
||||
List<SarStandardsInfo> selectStandardsInfoBynumber(SarStandardsInfoEOPage page);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.adc.da.slrs.sarStandardsInfo.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Created by super_liu
|
||||
* 用于搜索中心的推荐
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class RecommendVO extends BaseEntity {
|
||||
|
||||
private String nameShow;
|
||||
private String numberShow;
|
||||
private String typeShow;
|
||||
private String id;
|
||||
private String module;
|
||||
|
||||
}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
package com.adc.da.slrs.sarStandardsInfo.entity;
|
||||
|
||||
/**
|
||||
* @Description: 标准法规库高级查询
|
||||
* @Author: yangxuenan
|
||||
* date: 2020/12/11 9:22
|
||||
*/
|
||||
public class SarAdvanceSearchVO {
|
||||
|
||||
private String field; //字段 如 标准类别
|
||||
|
||||
private String value; //值
|
||||
|
||||
private String type; //查询类型 如 = != like
|
||||
|
||||
private String connect; //连接符号 如 and or
|
||||
|
||||
private String timeSt;
|
||||
|
||||
private String timeEd;
|
||||
|
||||
public String getField() {
|
||||
return field;
|
||||
}
|
||||
|
||||
public void setField(String field) {
|
||||
this.field = field;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getConnect() {
|
||||
return connect;
|
||||
}
|
||||
|
||||
public void setConnect(String connect) {
|
||||
this.connect = connect;
|
||||
}
|
||||
|
||||
public String getTimeSt() {
|
||||
return timeSt;
|
||||
}
|
||||
|
||||
public void setTimeSt(String timeSt) {
|
||||
this.timeSt = timeSt;
|
||||
}
|
||||
|
||||
public String getTimeEd() {
|
||||
return timeEd;
|
||||
}
|
||||
|
||||
public void setTimeEd(String timeEd) {
|
||||
this.timeEd = timeEd;
|
||||
}
|
||||
}
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
package com.adc.da.slrs.sarStandardsInfo.entity;
|
||||
|
||||
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
/***
|
||||
* @Description: 根据导入模板的标题,基础表填写对应数据
|
||||
* @Author: yangxuenan
|
||||
* @Date: 2020/9/22 10:33
|
||||
* @Param:
|
||||
* @Return:
|
||||
*/
|
||||
public class SarStandImportDto {
|
||||
|
||||
public static void compareFieldAndName (String name, String value,SarStandardsInfo sarStandardsInfoEO) throws Exception{
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
switch(name){
|
||||
case "适用区域":
|
||||
sarStandardsInfoEO.setCountry(value);
|
||||
break;
|
||||
case "标准类别":
|
||||
sarStandardsInfoEO.setStandSort(value);
|
||||
break;
|
||||
case "标准编号":
|
||||
sarStandardsInfoEO.setStandNumber(value);
|
||||
break;
|
||||
case "标准年份":
|
||||
sarStandardsInfoEO.setStandYear(value);
|
||||
break;
|
||||
case "中文名称":
|
||||
sarStandardsInfoEO.setStandName(value);
|
||||
break;
|
||||
case "英文名称":
|
||||
sarStandardsInfoEO.setStandEnName(value);
|
||||
break;
|
||||
case "标准状态":
|
||||
sarStandardsInfoEO.setStandState(value);
|
||||
break;
|
||||
case "标准性质":
|
||||
sarStandardsInfoEO.setStandNature(value);
|
||||
break;
|
||||
case "发布日期":
|
||||
// Date iuuseDate = sdf.parse(value);
|
||||
sarStandardsInfoEO.setIssueTime(value);
|
||||
break;
|
||||
case "实施日期":
|
||||
// Date putDate = sdf.parse(value);
|
||||
sarStandardsInfoEO.setPutTime2(value);
|
||||
break;
|
||||
case "文本说明":
|
||||
sarStandardsInfoEO.setSynopsis(value);
|
||||
break;
|
||||
case "代替标准号":
|
||||
sarStandardsInfoEO.setReplaceStandNum(value);
|
||||
break;
|
||||
case "被代替标准号":
|
||||
sarStandardsInfoEO.setReplacedStandNum(value);
|
||||
break;
|
||||
case "重要度":
|
||||
sarStandardsInfoEO.setIsRelateAccess(value);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
+66
-4
@@ -1,18 +1,24 @@
|
||||
package com.adc.da.slrs.sarStandardsInfo.entity;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.adc.da.slrs.sarStandItems.entity.SarStandItems;
|
||||
import com.adc.da.sys.entity.DicTypeEO;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.data.annotation.Transient;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
@@ -72,7 +78,8 @@ public class SarStandardsInfo extends BaseEntity {
|
||||
|
||||
@ApiModelProperty(value = "实施日期")
|
||||
@TableField("PUT_TIME")
|
||||
private LocalDateTime putTime;
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private Date putTime;
|
||||
|
||||
@ApiModelProperty(value = "内容摘要")
|
||||
@TableField("SYNOPSIS")
|
||||
@@ -95,11 +102,13 @@ public class SarStandardsInfo extends BaseEntity {
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
@TableField("CREATION_TIME")
|
||||
private LocalDateTime creationTime;
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private Date creationTime;
|
||||
|
||||
@ApiModelProperty(value = "修改时间")
|
||||
@TableField("MODIFY_TIME")
|
||||
private LocalDateTime modifyTime;
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private Date modifyTime;
|
||||
|
||||
@ApiModelProperty(value = "是否法规清单相关(0否 1是)")
|
||||
@TableField("IS_RELATE_ACCESS")
|
||||
@@ -114,4 +123,57 @@ public class SarStandardsInfo extends BaseEntity {
|
||||
private String citedStand;
|
||||
|
||||
|
||||
// 以下为非表中字段
|
||||
@Transient
|
||||
private String collectId; // 收藏表ID
|
||||
@Transient
|
||||
private String countryShow; //国家地区显示名称
|
||||
@Transient
|
||||
private String standSortShow; // 标准类别显示名称
|
||||
@Transient
|
||||
private String standStateShow; // 标准状态显示名称
|
||||
@Transient
|
||||
private String standNatureShow; // 标准性质显示名称
|
||||
@Transient
|
||||
private String sychronId; // 同步数据ID
|
||||
@Transient
|
||||
private List<DicTypeEO> dicTypeList = new ArrayList(); // 记录标准涉及到的所有数据字典数据
|
||||
@Transient
|
||||
private Map<String, Object> attrInfoMap = new LinkedHashMap<>(); //属性表字段与值
|
||||
@Transient
|
||||
private String sarStandAttrEOStr; //新增修改时属性表信息
|
||||
@Transient
|
||||
private String menuId; //目录ID
|
||||
@Transient
|
||||
private int upReplaceNumFlag; //记录是否修改了替代文件号
|
||||
@Transient
|
||||
private int upNumFlag; //记录是否修改了文件号
|
||||
@Transient
|
||||
private String fileIds; //全部文件ID
|
||||
@Transient
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private Date newCarPutTime;
|
||||
@Transient
|
||||
private List<SarStandItems> itemsList = new ArrayList<>();
|
||||
@Transient
|
||||
private String relateStand;//对应其他标准
|
||||
@Transient
|
||||
private String accessCountry;//纳入清单的国家
|
||||
@Transient
|
||||
private String processNum;//流程编号
|
||||
@Transient
|
||||
private String textStatus;//文本状态
|
||||
// 在库里的标准节点类型(工作组)
|
||||
@Transient
|
||||
private String menuType;
|
||||
@Transient
|
||||
private String allPutTime;
|
||||
@Transient
|
||||
private String jspg;
|
||||
@Transient
|
||||
private String CHJL;
|
||||
|
||||
@Transient
|
||||
private String putTime2;
|
||||
|
||||
}
|
||||
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
package com.adc.da.slrs.sarStandardsInfo.entity;
|
||||
|
||||
import com.adc.da.base.page.BasePage;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <b>功能:</b>SAR_STANDARDS_INFO SarStandardsInfoEOPage<br>
|
||||
* <b>作者:</b>code generator<br>
|
||||
* <b>日期:</b> 2020-08-19 <br>
|
||||
* <b>版权所有:<b>版权归北京卡达克数据技术中心所有。<br>
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class SarStandardsInfoEOPage extends BasePage {
|
||||
|
||||
private String id;
|
||||
private String idOperator = "=";
|
||||
private String standType;
|
||||
private String standTypeOperator = "=";
|
||||
private String country;
|
||||
private String countryOperator = "=";
|
||||
private String standSort;
|
||||
private String standSortOperator = "=";
|
||||
private String standNumber;
|
||||
private String standNumberOperator = "=";
|
||||
private String standYear;
|
||||
private String standYearOperator = "=";
|
||||
private String standName;
|
||||
private String standNameOperator = "=";
|
||||
private String standEnName;
|
||||
private String standEnNameOperator = "=";
|
||||
private String standState;
|
||||
private String standStateOperator = "=";
|
||||
private String standNature;
|
||||
private String standNatureOperator = "=";
|
||||
private String issueTime;
|
||||
private String issueTime1;
|
||||
private String issueTime2;
|
||||
private String issueTimeOperator = "=";
|
||||
private String putTime;
|
||||
private String putTime1;
|
||||
private String putTime2;
|
||||
private String putTimeOperator = "=";
|
||||
private String synopsis;
|
||||
private String synopsisOperator = "=";
|
||||
private String replaceStandNum;
|
||||
private String replaceStandNumOperator = "=";
|
||||
private String replacedStandNum;
|
||||
private String replacedStandNumOperator = "=";
|
||||
private String creationUser;
|
||||
private String creationUserOperator = "=";
|
||||
private String validFlag;
|
||||
private String validFlagOperator = "=";
|
||||
private String creationTime;
|
||||
private String creationTime1;
|
||||
private String creationTime2;
|
||||
private String creationTimeOperator = "=";
|
||||
private String modifyTime;
|
||||
private String isRelateAccess;
|
||||
private String modifyTime1;
|
||||
private String modifyTime2;
|
||||
private String modifyTimeOperator = "=";
|
||||
private List<String> menuRoleList; //有权限的目录
|
||||
private String[] idlist; //多个id
|
||||
private String menuId; //目录ID
|
||||
private String rootMenuId;
|
||||
private String attrSearchStr;
|
||||
private String advanceSearchStr;
|
||||
private Map<String,String> attrSearchMap; //属性表数据条件查询
|
||||
// 树结构增加搜索条件
|
||||
private String collectMenuId;
|
||||
private String labelMenuId;
|
||||
private String applyArctic;
|
||||
private String ids;
|
||||
private List<String> replaceStandNumList;
|
||||
private List<String> menuAllChildrenIdList;
|
||||
private List<SarAdvanceSearchVO> advanceSearchVOList;
|
||||
private String advanceSearchVOStr;
|
||||
private String proType; // 请求的流程类型
|
||||
private String userId;
|
||||
private String productId;
|
||||
private Integer nowOrder;
|
||||
private Integer nowOrderBy;
|
||||
private String orderBy1 = "SAR_STANDARDS_INFO.issue_time";
|
||||
private String order1 = "desc";
|
||||
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.adc.da.slrs.sarStandardsInfo.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class StandardsInfoExcelVO {
|
||||
String exportType;
|
||||
String menuId;
|
||||
String labelMenuId;
|
||||
String exportContent;
|
||||
String exportName;
|
||||
String standType;
|
||||
String standSort;
|
||||
String standNumber;
|
||||
String collectMenuId;
|
||||
|
||||
}
|
||||
+28
@@ -1,8 +1,15 @@
|
||||
package com.adc.da.slrs.sarStandardsInfo.service;
|
||||
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.RecommendVO;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.StandardsInfoExcelVO;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
@@ -13,4 +20,25 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
*/
|
||||
public interface ISarStandardsInfoService extends IService<SarStandardsInfo> {
|
||||
|
||||
List<SarStandardsInfo> getSarStandardsInfoPage(SarStandardsInfoEOPage page) throws Exception;
|
||||
|
||||
// void createSarStandardsInfo(SarStandardsInfo sarStandardsInfoEO) throws Exception;
|
||||
//
|
||||
// int updateSarStandardsInfo(SarStandardsInfo sarStandardsInfoEO) throws Exception;
|
||||
//
|
||||
// int deleteSarStandards(String ids);
|
||||
//
|
||||
// List<SarStandardsInfo> getExportDatas (StandardsInfoExcelVO standardsInfoExcelVO) throws Exception;
|
||||
//
|
||||
// ResponseMessage<SarStandardsInfo> importSarStandardsInfoData(List<Map<String,String>> dataList, String standType, String menuId, String filepath);
|
||||
//
|
||||
// List<SarStandardsInfo> selectStandardsByStandnumber(String replaceStandNum, String standType);
|
||||
//
|
||||
// SarStandardsInfo selectStandardsInfoByKey(String id) throws Exception;
|
||||
//
|
||||
// boolean updateStandardsMenu(SarStandardsInfoEOPage standardsInfoEO);
|
||||
//
|
||||
// boolean updateStandInfo(SarStandardsInfoEOPage standardsInfoEO);
|
||||
//
|
||||
// List<RecommendVO> selectRecommendStand(SarStandardsInfoEOPage pagenew);
|
||||
}
|
||||
|
||||
+215
-1
@@ -1,11 +1,30 @@
|
||||
package com.adc.da.slrs.sarStandardsInfo.service.impl;
|
||||
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||
import com.adc.da.att.entity.AttFileEO;
|
||||
import com.adc.da.att.service.IAttFileEOService;
|
||||
import com.adc.da.common.*;
|
||||
import com.adc.da.person.service.IPersonCollectEOService;
|
||||
import com.adc.da.slrs.sarStandAttrInfo.dao.SarStandAttrInfoDao;
|
||||
import com.adc.da.slrs.sarStandItems.dao.SarStandItemsDao;
|
||||
import com.adc.da.slrs.sarStandItems.entity.SarStandItems;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.*;
|
||||
import com.adc.da.slrs.sarMenu.service.ISarMenuService;
|
||||
import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao;
|
||||
import com.adc.da.slrs.sarStandardsInfo.service.ISarStandardsInfoService;
|
||||
import com.adc.da.slrs.sysInfo.service.SysInfoEOService;
|
||||
import com.adc.da.sys.dao.DicTypeEODao;
|
||||
import com.adc.da.utils.util.*;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.sql.Clob;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
@@ -17,4 +36,199 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao, SarStandardsInfo> implements ISarStandardsInfoService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(SarStandardsInfoServiceImpl.class);
|
||||
|
||||
@Value("${elas.flag}")
|
||||
private boolean elasflag; //ES是否启用
|
||||
|
||||
@Autowired
|
||||
private SarStandardsInfoDao dao;
|
||||
|
||||
@Autowired
|
||||
private ISarMenuService sarMenuEOService;
|
||||
|
||||
@Autowired
|
||||
private IPersonCollectEOService personCollectEOService;
|
||||
|
||||
@Autowired
|
||||
private SarStandAttrInfoDao sarStandAttrInfoEODao;
|
||||
|
||||
@Autowired
|
||||
private IAttFileEOService attFileEOService;
|
||||
|
||||
@Autowired
|
||||
private DicTypeEODao dicTypeEODao;
|
||||
|
||||
@Autowired
|
||||
private SarStandItemsDao sarStandItemsEODao;
|
||||
|
||||
@Autowired
|
||||
private SysInfoEOService sysInfoEOService;
|
||||
|
||||
|
||||
|
||||
/***
|
||||
* @Description: 分页查询
|
||||
* @Author: super_liu
|
||||
* @Date: 2020/8/19 10:23
|
||||
* @Param: [page]
|
||||
* @Return: java.util.List<com.adc.da.lawss.entity.SarStandardsInfoEO>
|
||||
*/
|
||||
public List<SarStandardsInfo> getSarStandardsInfoPage(SarStandardsInfoEOPage page) throws Exception {
|
||||
//查询当前登录人角色拥有权限的菜单
|
||||
List<String> getMenuIdList = sarMenuEOService.queryRoleMenuIdList(page.getStandType()+"_STAND",null);
|
||||
if(getMenuIdList != null && !getMenuIdList.isEmpty()){
|
||||
page.setMenuRoleList(getMenuIdList);
|
||||
} else {
|
||||
page.setMenuRoleList(null);
|
||||
}
|
||||
List<String> ids = sarMenuEOService.getChildMenuList(page.getMenuId());
|
||||
if (ids != null && !ids.isEmpty()) {
|
||||
page.setMenuAllChildrenIdList(ids);
|
||||
}
|
||||
Integer rowCount = dao.getSarStandardsInfoCount(page);
|
||||
page.getPager().setRowCount(rowCount);
|
||||
List<SarStandardsInfo> sarlist = dao.getSarStandardsInfoPage(page);
|
||||
attrInfo(sarlist);
|
||||
return sarlist;
|
||||
}
|
||||
|
||||
/***
|
||||
* @Description: 处理属性表数据
|
||||
* @Author: super_liu
|
||||
* @Date: 2021/6/1 9:37
|
||||
* @Param: [sarlist]
|
||||
* @Return: void
|
||||
*/
|
||||
public void attrInfo (List<SarStandardsInfo> sarlist) throws Exception {
|
||||
for(SarStandardsInfo row : sarlist){
|
||||
attrInfoDetails(row);
|
||||
}
|
||||
}
|
||||
|
||||
public void attrInfoDetails (SarStandardsInfo row) throws Exception {
|
||||
String fieldInfo = InitStandAttrUtil.queryField;
|
||||
String collectId = personCollectEOService.queryCollectByUserAndId(row.getId());
|
||||
row.setCollectId(collectId);
|
||||
// 查询属性表数据
|
||||
if (StringUtils.isNotBlank(fieldInfo)) {
|
||||
Map<String, Object> getAttrMap = sarStandAttrInfoEODao.selectStandFieldAndData(fieldInfo,row.getId());
|
||||
if (InitStandAttrUtil.clobFieldList != null && !InitStandAttrUtil.clobFieldList.isEmpty()) {
|
||||
// 遍历修改所有clob类型的值
|
||||
for (String clobField : InitStandAttrUtil.clobFieldList) {
|
||||
Clob clobValue = (Clob) getAttrMap.get(clobField);
|
||||
String fieldValue = FieldConvertUtil.ClobToString(clobValue);
|
||||
getAttrMap.put(clobField,fieldValue);
|
||||
}
|
||||
}
|
||||
// 组织机构和人员
|
||||
Map<String,Object> newMap = new HashMap<>();
|
||||
if (getAttrMap != null) {
|
||||
for (Map.Entry<String,Object> entry : getAttrMap.entrySet()) {
|
||||
if ("EOPSSRQ".equals(entry.getKey())){
|
||||
if (entry.getValue() != null && entry.getValue().toString().length()>10){
|
||||
String time = DateUtil.formatStrUTCToDateStr(entry.getValue().toString());
|
||||
entry.setValue(time);
|
||||
}
|
||||
}
|
||||
String name = entry.getKey();
|
||||
if ("\"null\"".equals(entry.getValue())) {
|
||||
entry.setValue("");
|
||||
}
|
||||
if ("SVPPS".equals(name)) {
|
||||
Set<String> set = new HashSet();
|
||||
// 查询条款svpps
|
||||
Set<String> itemSvpps = sarStandItemsEODao.selectSvppsByStandId(row.getId(),null,null);
|
||||
if (itemSvpps != null && !itemSvpps.isEmpty()) {
|
||||
set.addAll(itemSvpps);
|
||||
}
|
||||
Object value = entry.getValue();
|
||||
if (value != null && StringUtils.isNotBlank(value.toString())) {
|
||||
set.addAll(Arrays.asList(value.toString().split(",")));
|
||||
}
|
||||
String allVal = ConcatStringUtil.concatSet(set);
|
||||
if (StringUtils.isNotBlank(allVal)) {
|
||||
entry.setValue(allVal);
|
||||
value = sysInfoEOService.getSvppsNamesByIds(allVal);
|
||||
}
|
||||
newMap.put(name + "Name",value);
|
||||
} else if ("YQLX".equals(name)) {
|
||||
//要求类型来源于条款
|
||||
SarStandItems sarStandItemsEO = new SarStandItems();
|
||||
sarStandItemsEO.setStandId(row.getId());
|
||||
Set<String> itemClaimType = sarStandItemsEODao.selectClaimTypesByStandId(row.getId(),null,null);
|
||||
if (itemClaimType != null && itemClaimType.size() > 1) {
|
||||
entry.setValue("RENVECPFGT");
|
||||
} else if (itemClaimType != null && itemClaimType.size() == 1) {
|
||||
entry.setValue(itemClaimType.toArray()[0]);
|
||||
}
|
||||
} else if (entry.getValue() != null && InitStandAttrUtil.selectionFieldList != null && InitStandAttrUtil.selectionFieldList.size() > 0 && InitStandAttrUtil.selectionFieldList.contains(name)) {
|
||||
String value = entry.getValue().toString();
|
||||
String selVal = InitStandAttrUtil.selectFieldMap.get(name);
|
||||
if (SelectionTypeEnum.ORGLIST.getValue().equals(selVal)) {
|
||||
value = sysInfoEOService.getOrgNamesByIds(value);
|
||||
newMap.put(name + "Name",value);
|
||||
} else if (SelectionTypeEnum.USERLIST.getValue().equals(selVal)) {
|
||||
value = sysInfoEOService.getUserNamesByIds(value);
|
||||
newMap.put(name + "Name",value);
|
||||
} else if (SelectionTypeEnum.ROLELIST.getValue().equals(selVal)) {
|
||||
value = sysInfoEOService.getRoleNamesByIds(value);
|
||||
newMap.put(name + "Name",value);
|
||||
}
|
||||
}
|
||||
}
|
||||
getAttrMap.putAll(newMap);
|
||||
}
|
||||
row.setAttrInfoMap(getAttrMap);
|
||||
}
|
||||
}
|
||||
|
||||
public void attrInfoShow (List<SarStandardsInfo> sarlist) throws Exception {
|
||||
for(SarStandardsInfo row : sarlist){
|
||||
attrInfoDetails(row);
|
||||
Map<String, Object> getAttrMap = row.getAttrInfoMap();
|
||||
Map<String, Object> getNewMap = new LinkedHashMap<>();
|
||||
if (getAttrMap != null && getAttrMap.size() > 0) {
|
||||
String svppsTip = "";
|
||||
for (Map.Entry<String,Object> entry : getAttrMap.entrySet()) {
|
||||
String name = entry.getKey();
|
||||
String value = "";
|
||||
if ("SVPPS".equals(name)) {
|
||||
Object svpps = entry.getValue();
|
||||
if (svpps != null && StringUtils.isNotBlank(svpps.toString())) {
|
||||
svppsTip = svpps.toString();
|
||||
}
|
||||
if (StringUtils.isNotBlank(svppsTip)) {
|
||||
svppsTip = sysInfoEOService.getSvppsNamesTipByIds(svppsTip);
|
||||
}
|
||||
value = String.valueOf(getAttrMap.get("SVPPSName"));
|
||||
entry.setValue(value);
|
||||
} else if (entry.getValue() != null && InitStandAttrUtil.fileFieldList != null && InitStandAttrUtil.fileFieldList.size() > 0 && InitStandAttrUtil.fileFieldList.contains(name)) {
|
||||
value = entry.getValue().toString();
|
||||
if (StringUtils.isNotBlank(value)) {
|
||||
List<AttFileEO> fileObj = attFileEOService.getMultiFileInfos(value);
|
||||
entry.setValue(fileObj);
|
||||
}
|
||||
} else if (entry.getValue() != null && InitStandAttrUtil.selectionFieldList != null && InitStandAttrUtil.selectionFieldList.size() > 0 && InitStandAttrUtil.selectionFieldList.contains(name)) {
|
||||
value = entry.getValue().toString();
|
||||
if ("GZZXX".equals(name)) {
|
||||
value = sysInfoEOService.getGroupNamesByIds(value);
|
||||
} else {
|
||||
String selVal = InitStandAttrUtil.selectFieldMap.get(name);
|
||||
if (SelectionTypeEnum.ORGLIST.getValue().equals(selVal) || SelectionTypeEnum.USERLIST.getValue().equals(selVal) || SelectionTypeEnum.ROLELIST.getValue().equals(selVal)) {
|
||||
if(getAttrMap.get(name + "Name") != null){
|
||||
value = String.valueOf(getAttrMap.get(name + "Name"));
|
||||
}
|
||||
} else {
|
||||
List<String> valArr = Arrays.asList(value.split(","));
|
||||
value = dicTypeEODao.getDicNamesByCodes(valArr);
|
||||
}
|
||||
}
|
||||
entry.setValue(value);
|
||||
}
|
||||
}
|
||||
getAttrMap.put("SVPPSTips",svppsTip);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user