Merge remote-tracking branch 'origin/develop_master' into develop_1
This commit is contained in:
@@ -24,8 +24,8 @@ import org.springframework.stereotype.Component;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
|
||||
@EnableScheduling
|
||||
@Component
|
||||
@@ -215,56 +215,50 @@ public class ScheduledJob {
|
||||
//查询代替标准字段得到一个 被代替了的标准的id的键值对列表
|
||||
List<Map<String, Object>> replaceStandIdMaps = sarStandAttrInfoDao.selectMaps(columnForDTBJH);
|
||||
HashMap<String, Integer> replaceIdCountMap = new HashMap<>();
|
||||
|
||||
|
||||
// 格式为 T/CSAE 175-2021
|
||||
Pattern pattern = Pattern.compile("^\\S*\\s\\S*[\\u2014\\u002d\\s]\\d{4}$");
|
||||
replaceStandIdMaps.forEach(item->{
|
||||
if (item!=null){
|
||||
//此标准代替的标准的标准号的数组
|
||||
String DTBJHStr = item.get("DTBJH").toString();
|
||||
|
||||
//数据格式: (GB 123-2000,GB 4233434-2021,GB 423423423-2021)
|
||||
if (!DTBJHStr.equals("")){
|
||||
try{
|
||||
String[] DTBJHArray = DTBJHStr.split(",");
|
||||
for (String DTBJH : DTBJHArray) {
|
||||
String[] sortAndNumberAndYear = DTBJH.split("\\s+");
|
||||
String sort = sortAndNumberAndYear[0];
|
||||
|
||||
String[] numberAndYear = sortAndNumberAndYear[1].split("\\-");
|
||||
String number=numberAndYear[0];
|
||||
String year=numberAndYear[1];
|
||||
|
||||
QueryWrapper<SarStandardsInfo> infoWrapper = new QueryWrapper<>();
|
||||
infoWrapper.select("ID")
|
||||
.eq("STAND_SORT",sort)
|
||||
.eq("STAND_NUMBER",number)
|
||||
.eq("STAND_YEAR",year);
|
||||
|
||||
|
||||
List<Map<String, Object>> idMaps = sarStandardsInfoDao.selectMaps(infoWrapper);
|
||||
if (idMaps.size()>0){
|
||||
String standId = idMaps.get(0).get("ID").toString();
|
||||
//如果代替标准id已存在则映射为2不存在则添加并映射为1
|
||||
if (replaceIdCountMap.containsKey(standId)) {
|
||||
replaceIdCountMap.replace(standId,2);
|
||||
}else {
|
||||
replaceIdCountMap.put(standId, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!DTBJHStr.equals("")) {
|
||||
String[] DTBJHArray = DTBJHStr.split(",");
|
||||
for (String DTBJH : DTBJHArray) {
|
||||
|
||||
if (!pattern.matcher(DTBJH).matches()){
|
||||
continue;
|
||||
}
|
||||
}catch (Exception e){
|
||||
System.out.println("=====错误===="+item+"=====错误=====");
|
||||
|
||||
String[] split = DTBJH.split("[\\u2014\\u002d\\s]");//以空格或'-'或'—'分割
|
||||
String sort = split[0];
|
||||
String number = split[1];
|
||||
String year = split[2];
|
||||
|
||||
QueryWrapper<SarStandardsInfo> infoWrapper = new QueryWrapper<>();
|
||||
infoWrapper.select("ID")
|
||||
.eq("STAND_SORT", sort)
|
||||
.eq("STAND_NUMBER", number)
|
||||
.eq("STAND_YEAR", year);
|
||||
|
||||
|
||||
List<Map<String, Object>> idMaps = sarStandardsInfoDao.selectMaps(infoWrapper);
|
||||
if (idMaps.size() > 0) {
|
||||
String standId = idMaps.get(0).get("ID").toString();
|
||||
//如果代替标准id已存在则映射为2不存在则添加并映射为1
|
||||
if (replaceIdCountMap.containsKey(standId)) {
|
||||
replaceIdCountMap.replace(standId, 2);
|
||||
} else {
|
||||
replaceIdCountMap.put(standId, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
+4
-5
@@ -47,11 +47,10 @@ public class ImportExcelController extends BaseController<ImportDto> {
|
||||
@PostMapping("/import")
|
||||
public void deleteList(MultipartFile file, MultipartFile file2, HttpServletResponse response, HttpServletRequest request) throws IOException {
|
||||
Map<String, List<ImportDto>> mapMap=importExcelService.getExcelData(file,file2);
|
||||
List<ImportDto> errorList = importExcelService.storageExclData(mapMap);
|
||||
// ResponseMessage responseMessage=new ResponseMessage();
|
||||
// responseMessage.setMessage(mapMap.toString());
|
||||
// responseMessage.isOk();
|
||||
|
||||
List<ImportDto> errorList = importExcelService.storageExclData(mapMap);
|
||||
// List<ImportDto> guonei= mapMap.get("GNBZ");
|
||||
// List<ImportDto> haiwai = mapMap.get("HWBZ");
|
||||
// List<ImportDto> qibiao = mapMap.get("QYBZ");
|
||||
OutputStream os = null;
|
||||
Workbook workbook = null;
|
||||
try {
|
||||
|
||||
+108
-87
@@ -34,7 +34,9 @@ import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@Service
|
||||
public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDto> implements ImportExcelService {
|
||||
@@ -75,16 +77,19 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
",NB/T,CJ/T,YS/T,SJ/T,BB/T,SN/T,SB/T,MH/T,DB11,SZDB/Z,HKG,T/ZSA,CSAE,T/CAS,T/CADA,T/CHTS,T/ITS,T/BJQC";
|
||||
private final static String QB = "Q/QCBFC,Q/FT,Q/FL,Q/QCFLC,Q/BQB,Q/SGT," +
|
||||
"Q-AMSN,QB-NE,Q-IOUM,Q房/AYJ,KNT";
|
||||
private final static String DATE = "-2008,—2008,-2009,—2009,-2010,—2010,-2011,—2011,-2012,—2012,-2013,—2013," +
|
||||
"- 2008,— 2008,- 2009,— 2009,- 2010,— 2010,- 2011,— 2011,- 2012,— 2012,- 2013,— 2013" +
|
||||
",-2014,—2014,-2015,—2015,-2016,—2016,-2017,—2017,-2018,—2018,-2019,—2019,-2020,—2020,-2021,—2021" +
|
||||
",- 2014,— 2014,- 2015,— 2015,- 2016,— 2016,- 2017,— 2017,- 2018,— 2018,- 2019,— 2019,- 2020,— 2020,- 2021,— 2021";
|
||||
|
||||
|
||||
// file 为主 file2 为附件
|
||||
@Override
|
||||
public Map<String, List<ImportDto>> getExcelData(MultipartFile file, MultipartFile file2) {
|
||||
|
||||
List<String> dates=new ArrayList<>();
|
||||
for(int i=1669;i<2023;i++){
|
||||
dates.add("-"+i);
|
||||
dates.add("—"+i);
|
||||
dates.add("- "+i);
|
||||
dates.add("— "+i);
|
||||
}
|
||||
|
||||
if (file == null || file.getSize() == 0) {
|
||||
log.error("文件上传错误,重新上传");
|
||||
}
|
||||
@@ -133,7 +138,7 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
datas.forEach(items -> {
|
||||
//判断是否是正确的数据
|
||||
String[] as = items.split(",");
|
||||
if (!inDate(as[0])) {
|
||||
if (!inDate(as[0],dates)) {
|
||||
ImportDto importDto = getImportDto(as);
|
||||
error.add(importDto);
|
||||
middle.put(as[0].trim(), "error-"+error.size());
|
||||
@@ -176,8 +181,7 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
return res;
|
||||
}
|
||||
|
||||
private boolean inDate(String as) {
|
||||
List<String> dates = new ArrayList<>(Arrays.asList(DATE.split(",")));
|
||||
private boolean inDate(String as,List<String> dates) {
|
||||
if (null != as && !"".equals(as)) {
|
||||
for (String s : dates) {
|
||||
if (s.equals(as.trim())) {
|
||||
@@ -283,6 +287,8 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
private String importPath;
|
||||
|
||||
private List<ImportDto> error=new ArrayList<>();
|
||||
|
||||
private List<ImportDto> fileError=new ArrayList<>();
|
||||
@Override
|
||||
public List<ImportDto> storageExclData(Map<String, List<ImportDto>> importListMap) {
|
||||
|
||||
@@ -296,8 +302,8 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
String standID = UUIDUtils.randomUUID20();
|
||||
|
||||
SarStandardsInfo sarStandardsInfo = parseImportDtoToStandardsInfo(item, standID);
|
||||
|
||||
|
||||
//
|
||||
//
|
||||
if (sarStandardsInfo!=null)
|
||||
{
|
||||
SarStandAttrInfo sarStandAttrInfo = parseImportDtoToStandAttrInfo(item, standID);
|
||||
@@ -422,7 +428,6 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
|
||||
if (sarBussionessStand!=null) {
|
||||
|
||||
|
||||
SarBussStandAttrInfo sarBussStandAttrInfo = parseImportDtoToSarBussStandAttrInfo(item, standId);
|
||||
|
||||
|
||||
@@ -451,16 +456,11 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
} catch (Exception e) {
|
||||
item.setErrorStr("数据格式错误");
|
||||
error.add(item);
|
||||
importListMap.replace("error",error);
|
||||
System.out.println("issueTime====Hello======" + sarBussionessStand.getIssueTime() + "===hello=====" + item);
|
||||
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
|
||||
}else {
|
||||
item.setErrorStr("标准号无法解析");
|
||||
error.add(item);
|
||||
importListMap.replace("error",error);
|
||||
}
|
||||
|
||||
});
|
||||
@@ -470,8 +470,7 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
// String head="standId,standName,standNameEN,publishTime,implementedTime" +
|
||||
// ",standStatus,replaceId,path";
|
||||
// String headStr="标准号,标准名称,英文名称,发布时间,实施时间,标准状态,代替标准号,附件路径";
|
||||
|
||||
|
||||
error.addAll(fileError);
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -482,41 +481,34 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
|
||||
public SarStandardsInfo parseImportDtoToStandardsInfo(ImportDto importDto,String standId){
|
||||
|
||||
String sort="";
|
||||
String number="";
|
||||
String year="";
|
||||
try {
|
||||
String[] sortAndNumberAndYear = importDto.getStandId().split("\\s+");
|
||||
sort = sortAndNumberAndYear[0];
|
||||
|
||||
String[] numberAndYear = sortAndNumberAndYear[1].split("\\-");
|
||||
number=numberAndYear[0];
|
||||
year=numberAndYear[1];
|
||||
|
||||
}catch (Exception e){
|
||||
HashMap<String, String> analysis = analysisStandId(importDto);
|
||||
if (analysis==null){
|
||||
return null;
|
||||
}else {
|
||||
|
||||
System.out.println("id为"+importDto.getStandId()+"格式无法解析");
|
||||
// return null;
|
||||
SarStandardsInfo sarStandardsInfo = new SarStandardsInfo();
|
||||
sarStandardsInfo.setId(standId);
|
||||
|
||||
|
||||
sarStandardsInfo.setStandSort(analysis.get("sort"));
|
||||
sarStandardsInfo.setStandNumber(analysis.get("number"));
|
||||
sarStandardsInfo.setStandYear(analysis.get("year"));
|
||||
|
||||
sarStandardsInfo.setStandName(importDto.getStandName());
|
||||
sarStandardsInfo.setStandEnName(importDto.getStandNameEN());
|
||||
|
||||
String issueDate = importDto.getPublishTime().substring(0, 9);
|
||||
sarStandardsInfo.setIssueTime(issueDate);//标准发布日期
|
||||
|
||||
String standStatus = importDto.getStandStatus();
|
||||
if ("有效".equals(standStatus)) {
|
||||
sarStandardsInfo.setTextStatus("vsaga7nwub");//现行有效
|
||||
}
|
||||
|
||||
return sarStandardsInfo;
|
||||
}
|
||||
|
||||
SarStandardsInfo sarStandardsInfo = new SarStandardsInfo();
|
||||
sarStandardsInfo.setId(standId);
|
||||
|
||||
|
||||
sarStandardsInfo.setStandSort(sort);
|
||||
sarStandardsInfo.setStandNumber(number);
|
||||
sarStandardsInfo.setStandYear(year);
|
||||
|
||||
sarStandardsInfo.setStandName(importDto.getStandName());
|
||||
sarStandardsInfo.setStandEnName(importDto.getStandNameEN());
|
||||
sarStandardsInfo.setIssueTime(importDto.getPublishTime());//标准发布日期
|
||||
|
||||
String standStatus = importDto.getStandStatus();
|
||||
if ("有效".equals(standStatus)){
|
||||
sarStandardsInfo.setTextStatus("vsaga7nwub");//现行有效
|
||||
}
|
||||
|
||||
return sarStandardsInfo;
|
||||
}
|
||||
|
||||
|
||||
@@ -529,7 +521,9 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
sarStandAttrInfo.setId(UUIDUtils.randomUUID20());
|
||||
sarStandAttrInfo.setStandId(standId);
|
||||
sarStandAttrInfo.setDtbjh(importDto.getReplaceId());
|
||||
sarStandAttrInfo.setSsrq(importDto.getImplementedTime());
|
||||
|
||||
String ssrqDate = importDto.getImplementedTime().substring(0, 9);
|
||||
sarStandAttrInfo.setSsrq(ssrqDate);
|
||||
sarStandAttrInfo.setValidFlag("0");
|
||||
|
||||
|
||||
@@ -564,7 +558,7 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
sarStandardsInfoService.createStandFile(standId,fileMap);
|
||||
} catch (Exception e) {
|
||||
importDto.setErrorStr("创建标准文件异常");
|
||||
error.add(importDto);
|
||||
fileError.add(importDto);
|
||||
e.printStackTrace();
|
||||
System.out.println("创建标准文件异常");
|
||||
}
|
||||
@@ -572,12 +566,12 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
sarStandAttrInfo.setGlwj(fileInfo.getAttId());
|
||||
}else {
|
||||
importDto.setErrorStr("文件不存在");
|
||||
error.add(importDto);
|
||||
fileError.add(importDto);
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
importDto.setErrorStr("文件打开失败");
|
||||
error.add(importDto);
|
||||
fileError.add(importDto);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -597,41 +591,29 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
public SarBussionessStand parseImportDtoToSarBussionessStand(ImportDto importDto,String standId){
|
||||
|
||||
|
||||
if(importDto.getStandId()==null){
|
||||
HashMap<String, String> analysis = analysisStandId(importDto);
|
||||
if (analysis==null){
|
||||
return null;
|
||||
}else {
|
||||
SarBussionessStand sarBussionessStand = new SarBussionessStand();
|
||||
sarBussionessStand.setId(standId);
|
||||
sarBussionessStand.setStandSort(analysis.get("sort"));
|
||||
sarBussionessStand.setStandYear(analysis.get("year"));
|
||||
sarBussionessStand.setStandCode(importDto.getStandId());
|
||||
sarBussionessStand.setStandName(importDto.getStandName());
|
||||
sarBussionessStand.setStandEnName(importDto.getStandNameEN());
|
||||
sarBussionessStand.setIssueTime(importDto.getPublishTime());
|
||||
sarBussionessStand.setPutTime(importDto.getImplementedTime());
|
||||
sarBussionessStand.setReplacedStandNum(importDto.getReplaceId());
|
||||
sarBussionessStand.setValidFlag(0);
|
||||
if ("有效".equals(importDto.getStandStatus())){
|
||||
sarBussionessStand.setTextStatusBuss("vsaga7nwub");
|
||||
}
|
||||
return sarBussionessStand;
|
||||
}
|
||||
|
||||
|
||||
String sort="";
|
||||
String number="";
|
||||
String year="";
|
||||
try {
|
||||
String[] sortAndNumberAndYear = importDto.getStandId().split("\\s+");
|
||||
sort = sortAndNumberAndYear[0];
|
||||
String[] numberAndYear = sortAndNumberAndYear[1].split("\\-");
|
||||
number=numberAndYear[0];
|
||||
year=numberAndYear[1];
|
||||
|
||||
}catch (Exception e){
|
||||
System.out.println("id为"+importDto.getStandId()+"格式无法解析");
|
||||
// return null;
|
||||
}
|
||||
|
||||
SarBussionessStand sarBussionessStand = new SarBussionessStand();
|
||||
sarBussionessStand.setId(standId);
|
||||
sarBussionessStand.setStandSort(sort);
|
||||
sarBussionessStand.setStandYear(year);
|
||||
sarBussionessStand.setStandCode(importDto.getStandId());
|
||||
sarBussionessStand.setStandName(importDto.getStandName());
|
||||
sarBussionessStand.setStandEnName(importDto.getStandNameEN());
|
||||
sarBussionessStand.setIssueTime(importDto.getPublishTime());
|
||||
sarBussionessStand.setPutTime(importDto.getImplementedTime());
|
||||
sarBussionessStand.setReplacedStandNum(importDto.getReplaceId());
|
||||
sarBussionessStand.setValidFlag(0);
|
||||
if ("有效".equals(importDto.getStandStatus())){
|
||||
sarBussionessStand.setTextStatusBuss("vsaga7nwub");
|
||||
}
|
||||
return sarBussionessStand;
|
||||
}
|
||||
|
||||
|
||||
@@ -672,7 +654,7 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
sarBussionessStandService.createStandFile(standId,fileMap);
|
||||
} catch (Exception e) {
|
||||
importDto.setErrorStr("创建标准文件异常");
|
||||
error.add(importDto);
|
||||
fileError.add(importDto);
|
||||
e.printStackTrace();
|
||||
System.out.println("创建标准文件异常");
|
||||
}
|
||||
@@ -681,12 +663,12 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
|
||||
}else {
|
||||
importDto.setErrorStr("文件不存在");
|
||||
error.add(importDto);
|
||||
fileError.add(importDto);
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
importDto.setErrorStr("路径错误!");
|
||||
error.add(importDto);
|
||||
fileError.add(importDto);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -696,4 +678,43 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
return sarBussStandAttrInfo;
|
||||
}
|
||||
|
||||
|
||||
public HashMap<String,String> analysisStandId(ImportDto importDto){
|
||||
HashMap<String, String> result = new HashMap<>();
|
||||
if(importDto.getStandId()==null){
|
||||
importDto.setErrorStr("标准号为空");
|
||||
error.add(importDto);
|
||||
return null;
|
||||
}else {
|
||||
String standId = importDto.getStandId();
|
||||
//格式 非空格字符+空格+非空格字符+‘-’或‘—’或空格+年份 如Q/FT F003—2001
|
||||
Pattern pattern = Pattern.compile("^\\S*\\s\\S*[\\u2014\\u002d\\s]\\d{4}$");
|
||||
if (!pattern.matcher(standId).matches()){
|
||||
importDto.setErrorStr("标准号无法解析");
|
||||
error.add(importDto);
|
||||
return null;
|
||||
}
|
||||
|
||||
String sort="";
|
||||
String number="";
|
||||
String year="";
|
||||
String[] split = importDto.getStandId().split("[\\u2014\\u002d\\s]");//以空格或'-'或'—'分割
|
||||
|
||||
// 多种格式(╯‵□′)╯︵┻━┻ Q-FL T015-2021 Q/ FL T015-2021 Q/FL T015-2021
|
||||
int length = split.length;
|
||||
number=split[length-2];
|
||||
year=split[length-1];
|
||||
for (int i = 0; i < length-2; i++) {
|
||||
sort+=split[i];
|
||||
}
|
||||
|
||||
result.put("sort",sort);
|
||||
result.put("number",number);
|
||||
result.put("year",year);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
@@ -24,6 +24,8 @@ public interface ISarBussionessStandService extends IService<SarBussionessStand>
|
||||
|
||||
SarBussionessStand updateSarBussionessStand(SarBussionessStand sarBussionessStandEO) throws Exception;
|
||||
|
||||
ResponseMessage<SarBussionessStand> createSarBussionessStand(SarBussionessStand sarBussionessStandEO) throws Exception;
|
||||
|
||||
List<SarBussionessStand> selectStandardsByStandNumber(String replaceStandNum);
|
||||
|
||||
SarBussionessStand selectStandardsInfoByKey(String id) throws Exception;
|
||||
|
||||
+2
@@ -288,6 +288,8 @@ public class SarLawsAttrDetailedListServiceImpl extends ServiceImpl<SarLawsAttrD
|
||||
}
|
||||
|
||||
private void dateTime(LinkedHashMap<String, List<String>> mapList, List<String> putTime, List<String> xcx, List<String> zcc, StandRegionalTimeDto s) {
|
||||
//临时
|
||||
|
||||
putTime.add(new SimpleDateFormat("yyyy-MM-dd").format(s.getPutTime()));
|
||||
xcx.add(new SimpleDateFormat("yyyy-MM-dd").format(s.getXcxssrq()));
|
||||
zcc.add(new SimpleDateFormat("yyyy-MM-dd").format(s.getZccssrq()));
|
||||
|
||||
+5
@@ -599,6 +599,11 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
@Override
|
||||
public void standardToLaws(String countryArea,TimeDto timeDto) {
|
||||
|
||||
if (countryArea==null){
|
||||
countryArea="";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 加入对应"国家/地区"的清单列表
|
||||
*/
|
||||
|
||||
+1
@@ -291,6 +291,7 @@ public class TsResourceServiceImpl extends ServiceImpl<TsResourceDao, TsResource
|
||||
QueryWrapper<TsResource> TsResourceQueryWrapper=new QueryWrapper<>();
|
||||
TsResourceQueryWrapper.eq("PARENT_ID",parent.getId());
|
||||
TsResourceQueryWrapper.in("ID",getMenuIdList);
|
||||
TsResourceQueryWrapper.orderByAsc("DISPLAY_SEQ");
|
||||
List<TsResource> children=dao.selectList(TsResourceQueryWrapper);
|
||||
for(TsResource TsResource:children){
|
||||
TsResource.setChildren(recursionGetListChildren((TsResource),(getMenuIdList)));
|
||||
|
||||
+2
-2
@@ -39,7 +39,7 @@ public class SarPublicIdeaController extends BaseController<SarPublicIdea> {
|
||||
@ApiOperation(value = "分页查询")
|
||||
@GetMapping("/SelectAllPage")
|
||||
public ResponseMessage selectAllPage(@RequestParam(defaultValue="1")Integer page,@RequestParam(defaultValue="10")Integer size,String categorg, String cname,
|
||||
String start, String end){
|
||||
String start, String end,String type){
|
||||
Date startdate = null;
|
||||
Date enddate = null;
|
||||
SimpleDateFormat formater = new SimpleDateFormat();
|
||||
@@ -54,7 +54,7 @@ public class SarPublicIdeaController extends BaseController<SarPublicIdea> {
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
IPage<SarPublicIdea> Publiclist =sarPublicIdeaService.selectAllP(page,size,categorg,cname,startdate,enddate);
|
||||
IPage<SarPublicIdea> Publiclist =sarPublicIdeaService.selectAllP(page,size,categorg,cname,startdate,enddate,type);
|
||||
return Result.success(Publiclist);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,5 +66,11 @@ public class SarPublicIdea extends BaseEntity {
|
||||
@TableField("uniques")
|
||||
private String uniques;
|
||||
|
||||
@TableField("files")
|
||||
private String files;
|
||||
|
||||
@TableField("files_name")
|
||||
private String filesName;
|
||||
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -20,6 +20,6 @@ import java.util.Date;
|
||||
public interface ISarPublicIdeaService extends IService<SarPublicIdea> {
|
||||
|
||||
String add(SarPublicIdea sarPublicIdea);
|
||||
IPage<SarPublicIdea> selectAllP(Integer page, Integer size, String categorg, String cname, Date startdate, Date enddate);
|
||||
IPage<SarPublicIdea> selectAllP(Integer page, Integer size, String categorg, String cname, Date startdate, Date enddate, String type);
|
||||
IPage<SarPublicIdea> selectAllDynamic(SeByoDto seByoDto);
|
||||
}
|
||||
|
||||
+31
-25
@@ -1,7 +1,6 @@
|
||||
package com.adc.da.slrs.sarStandIdea.service.Impl;
|
||||
|
||||
|
||||
|
||||
import com.adc.da.slrs.sarStandIdea.dao.SarPublicIdeaDao;
|
||||
|
||||
import com.adc.da.slrs.sarStandIdea.entity.SarPublicIdea;
|
||||
@@ -22,7 +21,7 @@ import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
@@ -36,7 +35,7 @@ public class SarPublicIdeaServiceImpl extends ServiceImpl<SarPublicIdeaDao, SarP
|
||||
|
||||
@Override
|
||||
public String add(SarPublicIdea sarPublicIdea) {
|
||||
if (!sarPublicIdea.getId().isEmpty()){
|
||||
if (!sarPublicIdea.getId().isEmpty()) {
|
||||
sarPublicIdea.setId(UUIDUtils.randomUUID10());
|
||||
sarPublicIdeaDao.insert(sarPublicIdea);
|
||||
return "增加成功";
|
||||
@@ -45,22 +44,29 @@ public class SarPublicIdeaServiceImpl extends ServiceImpl<SarPublicIdeaDao, SarP
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<SarPublicIdea> selectAllP(Integer p, Integer size, String category, String cname, Date start, Date end) {
|
||||
public IPage<SarPublicIdea> selectAllP(Integer p, Integer size, String category, String cname, Date start, Date end, String type) {
|
||||
QueryWrapper<SarPublicIdea> list = new QueryWrapper<>();
|
||||
list.like(StringUtils.isNotEmpty(category),"category",category)
|
||||
.like(StringUtils.isNotEmpty(cname),"cname",cname)
|
||||
.ge(start!=null,"start_time",start)
|
||||
.le(end!=null,"end_time",end)
|
||||
.orderByAsc("end_time");
|
||||
Page<SarPublicIdea> page = new Page<>(p,size);
|
||||
if ("1".equals(type)) {
|
||||
list.like(StringUtils.isNotEmpty(category), "category", category)
|
||||
.like(StringUtils.isNotEmpty(cname), "cname", cname)
|
||||
.ge(start != null, "start_time", start)
|
||||
.le(end != null, "end_time", end)
|
||||
.orderByDesc("start_time");
|
||||
} else {
|
||||
list.like(StringUtils.isNotEmpty(category), "category", category)
|
||||
.like(StringUtils.isNotEmpty(cname), "cname", cname)
|
||||
.ge(start != null, "start_time", start)
|
||||
.le(end != null, "end_time", end)
|
||||
.orderByAsc("end_time");
|
||||
}
|
||||
Page<SarPublicIdea> page = new Page<>(p, size);
|
||||
IPage<SarPublicIdea> userIPage = sarPublicIdeaDao.selectPage(page, list);
|
||||
System.out.println("总条数"+userIPage.getTotal());
|
||||
System.out.println("总页数"+userIPage.getPages());
|
||||
System.out.println("总条数" + userIPage.getTotal());
|
||||
System.out.println("总页数" + userIPage.getPages());
|
||||
return userIPage;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param seByoDto
|
||||
* @return
|
||||
*/
|
||||
@@ -72,33 +78,33 @@ public class SarPublicIdeaServiceImpl extends ServiceImpl<SarPublicIdeaDao, SarP
|
||||
SimpleDateFormat formater = new SimpleDateFormat();
|
||||
formater.applyPattern("yyyy-MM-dd");
|
||||
try {
|
||||
if (seByoDto.getStartTime()!=null){
|
||||
if (seByoDto.getStartTime() != null) {
|
||||
sar.setStartTime(formater.parse(seByoDto.getStartTime()));
|
||||
}
|
||||
if (seByoDto.getEndTime()!=null){
|
||||
if (seByoDto.getEndTime() != null) {
|
||||
sar.setEndTime(formater.parse(seByoDto.getEndTime()));
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
QueryWrapper<SarPublicIdea> wrapper = new QueryWrapper<>();
|
||||
if (sar.getCategory()!=null&&sar.getCategory().length()!=0){
|
||||
wrapper.like("category",sar.getCategory());
|
||||
if (sar.getCategory() != null && sar.getCategory().length() != 0) {
|
||||
wrapper.like("category", sar.getCategory());
|
||||
}
|
||||
if (sar.getCname()!=null&&sar.getCname().length()!=0){
|
||||
wrapper.like("cname",sar.getCname());
|
||||
if (sar.getCname() != null && sar.getCname().length() != 0) {
|
||||
wrapper.like("cname", sar.getCname());
|
||||
}
|
||||
if (sar.getStartTime()!=null){
|
||||
wrapper.le("start_time",sar.getStartTime());
|
||||
if (sar.getStartTime() != null) {
|
||||
wrapper.le("start_time", sar.getStartTime());
|
||||
}
|
||||
if (sar.getEndTime()!=null){
|
||||
wrapper.gt("end_time",sar.getEndTime());
|
||||
if (sar.getEndTime() != null) {
|
||||
wrapper.gt("end_time", sar.getEndTime());
|
||||
}
|
||||
|
||||
Page<SarPublicIdea> page = new Page<>(seByoDto.getPage(), seByoDto.getSize());
|
||||
IPage<SarPublicIdea> userIPage = sarPublicIdeaDao.selectPage(page, wrapper);
|
||||
System.out.println("总条数"+userIPage.getTotal());
|
||||
System.out.println("总页数"+userIPage.getPages());
|
||||
System.out.println("总条数" + userIPage.getTotal());
|
||||
System.out.println("总页数" + userIPage.getPages());
|
||||
return userIPage;
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -136,7 +136,7 @@
|
||||
|
||||
<!-- 查询字段及对应数据-->
|
||||
<select id="selectStandFieldAndData" resultType="Map">
|
||||
SELECT ${fieldInfo}
|
||||
SELECT STAND_ID,${fieldInfo}
|
||||
FROM SAR_BUSS_STAND_ATTR_INFO
|
||||
WHERE valid_flag=0 and stand_id = #{standId}
|
||||
</select>
|
||||
@@ -161,4 +161,4 @@
|
||||
FROM SAR_BUSS_STAND_ATTR_INFO
|
||||
WHERE stand_id = #{standId} and valid_flag=0
|
||||
</select>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
+1
-3
@@ -122,7 +122,6 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</where>
|
||||
group by a.ID
|
||||
limit #{start},#{end}
|
||||
</select>
|
||||
|
||||
@@ -150,13 +149,12 @@
|
||||
#{item}
|
||||
</foreach>
|
||||
</where>
|
||||
group by a.ID
|
||||
</select>
|
||||
|
||||
<select id="selectTimes" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.StandRegionalTimeDto">
|
||||
SELECT
|
||||
b.country_area AS country,
|
||||
a.ssrq AS ssrq,
|
||||
a.ssrq AS putTime,
|
||||
a.xcxssrq AS xcxssrq,
|
||||
a.zccssrq AS zccssrq
|
||||
FROM
|
||||
|
||||
Reference in New Issue
Block a user