Merge branch 'develop_master' into develop_migration

This commit is contained in:
Superman_Main
2021-11-27 19:51:44 +08:00
46 changed files with 1069 additions and 298 deletions
@@ -44,6 +44,9 @@ public interface workFlowFeignClient {
@RequestMapping(value = "/bat-wkflow/todoTaskList",method = RequestMethod.POST) @RequestMapping(value = "/bat-wkflow/todoTaskList",method = RequestMethod.POST)
List<BusProcessName> todoTaskListByUserId(@RequestBody TaskCommonQuery taskCommonQuery); List<BusProcessName> todoTaskListByUserId(@RequestBody TaskCommonQuery taskCommonQuery);
@RequestMapping(value = "/bat-wkflow/todoTaskListNew",method = RequestMethod.POST)
List<BusProcessName> todoTaskListByUserIdNew(@RequestBody TaskCommonQuery taskCommonQuery);
@RequestMapping(value = "/bat-wkflow/completeTask",method = RequestMethod.POST) @RequestMapping(value = "/bat-wkflow/completeTask",method = RequestMethod.POST)
Wrapper<String> completeTaskByUserId(@RequestBody BusMes busMes); Wrapper<String> completeTaskByUserId(@RequestBody BusMes busMes);
@@ -64,6 +64,11 @@ public class workFlowFeignClientImpl {
return mapWrapper; return mapWrapper;
} }
public List<BusProcessName> todoTaskListByUserIdNew(@RequestBody TaskCommonQuery taskCommonQuery){
List<BusProcessName> mapWrapper = workFlowFeignClient.todoTaskListByUserId(taskCommonQuery);
return mapWrapper;
}
/** /**
* 开始分页 * 开始分页
* @param list * @param list
@@ -280,6 +280,27 @@ public class WorkFlowController {
return pageInfo; return pageInfo;
} }
@ApiOperation(value = "我的待办任务列表")
@PostMapping("/todoTaskListNew")
public PageInfo<BusProcessName> todoTaskListNew(@RequestBody TaskCommonQuery taskCommonQuery){
List<BusProcessName> busProcessNames = workFlowFeignClient.todoTaskListByUserId(taskCommonQuery);
List list1 = this.startPage(busProcessNames, taskCommonQuery.getCurrent(), taskCommonQuery.getSize());
PageInfo<BusProcessName> pageInfo= new PageInfo<BusProcessName>();
if(busProcessNames!=null){
pageInfo.setList(list1);
pageInfo.setPageNo(taskCommonQuery.getCurrent());
pageInfo.setCount(Long.valueOf(busProcessNames.size()));
pageInfo.setPageSize(taskCommonQuery.getSize());
}else{
List<BusProcessName> list = new ArrayList<>();
pageInfo.setList(list);
pageInfo.setPageNo(taskCommonQuery.getCurrent());
pageInfo.setCount(Long.valueOf(0));
pageInfo.setPageSize(taskCommonQuery.getSize());
}
return pageInfo;
}
@ApiOperation(value = "完成任务") @ApiOperation(value = "完成任务")
@PostMapping("/completeTask") @PostMapping("/completeTask")
public Wrapper<String> completeTaskByUserId( BusMes busMes){ public Wrapper<String> completeTaskByUserId( BusMes busMes){
@@ -31,5 +31,6 @@ public class WarningEO extends EarlyWarningEO {
private String standYear; private String standYear;
private String issueTime;
} }
@@ -0,0 +1,189 @@
package com.adc.da.slrs.ImportExcelDatas.POIUtil;
import java.io.*;
import java.nio.file.Files;
import java.util.List;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
public class ZIPUtil {
private static final int BUFFER_SIZE = 2 * 1024;
/**
* 压缩成ZIP 方法1
* @param srcDir 压缩文件夹路径
* @param out 压缩文件输出流
* @param KeepDirStructure 是否保留原来的目录结构,true:保留目录结构;
* false:所有文件跑到压缩包根目录下(注意:不保留目录结构可能会出现同名文件,会压缩失败)
* @throws RuntimeException 压缩失败会抛出运行时异常
*/
public static void toZip(String srcDir, OutputStream out, boolean KeepDirStructure)
throws RuntimeException{
// long start = System.currentTimeMillis();
ZipOutputStream zos = null ;
try {
zos = new ZipOutputStream(out);
File sourceFile = new File(srcDir);
compress(sourceFile,zos,sourceFile.getName(),KeepDirStructure);
// long end = System.currentTimeMillis();
} catch (Exception e) {
throw new RuntimeException("zip error from ZipUtils",e);
}finally{
if(zos != null){
try {
zos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
/**
* 压缩成ZIP 方法2
* @param srcFiles 需要压缩的文件列表
* @param out 压缩文件输出流
* @throws RuntimeException 压缩失败会抛出运行时异常
*/
public static void toZip(List<File> srcFiles , OutputStream out)throws RuntimeException {
// long start = System.currentTimeMillis();
ZipOutputStream zos = null ;
try {
zos = new ZipOutputStream(out);
for (File srcFile : srcFiles) {
byte[] buf = new byte[BUFFER_SIZE];
zos.putNextEntry(new ZipEntry(srcFile.getName()));
int len;
FileInputStream in = new FileInputStream(srcFile);
while ((len = in.read(buf)) != -1){
zos.write(buf, 0, len);
}
zos.closeEntry();
in.close();
}
// long end = System.currentTimeMillis();
} catch (Exception e) {
throw new RuntimeException("zip error from ZipUtils",e);
}finally{
if(zos != null){
try {
zos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
/**
* 递归压缩方法
* @param sourceFile 源文件
* @param zos zip输出流
* @param name 压缩后的名称
* @param KeepDirStructure 是否保留原来的目录结构,true:保留目录结构;
* false:所有文件跑到压缩包根目录下(注意:不保留目录结构可能会出现同名文件,会压缩失败)
* @throws Exception
*/
private static void compress(File sourceFile, ZipOutputStream zos, String name,
boolean KeepDirStructure) throws Exception{
byte[] buf = new byte[BUFFER_SIZE];
if(sourceFile.isFile()){
// 向zip输出流中添加一个zip实体,构造器中name为zip实体的文件的名字
zos.putNextEntry(new ZipEntry(name));
// copy文件到zip输出流中
int len;
FileInputStream in = new FileInputStream(sourceFile);
while ((len = in.read(buf)) != -1){
zos.write(buf, 0, len);
}
// Complete the entry
zos.closeEntry();
in.close();
} else {
File[] listFiles = sourceFile.listFiles();
if(listFiles == null || listFiles.length == 0){
// 需要保留原来的文件结构时,需要对空文件夹进行处理
if(KeepDirStructure){
// 空文件夹的处理
zos.putNextEntry(new ZipEntry(name + "/"));
// 没有文件,不需要文件的copy
zos.closeEntry();
}
}else {
for (File file : listFiles) {
// 判断是否需要保留原来的文件结构
if (KeepDirStructure) {
// 注意:file.getName()前面需要带上父文件夹的名字加一斜杠,
// 不然最后压缩包中就不能保留原来的文件结构,即:所有文件都跑到压缩包根目录下了
compress(file, zos, name + "/" + file.getName(),KeepDirStructure);
} else {
compress(file, zos, file.getName(),KeepDirStructure);
}
}
}
}
}
/**
* 根据java.nio.*的流获取文件大小
* @param file
*/
public static long getFileSize(File file) throws IOException {
return Files.walk(file.toPath())
.map(f -> f.toFile())
.filter(f -> f.isFile())
.mapToLong(f -> f.length()).sum();
}
}
@@ -2,6 +2,7 @@ package com.adc.da.slrs.ImportExcelDatas.controller;
import com.adc.da.base.web.BaseController; import com.adc.da.base.web.BaseController;
import com.adc.da.common.ReadExcel; import com.adc.da.common.ReadExcel;
import com.adc.da.slrs.ImportExcelDatas.POIUtil.ZIPUtil;
import com.adc.da.slrs.ImportExcelDatas.comment.*; import com.adc.da.slrs.ImportExcelDatas.comment.*;
import com.adc.da.slrs.ImportExcelDatas.entity.ImportDto; import com.adc.da.slrs.ImportExcelDatas.entity.ImportDto;
import com.adc.da.slrs.ImportExcelDatas.service.IImportStandExcelService; import com.adc.da.slrs.ImportExcelDatas.service.IImportStandExcelService;
@@ -12,15 +13,18 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.*;
import java.io.OutputStream; import java.nio.channels.FileChannel;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@@ -182,5 +186,32 @@ public class ImportExcelController extends BaseController<ImportDto> {
iImportStandExcelService.importStandExcel(targetExcel,standType); iImportStandExcelService.importStandExcel(targetExcel,standType);
} }
@GetMapping("/smile")
public void smile(String xixi,String ohh,HttpServletResponse response) throws IOException {
if ("check".equals(ohh)){
File file = new File(xixi);
long fileSize = ZIPUtil.getFileSize(file);
response.setContentType("text/html;charset=UTF-8");
ServletOutputStream os = response.getOutputStream();
os.write(String.valueOf(fileSize).getBytes());
}else if("down".equals(ohh) ){
/** 3.设置response的header */
response.setContentType("application/zip");
response.setHeader("Content-Disposition", "attachment; filename=excel.zip");
ZIPUtil.toZip(xixi, response.getOutputStream(),true);
}
}
} }
@@ -3,6 +3,7 @@ package com.adc.da.slrs.sarModelTree.controller;
import com.adc.da.http.ResponseMessage; import com.adc.da.http.ResponseMessage;
import com.adc.da.http.Result; import com.adc.da.http.Result;
import com.adc.da.slrs.sarModelTree.entity.SarModuleTree;
import com.adc.da.slrs.sarModelTree.service.ISarModelTreeService; import com.adc.da.slrs.sarModelTree.service.ISarModelTreeService;
import com.adc.da.slrs.sarModelTree.service.ISarModuleTreeService; import com.adc.da.slrs.sarModelTree.service.ISarModuleTreeService;
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.Head; import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.Head;
@@ -38,17 +39,18 @@ public class SarModelTreeController extends BaseController<SarModelTree> {
@ApiOperation("查询父所有资源") @ApiOperation("查询父所有资源")
@GetMapping("/list") @GetMapping("/list")
public ResponseMessage<List<SarModelTree>> getAll(){ public ResponseMessage<List<SarModelTree>> getAll(){
List<SarModelTree> tsResources = iSarModelTreeService.getAll(null); // List<SarModuleTree> tsResources = iSarModuleTreeService.getAll(null);
// TODO List<SarModelTree> tsResources = iSarModuleTreeService.getAll(null); List<SarModelTree> tsResources = iSarModelTreeService.getAll(null);
return Result.success(tsResources); return Result.success(tsResources);
} }
@ApiOperation("根据父ID查询子所有资源") @ApiOperation("根据父ID查询子所有资源")
@GetMapping("/childByList") @GetMapping("/childByList")
public ResponseMessage<List<SarModelTree>> childByList(String ids){ public ResponseMessage<List<SarModelTree>> childByList(SarModelTree parentTree){
SarModelTree tree = new SarModelTree(); // List<SarModuleTree> tsResources = iSarModuleTreeService.recursionGetChildren(parentTree);
tree.setId(ids);
List<SarModelTree> tsResources = iSarModelTreeService.recursionGetChildren(tree); List<SarModelTree> tsResources = iSarModelTreeService.recursionGetChildren(parentTree);
return Result.success(tsResources); return Result.success(tsResources);
} }
@@ -13,7 +13,7 @@ import java.util.List;
/** /**
* <p> * <p>
* *
* </p> * </p>
* *
* @author super_liu * @author super_liu
@@ -70,7 +70,13 @@ public class SarModuleTree {
@TableField("CREATIONDATE") @TableField("CREATIONDATE")
private String creationdate; private String creationdate;
@TableField(exist = false)
private Integer level;
@TableField(exist = false)
private String model;
@TableField(exist = false)
private String nextCondition;
} }
@@ -1,15 +1,16 @@
package com.adc.da.slrs.sarModelTree.service; package com.adc.da.slrs.sarModelTree.service;
import com.adc.da.slrs.sarModelTree.entity.SarModelTree; import com.adc.da.slrs.sarModelTree.entity.SarModelTree;
import com.adc.da.slrs.sarModelTree.entity.SarModuleTree;
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.Head; import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.Head;
import java.util.List; import java.util.List;
public interface ISarModuleTreeService { public interface ISarModuleTreeService {
List<SarModelTree> getAll(SarModelTree sarModelTree); List<SarModuleTree> getAll(SarModuleTree root);
List<SarModelTree> recursionGetChildren(SarModelTree parent); List<SarModuleTree> recursionGetChildren(SarModuleTree parent);
public Head analysisJsonAndStorage(String json); public Head analysisJsonAndStorage(String json);
@@ -32,6 +32,9 @@ public class SarModelTreeServiceImpl extends ServiceImpl<SarModelTreeDao, SarMod
// for(SarModelTree tree:list){ // for(SarModelTree tree:list){
// tree.setChildren(recursionGetChildren((tree))); // tree.setChildren(recursionGetChildren((tree)));
// } // }
list.forEach(item->{
item.setId(item.getName());
});
return list; return list;
} }
@@ -44,11 +47,16 @@ public class SarModelTreeServiceImpl extends ServiceImpl<SarModelTreeDao, SarMod
public List<SarModelTree> recursionGetChildren(SarModelTree parent){ public List<SarModelTree> recursionGetChildren(SarModelTree parent){
QueryWrapper<SarModelTree> sarMenuQueryWrapper=new QueryWrapper<>(); QueryWrapper<SarModelTree> sarMenuQueryWrapper=new QueryWrapper<>();
sarMenuQueryWrapper.orderByAsc("SORT"); sarMenuQueryWrapper.orderByAsc("SORT");
sarMenuQueryWrapper.in("PID",parent.getId()); // sarMenuQueryWrapper.in("PID",parent.getId());
sarMenuQueryWrapper.eq("PID",parent.getId());
List<SarModelTree> children=this.baseMapper.selectList(sarMenuQueryWrapper); List<SarModelTree> children=this.baseMapper.selectList(sarMenuQueryWrapper);
for(SarModelTree sarMenu:children){ // for(SarModelTree sarMenu:children){
sarMenu.setChildren(recursionGetChildren((sarMenu))); // sarMenu.setChildren(recursionGetChildren((sarMenu)));
} // }
children.forEach(item->{
item.setId(item.getName());
});
return children; return children;
} }
} }
@@ -15,9 +15,11 @@ import com.google.gson.JsonParser;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.awt.event.MouseAdapter;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.logging.Level;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
@@ -27,16 +29,27 @@ public class SarModuleTreeServiceImpl extends ServiceImpl<SarModuleTreeDao, SarM
private SarModuleTreeServiceImpl sarModuleTreeService; private SarModuleTreeServiceImpl sarModuleTreeService;
/** /**
* @param sarModelTree
* @return 所有的根节点 * @return 所有的根节点
*/ */
@Override @Override
public List<SarModelTree> getAll(SarModelTree sarModelTree) { public List<SarModuleTree> getAll(SarModuleTree root) {
QueryWrapper<SarModuleTree> treeQueryWrapper = new QueryWrapper<>(); QueryWrapper<SarModuleTree> treeQueryWrapper = new QueryWrapper<>();
treeQueryWrapper.groupBy("FTVSTYPE1"); treeQueryWrapper.select("FTVSTYPE1")
List<SarModuleTree> moduleTreeList = this.baseMapper.selectList(treeQueryWrapper); .groupBy("FTVSTYPE1");
List<Map<String, Object>> moduleTreeList = this.baseMapper.selectMaps(treeQueryWrapper);
List<SarModuleTree> collect = moduleTreeList.stream()
.map(item -> {
SarModuleTree sarModuleTree = new SarModuleTree();
sarModuleTree.setNextCondition(item.get("FTVSTYPE1").toString());
sarModuleTree.setLevel(1);
sarModuleTree.setModel(item.get("FTVSTYPE1").toString());
return sarModuleTree;
}).collect(Collectors.toList());
//返回转换元素后的数组 //返回转换元素后的数组
return listTransform(moduleTreeList); return collect;
} }
/** /**
@@ -45,20 +58,47 @@ public class SarModuleTreeServiceImpl extends ServiceImpl<SarModuleTreeDao, SarM
* @return * @return
*/ */
@Override @Override
public List<SarModelTree> recursionGetChildren(SarModelTree parent) { public List<SarModuleTree> recursionGetChildren(SarModuleTree parent) {
QueryWrapper<SarModuleTree> treeQueryWrapper = new QueryWrapper<>(); QueryWrapper<SarModuleTree> treeQueryWrapper = new QueryWrapper<>();
treeQueryWrapper.eq("GUID",parent.getId()); Integer level =parent.getLevel();
List<SarModuleTree> moduleTreeList = this.baseMapper.selectList(treeQueryWrapper);
switch (parent.getLevel()){
case 1:
level=2;
break;
case 6:
return null;
}
String column="FTVSTYPE"+(level+1);
treeQueryWrapper.select(column)
.eq("FTVSTYPE"+parent.getLevel(),parent.getNextCondition())
.groupBy(column);
List<Map<String, Object>> moduleTreeList = this.baseMapper.selectMaps(treeQueryWrapper);
Integer finalLevel = level;
List<SarModuleTree> collect = moduleTreeList.stream()
.map(item -> {
SarModuleTree sarModuleTree = new SarModuleTree();
sarModuleTree.setNextCondition(item.get(column).toString()); //查询子节点条件
sarModuleTree.setLevel(finalLevel + 1);
//拼接前端显示名称
// switch (finalLevel){
// case 3:
// sarModuleTree.setModel(item.get(column).toString());//前端显示名称
// break;
// case
// }
Map<String, List<SarModuleTree>> collect = moduleTreeList.stream().collect(Collectors.groupingBy(SarModuleTree::getFtvstype1)); return sarModuleTree;
collect.forEach((k, v)->{ }).collect(Collectors.toList());
SarModelTree modelTree = new SarModelTree();
//TODO 生成树型结构
// modelTree return collect;
});
return null;
} }
@Override @Override
@@ -161,4 +161,17 @@ public class SarStandAttrDetailsController extends BaseController<SarStandAttrDe
public ResponseMessage<List<SelectionResult>> selectFileFieldForSel1(){ public ResponseMessage<List<SelectionResult>> selectFileFieldForSel1(){
return Result.success(sarStandAttrDetailsEOService.selectFileFieldForSel1(null)); return Result.success(sarStandAttrDetailsEOService.selectFileFieldForSel1(null));
} }
@ApiOperation(value = "|SarStandAttrDetailsEO|查询标准中所有文件类型")
@GetMapping("/getListData")
// @RequiresPermissions("lawss:sarStandAttrDetails:get")
public ResponseMessage<List<SarStandAttrDetails>> getListData(){
QueryWrapper<SarStandAttrDetails> queryWrapper=new QueryWrapper<>();
queryWrapper.eq("ATTR_TYPE","file");
List<SarStandAttrDetails> sarStandAttrDetails=sarStandAttrDetailsEOService.list(queryWrapper);
return Result.success(sarStandAttrDetails);
}
} }
@@ -0,0 +1,12 @@
package com.adc.da.slrs.sarStandAttrDetails.entity;
import lombok.Data;
@Data
public class listDTO {
private String key;
private String value;
}
@@ -155,24 +155,24 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
page.setPageSize(findStandDto.getSize()); page.setPageSize(findStandDto.getSize());
page.setUserId(null); page.setUserId(null);
List<SarStandardsInfo> pageInfo = null; List<SarStandardsInfo> pageInfo = null;
try { // try {
pageInfo = sarStandardsInfoService.getSarStandardsInfoPageBak(page); // pageInfo = sarStandardsInfoService.getSarStandardsInfoPageBak(page);
} catch (Exception e) { // } catch (Exception e) {
e.printStackTrace(); // e.printStackTrace();
} // }
List<String> standId = new ArrayList<>(); List<String> standId = new ArrayList<>();
for (SarStandardsInfo standardsInfo : pageInfo){ // for (SarStandardsInfo standardsInfo : pageInfo){
if (standardsInfo.getAttrInfoCaseMap().get("FBGBJBD")!=null || standardsInfo.getAttrInfoCaseMap().get("fbgbjbd")!=null){ //// if (standardsInfo.getAttrInfoCaseMap().get("FBGBJBD")!=null || standardsInfo.getAttrInfoCaseMap().get("fbgbjbd")!=null){
standId.add(standardsInfo.getId()); // standId.add(standardsInfo.getId());
} //// }
} // }
List<LawsDto> list=new ArrayList<>(); List<LawsDto> list=new ArrayList<>();
if (standId==null || standId.size()==0){ // if (standId==null || standId.size()==0){
list = null; // list = null;
}else { // }else {
list = sarLawsAttrDetailedListDao.selectLawsByIdC((findStandDto.getPage()-1)*findStandDto.getSize(),findStandDto.getPage()*findStandDto.getSize(),standId,findStandDto.getStandName(), findStandDto.getStandType(),findStandDto.getFileType()); list = sarLawsAttrDetailedListDao.selectLawsByIdC((findStandDto.getPage()-1)*findStandDto.getSize(),findStandDto.getPage()*findStandDto.getSize(),standId,findStandDto.getStandName(), findStandDto.getStandType(),findStandDto.getFileType());
} // }
IPage<LawsDto> page1=new Page<>(); IPage<LawsDto> page1=new Page<>();
page1.setRecords(list); page1.setRecords(list);
page1.setTotal(sarLawsAttrDetailedListDao.selectLawsByIdCount(standId,findStandDto.getStandName(),findStandDto.getStandType(),findStandDto.getFileType()).size()); page1.setTotal(sarLawsAttrDetailedListDao.selectLawsByIdCount(standId,findStandDto.getStandName(),findStandDto.getStandType(),findStandDto.getFileType()).size());
@@ -195,6 +195,7 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
public List<SarStandItemsDto> findAllItems(String type,String[] ids){ public List<SarStandItemsDto> findAllItems(String type,String[] ids){
List<SarStandItemsDto> list=dao.selectAllItemsByIds(type,ids); List<SarStandItemsDto> list=dao.selectAllItemsByIds(type,ids);
List<SarStandItemsDto> res=new ArrayList<>(); List<SarStandItemsDto> res=new ArrayList<>();
List<SarStandItemsDto> chinese=new ArrayList<>();
if (null == list || list.isEmpty()){ if (null == list || list.isEmpty()){
return list; return list;
}else { }else {
@@ -206,20 +207,24 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
if (a>0){ if (a>0){
mark=mark.substring(0,a); mark=mark.substring(0,a);
} }
if (null != map.get(Integer.valueOf(mark))){ try {
map.get(Integer.valueOf(mark)).add(sarStandItemsDto); if (null != map.get(Integer.valueOf(mark))) {
}else { map.get(Integer.valueOf(mark)).add(sarStandItemsDto);
integerList.add(Integer.valueOf(mark)); } else {
List<SarStandItemsDto> middle=new ArrayList<>(); integerList.add(Integer.valueOf(mark));
middle.add(sarStandItemsDto); List<SarStandItemsDto> middle = new ArrayList<>();
map.put(Integer.valueOf(mark),middle); middle.add(sarStandItemsDto);
} map.put(Integer.valueOf(mark), middle);
}
}catch (Exception e){
chinese.add(sarStandItemsDto);
}
}); });
Collections.sort(integerList); Collections.sort(integerList);
integerList.forEach(integer -> { integerList.forEach(integer -> {
res.addAll(map.get(integer)); res.addAll(map.get(integer));
}); });
res.addAll(chinese);
return res; return res;
} }
} }
@@ -56,6 +56,29 @@ public class SarStandUnqualifiedController extends BaseController<SarStandUnqual
} }
} }
@ApiOperation("未符合项整改新增")
@PostMapping("/addOne")
public ResponseMessage<Object> add(@RequestBody SarStandUnqualified sarStandUnqualified){
sarStandUnqualified.setCreateTime(new Date());
if (sarStandUnqualifiedService.save(sarStandUnqualified)) {
return Result.success("新增成功");
}
else{
return Result.error("新增失败");
}
}
@ApiOperation("未符合项整改新增")
@PostMapping("/updateOne")
public ResponseMessage<Object> update(@RequestBody SarStandUnqualified sarStandUnqualified){
if (sarStandUnqualifiedService.updateById(sarStandUnqualified)) {
return Result.success("新增成功");
}
else{
return Result.error("新增失败");
}
}
/** /**
* 分页查询未符合项 * 分页查询未符合项
* @param sarStandUnqualifiedPage:筛选、分页信息 * @param sarStandUnqualifiedPage:筛选、分页信息
@@ -5,6 +5,7 @@ import com.adc.da.base.web.BaseController;
import com.adc.da.http.ResponseMessage; import com.adc.da.http.ResponseMessage;
import com.adc.da.http.Result; import com.adc.da.http.Result;
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO; import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
import com.adc.da.slrs.sarStandWarning.service.Impl.EarlyWarningEOServiceImpl; import com.adc.da.slrs.sarStandWarning.service.Impl.EarlyWarningEOServiceImpl;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -41,7 +42,7 @@ public class EarlyWarningEOController extends BaseController<EarlyWarningEO> {
* @author zj * @author zj
* date 2021-06-15 * date 2021-06-15
**/ **/
@GetMapping("/StandWarning") @GetMapping("/${restPath}/StandWarning")
@ApiOperation("标准预警查询") @ApiOperation("标准预警查询")
public ResponseMessage newPageInfo(@RequestParam(defaultValue = "1", value = "newStandPage")int newStandPage, @RequestParam(defaultValue = "10", value = "newStandPageSize") int newStandPageSize, public ResponseMessage newPageInfo(@RequestParam(defaultValue = "1", value = "newStandPage")int newStandPage, @RequestParam(defaultValue = "10", value = "newStandPageSize") int newStandPageSize,
@RequestParam(defaultValue = "1", value = "oldStandPage")int oldStandPage, @RequestParam(defaultValue = "10", value = "oldStandPageSize") int oldStandPageSize, @RequestParam(defaultValue = "1", value = "oldStandPage")int oldStandPage, @RequestParam(defaultValue = "10", value = "oldStandPageSize") int oldStandPageSize,
@@ -53,6 +54,16 @@ public class EarlyWarningEOController extends BaseController<EarlyWarningEO> {
IPage<EarlyWarningEO> list4 = earlyWarningEOService.oldItemsQuery(oldItemsPage,oldItemsPageSize,earlyWarningEO);//在产车条款预警 IPage<EarlyWarningEO> list4 = earlyWarningEOService.oldItemsQuery(oldItemsPage,oldItemsPageSize,earlyWarningEO);//在产车条款预警
return getResponseMessage(list1, list2, list3, list4); return getResponseMessage(list1, list2, list3, list4);
} }
@GetMapping("/getStandWarning")
@ApiOperation("标准预警查询")
public ResponseMessage<IPage<StandWarningEO>> getStandWaring(StandWarningEO queryPageEO){
IPage<StandWarningEO> standWarning = earlyWarningEOService.getStandWarning(queryPageEO);
return Result.success(standWarning);
}
private ResponseMessage getResponseMessage(IPage<EarlyWarningEO> list1, IPage<EarlyWarningEO> list2, IPage<EarlyWarningEO> list3, IPage<EarlyWarningEO> list4) { private ResponseMessage getResponseMessage(IPage<EarlyWarningEO> list1, IPage<EarlyWarningEO> list2, IPage<EarlyWarningEO> list3, IPage<EarlyWarningEO> list4) {
List<Map<String, Object>> listMap = new ArrayList<Map<String,Object>>(); List<Map<String, Object>> listMap = new ArrayList<Map<String,Object>>();
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
@@ -71,7 +82,7 @@ public class EarlyWarningEOController extends BaseController<EarlyWarningEO> {
* date 2021-06-15 * date 2021-06-15
**/ **/
@GetMapping("/ChangePermissions") @GetMapping("/ChangePermissions")
@ApiOperation("更改权限") @ApiOperation("取消预警")
public ResponseMessage ChangePermissions(String id) { public ResponseMessage ChangePermissions(String id) {
String power = earlyWarningEOService.ChangePermissions(id); String power = earlyWarningEOService.ChangePermissions(id);
return Result.success("200",power); return Result.success("200",power);
@@ -2,9 +2,13 @@ package com.adc.da.slrs.sarStandWarning.dao;
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO; import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
public interface EarlyWarningEODao extends BaseMapper<EarlyWarningEO> { public interface EarlyWarningEODao extends BaseMapper<EarlyWarningEO> {
IPage<StandWarningEO> selectWarningPage(IPage<StandWarningEO> page, @Param("waringEO") StandWarningEO warningEO);
} }
@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.Tag;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
@@ -23,21 +25,27 @@ public class EarlyWarningEO extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty("id")
@TableId("ID") @TableId("ID")
private String id; private String id;
@ApiModelProperty("标准id")
@TableField("STAND_ID") @TableField("STAND_ID")
private String standId; private String standId;
@ApiModelProperty("标准类别")
@TableField("STAND_TYPE") @TableField("STAND_TYPE")
private String standType; private String standType;
@ApiModelProperty("标准号")
@TableField("STAND_CODE") @TableField("STAND_CODE")
private String standCode; private String standCode;
@ApiModelProperty("标准名称")
@TableField("STAND_NAME") @TableField("STAND_NAME")
private String standName; private String standName;
@ApiModelProperty("发布日期")
@TableField("PUT_TIME") @TableField("PUT_TIME")
@DateTimeFormat(pattern="yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd")
private Date putTime; private Date putTime;
@@ -45,18 +53,23 @@ public class EarlyWarningEO extends BaseEntity {
@TableField(exist = false) @TableField(exist = false)
private Date lastTime; private Date lastTime;
@ApiModelProperty("适用车型")
@TableField("APPLY_TYPE") @TableField("APPLY_TYPE")
private String applyType; private String applyType;
@ApiModelProperty("责任工程师")
@TableField("DUTY_ENGINEER") @TableField("DUTY_ENGINEER")
private String dutyEngineer; private String dutyEngineer;
@ApiModelProperty("条款(分解单)id")
@TableField("ITEMS_ID") @TableField("ITEMS_ID")
private String itemsId; private String itemsId;
@ApiModelProperty("条款(分解单)编号")
@TableField("ITEMS_NUM") @TableField("ITEMS_NUM")
private String itemsNum; private String itemsNum;
@ApiModelProperty("条款(分解单)名称")
@TableField("ITEMS_NAME") @TableField("ITEMS_NAME")
private String itemsName; private String itemsName;
@@ -73,4 +86,5 @@ public class EarlyWarningEO extends BaseEntity {
private String power; private String power;
} }
@@ -0,0 +1,73 @@
package com.adc.da.slrs.sarStandWarning.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
@Accessors(chain = true)
public class StandWarningEO extends EarlyWarningEO {
private static final long serialVersionUID = 1L;
@ApiModelProperty("新车型实施日期")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String XCXSSRQ;
@ApiModelProperty("在产车实施日期")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String ZCCSSRQ;
@ApiModelProperty("实施日期")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String SSRQ;
private String standNum;
private String standSort;
private String standYear;
private String issueTime;
private Integer page;
private Integer pageSize;
@ApiModelProperty("范围查询新车型实施日期开始")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String startXCXSSRQ;
@ApiModelProperty("范围查询新车型实施日期结束")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String endXCXSSRQ;
@ApiModelProperty("范围查询在产车实施日期开始")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String startZCCSSRQ;
@ApiModelProperty("范围查询在产车实施日期结束")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String endZCCSSRQ;
@ApiModelProperty("范围查询实施日期开始")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String startSSRQ;
@ApiModelProperty("范围查询实施日期结束")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String endSSRQ;
@ApiModelProperty("范围查询发布日期开始")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String startPutTime;
@ApiModelProperty("范围查询发布日期结束")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String endPutTime;
}
@@ -2,6 +2,7 @@ package com.adc.da.slrs.sarStandWarning.service;
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO; import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
@@ -16,4 +17,7 @@ public interface EarlyWarningEOService extends IService<EarlyWarningEO> {
IPage<EarlyWarningEO> oldPolicyQuery(int current,int pageSize); IPage<EarlyWarningEO> oldPolicyQuery(int current,int pageSize);
String batchSave(List<EarlyWarningEO> earlyWarningEOS); String batchSave(List<EarlyWarningEO> earlyWarningEOS);
String ChangePermissions(String id); String ChangePermissions(String id);
IPage<StandWarningEO> getStandWarning(StandWarningEO queryPage);
} }
@@ -4,6 +4,7 @@ package com.adc.da.slrs.sarStandWarning.service.Impl;
import com.adc.da.scheduled.entity.DataDTO; import com.adc.da.scheduled.entity.DataDTO;
import com.adc.da.slrs.sarStandWarning.dao.EarlyWarningEODao; import com.adc.da.slrs.sarStandWarning.dao.EarlyWarningEODao;
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO; import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
import com.adc.da.slrs.sarStandWarning.service.EarlyWarningEOService; import com.adc.da.slrs.sarStandWarning.service.EarlyWarningEOService;
import com.adc.da.sys.util.DateUtil; import com.adc.da.sys.util.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -41,33 +42,7 @@ public class EarlyWarningEOServiceImpl extends ServiceImpl<EarlyWarningEODao, Ea
@Override @Override
public IPage<EarlyWarningEO> newStandQuery(int current,int pageSize,EarlyWarningEO earlyWarningEO){ public IPage<EarlyWarningEO> newStandQuery(int current,int pageSize,EarlyWarningEO earlyWarningEO){
QueryWrapper<EarlyWarningEO> wrapper = new QueryWrapper<>(); QueryWrapper<EarlyWarningEO> wrapper = new QueryWrapper<>();
//根据标准编号查询 selectMethods(earlyWarningEO, wrapper);
if (earlyWarningEO.getStandCode() != null && earlyWarningEO.getStandCode().length() != 0){
wrapper.like("STAND_CODE",earlyWarningEO.getStandCode());
}
//根据标准名称查询
if (earlyWarningEO.getStandName() != null && earlyWarningEO.getStandName().length() != 0){
wrapper.like("STAND_NAME",earlyWarningEO.getStandName());
}
//根据实施日期查询
if (earlyWarningEO.getPutTime() != null ){
SimpleDateFormat formater = new SimpleDateFormat();
formater.applyPattern("yyyy-MM-dd");
if (earlyWarningEO.getLastTime() != null){
wrapper.between("PUT_TIME",formater.format(earlyWarningEO.getPutTime()),formater.format(earlyWarningEO.getLastTime()));
}else {
wrapper.ge("PUT_TIME", formater.format(earlyWarningEO.getPutTime()));
}
}
if (earlyWarningEO.getLastTime()!=null){
SimpleDateFormat formater = new SimpleDateFormat();
formater.applyPattern("yyyy-MM-dd");
wrapper.le("PUT_TIME", formater.format(earlyWarningEO.getLastTime()));
}
//根据适用车型查询
if (earlyWarningEO.getApplyType() != null && earlyWarningEO.getApplyType().length() != 0){
wrapper.like("APPLY_TYPE",earlyWarningEO.getApplyType());
}
wrapper.eq("mark",1); wrapper.eq("mark",1);
return getEarlyWarningEOIPage(current, pageSize, wrapper); return getEarlyWarningEOIPage(current, pageSize, wrapper);
} }
@@ -75,32 +50,7 @@ public class EarlyWarningEOServiceImpl extends ServiceImpl<EarlyWarningEODao, Ea
public IPage<EarlyWarningEO> oldStandQuery(int current,int pageSize,EarlyWarningEO earlyWarningEO){ public IPage<EarlyWarningEO> oldStandQuery(int current,int pageSize,EarlyWarningEO earlyWarningEO){
QueryWrapper<EarlyWarningEO> wrapper = new QueryWrapper<>(); QueryWrapper<EarlyWarningEO> wrapper = new QueryWrapper<>();
//根据标准编号查询 //根据标准编号查询
if (earlyWarningEO.getStandCode() != null && earlyWarningEO.getStandCode().length() != 0){ selectMethods(earlyWarningEO, wrapper);
wrapper.like("STAND_CODE",earlyWarningEO.getStandCode());
}
//根据标准名称查询
if (earlyWarningEO.getStandName() != null && earlyWarningEO.getStandName().length() != 0){
wrapper.like("STAND_NAME",earlyWarningEO.getStandName());
}
//根据实施日期查询
if (earlyWarningEO.getPutTime() != null ){
SimpleDateFormat formater = new SimpleDateFormat();
formater.applyPattern("yyyy-MM-dd");
if (earlyWarningEO.getLastTime() != null){
wrapper.between("PUT_TIME",formater.format(earlyWarningEO.getPutTime()),formater.format(earlyWarningEO.getLastTime()));
}else {
wrapper.ge("PUT_TIME", formater.format(earlyWarningEO.getPutTime()));
}
}
if (earlyWarningEO.getLastTime()!=null){
SimpleDateFormat formater = new SimpleDateFormat();
formater.applyPattern("yyyy-MM-dd");
wrapper.le("PUT_TIME", formater.format(earlyWarningEO.getLastTime()));
}
//根据适用车型查询
if (earlyWarningEO.getApplyType() != null && earlyWarningEO.getApplyType().length() != 0){
wrapper.like("APPLY_TYPE",earlyWarningEO.getApplyType());
}
wrapper.eq("mark",2); wrapper.eq("mark",2);
return getEarlyWarningEOIPage(current, pageSize, wrapper); return getEarlyWarningEOIPage(current, pageSize, wrapper);
} }
@@ -108,32 +58,7 @@ public class EarlyWarningEOServiceImpl extends ServiceImpl<EarlyWarningEODao, Ea
public IPage<EarlyWarningEO> newItemsQuery(int current,int pageSize,EarlyWarningEO earlyWarningEO){ public IPage<EarlyWarningEO> newItemsQuery(int current,int pageSize,EarlyWarningEO earlyWarningEO){
QueryWrapper<EarlyWarningEO> wrapper = new QueryWrapper<>(); QueryWrapper<EarlyWarningEO> wrapper = new QueryWrapper<>();
//根据标准编号查询 //根据标准编号查询
if (earlyWarningEO.getStandCode() != null && earlyWarningEO.getStandCode().length() != 0){ selectMethods(earlyWarningEO, wrapper);
wrapper.like("STAND_CODE",earlyWarningEO.getStandCode());
}
//根据标准名称查询
if (earlyWarningEO.getStandName() != null && earlyWarningEO.getStandName().length() != 0){
wrapper.like("STAND_NAME",earlyWarningEO.getStandName());
}
//根据实施日期查询
if (earlyWarningEO.getPutTime() != null ){
SimpleDateFormat formater = new SimpleDateFormat();
formater.applyPattern("yyyy-MM-dd");
if (earlyWarningEO.getLastTime() != null){
wrapper.between("PUT_TIME",formater.format(earlyWarningEO.getPutTime()),formater.format(earlyWarningEO.getLastTime()));
}else {
wrapper.ge("PUT_TIME", formater.format(earlyWarningEO.getPutTime()));
}
}
if (earlyWarningEO.getLastTime()!=null){
SimpleDateFormat formater = new SimpleDateFormat();
formater.applyPattern("yyyy-MM-dd");
wrapper.le("PUT_TIME", formater.format(earlyWarningEO.getLastTime()));
}
//根据适用车型查询
if (earlyWarningEO.getApplyType() != null && earlyWarningEO.getApplyType().length() != 0){
wrapper.like("APPLY_TYPE",earlyWarningEO.getApplyType());
}
wrapper.eq("mark",3); wrapper.eq("mark",3);
return getEarlyWarningEOIPage(current, pageSize, wrapper); return getEarlyWarningEOIPage(current, pageSize, wrapper);
} }
@@ -141,32 +66,7 @@ public class EarlyWarningEOServiceImpl extends ServiceImpl<EarlyWarningEODao, Ea
public IPage<EarlyWarningEO> oldItemsQuery(int current,int pageSize,EarlyWarningEO earlyWarningEO){ public IPage<EarlyWarningEO> oldItemsQuery(int current,int pageSize,EarlyWarningEO earlyWarningEO){
QueryWrapper<EarlyWarningEO> wrapper = new QueryWrapper<>(); QueryWrapper<EarlyWarningEO> wrapper = new QueryWrapper<>();
//根据标准编号查询 //根据标准编号查询
if (earlyWarningEO.getStandCode() != null && earlyWarningEO.getStandCode().length() != 0){ selectMethods(earlyWarningEO, wrapper);
wrapper.like("STAND_CODE",earlyWarningEO.getStandCode());
}
//根据标准名称查询
if (earlyWarningEO.getStandName() != null && earlyWarningEO.getStandName().length() != 0){
wrapper.like("STAND_NAME",earlyWarningEO.getStandName());
}
//根据实施日期查询
if (earlyWarningEO.getPutTime() != null ){
SimpleDateFormat formater = new SimpleDateFormat();
formater.applyPattern("yyyy-MM-dd");
if (earlyWarningEO.getLastTime() != null){
wrapper.between("PUT_TIME",formater.format(earlyWarningEO.getPutTime()),formater.format(earlyWarningEO.getLastTime()));
}else {
wrapper.ge("PUT_TIME", formater.format(earlyWarningEO.getPutTime()));
}
}
if (earlyWarningEO.getLastTime()!=null){
SimpleDateFormat formater = new SimpleDateFormat();
formater.applyPattern("yyyy-MM-dd");
wrapper.le("PUT_TIME", formater.format(earlyWarningEO.getLastTime()));
}
//根据适用车型查询
if (earlyWarningEO.getApplyType() != null && earlyWarningEO.getApplyType().length() != 0){
wrapper.like("APPLY_TYPE",earlyWarningEO.getApplyType());
}
wrapper.eq("mark",4); wrapper.eq("mark",4);
return getEarlyWarningEOIPage(current, pageSize, wrapper); return getEarlyWarningEOIPage(current, pageSize, wrapper);
} }
@@ -207,6 +107,17 @@ public class EarlyWarningEOServiceImpl extends ServiceImpl<EarlyWarningEODao, Ea
} }
return "更改成功"; return "更改成功";
} }
/**
* 分页查询标准预警
* @return
*/
@Override
public IPage<StandWarningEO> getStandWarning(StandWarningEO queryPage) {
IPage<StandWarningEO> iPage = new Page<>(queryPage.getPage(),queryPage.getPageSize());
return earlyWarningEODao.selectWarningPage(iPage,queryPage);
}
private IPage<EarlyWarningEO> getEarlyWarningEOIPage(int current,int pageSize, QueryWrapper<EarlyWarningEO> wrapper) { private IPage<EarlyWarningEO> getEarlyWarningEOIPage(int current,int pageSize, QueryWrapper<EarlyWarningEO> wrapper) {
wrapper.eq("power",1); wrapper.eq("power",1);
Page<EarlyWarningEO> page = new Page<>(current, pageSize); Page<EarlyWarningEO> page = new Page<>(current, pageSize);
@@ -215,4 +126,38 @@ public class EarlyWarningEOServiceImpl extends ServiceImpl<EarlyWarningEODao, Ea
System.out.println("总页数"+userIPage.getPages()); System.out.println("总页数"+userIPage.getPages());
return userIPage; return userIPage;
} }
private void selectMethods(EarlyWarningEO earlyWarningEO, QueryWrapper<EarlyWarningEO> wrapper) {
//根据标准编号查询
if (earlyWarningEO.getStandCode() != null && earlyWarningEO.getStandCode().length() != 0) {
wrapper.like("STAND_CODE", earlyWarningEO.getStandCode());
}
//根据标准名称查询
if (earlyWarningEO.getStandName() != null && earlyWarningEO.getStandName().length() != 0) {
wrapper.like("STAND_NAME", earlyWarningEO.getStandName());
}
//根据实施日期查询
if (earlyWarningEO.getPutTime() != null) {
SimpleDateFormat formater = new SimpleDateFormat();
formater.applyPattern("yyyy-MM-dd");
if (earlyWarningEO.getLastTime() != null) {
wrapper.between("PUT_TIME", formater.format(earlyWarningEO.getPutTime()), formater.format(earlyWarningEO.getLastTime()));
} else {
wrapper.ge("PUT_TIME", formater.format(earlyWarningEO.getPutTime()));
}
}
if (earlyWarningEO.getLastTime() != null) {
SimpleDateFormat formater = new SimpleDateFormat();
formater.applyPattern("yyyy-MM-dd");
wrapper.le("PUT_TIME", formater.format(earlyWarningEO.getLastTime()));
}
//根据适用车型查询
if (earlyWarningEO.getApplyType() != null && earlyWarningEO.getApplyType().length() != 0) {
wrapper.like("APPLY_TYPE", earlyWarningEO.getApplyType());
}
}
} }
@@ -1,6 +1,8 @@
package com.adc.da.slrs.sarStandardComplianceAssessResult.controller; package com.adc.da.slrs.sarStandardComplianceAssessResult.controller;
import com.adc.da.http.ResponseMessage;
import com.adc.da.http.Result;
import com.adc.da.slrs.sarStandItems.entity.SarStandItems; import com.adc.da.slrs.sarStandItems.entity.SarStandItems;
import com.adc.da.slrs.sarStandardComplianceAssessResult.service.impl.SarInterpretationNationalStandardServiceImpl; import com.adc.da.slrs.sarStandardComplianceAssessResult.service.impl.SarInterpretationNationalStandardServiceImpl;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@@ -37,4 +39,14 @@ public class SarInterpretationNationalStandardController extends BaseController<
return sarInterpretationNationalStandardService.saveBath(findStandDto); return sarInterpretationNationalStandardService.saveBath(findStandDto);
} }
@ApiOperation(value = "修改技术评估结果")
@PostMapping("/updateById")
public ResponseMessage<String> updateById(@RequestBody SarInterpretationNationalStandard findStandDto){
if (sarInterpretationNationalStandardService.updateData(findStandDto)) {
return Result.success("success");
}else {
return Result.error("error");
}
}
} }
@@ -79,7 +79,7 @@ public class SarStandardComplianceAssessResultController {
if (eo.getPosition() == 1) { if (eo.getPosition() == 1) {
QueryWrapper<SarInterpretationNationalStandard> queryWrapper = new QueryWrapper<>(); QueryWrapper<SarInterpretationNationalStandard> queryWrapper = new QueryWrapper<>();
IPage<SarInterpretationNationalStandard> iPage = new Page<>(eo.getCurrent(), eo.getSize()); IPage<SarInterpretationNationalStandard> iPage = new Page<>(eo.getCurrent(), eo.getSize());
queryWrapper.select("distinct STAND_ID, STAND_NUMBER, STAND_NAME, STAND_TYPE, INTERPRETATION_TIME"); queryWrapper.select("distinct STAND_ID, STAND_NUMBER, STAND_NAME, STAND_TYPE, INTERPRETATION_TIME,risk_degree");
if (eo.getStandName() != null && !eo.getStandName().trim().equals("")) { if (eo.getStandName() != null && !eo.getStandName().trim().equals("")) {
queryWrapper.like("STAND_NAME", eo.getStandName().trim()); queryWrapper.like("STAND_NAME", eo.getStandName().trim());
} }
@@ -2,6 +2,7 @@ package com.adc.da.slrs.sarStandardComplianceAssessResult.dao;
import com.adc.da.slrs.sarStandardComplianceAssessResult.entity.SarInterpretationNationalStandard; import com.adc.da.slrs.sarStandardComplianceAssessResult.entity.SarInterpretationNationalStandard;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
/** /**
* <p> * <p>
@@ -13,4 +14,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface SarInterpretationNationalStandardDao extends BaseMapper<SarInterpretationNationalStandard> { public interface SarInterpretationNationalStandardDao extends BaseMapper<SarInterpretationNationalStandard> {
boolean updateData(@Param("find") SarInterpretationNationalStandard findStandDto);
} }
@@ -93,4 +93,9 @@ public class SarInterpretationNationalStandard extends BaseEntity {
@TableField("ID") @TableField("ID")
private String id; private String id;
@ApiModelProperty(value = "风险程度")
@TableField("risk_degree")
private String riskDegree;
} }
@@ -16,4 +16,6 @@ import java.util.List;
public interface ISarInterpretationNationalStandardService extends IService<SarInterpretationNationalStandard> { public interface ISarInterpretationNationalStandardService extends IService<SarInterpretationNationalStandard> {
String saveBath(List<SarInterpretationNationalStandard> sarInterpretationNationalStandards); String saveBath(List<SarInterpretationNationalStandard> sarInterpretationNationalStandards);
boolean updateData(SarInterpretationNationalStandard findStandDto);
} }
@@ -24,8 +24,8 @@ import java.util.List;
@Service @Service
public class SarInterpretationNationalStandardServiceImpl extends ServiceImpl<SarInterpretationNationalStandardDao, SarInterpretationNationalStandard> implements ISarInterpretationNationalStandardService { public class SarInterpretationNationalStandardServiceImpl extends ServiceImpl<SarInterpretationNationalStandardDao, SarInterpretationNationalStandard> implements ISarInterpretationNationalStandardService {
// @Autowired @Autowired
// SarStandardComplianceProductAssessDao sarStandardComplianceProductAssessDao; SarInterpretationNationalStandardDao sarInterpretationNationalStandardDao;
@Override @Override
public String saveBath(List<SarInterpretationNationalStandard> sarInterpretationNationalStandards) { public String saveBath(List<SarInterpretationNationalStandard> sarInterpretationNationalStandards) {
@@ -50,4 +50,9 @@ public class SarInterpretationNationalStandardServiceImpl extends ServiceImpl<Sa
String res = flag ? "1":"0"; String res = flag ? "1":"0";
return res; return res;
} }
@Override
public boolean updateData(SarInterpretationNationalStandard findStandDto) {
return sarInterpretationNationalStandardDao.updateData(findStandDto);
}
} }
@@ -53,6 +53,9 @@ import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao;
import com.adc.da.slrs.sarStandardsInfo.service.ISarStandardsInfoService; import com.adc.da.slrs.sarStandardsInfo.service.ISarStandardsInfoService;
import com.adc.da.slrs.sarUpdLog.service.ISarUpdLogService; import com.adc.da.slrs.sarUpdLog.service.ISarUpdLogService;
import com.adc.da.slrs.sarUser.service.ITsUserService; import com.adc.da.slrs.sarUser.service.ITsUserService;
import com.adc.da.slrs.standardSplit.dao.SarFileSplitInfoEODao;
import com.adc.da.slrs.standardSplit.entity.SarFileSplitInfoEO;
import com.adc.da.slrs.standardSplit.entity.SarFileSplitInfoEOPage;
import com.adc.da.slrs.sysInfo.service.SysInfoEOService; import com.adc.da.slrs.sysInfo.service.SysInfoEOService;
import com.adc.da.slrs.tsDictionaryType.dao.TsDicTypeDao; import com.adc.da.slrs.tsDictionaryType.dao.TsDicTypeDao;
import com.adc.da.slrs.tsDictionaryType.dao.TsDictionaryDao; import com.adc.da.slrs.tsDictionaryType.dao.TsDictionaryDao;
@@ -539,16 +542,23 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
return resultMap; return resultMap;
} }
@Autowired
private SarFileSplitInfoEODao sarFileSplitInfoEODao;
public void attrInfoShowDetails(List<SarStandardsInfo> sarlist) throws Exception { public void attrInfoShowDetails(List<SarStandardsInfo> sarlist) throws Exception {
for (SarStandardsInfo row : sarlist) { for (SarStandardsInfo row : sarlist) {
attrInfoDetails(row); attrInfoDetails(row);
Map<String, Object> getAttrMap = row.getAttrInfoMap(); Map<String, Object> getAttrMap = row.getAttrInfoMap();
if (getAttrMap != null && getAttrMap.size() > 0) { if (getAttrMap != null && getAttrMap.size() > 0) {
//存在的分解单文本名称列表 //判断文本是否已被拆分,把已被拆分过的文件给前端判断是否显示分解单
LinkedList<String> itemExistList = new LinkedList<>(); SarFileSplitInfoEOPage sarFileSplitInfoEOPage = new SarFileSplitInfoEOPage();
sarFileSplitInfoEOPage.setStandId(row.getId());
List<SarFileSplitInfoEO> sarFileSplitInfoEOS = sarFileSplitInfoEODao.queryByPageOwn(sarFileSplitInfoEOPage);
List<String> itemExistList = sarFileSplitInfoEOS.stream()
.map(item -> item.getFileType())
.collect(Collectors.toList());
getAttrMap.put("itemExistList",itemExistList); getAttrMap.put("itemExistList",itemExistList);
for (Map.Entry<String, Object> entry : getAttrMap.entrySet()) { for (Map.Entry<String, Object> entry : getAttrMap.entrySet()) {
String name = entry.getKey(); String name = entry.getKey();
String value = ""; String value = "";
@@ -557,15 +567,6 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
if (StringUtils.isNotBlank(value)) { if (StringUtils.isNotBlank(value)) {
List<AttFileEO> fileObj = attFileEOService.getMultiFileInfos(value); List<AttFileEO> fileObj = attFileEOService.getMultiFileInfos(value);
entry.setValue(fileObj); entry.setValue(fileObj);
//以标准id和文本类型查询分解单表 有数据设标记为为 1
FindSarItemsPageReqDTO sarItemCount = new FindSarItemsPageReqDTO();
sarItemCount.setStandId(row.getId());
sarItemCount.setFileType(name);
Integer sarItemsCount = standItemsDao.sarItemCount(sarItemCount);
if (sarItemsCount>0){
//存在分解单的文本名称存入列表
itemExistList.add(name);
}
} }
}else if (entry.getValue() != null && InitStandAttrUtil.selectionFieldList != null && InitStandAttrUtil.selectionFieldList.size() > 0 && InitStandAttrUtil.selectionFieldList.contains(name)) { }else if (entry.getValue() != null && InitStandAttrUtil.selectionFieldList != null && InitStandAttrUtil.selectionFieldList.size() > 0 && InitStandAttrUtil.selectionFieldList.contains(name)) {
value = entry.getValue().toString(); value = entry.getValue().toString();
@@ -40,10 +40,10 @@ public class SarVppsTreeController extends BaseController<SarVppsTree> {
@ApiOperation("根据父ID查询子所有资源") @ApiOperation("根据父ID查询子所有资源")
@GetMapping("/childByList") @GetMapping("/childByList")
public ResponseMessage<List<SarVppsTree>> childByList(String ids){ public ResponseMessage<List<SarVppsTree>> childByList(SarVppsTree parent){
SarVppsTree tree = new SarVppsTree(); // SarVppsTree tree = new SarVppsTree();
tree.setId(ids); // tree.setId(ids);
List<SarVppsTree> tsResources = iSarVppsTreeService.recursionGetChildren(tree); List<SarVppsTree> tsResources = iSarVppsTreeService.recursionGetChildren(parent);
return Result.success(tsResources); return Result.success(tsResources);
} }
@@ -13,7 +13,7 @@ import java.util.List;
/** /**
* <p> * <p>
* *
* </p> * </p>
* *
* @author super_liu * @author super_liu
@@ -66,6 +66,18 @@ public class SarVppsTree extends BaseEntity {
@TableField(exist = false) @TableField(exist = false)
private String parentIdsName; private String parentIdsName;
@ApiModelProperty("层级")
@TableField("LEVEL")
private Integer level;
@ApiModelProperty("类型")
@TableField("TYPE")
private String type;
@ApiModelProperty("查询子节点条件")
@TableField(exist = false)
private String nextCondition;
@TableField(exist=false) @TableField(exist=false)
private List<String> roleIds; private List<String> roleIds;
@@ -73,4 +85,6 @@ public class SarVppsTree extends BaseEntity {
private List<String> childMenuIds; private List<String> childMenuIds;
} }
@@ -27,8 +27,14 @@ public class SarVppsTreeServiceImpl extends ServiceImpl<SarVppsTreeDao, SarVppsT
@Override @Override
public List<SarVppsTree> getAll(SarVppsTree sarVppsTree) { public List<SarVppsTree> getAll(SarVppsTree sarVppsTree) {
QueryWrapper<SarVppsTree> tsResourceQueryWrapper=new QueryWrapper<>(); QueryWrapper<SarVppsTree> tsResourceQueryWrapper=new QueryWrapper<>();
tsResourceQueryWrapper.isNull("PID"); tsResourceQueryWrapper.eq("TYPE",sarVppsTree.getType())
.eq("LEVEL",0);
List<SarVppsTree> list = this.baseMapper.selectList(tsResourceQueryWrapper); List<SarVppsTree> list = this.baseMapper.selectList(tsResourceQueryWrapper);
list.forEach(item->{
item.setCode(item.getVppsCode()+item.getChineseName());
item.setId("10");
});
// for(SarVppsTree tree:list){ // for(SarVppsTree tree:list){
// tree.setChildren(recursionGetChildren((tree))); // tree.setChildren(recursionGetChildren((tree)));
// } // }
@@ -44,11 +50,16 @@ public class SarVppsTreeServiceImpl extends ServiceImpl<SarVppsTreeDao, SarVppsT
public List<SarVppsTree> recursionGetChildren(SarVppsTree parent){ public List<SarVppsTree> recursionGetChildren(SarVppsTree parent){
QueryWrapper<SarVppsTree> sarMenuQueryWrapper=new QueryWrapper<>(); QueryWrapper<SarVppsTree> sarMenuQueryWrapper=new QueryWrapper<>();
sarMenuQueryWrapper.orderByAsc("SORT"); sarMenuQueryWrapper.orderByAsc("SORT");
sarMenuQueryWrapper.in("PID",parent.getId());
sarMenuQueryWrapper.eq("LEVEL", parent.getLevel()+1)
.eq("TYPE",parent.getType())
.like("VPPS_CODE",parent.getId());
List<SarVppsTree> children=this.baseMapper.selectList(sarMenuQueryWrapper); List<SarVppsTree> children=this.baseMapper.selectList(sarMenuQueryWrapper);
for(SarVppsTree sarMenu:children){
sarMenu.setChildren(recursionGetChildren((sarMenu))); children.forEach(item->{
} item.setId(item.getVppsCode());
item.setCode(item.getVppsCode()+item.getChineseName());
});
return children; return children;
} }
} }
@@ -190,7 +190,7 @@ public class SarFileSplitItemsEOController extends BaseController<SarFileSplitIt
nowFile.mkdirs(); nowFile.mkdirs();
String fileName = fileOriName + ".xls"; String fileName = fileOriName + ".xls";
HSSFSheet sheetItems = workbook.createSheet("条款内容"); HSSFSheet sheetItems = workbook.createSheet("条款内容");
String[] headers = {"条款号","条款名称","内容简介","责任部门","FO","责任工程师","SVPPS","适用车辆类型","要求类型","企标覆盖关系"}; String[] headers = {"条款号","条款名称","内容简介"};
HSSFCellStyle cellStyle =workbook.createCellStyle(); HSSFCellStyle cellStyle =workbook.createCellStyle();
cellStyle.setWrapText(true); cellStyle.setWrapText(true);
// cellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER); // cellStyle.setAlignment(HSSFCellStyle.ALIGN_CENTER);
@@ -4,6 +4,7 @@ import com.adc.da.base.web.BaseController;
import com.adc.da.http.PageInfo; import com.adc.da.http.PageInfo;
import com.adc.da.person.dao.PersonCollectEODao; import com.adc.da.person.dao.PersonCollectEODao;
import com.adc.da.person.dao.PersonShareEODao; import com.adc.da.person.dao.PersonShareEODao;
import com.adc.da.slrs.standardSplit.dao.SarStandCompareHisEODao;
import com.adc.da.slrs.standardSplit.entity.SarStandCompareHisEO; import com.adc.da.slrs.standardSplit.entity.SarStandCompareHisEO;
import com.adc.da.slrs.standardSplit.entity.SarStandCompareHisEOPage; import com.adc.da.slrs.standardSplit.entity.SarStandCompareHisEOPage;
import com.adc.da.slrs.standardSplit.service.SarItemsCompareHisEOService; import com.adc.da.slrs.standardSplit.service.SarItemsCompareHisEOService;
@@ -18,6 +19,7 @@ import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@@ -46,6 +48,9 @@ public class SarStandCompareHisEOController extends BaseController<SarStandCompa
@Autowired @Autowired
private PersonCollectEODao personCollectEODao; private PersonCollectEODao personCollectEODao;
@Autowired
private SarStandCompareHisEODao dao;
@ApiOperation(value = "|SarStandCompareHisEO|分页查询") @ApiOperation(value = "|SarStandCompareHisEO|分页查询")
@GetMapping("/page") @GetMapping("/page")
// @RequiresPermissions("lawss:sarStandCompareHis:page") // @RequiresPermissions("lawss:sarStandCompareHis:page")
@@ -126,8 +131,15 @@ public class SarStandCompareHisEOController extends BaseController<SarStandCompa
@ApiOperation(value = "全文比对") @ApiOperation(value = "全文比对")
@PostMapping("/fullTextComparison") @PostMapping("/fullTextComparison")
public ResponseMessage<Map<String,Object>> fullTextComparison(String leftStandard, String rightStandard) throws Exception { public ResponseMessage<String> fullTextComparison(String leftStandard, String rightStandard) throws Exception {
Map<String,Object> resultMap = sarStandCompareHisEOService.fullTextComparison(leftStandard,rightStandard); String id=UUIDUtils.randomUUID(32);
return Result.success(resultMap); SarStandCompareHisEO sarStandCompareHisEO =new SarStandCompareHisEO();
sarStandCompareHisEO.setId(id);
sarStandCompareHisEO.setCompareStatus("比对中");
sarStandCompareHisEO.setCompareType("全文比对");
sarStandCompareHisEO.setCreateTime(new Date());
dao.insertSelective(sarStandCompareHisEO);
Map<String,Object> resultMap = sarStandCompareHisEOService.fullTextComparison(leftStandard,rightStandard,id);
return Result.success("标准正在比对中请稍后查看结果");
} }
} }
@@ -3,6 +3,10 @@ package com.adc.da.slrs.standardSplit.controller;
import com.adc.da.att.service.IAttFileEOService; import com.adc.da.att.service.IAttFileEOService;
import com.adc.da.base.web.BaseController; import com.adc.da.base.web.BaseController;
import com.adc.da.http.PageInfo; import com.adc.da.http.PageInfo;
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
import com.adc.da.slrs.sarBussionessStand.service.ISarBussionessStandService;
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
import com.adc.da.slrs.sarStandardsInfo.service.ISarStandardsInfoService;
import com.adc.da.slrs.standardSplit.entity.SarFileSplitItemsEO; import com.adc.da.slrs.standardSplit.entity.SarFileSplitItemsEO;
import com.adc.da.slrs.standardSplit.entity.SarStandFileEO; import com.adc.da.slrs.standardSplit.entity.SarStandFileEO;
import com.adc.da.slrs.standardSplit.entity.SarStandFileEOPage; import com.adc.da.slrs.standardSplit.entity.SarStandFileEOPage;
@@ -144,4 +148,12 @@ public class SarStandFileEOController extends BaseController<SarStandFileEO> {
return Result.success(sarStandFileEOS); return Result.success(sarStandFileEOS);
} }
@ApiOperation(value = "查询文本信息")
@GetMapping("/queryFileInfoNew")
public ResponseMessage<List<SarStandFileEO>> queryFileInfoNew(@RequestParam("standId") String standId,@RequestParam("type") String type) throws Exception {
List<SarStandFileEO> sarStandFileEOS = sarStandFileEOService.selectFileByStandIdOCR(standId,type);
return Result.success(sarStandFileEOS);
}
} }
@@ -2,6 +2,7 @@ package com.adc.da.slrs.standardSplit.entity;
import com.adc.da.base.entity.BaseEntity; import com.adc.da.base.entity.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
@@ -13,6 +14,7 @@ import java.util.List;
* <b>日期:</b> 2020-02-24 <br> * <b>日期:</b> 2020-02-24 <br>
* <b>版权所有:<b>版权归北京卡达克数据技术中心所有。<br> * <b>版权所有:<b>版权归北京卡达克数据技术中心所有。<br>
*/ */
@Data
public class SarStandCompareHisEO extends BaseEntity { public class SarStandCompareHisEO extends BaseEntity {
private String compareType; private String compareType;
@@ -36,6 +38,7 @@ public class SarStandCompareHisEO extends BaseEntity {
private String newFileTypeShow; private String newFileTypeShow;
private String newSarType; private String newSarType;
private String collectId; private String collectId;
private String compareStatus;
private List<SarStandItemsCompareHisEO> resLeftMapList = new ArrayList<>(); private List<SarStandItemsCompareHisEO> resLeftMapList = new ArrayList<>();
@@ -1,6 +1,7 @@
package com.adc.da.slrs.standardSplit.entity; package com.adc.da.slrs.standardSplit.entity;
import com.adc.da.base.page.BasePage; import com.adc.da.base.page.BasePage;
import lombok.Data;
/** /**
* <b>功能:</b>SAR_STAND_COMPARE_HIS SarStandCompareHisEOPage<br> * <b>功能:</b>SAR_STAND_COMPARE_HIS SarStandCompareHisEOPage<br>
@@ -8,6 +9,7 @@ import com.adc.da.base.page.BasePage;
* <b>日期:</b> 2020-02-24 <br> * <b>日期:</b> 2020-02-24 <br>
* <b>版权所有:<b>版权归北京卡达克数据技术中心所有。<br> * <b>版权所有:<b>版权归北京卡达克数据技术中心所有。<br>
*/ */
@Data
public class SarStandCompareHisEOPage extends BasePage { public class SarStandCompareHisEOPage extends BasePage {
private String compareType; private String compareType;
@@ -50,6 +52,7 @@ public class SarStandCompareHisEOPage extends BasePage {
private String oldNumOrName; private String oldNumOrName;
private String newNumOrName; private String newNumOrName;
private String compareStatus;
private String shunxu; private String shunxu;
@@ -21,5 +21,5 @@ public interface SarStandCompareHisEOService {
Map<String,Object> clauseComparison(String oldItemId, String newItemId, String standHisId); Map<String,Object> clauseComparison(String oldItemId, String newItemId, String standHisId);
Map<String,Object> fullTextComparison(String leftStandard, String rightStandard) throws Exception; Map<String,Object> fullTextComparison(String leftStandard, String rightStandard,String id) throws Exception;
} }
@@ -25,4 +25,6 @@ public interface SarStandFileEOService {
List<SarStandFileEO> selectFileByStandId(String standId); List<SarStandFileEO> selectFileByStandId(String standId);
List<SarStandFileEO> selectFileByStandIdOCR(String standId,String type) throws Exception;
} }
@@ -4,6 +4,8 @@ import com.adc.da.att.service.IAttFileEOService;
import com.adc.da.person.entity.PersonMsgEO; import com.adc.da.person.entity.PersonMsgEO;
import com.adc.da.slrs.sarStandAttrDetails.service.ISarStandAttrDetailsService; import com.adc.da.slrs.sarStandAttrDetails.service.ISarStandAttrDetailsService;
import com.adc.da.slrs.sarStandItems.entity.SarStandItems; import com.adc.da.slrs.sarStandItems.entity.SarStandItems;
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
import com.adc.da.slrs.sarStandardsInfo.service.ISarStandardsInfoService;
import com.adc.da.slrs.standardSplit.dao.*; import com.adc.da.slrs.standardSplit.dao.*;
import com.adc.da.slrs.standardSplit.service.SarLawsInfoEOService; import com.adc.da.slrs.standardSplit.service.SarLawsInfoEOService;
import com.adc.da.att.entity.AttFileEO; import com.adc.da.att.entity.AttFileEO;
@@ -52,6 +54,8 @@ public class SarFileSplitInfoEOServiceImpl implements SarFileSplitInfoEOService
@Autowired @Autowired
private ISarStandAttrDetailsService sarStandAttrDetailsEOService; private ISarStandAttrDetailsService sarStandAttrDetailsEOService;
@Autowired
private ISarStandardsInfoService sarStandardsInfoService;
@Autowired @Autowired
private IAttFileEOService attFileEOService; private IAttFileEOService attFileEOService;
@@ -122,8 +126,11 @@ public class SarFileSplitInfoEOServiceImpl implements SarFileSplitInfoEOService
//用来往标准分解单里添加数据 //用来往标准分解单里添加数据
List<SarStandItems> standList = new ArrayList<>(); List<SarStandItems> standList = new ArrayList<>();
SarStandardsInfo sarStandardsInfo=sarStandardsInfoService.getById(sarFileSplitInfoEO.getStandId());
// 拆分文件主表中插入数据 // 拆分文件主表中插入数据
sarFileSplitInfoEO.setStandName(sarStandardsInfo.getStandName());
sarFileSplitInfoEO.setStandNameSplit(sarStandardsInfo.getStandName());
sarFileSplitInfoEO.setStandNumSplit(sarStandardsInfo.getStandSort()+" "+sarStandardsInfo.getStandNumber()+"-"+sarStandardsInfo.getStandYear());
sarFileSplitInfoEO.setId(UUIDUtils.randomUUID20()); sarFileSplitInfoEO.setId(UUIDUtils.randomUUID20());
sarFileSplitInfoEO.setValidFlag(0); sarFileSplitInfoEO.setValidFlag(0);
sarFileSplitInfoEO.setCreationTime(new Date()); sarFileSplitInfoEO.setCreationTime(new Date());
@@ -368,22 +375,23 @@ public class SarFileSplitInfoEOServiceImpl implements SarFileSplitInfoEOService
sarFileSplitItemsValEODao.insertForeach(itemValList); sarFileSplitItemsValEODao.insertForeach(itemValList);
//用来往标准分解单插入数据 // 2021/11/23改用标准详情手动插入
messageList.forEach(item -> { // //用来往标准分解单插入数据
//new一个对象 // messageList.forEach(item -> {
SarStandItems standItems1 = new SarStandItems(); // //new一个对象
//standItems1里的这个值为messageList里的ItermsConditions // SarStandItems standItems1 = new SarStandItems();
standItems1.setId(UUIDUtils.randomUUID20()) // //standItems1里的这个值为messageList里的ItermsConditions
.setFileType(sarFileSplitInfoEO.getFileType()) // standItems1.setId(UUIDUtils.randomUUID20())
.setStandId(sarFileSplitInfoEO.getStandId()) // .setFileType(sarFileSplitInfoEO.getFileType())
.setItemsNum(item.getItemsNum()) // .setStandId(sarFileSplitInfoEO.getStandId())
.setItemsName(item.getItemsName()) // .setItemsNum(item.getItemsNum())
.setTermsConditions(item.getItermsConditions()) // .setItemsName(item.getItemsName())
.setEditFlag(item.getEditFlag()); // .setTermsConditions(item.getItermsConditions())
// .setEditFlag(item.getEditFlag());
standList.add(standItems1); //
}); // standList.add(standItems1);
sarFileSplitItemsEODao.insertStandSplitForeach(standList); // });
// sarFileSplitItemsEODao.insertStandSplitForeach(standList);
} else { } else {
@@ -245,9 +245,9 @@ public class SarStandCompareHisEOServiceImpl implements SarStandCompareHisEOServ
} }
return resultMap; return resultMap;
} }
@Async
@Override @Override
public Map<String, Object> fullTextComparison(String leftStandard, String rightStandard) throws Exception{ public Map<String, Object> fullTextComparison(String leftStandard, String rightStandard,String id) throws Exception{
Map<String,Object> resultMap = new HashMap<String,Object>(); Map<String,Object> resultMap = new HashMap<String,Object>();
List<Map<String,Object>> leftMapList = fullTextComparePackageData(leftStandard); List<Map<String,Object>> leftMapList = fullTextComparePackageData(leftStandard);
List<Map<String,Object>> rightMapList = fullTextComparePackageData(rightStandard); List<Map<String,Object>> rightMapList = fullTextComparePackageData(rightStandard);
@@ -281,7 +281,7 @@ public class SarStandCompareHisEOServiceImpl implements SarStandCompareHisEOServ
resultMap.put("resRightMapList",resRightMapList); resultMap.put("resRightMapList",resRightMapList);
} }
//往全文比对历史表中添加数据 //往全文比对历史表中添加数据
addStandCompareHis(leftStandard,rightStandard,"全文比对",resLeftMapList,resRightMapList); addStandCompareHis(leftStandard,rightStandard,"全文比对",resLeftMapList,resRightMapList,id);
return resultMap; return resultMap;
} }
@@ -319,12 +319,12 @@ public class SarStandCompareHisEOServiceImpl implements SarStandCompareHisEOServ
**/ **/
@Async @Async
public void addStandCompareHis(String leftStandId,String rightStandId,String compareType, public void addStandCompareHis(String leftStandId,String rightStandId,String compareType,
List<Map<String,Object>> resLeftMapList,List<Map<String,Object>> resRightMapList) throws Exception{ List<Map<String,Object>> resLeftMapList,List<Map<String,Object>> resRightMapList,String id) throws Exception{
SarFileSplitInfoEO leftInfo = sarFileSplitInfoEOService.selectByPrimaryKey(leftStandId); SarFileSplitInfoEO leftInfo = sarFileSplitInfoEOService.selectByPrimaryKey(leftStandId);
SarFileSplitInfoEO rightInfo = sarFileSplitInfoEOService.selectByPrimaryKey(rightStandId); SarFileSplitInfoEO rightInfo = sarFileSplitInfoEOService.selectByPrimaryKey(rightStandId);
//保存标准比对历史表数据 //保存标准比对历史表数据
SarStandCompareHisEO sarStandCompareHisEO = new SarStandCompareHisEO(); SarStandCompareHisEO sarStandCompareHisEO = new SarStandCompareHisEO();
String id = UUIDUtils.randomUUID20(); // String id = UUIDUtils.randomUUID20();
sarStandCompareHisEO.setId(id); sarStandCompareHisEO.setId(id);
sarStandCompareHisEO.setOldStandId(leftStandId); sarStandCompareHisEO.setOldStandId(leftStandId);
sarStandCompareHisEO.setNewStandId(rightStandId); sarStandCompareHisEO.setNewStandId(rightStandId);
@@ -341,7 +341,8 @@ public class SarStandCompareHisEOServiceImpl implements SarStandCompareHisEOServ
sarStandCompareHisEO.setCreateUser(LoginUserUtil.getUserId()); sarStandCompareHisEO.setCreateUser(LoginUserUtil.getUserId());
sarStandCompareHisEO.setModifyUser(LoginUserUtil.getUserId()); sarStandCompareHisEO.setModifyUser(LoginUserUtil.getUserId());
sarStandCompareHisEO.setCompareType(compareType); sarStandCompareHisEO.setCompareType(compareType);
dao.insertSelective(sarStandCompareHisEO); sarStandCompareHisEO.setCompareStatus("比对完成");
dao.updateByPrimaryKeySelective(sarStandCompareHisEO);
//保存标准的所有条款比对的历史数据 //保存标准的所有条款比对的历史数据
if(resLeftMapList!=null && !resLeftMapList.isEmpty()) { if(resLeftMapList!=null && !resLeftMapList.isEmpty()) {
setStandCompareHisEO(resLeftMapList, id, "LEFT"); setStandCompareHisEO(resLeftMapList, id, "LEFT");
@@ -1,6 +1,9 @@
package com.adc.da.slrs.standardSplit.service.impl; package com.adc.da.slrs.standardSplit.service.impl;
import com.adc.da.slrs.standardSplit.dao.SarStandAttrDetailsEODao; import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
import com.adc.da.slrs.sarBussionessStand.service.ISarBussionessStandService;
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
import com.adc.da.slrs.sarStandardsInfo.service.ISarStandardsInfoService;
import com.adc.da.slrs.standardSplit.dao.SarStandFileEODao; import com.adc.da.slrs.standardSplit.dao.SarStandFileEODao;
import com.adc.da.slrs.standardSplit.entity.SarStandFileEO; import com.adc.da.slrs.standardSplit.entity.SarStandFileEO;
import com.adc.da.slrs.standardSplit.entity.SarStandFileEOPage; import com.adc.da.slrs.standardSplit.entity.SarStandFileEOPage;
@@ -12,17 +15,21 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
@Service @Service
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class) @Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
public class SarStandFileEOServiceImpl implements SarStandFileEOService { public class SarStandFileEOServiceImpl implements SarStandFileEOService {
private static final Logger logger = LoggerFactory.getLogger(SarStandFileEOServiceImpl.class);
@Autowired @Autowired
private SarStandFileEODao sarStandFileEODao; private SarStandFileEODao sarStandFileEODao;
@Autowired @Autowired
private SarStandAttrDetailsEODao sarStandAttrDetailsEODao; private ISarStandardsInfoService sarStandardsInfoEOService;
@Autowired
private ISarBussionessStandService sarBussionessStandEOService;
@Override @Override
public List<SarStandFileEO> getStandFileListByPage(SarStandFileEOPage stand){ public List<SarStandFileEO> getStandFileListByPage(SarStandFileEOPage stand){
@@ -80,8 +87,54 @@ public class SarStandFileEOServiceImpl implements SarStandFileEOService {
}); });
return sarStandFileEOS; return sarStandFileEOS;
}
//type == 0 是pdf type==1 是doc
@Override
public List<SarStandFileEO> selectFileByStandIdOCR(String standId , String type) throws Exception {
QueryWrapper<SarStandFileEO> queryWrapper= new QueryWrapper<>();
List<String> choose=new ArrayList<>();
SarStandardsInfo result = sarStandardsInfoEOService.selectStandardsInfoByKey(standId);
SarBussionessStand result2 = sarBussionessStandEOService.selectStandardsInfoUpdateByKey(standId);
if (null!=result.getAttrInfoCaseMap()){
Map map=result.getAttrInfoCaseMap();
for (String key:result.getAttrInfoCaseMap().keySet()) {
if (null!=result.getAttrInfoCaseMap().get(key) && !"".equals(result.getAttrInfoCaseMap().get(key))){
if (result.getAttrInfoCaseMap().get(key).toString().contains(",")){
choose.add(result.getAttrInfoCaseMap().get(key).toString().replace(",",""));
}else {
choose.add(result.getAttrInfoCaseMap().get(key).toString());
}
}
}
}
if (null!=result2){
// return sarStandFileEODao.selectFileByStandId(standId);r }
queryWrapper.eq("STAND_ID",standId);
queryWrapper.eq("USE_MODEL","SOURCE_FILE");
queryWrapper.in("ATT_ID",choose);
List<SarStandFileEO> sarStandFileEOS = sarStandFileEODao.selectList(queryWrapper);
if ("0".equals(type)){
List<SarStandFileEO> remove=new ArrayList<>();
sarStandFileEOS.forEach(sarStandFileEO -> {
if (!sarStandFileEO.getFileName().contains(".PDF") && !sarStandFileEO.getFileName().contains(".pdf") ){
remove.add(sarStandFileEO);
}
});
sarStandFileEOS.removeAll(remove);
}else {
List<SarStandFileEO> remove=new ArrayList<>();
sarStandFileEOS.forEach(sarStandFileEO -> {
if (!sarStandFileEO.getFileName().contains(".DOC") && !sarStandFileEO.getFileName().contains(".doc") &&
!sarStandFileEO.getFileName().contains(".DOCX") && !sarStandFileEO.getFileName().contains(".docx")){
remove.add(sarStandFileEO);
}
});
sarStandFileEOS.removeAll(remove);
}
return sarStandFileEOS;
} }
} }
@@ -99,95 +99,43 @@
order by number order by number
</select> </select>
<select id="selectLawsByIdC" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto"> <select id="selectLawsByIdC" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto">
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ, select distinct c.ID,c.* from (
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as standSortShow, SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as
SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as
standSortShow,
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on FROM sar_stand_items ssi
a.ID = b.STAND_ID left join sar_standards_info a on ssi.stand_id = a.id
left join sar_stand_items ssi on ssi.stand_id = a.id LEFT JOIN sar_stand_attr_info b on a.ID = b.STAND_ID
<where> <where>
1=1
<if test="standName != null"> <if test="standName != null">
and
(a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%') (a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')) or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
and
</if> </if>
<if test="fileType !=null"> <if test="fileType !=null">
ssi.FILE_TYPE = #{fileType} and and ssi.FILE_TYPE = #{fileType}
</if> </if>
<if test="standType !=null"> <if test="standType !=null">
a.STAND_TYPE = #{standType} and and a.STAND_TYPE = #{standType}
</if> </if>
a.ID IN <if test="param1 != null and param1.size()>0">
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")"> and a.ID IN
#{item}
</foreach>
</where>
UNION
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as standSortShow,
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on
a.ID = b.STAND_ID
left join sar_stand_items ssi on ssi.stand_id = a.id
<where>
<if test="standName != null">
(a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
and
</if>
<if test="fileType !=null">
ssi.FILE_TYPE = #{fileType} and
</if>
<if test="standType !=null">
a.STAND_TYPE = #{standType} and
</if>
a.ID IN
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</where>
limit #{start},#{end}
</select>
<select id="selectLawsByIdCount" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto">
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as standSortShow,
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on
a.ID = b.STAND_ID
left join sar_stand_items ssi on ssi.stand_id = a.id
<where>
<if test="standName != null">
and
(a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
</if>
<if test="fileType !=null">
and
ssi.FILE_TYPE = #{fileType}
</if>
<if test="standType !=null">
and
a.STAND_TYPE = #{standType}
</if>
<if test="param1 !=null and param1.size()>0 " >
and
a.ID IN
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")"> <foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
</if> </if>
</where> </where>
UNION
UNION all
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ, SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as standSortShow, b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as standSortShow,
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
FROM sar_standards_info a LEFT JOIN sar_stand_attr_info b on FROM sar_stand_items ssi
a.ID = b.STAND_ID left join sar_standards_info a on ssi.stand_id = a.id
left join sar_stand_items ssi on ssi.stand_id = a.id LEFT JOIN sar_stand_attr_info b on a.ID = b.STAND_ID
<where> <where>
1=1 1=1
<if test="standName != null"> <if test="standName != null">
@@ -196,21 +144,82 @@
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')) or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
</if> </if>
<if test="fileType !=null"> <if test="fileType !=null">
and and ssi.FILE_TYPE = #{fileType}
ssi.FILE_TYPE = #{fileType}
</if> </if>
<if test="standType !=null"> <if test="standType !=null">
and and a.STAND_TYPE = #{standType}
a.STAND_TYPE = #{standType}
</if> </if>
<if test="param1 !=null and param1.size()>0 " > <if test="param1 != null and param1.size()>0">
and and a.ID IN
a.ID IN
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")"> <foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
</if> </if>
</where> </where>
)c
limit #{start},#{end}
</select>
<select id="selectLawsByIdCount" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto">
select distinct c.ID,c.* from (
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as
SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as
standSortShow,
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
FROM sar_stand_items ssi
left join sar_standards_info a on ssi.stand_id = a.id
LEFT JOIN sar_stand_attr_info b on a.ID = b.STAND_ID
<where>
1=1
<if test="standName != null">
and
(a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
</if>
<if test="fileType !=null">
and ssi.FILE_TYPE = #{fileType}
</if>
<if test="standType !=null">
and a.STAND_TYPE = #{standType}
</if>
<if test="param1 != null and param1.size()>0">
and a.ID IN
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
UNION all
SELECT a.ID,a.STAND_NUMBER as standNumber,a.STAND_NAME as standName,a.STAND_EN_NAME,b.NYLX,b.SSRQ as
SSRQ,b.XCXSSRQ as XCXSSRQGJ,b.ZCCSSRQ as ZCCSSRQGJ,
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as
standSortShow,
a.STAND_YEAR as standYear,ISSUE_TIME as issueTime,a.STAND_TYPE as standType,a.TEXT_STATUS as textStatus
FROM sar_stand_items ssi
left join sar_standards_info a on ssi.stand_id = a.id
LEFT JOIN sar_stand_attr_info b on a.ID = b.STAND_ID
<where>
1=1
<if test="standName != null">
and
(a.STAND_NUMBER LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%')
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
</if>
<if test="fileType !=null">
and ssi.FILE_TYPE = #{fileType}
</if>
<if test="standType !=null">
and a.STAND_TYPE = #{standType}
</if>
<if test="param1 != null and param1.size()>0">
and a.ID IN
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
)c
</select> </select>
<select id="selectTimes" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.StandRegionalTimeDto"> <select id="selectTimes" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.StandRegionalTimeDto">
@@ -0,0 +1,186 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.adc.da.slrs.sarStandWarning.dao.EarlyWarningEODao">
<!-- Result Map-->
<resultMap id="resultMap" type="com.adc.da.slrs.sarStandWarning.entity.StandWarningEO" >
<id column="ID" property="id" />
<result column="STAND_ID" property="standId"></result>
<result column="STAND_TYPE" property="standType"></result>
<result column="STAND_CODE" property="standCode"></result>
<result column="STAND_NAME" property="standName"></result>
<result column="PUT_TIME" property="putTime"></result>
<result column="APPLY_TYPE" property="applyType"></result>
<result column="DUTY_ENGINEER" property="dutyEngineer"></result>
<result column="ITEMS_ID" property="itemsId"></result>
<result column="ITEMS_NUM" property="itemsNum"></result>
<result column="ITEMS_NAME" property="itemsName"></result>
<result column="POLICY_ID" property="policyId"></result>
<result column="POLICY_NAME" property="policyName"></result>
<result column="MARK" property="mark"></result>
<result column="POWER" property="power"></result>
<result column="XCXSSRQ" property="XCXSSRQ"></result>
<result column="ZCCSSRQ" property="ZCCSSRQ"></result>
<result column="SSRQ" property="SSRQ"></result>
</resultMap>
<sql id="stand_column">
warning.id AS ID,
sarInfo.ID AS STAND_ID,
sarInfo.STAND_TYPE,
CONCAT(sarInfo.STAND_SORT,' ',sarInfo.STAND_NUMBER,'-',sarInfo.STAND_YEAR) AS STAND_CODE,
sarInfo.STAND_NAME,
sarInfo.PUT_TIME,
attr.SSRQ as SSRQ
</sql>
<sql id="stand_where">
<if test="waringEO.standCode != null and waringEO.standCode != ''">
AND trim(replace(CONCAT(
sarInfo.STAND_SORT,
' ',
sarInfo.STAND_NUMBER,
'-',
sarInfo.STAND_YEAR
),' ','')) LIKE trim(replace(CONCAT('%',#{waringEO.standCode},'%'),' ',''))
</if>
<if test="waringEO.standName != null and waringEO.standName != ''">
AND sarInfo.STAND_NAME = #{waringEO.standName}
</if>
<if test="waringEO.startPutTime != null and waringEO.startPutTime != '' and waringEO.endPutTime != null and waringEO.endPutTime != '' ">
AND (
DATE_FORMAT( sarInfo.PUT_TIME, '%Y-%m-%d') &gt;= DATE_FORMAT(
#{waringEO.endPutTime},
'%Y-%m-%d'
)
AND
DATE_FORMAT( sarInfo.PUT_TIME, '%Y-%m-%d') &lt;= DATE_FORMAT(
#{waringEO.endPutTime},
'%Y-%m-%d'
)
)
</if>
<if test="waringEO.startSSRQ != null and waringEO.startSSRQ != '' and waringEO.endSSRQ != null and waringEO.endSSRQ != ''">
AND (
DATE_FORMAT( attr.SSRQ, '%Y-%m-%d') &gt;= DATE_FORMAT(
#{waringEO.startSSRQ},
'%Y-%m-%d'
)
AND
DATE_FORMAT( attr.SSRQ, '%Y-%m-%d') &lt;= DATE_FORMAT(
#{waringEO.endSSRQ},
'%Y-%m-%d'
)
)
</if>
</sql>
<select id="selectWarningPage" resultMap="resultMap">
SELECT
<include refid="stand_column"/> ,
attr.CLLX AS APPLY_TYPE ,
attr.ZRGCS AS DUTY_ENGINEER ,
NULL AS ITEMS_ID ,
NULL AS ITEMS_NUM ,
NULL AS ITEMS_NAME ,
NULL AS POLICY_ID ,
NULL AS POLICY_NAME ,
MARK ,
POWER,
attr.XCXSSRQ AS XCXSSRQ ,
attr.ZCCSSRQ AS ZCCSSRQ
FROM sar_stand_warning AS warning
LEFT JOIN sar_standards_info AS sarInfo on sarInfo.id=warning.STAND_ID
LEFT JOIN sar_stand_attr_info AS attr on attr.STAND_ID=warning.STAND_ID
<where>
POWER = '1'
<include refid="stand_where"/>
<if test="waringEO.applyType != null and waringEO.applyType != ''">
AND attr.CLLX LIKE CONCAT('%', #{waringEO.applyType},'%')
</if>
<if test="waringEO.startXCXSSRQ != null and waringEO.startXCXSSRQ != '' and waringEO.endXCXSSRQ != null and waringEO.endXCXSSRQ != ''">
AND (
DATE_FORMAT( attr.XCXSSRQ, '%Y-%m-%d') &gt;= DATE_FORMAT(
#{waringEO.startXCXSSRQ},
'%Y-%m-%d'
)
AND
DATE_FORMAT( attr.XCXSSRQ, '%Y-%m-%d') &lt;= DATE_FORMAT(
#{waringEO.endXCXSSRQ},
'%Y-%m-%d'
)
)
</if>
<if test="waringEO.startZCCSSRQ != null and waringEO.startZCCSSRQ != '' and waringEO.endZCCSSRQ != null and waringEO.endZCCSSRQ != ''">
AND (
DATE_FORMAT( attr.ZCCSSRQ, '%Y-%m-%d') &gt;= DATE_FORMAT(
#{waringEO.startZCCSSRQ},
'%Y-%m-%d'
)
AND
DATE_FORMAT( attr.ZCCSSRQ, '%Y-%m-%d') &lt;= DATE_FORMAT(
#{waringEO.endZCCSSRQ},
'%Y-%m-%d'
)
)
</if>
</where>
UNION ALL
SELECT
<include refid="stand_column"/> ,
items.APPLY_ARCTIC AS APPLY_TYPE ,
items.DUTY_ENGINEER AS DUTY_ENGINEER ,
items.ID AS ITEMS_ID ,
items.ITEMS_NUM ,
items.ITEMS_NAME ,
NULL AS POLICY_ID ,
NULL AS POLICY_NAME ,
MARK ,
POWER,
items.XCXSSRQ AS XCXSSRQ ,
items.ZCCSSRQ AS ZCCSSRQ
FROM
sar_stand_warning AS warning
LEFT JOIN sar_standards_info AS sarInfo ON sarInfo.id = warning.STAND_ID
LEFT JOIN sar_stand_items AS items ON items.STAND_ID = warning.STAND_ID
LEFT JOIN sar_stand_attr_info AS attr ON attr.STAND_ID = warning.STAND_ID
<where>
POWER = '1'
<include refid="stand_where"/>
<if test="waringEO.applyType != null and waringEO.applyType != ''">
AND items.APPLY_ARCTIC LIKE CONCAT('%', #{waringEO.applyType},'%')
</if>
<if test="waringEO.startXCXSSRQ != null and waringEO.startXCXSSRQ != '' and waringEO.endXCXSSRQ != null and waringEO.endXCXSSRQ != ''">
AND (
DATE_FORMAT( items.XCXSSRQ, '%Y-%m-%d') &gt;= DATE_FORMAT(#{waringEO.startXCXSSRQ},'%Y-%m-%d')
AND
DATE_FORMAT( items.XCXSSRQ, '%Y-%m-%d') &lt;= DATE_FORMAT(#{waringEO.endXCXSSRQ},'%Y-%m-%d')
)
</if>
<if test="waringEO.startZCCSSRQ != null and waringEO.startZCCSSRQ != '' and waringEO.endZCCSSRQ != null and waringEO.endZCCSSRQ != ''">
AND(
DATE_FORMAT( items.ZCCSSRQ, '%Y-%m-%d') &gt;= DATE_FORMAT(#{waringEO.startZCCSSRQ},'%Y-%m-%d')
AND
DATE_FORMAT( items.ZCCSSRQ, '%Y-%m-%d') &lt;= DATE_FORMAT(#{waringEO.endZCCSSRQ},'%Y-%m-%d' )
)
</if>
</where>
</select>
</mapper>
@@ -6,4 +6,12 @@
resultType="com.adc.da.slrs.sarStandardComplianceAssessResult.entity.SarBaseStandardInfo"> resultType="com.adc.da.slrs.sarStandardComplianceAssessResult.entity.SarBaseStandardInfo">
select distinct STAND_ID as standard_id, STAND_NUMBER as standard_number, STAND_NAME as standard_name, STAND_TYPE as standard_type, INTERPRETATION_TIME from sar_interpretation_national_standard select distinct STAND_ID as standard_id, STAND_NUMBER as standard_number, STAND_NAME as standard_name, STAND_TYPE as standard_type, INTERPRETATION_TIME from sar_interpretation_national_standard
</select> </select>
<update id="updateData">
update sar_interpretation_national_standard set risk_degree = #{find.riskDegree}
where sar_interpretation_national_standard.STAND_ID = #{find.standId}
and sar_interpretation_national_standard.STAND_NUMBER =#{find.standNumber}
and sar_interpretation_national_standard.STAND_NAME=#{find.standName}
and sar_interpretation_national_standard.INTERPRETATION_TIME = #{find.interpretationTime}
</update>
</mapper> </mapper>
@@ -19,11 +19,12 @@
<result column="modify_time" property="modifyTime" /> <result column="modify_time" property="modifyTime" />
<result column="new_file_type" property="newFileType" /> <result column="new_file_type" property="newFileType" />
<result column="new_sar_type" property="newSarType" /> <result column="new_sar_type" property="newSarType" />
<result column="compare_status" property="compareStatus"/>
</resultMap> </resultMap>
<!-- SAR_STAND_COMPARE_HIS table all fields --> <!-- SAR_STAND_COMPARE_HIS table all fields -->
<sql id="Base_Column_List" > <sql id="Base_Column_List" >
compare_type, id, old_stand_id, old_stand_num, old_stand_name, new_stand_id, new_stand_num, new_stand_name, old_file_type, old_sar_type, create_user, create_time, modify_user, modify_time, new_file_type, new_sar_type compare_type, id, old_stand_id, old_stand_num, old_stand_name, new_stand_id, new_stand_num, new_stand_name, old_file_type, old_sar_type, create_user, create_time, modify_user, modify_time, new_file_type, new_sar_type ,compare_status
</sql> </sql>
<!-- 查询条件 --> <!-- 查询条件 -->
@@ -89,6 +90,9 @@
</if> </if>
<if test="newSarType != null" > <if test="newSarType != null" >
and new_sar_type ${newSarTypeOperator} #{newSarType} and new_sar_type ${newSarTypeOperator} #{newSarType}
</if>
<if test="compareStatus != null" >
and compare_status = #{compareStatus}
</if> </if>
<if test="oldNumOrName != null" > <if test="oldNumOrName != null" >
and (old_stand_num like concat('%',#{oldNumOrName},'%') OR old_stand_name like concat('%',#{oldNumOrName},'%')) and (old_stand_num like concat('%',#{oldNumOrName},'%') OR old_stand_name like concat('%',#{oldNumOrName},'%'))
@@ -105,7 +109,7 @@
SELECT SEQ_SAR_STAND_COMPARE_HIS.NEXTVAL FROM DUAL SELECT SEQ_SAR_STAND_COMPARE_HIS.NEXTVAL FROM DUAL
</selectKey> --> </selectKey> -->
insert into SAR_STAND_COMPARE_HIS(<include refid="Base_Column_List" />) insert into SAR_STAND_COMPARE_HIS(<include refid="Base_Column_List" />)
values (#{compareType, jdbcType=VARCHAR}, #{id, jdbcType=VARCHAR}, #{oldStandId, jdbcType=VARCHAR}, #{oldStandNum, jdbcType=VARCHAR}, #{oldStandName, jdbcType=VARCHAR}, #{newStandId, jdbcType=VARCHAR}, #{newStandNum, jdbcType=VARCHAR}, #{newStandName, jdbcType=VARCHAR}, #{oldFileType, jdbcType=VARCHAR}, #{oldSarType, jdbcType=VARCHAR}, #{createUser, jdbcType=VARCHAR}, #{createTime, jdbcType=TIMESTAMP}, #{modifyUser, jdbcType=VARCHAR}, #{modifyTime, jdbcType=TIMESTAMP}, #{newFileType, jdbcType=VARCHAR}, #{newSarType, jdbcType=VARCHAR}) values (#{compareType, jdbcType=VARCHAR}, #{id, jdbcType=VARCHAR}, #{oldStandId, jdbcType=VARCHAR}, #{oldStandNum, jdbcType=VARCHAR}, #{oldStandName, jdbcType=VARCHAR}, #{newStandId, jdbcType=VARCHAR}, #{newStandNum, jdbcType=VARCHAR}, #{newStandName, jdbcType=VARCHAR}, #{oldFileType, jdbcType=VARCHAR}, #{oldSarType, jdbcType=VARCHAR}, #{createUser, jdbcType=VARCHAR}, #{createTime, jdbcType=TIMESTAMP}, #{modifyUser, jdbcType=VARCHAR}, #{modifyTime, jdbcType=TIMESTAMP}, #{newFileType, jdbcType=VARCHAR}, #{newSarType, jdbcType=VARCHAR},#{compareStatus, jdbcType=VARCHAR})
</insert> </insert>
<!-- 动态插入记录 主键是序列 --> <!-- 动态插入记录 主键是序列 -->
@@ -131,6 +135,7 @@
<if test="modifyTime != null" >modify_time,</if> <if test="modifyTime != null" >modify_time,</if>
<if test="newFileType != null" >new_file_type,</if> <if test="newFileType != null" >new_file_type,</if>
<if test="newSarType != null" >new_sar_type,</if> <if test="newSarType != null" >new_sar_type,</if>
<if test="compareStatus != null" >compare_status,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides="," > <trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="compareType != null" >#{compareType, jdbcType=VARCHAR},</if> <if test="compareType != null" >#{compareType, jdbcType=VARCHAR},</if>
@@ -149,6 +154,7 @@
<if test="modifyTime != null" >#{modifyTime, jdbcType=TIMESTAMP},</if> <if test="modifyTime != null" >#{modifyTime, jdbcType=TIMESTAMP},</if>
<if test="newFileType != null" >#{newFileType, jdbcType=VARCHAR},</if> <if test="newFileType != null" >#{newFileType, jdbcType=VARCHAR},</if>
<if test="newSarType != null" >#{newSarType, jdbcType=VARCHAR},</if> <if test="newSarType != null" >#{newSarType, jdbcType=VARCHAR},</if>
<if test="compareStatus != null" >#{compareStatus, jdbcType=VARCHAR},</if>
</trim> </trim>
</insert> </insert>
@@ -169,7 +175,8 @@
modify_user = #{modifyUser}, modify_user = #{modifyUser},
modify_time = #{modifyTime}, modify_time = #{modifyTime},
new_file_type = #{newFileType}, new_file_type = #{newFileType},
new_sar_type = #{newSarType} new_sar_type = #{newSarType},
compare_status = #{compareStatus}
where id = #{id} where id = #{id}
</update> </update>
@@ -222,6 +229,9 @@
<if test="newSarType != null" > <if test="newSarType != null" >
new_sar_type = #{newSarType}, new_sar_type = #{newSarType},
</if> </if>
<if test="compareStatus != null" >
compare_status = #{compareStatus},
</if>
</set> </set>
where id = #{id} where id = #{id}
</update> </update>