Merge branch 'develop_master' into origin/Three

This commit is contained in:
Superman_Main
2021-12-08 15:49:59 +08:00
123 changed files with 5770 additions and 494 deletions
@@ -408,4 +408,7 @@ public interface workFlowFeignClient {
@RequestMapping(value = "/bat-wkflow/datas/bus-process-new/everyDayTenOlockSAM",method = RequestMethod.GET)
List<BusProcessNew> everyDayTenOlockSAM();
@RequestMapping(value = "/bat-wkflow/delCG",method = RequestMethod.POST)
String delCG(@RequestParam("id") String id);
}
@@ -321,4 +321,8 @@ public class workFlowFeignClientImpl {
public List<BusProcessName> queryBusProcessNameForEnd(@RequestBody String prcNum){
return workFlowFeignClient.queryBusProcessNameForEnd(prcNum);
}
public String delCG(@RequestParam("id") String id){
return workFlowFeignClient.delCG(id);
}
}
@@ -32,6 +32,9 @@ public class ActDefineStartMap {
map.put("laws2","PolicyCommentProcessWorkFlow");
map.put("laws3","KCSTPReviewProcessWorkFlow");
// 企标制修订流程及企业标准库流程
map.put("buss1","bussLibraryWkflow");
//张超然
map.put("20","StandardApplyMeetProcess");
map.put("21","StandardMeetProcess");
@@ -687,4 +687,12 @@ public class WorkFlowController {
}
return Result.success("发送成功");
}
@ApiOperation(value = "草稿删除")
@PostMapping("/delCG")
public String delCG(@RequestParam("id")String id){
return workFlowFeignClient.delCG(id);
}
}
@@ -15,7 +15,7 @@ public class ProcessDetailExport {
private Date startTime;
@Excel(name = "完成时间", orderNum = "4",exportFormat = "yyyy/MM/dd",width = 15)
private Date endTime;
@Excel(name = "审批意见", orderNum = "5",width = 15)
@Excel(name = "流程信息", orderNum = "5",width = 15)
private String comment;
@Excel(name = "状态", orderNum = "6",width = 15)
private String flag;
@@ -0,0 +1,368 @@
//package com.adc.da.convert.mq;
//
//import com.adc.da.att.entity.AttFileEO;
//import com.adc.da.att.service.IAttFileEOService;
//import com.adc.da.common.SarTypeEnum;
//import com.adc.da.common.UseModuleEnum;
//import com.adc.da.convert.common.AsposeOfficeConvertUtils;
//import com.adc.da.mq.CreateMQService;
//import com.adc.da.slrs.otConvertMq.entity.OtConvertMq;
//import com.adc.da.slrs.otConvertMq.service.IOtConvertMqService;
//import com.adc.da.slrs.sarBussStandFile.dao.SarBussStandFileDao;
//import com.adc.da.slrs.sarBussStandFile.entity.SarBussStandFile;
//import com.adc.da.slrs.sarLawsFile.dao.SarLawsFileDao;
//import com.adc.da.slrs.sarLawsFile.entity.SarLawsFile;
//import com.adc.da.slrs.sarStandFile.dao.SarStandFileDao;
//import com.adc.da.slrs.sarStandFile.entity.SarStandFile;
//import com.adc.da.sys.util.LoginUserUtil;
//import com.adc.da.util.http.ResponseMessage;
//import com.adc.da.util.http.Result;
//import com.adc.da.util.utils.StringUtils;
//import com.adc.da.util.utils.UUID;
//import com.rabbitmq.client.Channel;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.amqp.rabbit.annotation.Exchange;
//import org.springframework.amqp.rabbit.annotation.Queue;
//import org.springframework.amqp.rabbit.annotation.QueueBinding;
//import org.springframework.amqp.rabbit.annotation.RabbitListener;
//import org.springframework.amqp.support.AmqpHeaders;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.messaging.Message;
//import org.springframework.stereotype.Component;
//
//import java.io.File;
//import java.util.Date;
//import java.util.Map;
//
//@Component
//public class SendUploadConvertService {
//
// // 文档转换远程服务IP地址s
// @Value("${convert.host}")
// private String convertHost;
//
// @Value("${server.port}")
// private String port;
//
// @Value("${file.path}")
// private String localFilePath;
//
// @Autowired
// private IAttFileEOService attFileEOService;
//
// @Autowired
// private CreateMQService convertMq;
//
// @Autowired
// private IOtConvertMqService convertMqEOService;
//
// @Autowired
// private SarStandFileDao sarStandFileEODao;
//
// @Autowired
// private SarBussStandFileDao sarBussStandFileEODao;
//
// @Autowired
// private SarLawsFileDao sarLawsFileDao;
//
// private static final Logger logger = LoggerFactory.getLogger(SendUploadConvertService.class);
//
// @RabbitListener(bindings = @QueueBinding(
// value = @Queue(value = "createUploadConvertMQ_SQ_GSAR_RELEASE", durable = "true"),
// exchange = @Exchange(value = "convertUpload-exchange_SQ_GSAR_RELEASE", ignoreDeclarationExceptions = "true"),
// key = "convertUpload-key_SQ_GSAR_RELEASE"))
// public void createMQ(Map<String,Object> convertInfo, Message message, Channel channel) throws Exception{
// try{
// try{
// Thread.sleep(5000);
// insertConvertMsg(convertInfo);
// }catch(InterruptedException e){
// logger.error(e.toString());
// Thread.currentThread().interrupt();
// }
// } catch (Exception e) {
// logger.error("文档转换消息队列进入添加数据方法前失败!");
// logger.error(e.getMessage(),e);
// }finally {
// Long tag = (Long) message.getHeaders().get(AmqpHeaders.DELIVERY_TAG);
// channel.basicAck(tag,false);
// }
//
// }
//
// public void insertConvertMsg(Map<String,Object> convertInfo) throws Exception{
// docUploadConvert(convertMqEO);
// }
//
// /**
// * @Description 文件转换
// * Date 2018/8/21 15:51
// * @Param [path]
// * @return com.adc.da.util.http.ResponseMessage
// **/
// public ResponseMessage docUploadConvert(OtConvertMq convertMqEO) throws Exception{
// //保存在数据库中的ID
// String path = localFilePath + convertMqEO.getFilePath();
// path = path.replace("//","/");
// String convertId = convertMqEO.getId();
// try {
// //进入转换方法中,修改OT_CONVERT表中状态为转换中
// convertMqEO.setId(convertId);
// convertMqEO.setModifyTime(new Date());
// convertMqEO.setMqState(3);
// convertMqEOService.updateById(convertMqEO);
// //开始转换。。。。。。
// if(!"".equals(path)){
// String converfilename = path.replaceAll("\\\\", "/");
// logger.info("*****上传路径:*******"+localFilePath);
// logger.info("************文件路径:**********" + convertMqEO.getFilePath());
//// logger.info("************接口:**********" + port);
// logger.info("*****上传路径替换,加入文件名*******"+converfilename);
// //截取文件类型
// int index = converfilename.lastIndexOf(".");
// String fileType = converfilename.substring(index,converfilename.length());
// String fileOriName = converfilename.substring(0,index);
//// //调用转换类DocConverter,并将需要转换的文件传递给该类的构造方法
//// DocConverterPdf d = new DocConverterPdf(converfilename,fileType);
//// d.setConvertHost(convertHost);
//// //调用conver方法开始转换,先执行doc2pdf()将office文件转换为pdf;再执行pdf2swf()将pdf转换为swf;
//// File getPdf = d.conver(fileType);
//// //调用getswfPath()方法,打印转换后的swf文件路径
//// String dPath = d.getpdfPath();
// String savePdfFileName = converfilename.substring(0, converfilename.lastIndexOf("."));
// String savePdfPath = savePdfFileName+".pdf";
// AsposeOfficeConvertUtils.convertOfficeFileToPDF(fileType,converfilename,savePdfPath);
// File pdfFile = new File(savePdfPath);
// logger.info("*****转换后的pdf文件路径*******"+savePdfPath);
// //判断是否转换成功,修改数据状态
// if(!savePdfPath.isEmpty() && pdfFile.length()>0){
// // 上传转换后文件
// String pdfId = attFileEOService.saveFileAttId(pdfFile);
// logger.info("////////转换后文件id"+pdfId);
// int count = 0;
// if("0".equals(convertMqEO.getAddOrUp())){
// count = insertConvertDocToFiles(convertMqEO,pdfId,fileOriName,fileType);
// } else {
// //查询之前在资源与文件关联表中是否有转换成功的数据,如果有执行修改,没有执行新增
// if(StringUtils.isNotEmpty(convertMqEO.getPdfId())){
// count = updateConvertDocToFIles(convertMqEO,pdfId);
// } else {
// count = insertConvertDocToFiles(convertMqEO,pdfId,fileOriName,fileType);
// }
// }
// convertMqEO.setId(convertId);
// if (count>0) {
// // 转换成功
// convertMqEO.setModifyTime(new Date());
// convertMqEO.setMqState(1);
// convertMqEOService.updateById(convertMqEO);
// } else {
// // 转换失败
// convertMqEO.setModifyTime(new Date());
// convertMqEO.setMqState(2);
// convertMqEOService.updateById(convertMqEO);
// }
// } else {
// // 转换失败
// convertMqEO.setId(convertId);
// convertMqEO.setModifyTime(new Date());
// convertMqEO.setMqState(2);
// convertMqEOService.updateById(convertMqEO);
//// if(convertMqEO.getAgainNum()<=5){
//// throw new Exception("转换失败");
//// }
// }
// return Result.success(savePdfPath);
// } else {
// logger.error("转换时未获取到文件路径!");
// return Result.error("文件存储失败,请重试");
// }
// } catch (Exception e) {
// // 转换失败
// logger.error("转换过程中失败!");
// logger.error(e.getMessage(),e);
// convertMqEO.setId(convertId);
// convertMqEO.setMqState(2);
// convertMqEOService.updateById(convertMqEO);
//// this.restartUploadConvert(convertMqEO);
// return Result.error("r0072", "文件转换失败,请重试");
// }
// }
//
// public ResponseMessage restartUploadConvert(OtConvertMq convertInfo) throws Exception{
// OtConvertMq convertMqEO = new OtConvertMq();
// convertMqEO.setLawsId(convertInfo.getLawsId());
// convertMqEO.setConvertType(convertInfo.getConvertType());
// convertMqEO.setAttId(convertInfo.getAttId());
// convertMqEO.setOriAttId(convertInfo.getOriAttId());
// convertMqEO.setId(convertInfo.getId());
// convertMqEO.setFilePath(convertInfo.getFilePath());
// convertMqEO.setAddOrUp(convertInfo.getAddOrUp());
// convertMqEO.setPdfId(convertInfo.getPdfId());
// convertMqEO.setStandFileClassify(convertInfo.getStandFileClassify());
// int countAdd = 0;
// convertMqEO.setAddOrUp("1");
// int againNumNew = Integer.valueOf(convertInfo.getAgainNum());
// convertMqEO.setAgainNum(againNumNew+1);
// convertMq.sendMQ(convertMqEO);
// return Result.success("true","已重新加入转换","");
//
// }
//
// /**
// * @Author yangxuenan
// * @Description 修改标准法规文件表pdf信息
// * Date 2018/10/31 17:09
// * @Param [convertMq, pdfId]
// * @return int
// **/
// public int updateConvertDocToFIles(OtConvertMq convertMq,String pdfId){
// int countSuccess = 0;
// if(SarTypeEnum.STAND.getValue().equals(convertMq.getConvertType())){
// SarStandFile lawsFile = new SarStandFile();
// lawsFile.setId(convertMq.getPdfId());
// lawsFile.setAttId(pdfId);
// lawsFile.setOriAttId(convertMq.getOriAttId());
// lawsFile.setModifyTime(new Date());
// lawsFile.setUseModel(UseModuleEnum.WEB_FILE.getValue());
// countSuccess = sarStandFileEODao.updateByPrimaryKeySelective(lawsFile);
// } else if (SarTypeEnum.LAWS_STAND.getValue().equals(convertMq.getConvertType())) {
// SarLawsFile lawsFile = new SarLawsFile();
// lawsFile.setId(convertMq.getPdfId());
// lawsFile.setAttId(pdfId);
// lawsFile.setOriAttId(convertMq.getOriAttId());
// lawsFile.setUseModel(UseModuleEnum.WEB_FILE.getValue());
// lawsFile.setModifyTime(new Date());
// countSuccess = sarLawsFileDao.updateByPrimaryKeySelective(lawsFile);
// } else if (SarTypeEnum.BUSINESS.getValue().equals(convertMq.getConvertType())) {
// SarBussStandFile lawsFile = new SarBussStandFile();
// lawsFile.setId(convertMq.getPdfId());
// lawsFile.setAttId(pdfId);
// lawsFile.setOriAttId(convertMq.getOriAttId());
// lawsFile.setUseModule(UseModuleEnum.WEB_FILE.getValue());
// lawsFile.setModifyTime(new Date());
// countSuccess = sarBussStandFileEODao.updateByPrimaryKeySelective(lawsFile);
// }else if (SarTypeEnum.RECORDS.getValue().equals(convertMq.getConvertType())) {
//// SarBussRecordsFileEO lawsFile = new SarBussRecordsFileEO();
//// lawsFile.setId(convertMq.getPdfId());
//// lawsFile.setRecordsId(convertMq.getLawsId());
//// lawsFile.setAttId(pdfId);
//// lawsFile.setOriAttId(convertMq.getOriAttId());
//// lawsFile.setUseModel(UseModuleEnum.WEB_FILE.getValue());
//// lawsFile.setValidFlag("0");
//// lawsFile.setCreationTime(new Date());
//// lawsFile.setModifyTime(new Date());
//// countSuccess = sarBussRecordsFileEODao.updateByPrimaryKeySelective(lawsFile);
// }
// else {
//// SarFileSplitItemsFileEO lawsFile = new SarFileSplitItemsFileEO();
//// lawsFile.setId(convertMq.getPdfId());
//// lawsFile.setAttId(pdfId);
////// lawsFile.setOriAttId(convertMq.getOriAttId());
//// lawsFile.setUseModel(UseModuleEnum.WEB_FILE.getValue());
//// lawsFile.setModifyTime(new Date());
//// countSuccess = sarFileSplitItemsFileEODao.updateByPrimaryKeySelective(lawsFile);
// }
// return countSuccess;
// }
//
// /**
// * @Author yangxuenan
// * @Description 添加标准法规文件表pdf信息
// * Date 2018/10/30 21:52
// * @Param [convertMq]
// * @return int
// **/
// public int insertConvertDocToFiles(OtConvertMq convertMq,String pdfId,String fileOriName,String fileType) {
// int countSuccess = 0;
// String creationUser = LoginUserUtil.getUserId();
// if(SarTypeEnum.STAND.getValue().equals(convertMq.getConvertType())){
// SarStandFile lawsFile = new SarStandFile();
// lawsFile.setId(UUID.randomUUID(20));
// lawsFile.setStandId(convertMq.getLawsId());
//// lawsFile.setResId(convertMq.getResId());
// lawsFile.setAttId(pdfId);
// lawsFile.setOriAttId(convertMq.getOriAttId());
// lawsFile.setValidFlag("0");
// lawsFile.setCreationUser(creationUser);
// lawsFile.setCreationTime(new Date());
// lawsFile.setModifyTime(new Date());
// lawsFile.setUseModel(UseModuleEnum.WEB_FILE.getValue());
// lawsFile.setStandFileClassify(convertMq.getStandFileClassify());
// lawsFile.setFileName(fileOriName+".pdf");
// lawsFile.setFileSuffix("pdf");
// countSuccess = sarStandFileEODao.insertSelective(lawsFile);
// } else if (SarTypeEnum.LAWS_STAND.getValue().equals(convertMq.getConvertType())) {
// SarLawsFile lawsFile = new SarLawsFile();
// lawsFile.setId(UUID.randomUUID(20));
// lawsFile.setLawsId(convertMq.getLawsId());
// lawsFile.setResId(convertMq.getResId());
// lawsFile.setAttId(pdfId);
// lawsFile.setOriAttId(convertMq.getOriAttId());
// lawsFile.setUseModel(UseModuleEnum.WEB_FILE.getValue());
// lawsFile.setValidFlag(0);
// lawsFile.setCreationTime(new Date());
// lawsFile.setModifyTime(new Date());
// lawsFile.setLawsFileClassify(convertMq.getLawsFileClassify());
// lawsFile.setFileName(fileOriName+".pdf");
// lawsFile.setFileSuffix("pdf");
// countSuccess = sarLawsFileDao.insertSelective(lawsFile);
// } else if (SarTypeEnum.BUSINESS.getValue().equals(convertMq.getConvertType())) {
// SarBussStandFile lawsFile = new SarBussStandFile();
// lawsFile.setId(UUID.randomUUID(20));
// lawsFile.setStandId(convertMq.getLawsId());
// lawsFile.setResId(convertMq.getResId());
// lawsFile.setAttId(pdfId);
// lawsFile.setOriAttId(convertMq.getOriAttId());
// lawsFile.setUseModule(UseModuleEnum.WEB_FILE.getValue());
// lawsFile.setStandFileClassify(convertMq.getStandFileClassify());
// lawsFile.setFileName(fileOriName+".pdf");
// lawsFile.setFileSuffix("pdf");
// lawsFile.setValidFlag(0);
// lawsFile.setCreationTime(new Date());
// lawsFile.setModifyTime(new Date());
// countSuccess = sarBussStandFileEODao.insertSelective(lawsFile);
// }
// else if (SarTypeEnum.RECORDS.getValue().equals(convertMq.getConvertType())) {
//// SarBussRecordsFileEO lawsFile = new SarBussRecordsFileEO();
//// lawsFile.setId(UUID.randomUUID(20));
//// lawsFile.setRecordsId(convertMq.getLawsId());
//// lawsFile.setResId(convertMq.getResId());
//// lawsFile.setAttId(pdfId);
//// lawsFile.setOriAttId(convertMq.getOriAttId());
//// lawsFile.setUseModel(UseModuleEnum.WEB_FILE.getValue());
//// lawsFile.setRecordsFileClassify(convertMq.getStandFileClassify());
//// lawsFile.setFileName(fileOriName+".pdf");
//// lawsFile.setFileSuffix("pdf");
//// lawsFile.setValidFlag("0");
//// lawsFile.setCreationTime(new Date());
//// lawsFile.setModifyTime(new Date());
//// countSuccess = sarBussRecordsFileEODao.insertSelective(lawsFile);
// }else {
//// SarFileSplitItemsFileEO lawsFile = new SarFileSplitItemsFileEO();
//// lawsFile.setId(UUID.randomUUID(20));
//// lawsFile.setStandId(convertMq.getLawsId());
//// lawsFile.setResId(convertMq.getResId());
//// lawsFile.setAttId(pdfId);
////// lawsFile.setOriAttId(convertMq.getOriAttId());
//// lawsFile.setUseModel(UseModuleEnum.WEB_FILE.getValue());
//// lawsFile.setValidFlag(0);
//// lawsFile.setCreationTime(new Date());
//// lawsFile.setModifyTime(new Date());
//// countSuccess = sarFileSplitItemsFileEODao.insertSelective(lawsFile);
// }
// return countSuccess;
// }
//
// /**
// * 文档转换逻辑
// * @param attFileEO
// */
// public void insertOrUpdateStandInfo(AttFileEO attFileEO){
//
// }
//
//
//}
@@ -1,18 +1,38 @@
package com.adc.da.convert.otConvert.controller;
import com.adc.da.att.controller.AttFileEOController;
import com.adc.da.att.entity.AttFileEO;
import com.adc.da.att.service.IAttFileEOService;
import com.adc.da.att.vo.AttFileVo;
import com.adc.da.convert.common.AsposeOfficeConvertUtils;
import com.adc.da.convert.mq.CreateConvertMQService;
import com.adc.da.convert.otConvert.service.IOtConvertService;
import com.adc.da.util.http.ResponseMessage;
import com.adc.da.util.http.Result;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import com.adc.da.convert.otConvert.entity.OtConvert;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.adc.da.base.web.BaseController;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.URLEncoder;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* <p>
@@ -24,12 +44,51 @@ import com.adc.da.base.web.BaseController;
*/
@RestController
@Api(tags = "|OtConvert| 文档转换")
@RequestMapping("/OtConvert")
@RequestMapping("/${restPath}/OtConvert")
public class OtConvertController extends BaseController<OtConvert> {
private static final Logger logger = LoggerFactory.getLogger(OtConvertController.class);
@Value("${file.path}")
private String filePath;//文件存储路径
@Value("${upload.file.white.lists}")
private String uploadFileWhiteLists; //上传文件白名单
@Autowired
private IOtConvertService iOtConvertService;
@Autowired
private IAttFileEOService attFileEOService;
@Autowired
private CreateConvertMQService createConvertMQService;
@ApiOperation(value = "|OtActConvertEO|根据文件ID获取流程转换文档")
@GetMapping(value = "/getConvertFileByAttId")
public ResponseMessage getConvertFileByAttId(String attId) throws Exception {
// 根据attId查到地址
if(StringUtils.isNotBlank(attId)){
QueryWrapper wrapper = new QueryWrapper();
wrapper.eq("ACT_FILE_ID",attId);
List<OtConvert> resultList = iOtConvertService.list(wrapper);
if(resultList!=null && !resultList.isEmpty()){
OtConvert convertEO = resultList.get(0);
if(StringUtils.isNotBlank(convertEO.getConvertFileId())){
AttFileEO attFileEO = attFileEOService.getFileInfo(convertEO.getConvertFileId());
convertEO.setConvertFileInfo(attFileEO);
return Result.success(convertEO);
}else{
return Result.success("-100","查询的转件文件未找到,请检查状态",convertEO);
}
}else{
return Result.error("-1","查询的转换记录不存在",null);
}
}else{
return Result.error("-1","查询的转换文档ID不存在",null);
}
}
/**
* @Author super_liu
* @Description 查询文件信息
@@ -0,0 +1,144 @@
package com.adc.da.convert.otConvert.entity;
import com.adc.da.att.entity.AttFileEO;
import com.adc.da.base.entity.BaseEntity;
import java.util.Date;
/**
* <b>功能:</b>OT_ACT_CONVERT OtActConvertEOEntity<br>
* <b>作者:</b>code generator<br>
* <b>日期:</b> 2021-03-19 <br>
* <b>版权所有:<b>版权归北京卡达克数据技术中心所有。<br>
*/
public class OtActConvertEO extends BaseEntity {
private String id;
private String actFileId;
private String convertState;
private String convertFileId;
@org.springframework.format.annotation.DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date createTime;
@org.springframework.format.annotation.DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date modifyTime;
// 转换后文件信息
private AttFileEO ConvertFileInfo;
/**
* java字段名转换为原始数据库列名。<b>如果不存在则返回null</b><br>
* <p>字段列表:</p>
* <li>id -> id</li>
* <li>actFileId -> act_file_id</li>
* <li>convertState -> convert_state</li>
* <li>convertFileId -> convert_file_id</li>
* <li>createTime -> create_time</li>
* <li>modifyTime -> modify_time</li>
*/
public static String fieldToColumn(String fieldName) {
if (fieldName == null) { return null; };
switch (fieldName) {
case "id": return "id";
case "actFileId": return "act_file_id";
case "convertState": return "convert_state";
case "convertFileId": return "convert_file_id";
case "createTime": return "create_time";
case "modifyTime": return "modify_time";
default: return null;
}
}
/**
* 原始数据库列名转换为java字段名。<b>如果不存在则返回null</b><br>
* <p>字段列表:</p>
* <li>id -> id</li>
* <li>act_file_id -> actFileId</li>
* <li>convert_state -> convertState</li>
* <li>convert_file_id -> convertFileId</li>
* <li>create_time -> createTime</li>
* <li>modify_time -> modifyTime</li>
*/
public static String columnToField(String columnName) {
if (columnName == null) { return null; };
switch (columnName) {
case "id": return "id";
case "act_file_id": return "actFileId";
case "convert_state": return "convertState";
case "convert_file_id": return "convertFileId";
case "create_time": return "createTime";
case "modify_time": return "modifyTime";
default: return null;
}
}
/** 主键 **/
public String getId() {
return this.id;
}
/** 主键 **/
public void setId(String id) {
this.id = id;
}
/** 流程中待转换文件ID **/
public String getActFileId() {
return this.actFileId;
}
/** 流程中待转换文件ID **/
public void setActFileId(String actFileId) {
this.actFileId = actFileId;
}
/** 转换状态:LODING:待转换 SUCCESS:成功 ERROR:错误 **/
public String getConvertState() {
return this.convertState;
}
/** 转换状态:LODING:待转换 SUCCESS:成功 ERROR:错误 **/
public void setConvertState(String convertState) {
this.convertState = convertState;
}
/** 转换后文件ID **/
public String getConvertFileId() {
return this.convertFileId;
}
/** 转换后文件ID **/
public void setConvertFileId(String convertFileId) {
this.convertFileId = convertFileId;
}
/** 数据创建时间 **/
public Date getCreateTime() {
return this.createTime;
}
/** 数据创建时间 **/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/** 数据修改时间 **/
public Date getModifyTime() {
return this.modifyTime;
}
/** 数据修改时间 **/
public void setModifyTime(Date modifyTime) {
this.modifyTime = modifyTime;
}
public AttFileEO getConvertFileInfo() {
return ConvertFileInfo;
}
public void setConvertFileInfo(AttFileEO convertFileInfo) {
ConvertFileInfo = convertFileInfo;
}
}
@@ -1,5 +1,6 @@
package com.adc.da.convert.otConvert.entity;
import com.adc.da.att.entity.AttFileEO;
import com.adc.da.base.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableId;
@@ -62,5 +63,7 @@ public class OtConvert extends BaseEntity {
@TableField("VALID_FLAG")
private Integer validFlag;
// 转换后文件信息
@TableField(exist = false)
private AttFileEO ConvertFileInfo;
}
@@ -63,6 +63,10 @@ public class WebMvcConfig implements WebMvcConfigurer {
addInterceptor.excludePathPatterns("/api/sarStandUnqualified/sar-stand-unqualified/exportStandUnqulifiedExcel");
//文件预览
addInterceptor.excludePathPatterns("/api/att/attFile/getFileInfo");
// onlyOffice 回调
addInterceptor.excludePathPatterns("/api/att/attFile/recieveFile");
addInterceptor.excludePathPatterns("/api/att/attFile/getSyncPdfFileInfo");
//附件下载
addInterceptor.excludePathPatterns("/api/att/attFile/downloadFileForSar");
//水印下载
@@ -81,6 +85,8 @@ public class WebMvcConfig implements WebMvcConfigurer {
//调研流程下载接口
addInterceptor.excludePathPatterns("/api/att/attFile/downloadFile");
addInterceptor.excludePathPatterns("/api/lawss/activiti/exportProcessDetailInfo");
// //测试接口使用
// addInterceptor.excludePathPatterns("/api/**");
@@ -138,8 +138,11 @@ verifyCodeMode=1
# =============================================================================
# file模块上传文件的服务器地址
file.path=D:/uploadfile/bus
# 文件下载地址参数
file.downloadUrl=http://39.98.140.126:10001/uploadPath
stand.edit.file.path = /usr/laws/file/
# onlyoffice 预览地址
file.downloadUrl=http://10.100.5.116:1080/file/
#上传文件白名单-以,分隔
upload.file.white.lists = doc,docx,xls,xlsx,pdf,PDF,png,jpg,pptx,ppt
@@ -3,28 +3,35 @@ package com.adc.da.scheduled;
import com.adc.da.scheduled.dao.SarStandardInfoDao;
import com.adc.da.scheduled.dao.SarStandardItemDao;
import com.adc.da.scheduled.dao.SarStandardWarningDao;
import com.adc.da.scheduled.entity.DataDTO;
import com.adc.da.scheduled.entity.WarningEO;
import com.adc.da.scheduled.entity.TermDTO;
import com.adc.da.slrs.sarStandAttrInfo.dao.SarStandAttrInfoDao;
import com.adc.da.slrs.sarStandAttrInfo.entity.SarStandAttrInfo;
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
import com.adc.da.slrs.sarStandWarning.entity.WarningDate;
import com.adc.da.slrs.sarStandWarning.service.IWarningDateService;
import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao;
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
import com.adc.da.util.UUIDUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.sun.corba.se.spi.ior.iiop.IIOPFactories;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.PostConstruct;
import java.time.LocalDate;
import java.util.*;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
@EnableScheduling
@@ -55,13 +62,15 @@ public class ScheduledJob {
@Autowired
private SarStandAttrInfoDao sarStandAttrInfoDao; //属性字段表
@Autowired
private IWarningDateService iWarningDateService;// 预警日期
// @PostConstruct //程序启动时执行一次
@Scheduled(cron = "0 0 0 * * ?") //每天的凌晨0点执行
// @Scheduled(cron="*/5 * * * * ?")
@Async
public void WarningSchedulingTasks() {
Logger logger = LoggerFactory.getLogger(ScheduledJob.class);
/**
* 1.查询标准属性字段表(sar_stand_attr_info) XCXSSEQ ZCCSSRQ ZRGCS
@@ -78,98 +87,44 @@ public class ScheduledJob {
4:在产车标准预警
1:新车条款预警
2:在产车条款预警
2021/12/1 日需求修改
分为标准预警与条款预警
mark:标识预警的种类 stand 标准 item 条款
*/
//删除不在预警范围的标准
QueryWrapper<EarlyWarningEO> earlyWarningEOQW = new QueryWrapper<>();
earlyWarningEOQW.lt("PUT_TIME",LocalDate.now());
int remove = sarStandardWarningDao.delete(earlyWarningEOQW);
System.out.println(remove);
int remove = sarStandardWarningDao.autoCancelWarning();
logger.info("==========================================================================");
logger.info("取消"+remove+"条预警");
logger.info("开始执行预警!!!");
logger.info("==========================================================================");
System.out.println("开始执行预警!!!");
TermDTO term = new TermDTO(); //预警期限(当前日期至3个月后)
DataDTO term = new DataDTO(); //预警期限(当前日期至3个月后)
List<WarningDate> warningDateList = sarStandardWarningDao.getWarningDate(term); //查询符合预警期限的标准 多个
LinkedList<WarningEO> warningList = new LinkedList<>();//需预警的标准和条款列表集合
//分解单(条款) 新车型 mark=1
List<WarningEO> itemForXCXSSRQ = sarStandardItemDao.selectWithinTerm(term, "XCXSSRQ");
for (WarningEO warningEO : itemForXCXSSRQ) {
warningEO.setId(UUIDUtils.randomUUID20())
.setPower("1")
.setMark("1")
.setPutTime(warningEO.getXCXSSRQ())
.setStandCode(warningEO.getStandSort()+" "+ warningEO.getStandNum()+"-"+ warningEO.getStandYear());
}
warningList.addAll(itemForXCXSSRQ);
//分解单(条款) 在产车型 mark=2
List<WarningEO> itemForZCCSSRQ = sarStandardItemDao.selectWithinTerm(term, "ZCCSSRQ");
for (WarningEO warningEO : itemForZCCSSRQ) {
warningEO.setId(UUIDUtils.randomUUID20())
.setPower("1")
.setMark("2")
.setPutTime(warningEO.getZCCSSRQ())
.setStandCode(warningEO.getStandSort()+" "+ warningEO.getStandNum()+"-"+ warningEO.getStandYear());
}
warningList.addAll(itemForZCCSSRQ);
//标准 新车型 预警 mark=3
List<WarningEO> standInfoXCXSSRQ = sarStandardInfoDao.selectWithinTerm(term, "XCXSSRQ");
for (WarningEO warningEO : standInfoXCXSSRQ) {
warningEO.setId(UUIDUtils.randomUUID20())
/**
* //如果插入的值均为NULL,则根据索引的原理,
* 全NULL值不被记录在索引上,所以插入全NULL值时,可以有重复的
* 则此处设为 '-1'
*/
.setItemsId("-1")
.setPower("1")
.setMark("3")
.setStandCode(warningEO.getStandSort()+" "+ warningEO.getStandNum()+"-"+ warningEO.getStandYear());
//实施日期达到预警时间,但在产车实施日期不在时间内
/**
* 2021/9/9取消限制
*/
// if (term.isTerm(warningEO.getXCXSSRQ())){
// warningEO.setPutTime(warningEO.getXCXSSRQ());
// }
warningEO.setPutTime(warningEO.getXCXSSRQ());
}
warningList.addAll(standInfoXCXSSRQ);
//标准 在产车型 mark=4
List<WarningEO> standInfoZCCSSRQ = sarStandardInfoDao.selectWithinTerm(term, "ZCCSSRQ");
for (WarningEO warningEO : standInfoZCCSSRQ) {
warningEO.setId(UUIDUtils.randomUUID20())
/**
* 同上
*/
.setItemsId("-1")
.setPower("1")
.setMark("4")
.setStandCode(warningEO.getStandSort()+" "+ warningEO.getStandNum()+"-"+ warningEO.getStandYear());
//实施日期达到预警时间,但在产车实施日期不在时间内
/**
* 2021/9/9取消限制
*/
// if (term.isTerm(warningEO.getZCCSSRQ())){
// warningEO.setPutTime(warningEO.getZCCSSRQ());
// }
warningEO.setPutTime(warningEO.getZCCSSRQ());
}
warningList.addAll(standInfoZCCSSRQ);
warningDateList.forEach(item->{
item.setId(UUIDUtils.randomUUID20());
});
iWarningDateService.remove(null); //清空标准的日期子表
iWarningDateService.saveBatch(warningDateList); // 保存进入标准的日期子表 保存标准的实施日期 新车型实施日期 在产车实施日期 多个
List<EarlyWarningEO> warningList = sarStandardWarningDao.getWarningId(term); //联接标准的日期子表 和分解单表 查询符合预警期限的标准和分解项
warningList.forEach(item->{
item.setId(UUIDUtils.randomUUID20());
});
//持久化至预警表 忽略标准id和标志位都一样的数据
if (warningList.size()!=0){
//此表的STAND_ID和MARK字段以及ITEMS_ID字段需个建立唯一性约束
int count = sarStandardWarningDao.ignoreInsert(warningList);
System.out.println("已预警 " + count + " 条标准或条款!!");
logger.info("==================================预警结束======================================");
logger.info("==================================预警结束======================================");
logger.info("已预警"+ count+"条标准或条款!!");
logger.info("==================================预警结束======================================");
logger.info("==================================预警结束======================================");
}
}
@@ -190,7 +145,7 @@ public class ScheduledJob {
public void TextStatusSchedulingTasks() {
QueryWrapper<SarStandardsInfo> wrapper = new QueryWrapper<>();
DataDTO data = new DataDTO(LocalDate.now(), LocalDate.now());
TermDTO data = new TermDTO(LocalDate.now(), LocalDate.now());
/**
*实施日期是当前系统时间的标准文本状态变为'现行有效'
@@ -1,8 +1,7 @@
package com.adc.da.scheduled.dao;
import com.adc.da.scheduled.entity.DataDTO;
import com.adc.da.scheduled.entity.WarningEO;
import com.adc.da.scheduled.entity.TermDTO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
@@ -12,7 +11,7 @@ import java.util.List;
@Repository
public interface SarStandardInfoDao{
public List<WarningEO> selectWithinTerm(DataDTO date, String str);
public List<String> selectWithinTerm(TermDTO date, String str);
public int updateStandardInfo(@Param("id")String id, @Param("textStatus") String textStatus);
@@ -1,6 +1,6 @@
package com.adc.da.scheduled.dao;
import com.adc.da.scheduled.entity.DataDTO;
import com.adc.da.scheduled.entity.TermDTO;
import com.adc.da.scheduled.entity.WarningEO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -11,6 +11,6 @@ import java.util.List;
@Repository
public interface SarStandardItemDao extends BaseMapper{
public List<WarningEO> selectWithinTerm(DataDTO date, String str);
public List<WarningEO> selectWithinTerm(TermDTO date, String str);
}
@@ -1,17 +1,26 @@
package com.adc.da.scheduled.dao;
import com.adc.da.scheduled.entity.WarningEO;
import com.adc.da.scheduled.entity.TermDTO;
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
import com.adc.da.slrs.sarStandWarning.entity.WarningDate;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.LinkedList;
import java.util.List;
@Repository
public interface SarStandardWarningDao extends BaseMapper<EarlyWarningEO> {
public int ignoreInsert(@Param(value = "warningEOS") LinkedList<WarningEO> warningEOS);
public int ignoreInsert(@Param(value = "warningEOS") List<EarlyWarningEO> warningEOS);
public int autoCancelWarning();
public List<EarlyWarningEO> getWarningId(TermDTO term);
public List<WarningDate> getWarningDate(TermDTO term);
}
@@ -16,7 +16,7 @@ import java.util.Date;
@Data
@Accessors(chain = true)
public class DataDTO {
public class TermDTO {
/**
* 预警的期限为系统日期的次日至3个月后
*/
@@ -28,14 +28,14 @@ public class DataDTO {
// private String str;
public DataDTO() {
public TermDTO() {
LocalDate starDate = LocalDate.now();//系统当前日期
LocalDate endDate = LocalDate.now().plusMonths(3);//系统当前日期3个月后
convertToStr(starDate,endDate);
}
public DataDTO(LocalDate startDate,LocalDate endDate){
public TermDTO(LocalDate startDate, LocalDate endDate){
convertToStr(startDate,endDate);
}
@@ -6,6 +6,7 @@ import com.adc.da.http.ResponseMessage;
import com.adc.da.http.Result;
import com.adc.da.slrs.esRevisePlan.service.IEsRevisePlanService;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.adc.da.slrs.esRevisePlan.entity.EsRevisePlan;
@@ -52,24 +53,49 @@ public class EsRevisePlanController extends BaseController<EsRevisePlan> {
return Result.success(iEsRevisePlanService.getOnePlan(id));
}
@ApiOperation(value = "获取是否存在重复名企标名称接口")
@GetMapping("/getDataByName")
public ResponseMessage<Object> getDataByName(EsRevisePlan esRevisePlan){
return Result.success(iEsRevisePlanService.getDataByName(esRevisePlan));
}
@ApiOperation(value = "编辑企标计划")
@PostMapping("modPlan")
public ResponseMessage<Object> modPlan(EsRevisePlan esRevisePlan){
return Result.success(iEsRevisePlanService.modPlan(esRevisePlan));
}
@ApiOperation(value = "编辑企标计划")
@PostMapping("/modPlanByWk")
public ResponseMessage<Object> modPlanByWk(@RequestBody EsRevisePlan esRevisePlan){
return Result.success(iEsRevisePlanService.modPlan(esRevisePlan));
}
@ApiOperation(value = "添加企标计划")
@PostMapping("addPlan")
public ResponseMessage<Object> addPlan(EsRevisePlan esRevisePlan){
return Result.success(iEsRevisePlanService.addPlan(esRevisePlan));
}
@ApiOperation(value = "添加企标计划")
@PostMapping("/addPlanByWk")
public ResponseMessage<Object> addPlanByWk(@RequestBody EsRevisePlan esRevisePlan){
return Result.success(iEsRevisePlanService.addPlan(esRevisePlan));
}
@ApiOperation(value = "删除单个企标计划")
@GetMapping("delPlan")
public ResponseMessage<Object> delPlan(String id){
return Result.success(iEsRevisePlanService.delPlan(id));
}
@ApiOperation(value = "删除单个企标计划")
@GetMapping("delPlanByWk")
public ResponseMessage<Object> delPlanByWk(@RequestParam("id") String id){
return Result.success(iEsRevisePlanService.delPlans(id));
}
@ApiOperation(value = "批量删除企标计划")
@GetMapping("delPlans")
public ResponseMessage<Object> delPlans(String ids){
@@ -19,6 +19,7 @@ public interface EsRevisePlanDao extends BaseMapper<EsRevisePlan> {
Integer getQueryTotal(EsRevisePlan esRevisePlan);
List<EsRevisePlan> selectAll(EsRevisePlan esRevisePlan);//查询所有
List<EsRevisePlan> queryAll(EsRevisePlan esRevisePlan);//多条件查询
List<EsRevisePlan> selectPageByName(EsRevisePlan esRevisePlan);//多条件查询
EsRevisePlan selectOne(String id);//查询详情
int updateOne(EsRevisePlan esRevisePlan);//编辑
@@ -3,6 +3,7 @@ package com.adc.da.slrs.esRevisePlan.entity;
import java.util.Date;
import com.adc.da.base.page.BasePage;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -46,15 +47,29 @@ public class EsRevisePlan extends BasePage {
@ApiModelProperty(value = "工作组组长")
private String wgLeader;
@ApiModelProperty(value = "起草人姓名")
private String drafterName;
@ApiModelProperty(value = "评审责任人姓名")
private String resPersonName;
@ApiModelProperty(value = "工作组组长姓名")
private String wgLeaderName;
@ApiModelProperty(value = "计划标准初稿完成时间")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
private Date draftTime;
@ApiModelProperty(value = "计划标准发布时间")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
private Date releaseTime;
@ApiModelProperty(value = "起草责任单位")
private String unit;
}
@@ -18,8 +18,9 @@ public interface IEsRevisePlanService extends IService<EsRevisePlan> {
List<EsRevisePlan> queryAllPlans(EsRevisePlan esRevisePlan);//多条件查询
EsRevisePlan getOnePlan(String id);//查询详情
int modPlan(EsRevisePlan esRevisePlan);//编辑
int addPlan(EsRevisePlan esRevisePlan);//插入
String modPlan(EsRevisePlan esRevisePlan);//编辑
String addPlan(EsRevisePlan esRevisePlan);//插入
int delPlan(String id);//删除
int delPlans(String ids);//批量删除
List<EsRevisePlan> getDataByName(EsRevisePlan esRevisePlan);
}
@@ -23,6 +23,8 @@ public class EsRevisePlanServiceImpl extends ServiceImpl<EsRevisePlanDao, EsRevi
@Autowired
EsRevisePlanDao esRevisePlanDao;
@Autowired
IEsRevisePlanService esRevisePlanService;
@Override
public List<EsRevisePlan> getAllPlans(EsRevisePlan esRevisePlan) {
@@ -46,14 +48,26 @@ public class EsRevisePlanServiceImpl extends ServiceImpl<EsRevisePlanDao, EsRevi
}
@Override
public int modPlan(EsRevisePlan esRevisePlan) {
return esRevisePlanDao.updateOne(esRevisePlan);
public String modPlan(EsRevisePlan esRevisePlan) {
List<EsRevisePlan> esRevisePlans=esRevisePlanDao.selectPageByName(esRevisePlan);
if (esRevisePlans.size()>0){
return "企标名称不能重复,请更换新的企标名称。";
}else {
esRevisePlanDao.updateOne(esRevisePlan);
return "操作成功";
}
}
@Override
public int addPlan(EsRevisePlan esRevisePlan) {
public String addPlan(EsRevisePlan esRevisePlan) {
esRevisePlan.setId(UUIDUtils.randomUUID(32));
return esRevisePlanDao.insertOne(esRevisePlan);
List<EsRevisePlan> esRevisePlans=esRevisePlanDao.selectPageByName(esRevisePlan);
if (esRevisePlans.size()>0){
return "企标名称不能重复,请更换新的企标名称";
}else {
esRevisePlanDao.insertOne(esRevisePlan);
return "操作成功";
}
}
@Override
@@ -66,4 +80,9 @@ public class EsRevisePlanServiceImpl extends ServiceImpl<EsRevisePlanDao, EsRevi
String[] str = ids.split(",");
return esRevisePlanDao.deleteBatch(str);
}
@Override
public List<EsRevisePlan> getDataByName(EsRevisePlan esRevisePlan) {
return esRevisePlanDao.selectPageByName(esRevisePlan);
}
}
@@ -38,10 +38,14 @@ public class SarBussionessStand extends BaseEntity {
@TableId("ID")
private String id;
@ApiModelProperty(value = "标准")
@ApiModelProperty(value = "企标标准号")
@TableField("STAND_CODE")
private String standCode;
@ApiModelProperty(value = "标准编号")
@TableField("STAND_NUMBER")
private String standNumber;
@ApiModelProperty(value = "标准名称")
@TableField("STAND_NAME")
private String standName;
@@ -0,0 +1,43 @@
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.controller;
import com.adc.da.http.ResponseMessage;
import com.adc.da.http.Result;
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.IEvaluationIndexService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.EvaluationIndex;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.adc.da.base.web.BaseController;
import javax.xml.ws.Response;
import java.util.List;
/**
* <p>
* 前端控制器
* </p>
*
* @author zhaokaiyao
* @since 2021-12-03
*/
@RestController
@Api(description = "|EvaluationIndex|")
@RequestMapping("/${restPath}/sarEnterpriseStandardEvaluation/evaluation-index")
public class EvaluationIndexController extends BaseController<EvaluationIndex> {
@Autowired
private IEvaluationIndexService iEvaluationIndexService;
@ApiOperation("获取评价指标")
@GetMapping("getEvaluationIndex")
public ResponseMessage<List<EvaluationIndex>> getEvaluationIndex(EvaluationIndex query){
List<EvaluationIndex> evaluationIndex = iEvaluationIndexService.getEvaluationIndex(query);
return Result.success(evaluationIndex);
}
}
@@ -0,0 +1,103 @@
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.controller;
import com.adc.da.http.ResponseMessage;
import com.adc.da.http.Result;
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.FormVO;
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.IQualityEvaluationService;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation;
import io.swagger.annotations.Api;
import com.adc.da.base.web.BaseController;
import java.util.List;
import java.util.Map;
import java.util.Optional;
/**
* <p>
* 前端控制器
* </p>
*
* @author zhaokaiyao
* @since 2021-12-03
*/
@RestController
@Api(description = "|QualityEvaluation|")
@RequestMapping("/${restPath}/sarEnterpriseStandardEvaluation/quality-evaluation")
public class QualityEvaluationController extends BaseController<QualityEvaluation> {
@Autowired
private IQualityEvaluationService iQualityEvaluationService;
@ApiOperation("提交评价表")
@PostMapping("submitEvaluationForm")
public ResponseMessage submitEvaluationForm(@RequestBody FormVO form){
if (form.getFormData()!=null && !form.getFormData().isEmpty()){
List<QualityEvaluation> tableData = form.getTableData();
String lawId = form.getLawId();
String userId = form.getUserId();
tableData.forEach(item->{
item.setUserId(userId);
item.setLawId(lawId);
if ( item.getEvaluationIndex()!=null && "3U9lb".equals( item.getEvaluationIndex() ) ){
JSONObject jsonObject = JSONObject.parseObject(form.getFormData());
item.setScore(jsonObject.getString("revise"));
item.setReason(jsonObject.getString("reviseReason"));
}
});
}
Boolean i = iQualityEvaluationService.submitEvaluationForm(form);
return Result.success(i);
}
@ApiOperation("查询评分表")
@PostMapping("getEvaluationForm")
public ResponseMessage getEvaluationForm(@RequestBody FormVO form){
QualityEvaluation qualityEvaluation = new QualityEvaluation();
qualityEvaluation.setLawId(form.getLawId()) ;
qualityEvaluation.setUserId(form.getUserId()) ;
iQualityEvaluationService.getEvaluationForm(qualityEvaluation);
return null;
}
@ApiOperation("查看评分历史")
@GetMapping("getHistory")
public ResponseMessage<IPage<QualityEvaluation>> getHistory(QualityEvaluation query){
IPage<QualityEvaluation> history = iQualityEvaluationService.getHistory(query);
return Result.success(history);
}
@ApiOperation("查询评价分数")
@GetMapping("getScore")
public ResponseMessage<Map<String,Double>> getScore(String lawId){
Map<String, Double> score = iQualityEvaluationService.getScore(lawId);
return Result.success(score);
}
}
@@ -0,0 +1,16 @@
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.dao;
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.EvaluationIndex;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author zhaokaiyao
* @since 2021-12-03
*/
public interface EvaluationIndexDao extends BaseMapper<EvaluationIndex> {
}
@@ -0,0 +1,26 @@
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.dao;
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation;
import com.adc.da.slrs.sarStandUnqualified.entity.BusinessDeptIssue;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* Mapper 接口
* </p>
*
* @author zhaokaiyao
* @since 2021-12-03
*/
public interface QualityEvaluationDao extends BaseMapper<QualityEvaluation> {
public IPage<QualityEvaluation> getHistory(IPage<QualityEvaluation> page,@Param(Constants.WRAPPER) QueryWrapper<QualityEvaluation> queryWrapper);
}
@@ -0,0 +1,59 @@
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity;
import com.adc.da.base.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author zhaokaiyao
* @since 2021-12-03
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="EvaluationIndex对象", description="")
public class EvaluationIndex extends BaseEntity {
private static final long serialVersionUID = 1L;
@TableField("code") //评价指标编码
private String code;
@ApiModelProperty(value = "显示顺序")
@TableField("index_sort")
private Integer indexSort;
@ApiModelProperty(value = "权重")
@TableField("weight")
private String weight;
@ApiModelProperty(value = "指标类型(动态评价指标,质量评价指标")
@TableField("index_type")
private String indexType;
@ApiModelProperty(value = "一级指标名称")
@TableField("one_index_title")
private String oneIndexTitle;
@ApiModelProperty(value = "二级指标名称")
@TableField("two_index_title")
private String twoIndexTitle;
@ApiModelProperty(value = "三级指标名称")
@TableField("three_index_title")
private String threeIndexTitle;
@ApiModelProperty(value = "指标值类型")
@TableField("value_type")
private String valueType;
}
@@ -0,0 +1,28 @@
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import java.util.List;
@Data
public class FormVO {
@ApiModelProperty("提交的评分表")
private List<QualityEvaluation> tableData;
@ApiModelProperty("企标法规id")
@JsonProperty("standId") //前后分离 前端字段
private String lawId;
@ApiModelProperty("提交的用户id")
private String userId;
@ApiModelProperty("附加")
private String formData;
@ApiModelProperty("评分类型")
private String evaluationType;
}
@@ -0,0 +1,94 @@
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity;
import com.adc.da.base.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;
import java.util.Date;
/**
* <p>
*
* </p>
*
* @author zhaokaiyao
* @since 2021-12-03
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="QualityEvaluation对象", description="")
public class QualityEvaluation extends BaseEntity {
private static final long serialVersionUID = 1L;
private String id;
@TableField("law_id")
@ApiModelProperty(value = "企标id")
private String lawId;
@TableField("user_id")
@ApiModelProperty(value = "用户id")
private String userId;
@ApiModelProperty(value = "用户名称")
@TableField(exist = false)
private String userName;
@TableField("is_need_revise")
@ApiModelProperty(value = "是否需要修订(废弃)")
private String isNeedRevise;
@JsonProperty("code") //前后分离 前端字段
@TableField("evaluation_index")
@ApiModelProperty(value = "评价指标")
private String evaluationIndex;
@JsonProperty("indexType") //前后分离 前端字段
@TableField("evaluation_type")
@ApiModelProperty(value = "评分类型")
private String evaluationType;
@JsonProperty("commentReason") //前后分离 前端字段
@TableField("reason")
@ApiModelProperty(value = "打分理由")
private String reason;
@JsonProperty("targetScore") //前后分离 前端字段
@TableField("score")
@ApiModelProperty(value = "打分")
private String score;
@ApiModelProperty(value = "指标值类型")
@TableField(exist = false)
private String valueType;
@TableField("process_node")
@ApiModelProperty(value = "流程节点")
private String processNode;
@ApiModelProperty(value = "创建时间")
@TableField(fill = FieldFill.INSERT)
private LocalDateTime createTime;
@ApiModelProperty(value = "更新时间")
@TableField(fill = FieldFill.INSERT_UPDATE)
private LocalDateTime modifyTime;
@TableField(exist = false)
private Integer page;
@TableField(exist = false)
private Integer pageSize;
}
@@ -0,0 +1,20 @@
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.service;
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.EvaluationIndex;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* <p>
* 服务类
* </p>
*
* @author zhaokaiyao
* @since 2021-12-03
*/
public interface IEvaluationIndexService extends IService<EvaluationIndex> {
public List<EvaluationIndex> getEvaluationIndex(EvaluationIndex query);
}
@@ -0,0 +1,30 @@
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.service;
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.FormVO;
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
import java.util.Map;
/**
* <p>
* 服务类
* </p>
*
* @author zhaokaiyao
* @since 2021-12-03
*/
public interface IQualityEvaluationService extends IService<QualityEvaluation> {
public Boolean submitEvaluationForm(FormVO form);
public IPage<QualityEvaluation> getHistory(QualityEvaluation query);
public List<QualityEvaluation> getEvaluationForm(QualityEvaluation query);
Map<String,Double> getScore(String lawId);
}
@@ -0,0 +1,40 @@
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.impl;
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.EvaluationIndex;
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.dao.EvaluationIndexDao;
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.IEvaluationIndexService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 服务实现类
* </p>
*
* @author zhaokaiyao
* @since 2021-12-03
*/
@Service
public class EvaluationIndexServiceImpl extends ServiceImpl<EvaluationIndexDao, EvaluationIndex> implements IEvaluationIndexService {
// @Autowired
// private EvaluationIndexDao evaluationIndexDao;
@Override
public List<EvaluationIndex> getEvaluationIndex(EvaluationIndex query) {
QueryWrapper<EvaluationIndex> queryWrapper = new QueryWrapper<>();
if (query.getIndexType()!=null){
queryWrapper.eq("index_type",query.getIndexType());
}
queryWrapper.orderByAsc("index_sort");
return this.baseMapper.selectList(queryWrapper);
}
}
@@ -0,0 +1,157 @@
package com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.impl;
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.EvaluationIndex;
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.FormVO;
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation;
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.dao.QualityEvaluationDao;
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.IEvaluationIndexService;
import com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.IQualityEvaluationService;
import com.adc.da.util.UUIDUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.collections.IterableMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.PipedReader;
import java.util.*;
import java.util.stream.Collector;
import java.util.stream.Collectors;
/**
* <p>
* 服务实现类
* </p>
*
* @author zhaokaiyao
* @since 2021-12-03
*/
@Service
public class QualityEvaluationServiceImpl extends ServiceImpl<QualityEvaluationDao, QualityEvaluation> implements IQualityEvaluationService {
@Autowired
private QualityEvaluationDao qualityEvaluationDao;
@Override
public Boolean submitEvaluationForm(FormVO form) {
//
// queryWrapper.eq("user_id",form.get)
// .eq("evaluation_type","dynamic");
Optional.ofNullable(form.getEvaluationType())
.ifPresent( item->{
if ("dynamic".equals(form.getEvaluationType())){
QueryWrapper<QualityEvaluation> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("law_id",form.getLawId()) //清除此用户在动态评分中已存在的评分
.eq("user_id",form.getUserId())
.eq("evaluation_type","dynamic");
this.remove(queryWrapper);
}
});
List<QualityEvaluation> tableData = form.getTableData();
tableData.forEach(item->{
item.setId( UUIDUtils.randomUUID20());
if ("number".equals(item.getValueType()) ){
item.setScore(String.valueOf (Double.valueOf(item.getScore()) * 2) );
}
});
return this.saveBatch(tableData);
}
@Override
public IPage<QualityEvaluation> getHistory(QualityEvaluation query) {
QueryWrapper<QualityEvaluation> queryWrapper = new QueryWrapper<>();
// Page<QualityEvaluation> page = new Page<>(query.getPage(), query.getPageSize());
Page<QualityEvaluation> page = new Page<>(1, 20);
if (query.getUserId()!=null){ //指定用户
queryWrapper.eq("user_id", query.getUserId())
.orderBy(true,true, "crate_time","modify_time");
}
if (query.getEvaluationType()!=null){ //指定评价指标
queryWrapper.eq("evaluation_type",query.getEvaluationType());
}
//sql计算每个用户的评分
return qualityEvaluationDao.getHistory(page,queryWrapper);
}
@Override
public List<QualityEvaluation> getEvaluationForm(QualityEvaluation query) {
QueryWrapper<QualityEvaluation> queryWrapper = new QueryWrapper<>();
queryWrapper.select("UNAME as userName","score","reason","create_time as createTime","modify_time as modifyTime","idx.value_type as valueType")
.last("JOIN ts_user user ON quality_evaluation.user_id = user.USID" +
"LEFT JOIN evaluation_index as idx on iex.id=quality_evaluation.evaluation_index");
if (query.getLawId()!=null){
queryWrapper.eq("law_id",query.getLawId()); //指定企标id
}
if (query.getUserId()!=null){ //指定用户
queryWrapper.eq("quality_evaluation.user_id", query.getUserId());
}
if (query.getEvaluationType()!=null){ //指定评价指标
queryWrapper.eq("evaluation_type",query.getEvaluationType());
}
return this.baseMapper.selectList(queryWrapper);
}
@Autowired
private IEvaluationIndexService iEvaluationIndexService;
@Override
public Map<String, Double> getScore(String lawId) {
QueryWrapper<QualityEvaluation> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("law_id",lawId);
List<QualityEvaluation> list = this.list(queryWrapper);
return list.stream()
.collect(Collectors.groupingBy(QualityEvaluation::getEvaluationType,
Collectors.averagingDouble(item -> getScoreSingle(item))));
}
private Double getScoreSingle(QualityEvaluation item){
QueryWrapper<EvaluationIndex> indexQuery = new QueryWrapper<>();
indexQuery.select("code","weight");
List<EvaluationIndex> indexList = iEvaluationIndexService.list(indexQuery);
Map<String, Float> weightMap = indexList.stream()
.collect(Collectors.toMap(EvaluationIndex::getCode, obj -> Float.valueOf(obj.getWeight())));
String score = item.getScore();
return ((score == null || (Float.valueOf(item.getScore()) < 0.0)) ? 0.0 : Float.valueOf(score) * weightMap.get(item.getEvaluationIndex()));
}
}
@@ -118,4 +118,12 @@ public class TsUserVO {
@ApiModelProperty(value = "岗位")
@TableField(exist = false)
private List<TsPosition> positions;
@ApiModelProperty(value = "单位")
@TableField(exist = false)
private String unit;
@ApiModelProperty(value = "单位Id")
@TableField(exist = false)
private String unitId;
}
@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@Controller
@RestController
@@ -65,4 +66,13 @@ public class IssueTrackController {
return Result.error("100","数据不能相同", false);
}
}
@GetMapping("/isPresent")
@ApiOperation("查询国内外标准和政策是否存在重点跟踪清单中")
public ResponseMessage<List<Map<String,String>>> isPresent(String ids){
List<Map<String, String>> maps = issueTrackService.idIsPresentIssueTrack(Arrays.asList(ids.split(",")));
return Result.success(maps);
}
}
@@ -5,6 +5,7 @@ import com.adc.da.slrs.sarIssueTrack.entity.IssueTrackVo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
import java.util.Map;
public interface IIssueTrackService {
@@ -15,4 +16,7 @@ public interface IIssueTrackService {
public IPage<IssueTrack> getIssueTrack(IssueTrackVo objVo);
public boolean updateIssueTrack(IssueTrack obj);
public List<Map<String,String>> idIsPresentIssueTrack(List<String> idList);
}
@@ -12,8 +12,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@Service
public class IssueTrackServiceImpl extends ServiceImpl<IssueTrackDao, IssueTrack> implements IIssueTrackService {
@@ -26,17 +27,12 @@ public class IssueTrackServiceImpl extends ServiceImpl<IssueTrackDao, IssueTrack
@Override
public boolean addIssueTrack(IssueTrack obj) {
QueryWrapper<IssueTrack> wrapper = new QueryWrapper<>();
wrapper.eq("law_id",obj.getLawId())
.eq("del_flag","0");
wrapper.eq("law_id",obj.getLawId());
IssueTrack one = this.getOne(wrapper);
if (one==null){
return false;
}else {
obj.setId(UUIDUtils.randomUUID20());
obj.setDelFlag("0");
return this.save(obj);
}
obj.setId(UUIDUtils.randomUUID20());
obj.setDelFlag("0");
return this.saveOrUpdate(obj,wrapper);
}
@@ -71,4 +67,28 @@ public class IssueTrackServiceImpl extends ServiceImpl<IssueTrackDao, IssueTrack
}
}
@Override
public List<Map<String,String>> idIsPresentIssueTrack(List<String> idList){
QueryWrapper<IssueTrack> wrapper = new QueryWrapper<>();
wrapper.select("law_id")
.in("law_id",idList);
List<IssueTrack> issueTracks = issueTrackDao.selectList(wrapper);
Set<String> lawIdSet = issueTracks.stream()
.map(item -> item.getLawId()).collect(Collectors.toSet());
return idList.stream()
.map(item -> {
HashMap<String, String> resultMap = new HashMap<>();
if (lawIdSet.contains(item)) {
resultMap.put(item, "1");
} else {
resultMap.put(item, "0");
}
return resultMap;
}).collect(Collectors.toList());
}
}
@@ -43,7 +43,7 @@ public class SarLawsAttrDetailedListServiceImpl extends ServiceImpl<SarLawsAttrD
IPage<SarLawsAttrDetailedList> pageRes = new Page<>(sarFindDto.getPage(), sarFindDto.getSize());
QueryWrapper<SarLawsAttrDetailedList> wrapper = new QueryWrapper<>();
wrapper.eq("detailed_list_id", sarFindDto.getId());
IPage<SarLawsAttrDetailedList> selectPage = sarLawsAttrDetailedListDao.selectPage(pageRes,wrapper);
IPage<SarLawsAttrDetailedList> selectPage = sarLawsAttrDetailedListDao.selectPage(pageRes,wrapper); //??????
//查询标准id
List<String> lawsIds = sarLawsAttrDetailedListDao.selectLawsId(sarFindDto.getId(),(sarFindDto.getPage())-1,sarFindDto.getSize(),sarFindDto);
if (CollectionUtils.isEmpty(lawsIds)){
@@ -11,6 +11,8 @@ import com.adc.da.slrs.sarLawsDetailedList.entity.SarLawsDetailedList;
import com.adc.da.slrs.sarLawsDetailedList.entity.DetailedUpDto;
import com.adc.da.slrs.sarLawsDetailedList.entity.TimeDto;
import com.adc.da.slrs.sarLawsDetailedList.service.ISarLawsDetailedListService;
import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao;
import com.adc.da.slrs.sarStandardsInfo.service.impl.SarStandardsInfoServiceImpl;
import com.adc.da.sys.service.IDicTypeEOService;
import com.adc.da.util.UUIDUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -39,6 +41,9 @@ import static com.adc.da.login.util.UserUtils.getUserName;
@Service
public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedListDao, SarLawsDetailedList> implements ISarLawsDetailedListService {
@Autowired
SarStandardsInfoDao sarStandardsInfoDao;
@Autowired
public SarLawsDetailedListDao sarLawsDetailedListDao;
@Autowired
@@ -582,6 +587,10 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
timeDto.add(dto);
}
service.updateDetailedLaws(detailedUpDto.getId(), timeDto);
//更新标准是否纳入认证清单
sarStandardsInfoDao.updateISRELATEACCESSById("1",Arrays.asList(detailedUpDto.getInforlist().split(",")) );
}
}
@@ -3,6 +3,7 @@ package com.adc.da.slrs.sarModelTree.controller;
import com.adc.da.http.ResponseMessage;
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.ISarModuleTreeService;
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.Head;
@@ -38,17 +39,18 @@ public class SarModelTreeController extends BaseController<SarModelTree> {
@ApiOperation("查询父所有资源")
@GetMapping("/list")
public ResponseMessage<List<SarModelTree>> getAll(){
List<SarModelTree> tsResources = iSarModelTreeService.getAll(null);
// TODO List<SarModelTree> tsResources = iSarModuleTreeService.getAll(null);
// List<SarModuleTree> tsResources = iSarModuleTreeService.getAll(null);
List<SarModelTree> tsResources = iSarModelTreeService.getAll(null);
return Result.success(tsResources);
}
@ApiOperation("根据父ID查询子所有资源")
@GetMapping("/childByList")
public ResponseMessage<List<SarModelTree>> childByList(String ids){
SarModelTree tree = new SarModelTree();
tree.setId(ids);
List<SarModelTree> tsResources = iSarModelTreeService.recursionGetChildren(tree);
public ResponseMessage<List<SarModelTree>> childByList(SarModelTree parentTree){
// List<SarModuleTree> tsResources = iSarModuleTreeService.recursionGetChildren(parentTree);
List<SarModelTree> tsResources = iSarModelTreeService.recursionGetChildren(parentTree);
return Result.success(tsResources);
}
@@ -13,7 +13,7 @@ import java.util.List;
/**
* <p>
*
*
* </p>
*
* @author super_liu
@@ -65,4 +65,11 @@ public class SarModelTree extends BaseEntity {
@TableField(exist=false)
private List<String> childMenuIds;
@TableField("HAS_CHILDREN")
private String hasChildren;
@TableField(exist = false)
private boolean leaf;
}
@@ -70,7 +70,13 @@ public class SarModuleTree {
@TableField("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;
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 java.util.List;
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);
@@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
* <p>
@@ -32,6 +34,17 @@ public class SarModelTreeServiceImpl extends ServiceImpl<SarModelTreeDao, SarMod
// for(SarModelTree tree:list){
// tree.setChildren(recursionGetChildren((tree)));
// }
list.forEach(item->{
switch (item.getHasChildren()){
case "0":
item.setLeaf(true);
break;
case "1":
item.setLeaf(false);
break;
}
item.setId(item.getName());
});
return list;
}
@@ -44,11 +57,29 @@ public class SarModelTreeServiceImpl extends ServiceImpl<SarModelTreeDao, SarMod
public List<SarModelTree> recursionGetChildren(SarModelTree parent){
QueryWrapper<SarModelTree> sarMenuQueryWrapper=new QueryWrapper<>();
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);
for(SarModelTree sarMenu:children){
sarMenu.setChildren(recursionGetChildren((sarMenu)));
}
return children;
// for(SarModelTree sarMenu:children){
// sarMenu.setChildren(recursionGetChildren((sarMenu)));
// }
List<SarModelTree> collect = children.stream()
.filter(item -> !parent.getModel().equals(item.getModel())).collect(Collectors.toList());
collect.forEach(item-> {
switch (item.getHasChildren()) {
case "0":
item.setLeaf(true);
break;
case "1":
item.setLeaf(false);
break;
}
item.setId(item.getName());
});
return collect;
}
}
@@ -15,9 +15,11 @@ import com.google.gson.JsonParser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.awt.event.MouseAdapter;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.stream.Collectors;
@Service
@@ -27,16 +29,27 @@ public class SarModuleTreeServiceImpl extends ServiceImpl<SarModuleTreeDao, SarM
private SarModuleTreeServiceImpl sarModuleTreeService;
/**
* @param sarModelTree
* @return 所有的根节点
*/
@Override
public List<SarModelTree> getAll(SarModelTree sarModelTree) {
public List<SarModuleTree> getAll(SarModuleTree root) {
QueryWrapper<SarModuleTree> treeQueryWrapper = new QueryWrapper<>();
treeQueryWrapper.groupBy("FTVSTYPE1");
List<SarModuleTree> moduleTreeList = this.baseMapper.selectList(treeQueryWrapper);
treeQueryWrapper.select("FTVSTYPE1")
.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
*/
@Override
public List<SarModelTree> recursionGetChildren(SarModelTree parent) {
public List<SarModuleTree> recursionGetChildren(SarModuleTree parent) {
QueryWrapper<SarModuleTree> treeQueryWrapper = new QueryWrapper<>();
treeQueryWrapper.eq("GUID",parent.getId());
List<SarModuleTree> moduleTreeList = this.baseMapper.selectList(treeQueryWrapper);
Integer level =parent.getLevel();
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));
collect.forEach((k, v)->{
SarModelTree modelTree = new SarModelTree();
//TODO 生成树型结构
// modelTree
});
return null;
return sarModuleTree;
}).collect(Collectors.toList());
return collect;
}
@Override
@@ -2,6 +2,7 @@ package com.adc.da.slrs.sarStandIdea.dao;
import com.adc.da.slrs.sarStandIdea.entity.SarPublicIdeaAll;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@@ -21,4 +22,8 @@ import java.util.List;
public interface SarPublicIdeaAllDao extends BaseMapper<SarPublicIdeaAll> {
List<SarPublicIdeaAll> getPublicIdea(@Param("unique")String unique);
List<SarPublicIdeaAll> getAllDataByIdea(@Param("page")Integer page,@Param("size")Integer size, @Param("ideaId")String ideaId);
Integer getAllDataByIdeaCount( @Param("ideaId")String ideaId);
}
@@ -48,10 +48,13 @@ public class SarPublicIdeaAllServiceImpl extends ServiceImpl<SarPublicIdeaAllDao
} catch (ParseException e) {
e.printStackTrace();
}
QueryWrapper<SarPublicIdeaAll> wrapper = new QueryWrapper<>();
wrapper.eq("idea_id", detAllStandDto.getIdeaId());
Page<SarPublicIdeaAll> page = new Page<>(detAllStandDto.getPage(), detAllStandDto.getSize());
IPage<SarPublicIdeaAll> userIPage = sarPublicIdeaAllDao.selectPage(page, wrapper);
List<SarPublicIdeaAll> sarPublicIdeaAlls=sarPublicIdeaAllDao.getAllDataByIdea(detAllStandDto.getPage(),detAllStandDto.getSize(),detAllStandDto.getIdeaId());
Integer a=sarPublicIdeaAllDao.getAllDataByIdeaCount(detAllStandDto.getIdeaId());
Page userIPage=new Page();
userIPage.setTotal(a);
userIPage.setRecords(sarPublicIdeaAlls);
userIPage.setSize(detAllStandDto.getSize());
userIPage.setCurrent(detAllStandDto.getPage());
System.out.println("总条数" + userIPage.getTotal());
System.out.println("总页数" + userIPage.getPages());
List<SarPublicIdeaAll> list = userIPage.getRecords();
@@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
import com.adc.da.base.web.BaseController;
import java.util.List;
import java.util.*;
/**
* <p>
@@ -53,6 +53,29 @@ public class SarStandItemsController extends BaseController<SarStandItems> {
}
}
@ApiOperation(value = "项目评估流程分解单查询")
@GetMapping("/workflowFindItems")
public ResponseMessage workflowFindItems( @RequestParam("ids") String ids,@RequestParam("types") String types){
List<String> id=new ArrayList<>(Arrays.asList(ids.split(",")));
List<String> type=new ArrayList<>(Arrays.asList(types.split(",")));
Map<String,String> map=new HashMap<>();
int i =0 ;
for (String s:type) {
if (null!=map.get(s)){
map.put(s,map.get(s)+","+id.get(i));
}else {
map.put(s,id.get(i));
}
}
List<SarStandItemsDto> ItemDto = new ArrayList<>();
map.entrySet().forEach(stringStringEntry -> {
if (!"BDR".equals(stringStringEntry.getKey())){
ItemDto.addAll(ServiceImpl.findAllItems(stringStringEntry.getKey(),stringStringEntry.getValue().split(",")));
}
});
return Result.success("200",ItemDto);
}
@ApiOperation(value = "分解单查询")
@GetMapping("/querySarItemAndInterpretation")
public ResponseMessage querySarItemAndInterpretation(FindSarItemsPageReqDTO page){
@@ -155,24 +155,24 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
page.setPageSize(findStandDto.getSize());
page.setUserId(null);
List<SarStandardsInfo> pageInfo = null;
try {
pageInfo = sarStandardsInfoService.getSarStandardsInfoPageBak(page);
} catch (Exception e) {
e.printStackTrace();
}
// try {
// pageInfo = sarStandardsInfoService.getSarStandardsInfoPageBak(page);
// } catch (Exception e) {
// e.printStackTrace();
// }
List<String> standId = new ArrayList<>();
for (SarStandardsInfo standardsInfo : pageInfo){
if (standardsInfo.getAttrInfoCaseMap().get("FBGBJBD")!=null || standardsInfo.getAttrInfoCaseMap().get("fbgbjbd")!=null){
standId.add(standardsInfo.getId());
}
}
// for (SarStandardsInfo standardsInfo : pageInfo){
//// if (standardsInfo.getAttrInfoCaseMap().get("FBGBJBD")!=null || standardsInfo.getAttrInfoCaseMap().get("fbgbjbd")!=null){
// standId.add(standardsInfo.getId());
//// }
// }
List<LawsDto> list=new ArrayList<>();
if (standId==null || standId.size()==0){
list = null;
}else {
// if (standId==null || standId.size()==0){
// list = null;
// }else {
list = sarLawsAttrDetailedListDao.selectLawsByIdC((findStandDto.getPage()-1)*findStandDto.getSize(),findStandDto.getPage()*findStandDto.getSize(),standId,findStandDto.getStandName(), findStandDto.getStandType(),findStandDto.getFileType());
}
// }
IPage<LawsDto> page1=new Page<>();
page1.setRecords(list);
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){
List<SarStandItemsDto> list=dao.selectAllItemsByIds(type,ids);
List<SarStandItemsDto> res=new ArrayList<>();
List<SarStandItemsDto> chinese=new ArrayList<>();
if (null == list || list.isEmpty()){
return list;
}else {
@@ -206,20 +207,24 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
if (a>0){
mark=mark.substring(0,a);
}
if (null != map.get(Integer.valueOf(mark))){
map.get(Integer.valueOf(mark)).add(sarStandItemsDto);
}else {
integerList.add(Integer.valueOf(mark));
List<SarStandItemsDto> middle=new ArrayList<>();
middle.add(sarStandItemsDto);
map.put(Integer.valueOf(mark),middle);
}
try {
if (null != map.get(Integer.valueOf(mark))) {
map.get(Integer.valueOf(mark)).add(sarStandItemsDto);
} else {
integerList.add(Integer.valueOf(mark));
List<SarStandItemsDto> middle = new ArrayList<>();
middle.add(sarStandItemsDto);
map.put(Integer.valueOf(mark), middle);
}
}catch (Exception e){
chinese.add(sarStandItemsDto);
}
});
Collections.sort(integerList);
integerList.forEach(integer -> {
res.addAll(map.get(integer));
});
res.addAll(chinese);
return res;
}
}
@@ -144,6 +144,29 @@ public class SarStandProjectLibraryController extends BaseController<SarStandPro
IPage<StandAttrInfoDto> list = sarStandProjectLibraryService.queryStandInfo(current,pageSize,id,cars);
return Result.success("200",list);
}
/**
*
* @param current
* @param pageSize
* @param id
* @return
* @author zj
* date 2021-07-15
**/
@GetMapping("/queryStandInfoNew")
@ApiOperation("查询标准信息")
public ResponseMessage queryStandInfoNew(@RequestParam(defaultValue = "1", value = "current")int current, @RequestParam(defaultValue = "10", value = "PageSize") int pageSize,
String id,String cars){
// List<SarStandProjectLibrary> list = sarStandProjectLibraryService.queryStandId(id);
// List<String> list1 = new ArrayList();
// for(SarStandProjectLibrary s:list){
// list1.add(s.getStandId());
// }
// System.out.println(list1);
IPage<StandAttrInfoDto> list = sarStandProjectLibraryService.queryStandInfoNew(current,pageSize,id,cars);
return Result.success("200",list);
}
/**
*
* @param id
@@ -192,6 +215,20 @@ public class SarStandProjectLibraryController extends BaseController<SarStandPro
sarStandProjectLibraryService.batchInsert(list);
return Result.success("200","新增成功",list);
}
/**
*
* @param list
* @return
* @author zj
* date 2021-07-15
**/
@PostMapping("/batchInsertAdd")
@ApiOperation("调取标准")
public ResponseMessage batchInsertAdd(@RequestBody List<StandProjectRelationDto> list){
sarStandProjectLibraryService.batchInsertAdd(list);
return Result.success("200","新增成功",list);
}
/**
*
* @param standAttrInfoExcelDto
@@ -29,6 +29,8 @@ public interface SarStandProjectLibraryDao extends BaseMapper<SarStandProjectLib
List<String> getAllStands();
List<String> getAllStand();
List<SarStandProjectLibrary> updateByProjectId(@Param("id")String id, @Param("version")String version);
List<SarStandProjectLibrary> updateByProjectIdBath(@Param("id")List<String> id, @Param("version")String version);
void deleteByProjectId(@Param("projectId")String projectId);
List<String> selectListByids(@Param("ids") List<String> ids);
}
@@ -59,4 +59,8 @@ public class StandAttrInfoDto {
//关联模块--乘用车vpps中文名称
@ExcelProperty("关联模块--乘用车vpps中文名称")
private String CYCVPPSCN;
private Long unCount;
private String endTimes;
}
@@ -22,8 +22,11 @@ public interface SarStandProjectLibraryService {
List<SarStandProjectLibrary> queryByProductLine(String productLine);
List<SarStandProjectLibrary> queryStandId(String standId);
IPage<StandAttrInfoDto> queryStandInfo(int current, int pageSize, String standId, String cars);
IPage<StandAttrInfoDto> queryStandInfoNew(int current, int pageSize, String standId, String cars);
void deleteByIds(List<StandProjectRelationDto> ids);
void batchInsert(@Param("ids") List<StandProjectRelationDto> list);
void batchInsertAdd(@Param("ids") List<StandProjectRelationDto> list);
List<StandAttrInfoDto> exportStandAttrInfoExcel(StandAttrInfoExcelDto standAttrInfoExcelDto,String standId);
public Head AnalysisJsonAndStorage(String jsonStr);
@@ -17,6 +17,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -370,6 +371,73 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
System.out.println("总页数"+userIPage.getPages());
return userIPage;
}
@Override
public IPage<StandAttrInfoDto> queryStandInfoNew(int current, int pageSize, String standId, String cars) {
//cars传回值为1时判断是从车型项目库中调取
QueryWrapper<SarStandardsInfo> wrapper1 = new QueryWrapper<>();
wrapper1.select("ID","STAND_NUMBER","STAND_SORT","STAND_YEAR","STAND_NAME","STAND_EN_NAME","STAND_TYPE","(select count(*) from sar_stand_unqualified" +
" where STAND_ID = r.stand_id and CLOSE_STATE = '1' ) as unCount ","(select count(*) from sar_stand_unqualified" +
" where STAND_ID = r.stand_id and CLOSE_STATE = '2' ) as counts ",
"(select GROUP_CONCAT( DISTINCT DATE_FORMAT( PLAN_CLOSE_TIME, '%Y-%m-%d' ) ORDER BY PLAN_CLOSE_TIME ) from sar_stand_unqualified where " +
" STAND_ID = r.stand_id and CLOSE_STATE = '1' AND PLAN_CLOSE_TIME is NOT NULL ) as endTimes ");
wrapper1.last("INNER JOIN sar_stand_project_relation r ON r.stand_id = sar_standards_info.ID WHERE r.project_id ='" + standId + "'");
Page<SarStandardsInfo> page1 = new Page<>(current, pageSize);
IPage<SarStandardsInfo> userIPage1 = SarStandardsInfoDao.selectPage(page1, wrapper1);
System.out.println("总条数"+userIPage1.getTotal());
System.out.println("总页数"+userIPage1.getPages());
QueryWrapper<SarStandAttrInfo> wrapper2 = new QueryWrapper<>();
wrapper2.select("r.STAND_ID","SSRQ","XCXSSRQ","ZCCSSRQ","ZRBM","KCCVPPSBM","KCCVPPSCN","CYCVPPSBM","CYCVPPSCN");
wrapper2.last("INNER JOIN sar_stand_project_relation r ON r.stand_id = sar_stand_attr_info.STAND_ID WHERE r.project_id ='"+ standId+"'");
Page<SarStandAttrInfo> page2 = new Page<>(current, pageSize);
IPage<SarStandAttrInfo> userIPage2 = sarStandAttrInfoDao.selectPage(page2, wrapper2);
System.out.println("总条数"+userIPage2.getTotal());
System.out.println("总页数"+userIPage2.getPages());
List<StandAttrInfoDto> list = new ArrayList<>();
List<SarStandardsInfo> list1 = userIPage1.getRecords();
List<SarStandAttrInfo> list2 = userIPage2.getRecords();
for(SarStandardsInfo s:list1){
StandAttrInfoDto p =new StandAttrInfoDto();
p.setStandId(s.getId());
p.setStandNumber(s.getStandNumber());
p.setStandSort(s.getStandSort());
p.setStandYear(s.getStandYear());
p.setStandName(s.getStandName());
p.setStandType(s.getStandType());
p.setStandEnName(s.getStandEnName());
if (s.getUnCount()==0L && s.getCounts()>0L) {
p.setUnCount(s.getUnCount());
}else if (s.getUnCount() == 0L && s.getCounts()==0L){
p.setUnCount(2L);
}else {
p.setUnCount(1L);
}
p.setEndTimes(s.getEndTimes());
for (SarStandAttrInfo a:list2){
if(s.getId().equals(a.getStandId())){
p.setCYCVPPSBM(a.getCycvppsbm());
p.setCYCVPPSCN(a.getCycvppscn());
p.setSSRQ(a.getSsrq());
p.setXCXSSRQ(a.getXcxssrq());
p.setZCCSSRQ(a.getZccssrq());
p.setKCCVPPSBM(a.getKccvppsbm());
p.setKCCVPPSCN(a.getKccvppscn());
p.setZRBM(a.getZrbm());
}
}
list.add(p);
}
IPage<StandAttrInfoDto> userIPage = new Page<>();
userIPage.setRecords(list);
userIPage.setTotal(userIPage1.getTotal());
System.out.println("总条数"+userIPage.getTotal());
System.out.println("总页数"+userIPage.getPages());
return userIPage;
}
@Override
public void deleteByIds(List<StandProjectRelationDto> ids) {
sarStandProjectLibraryDao.deleteByIds(ids);
@@ -385,6 +453,26 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
}
@Override
public void batchInsertAdd(List<StandProjectRelationDto> list) {
List<String> ids=new ArrayList<>();
List<String> projectIds=new ArrayList<>();
list.forEach(standProjectRelationDto -> {
if (!ids.contains(standProjectRelationDto.getStandId())) {
ids.add(standProjectRelationDto.getStandId());
}});
List<String> standProjectRelationDtos=sarStandProjectLibraryDao.selectListByids(ids);
List<StandProjectRelationDto> ins=new ArrayList<>();
list.forEach(standProjectRelationDto -> {
if (!standProjectRelationDtos.contains(standProjectRelationDto.getProjectId())){
ins.add(standProjectRelationDto);
projectIds.add(standProjectRelationDto.getProjectId());
}
});
sarStandProjectLibraryDao.batchInsert(ins);
sarStandProjectLibraryDao.updateByProjectIdBath(projectIds, TimeVersion());
}
@Override
public List<StandAttrInfoDto> exportStandAttrInfoExcel(StandAttrInfoExcelDto standAttrInfoExcelDto ,String id) {
List<String> ids = standAttrInfoExcelDto.getIds();
@@ -71,6 +71,7 @@ public class BusinessDeptIssue {
@ExcelIgnore
@TableLogic(value = "0",delval = "1")
@TableField("del_flag")
private String delFlag;
@ExcelProperty("责任部门")
@@ -59,6 +59,7 @@ public class ProductDeptIssue {
private String responseDept;
@TableLogic(value = "0",delval = "1")
@TableField("del_flag")
private String delFlag;
@TableField("is_close")
@@ -51,6 +51,9 @@ public class SarStandUnqualified extends BaseEntity {
@TableField("STAND_NAME")
private String standName;
@ApiModelProperty(value = "项目编号")
@TableField("product_id")
private String productId;
// @ExcelProperty("标准编号")
// @ApiModelProperty(value = "标准编号")
// @TableField("STAND_NUMBER")
@@ -4,10 +4,15 @@ package com.adc.da.slrs.sarStandWarning.controller;
import com.adc.da.base.web.BaseController;
import com.adc.da.http.ResponseMessage;
import com.adc.da.http.Result;
import com.adc.da.slrs.sarStandIssueControlProduct.entity.SarStandIssueControlProduct;
import com.adc.da.slrs.sarStandIssueControlProduct.entity.StandIssueControlProductExcelVO;
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
import com.adc.da.slrs.sarStandWarning.entity.WarningExcelVO;
import com.adc.da.slrs.sarStandWarning.service.Impl.EarlyWarningEOServiceImpl;
import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -17,10 +22,9 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import java.net.URLEncoder;
import java.util.*;
@RestController
@RequestMapping("/${restPath}/sys/EarlyWarning")
@@ -59,6 +63,16 @@ public class EarlyWarningEOController extends BaseController<EarlyWarningEO> {
@ApiOperation("标准预警查询")
public ResponseMessage<IPage<StandWarningEO>> getStandWaring(StandWarningEO queryPageEO){
IPage<StandWarningEO> standWarning = earlyWarningEOService.getStandWarning(queryPageEO);
standWarning.getRecords().forEach(item->{
Optional.ofNullable(item.getSSRQ())
.ifPresent(SSRQ -> item.setSSRQ(item.getSSRQ().replaceAll("\\s[0-6][0-9]\\:[0-6][0-9]\\:[0-6][0-9]", "")));
Optional.ofNullable(item.getXCXSSRQ())
.ifPresent(SSRQ ->item.setXCXSSRQ(item.getXCXSSRQ().replaceAll("\\s[0-6][0-9]\\:[0-6][0-9]\\:[0-6][0-9]", "")));
Optional.ofNullable(item.getZCCSSRQ())
.ifPresent(SSRQ ->item.setZCCSSRQ(item.getZCCSSRQ().replaceAll("\\s[0-6][0-9]\\:[0-6][0-9]\\:[0-6][0-9]", "")));
});
return Result.success(standWarning);
}
@@ -113,4 +127,37 @@ public class EarlyWarningEOController extends BaseController<EarlyWarningEO> {
return Result.success("200",listMap);
}
@GetMapping("/exprotWarning")
@ApiOperation("导出预警")
public void exportStandardsInfoExcel(WarningExcelVO excelVO, HttpServletResponse response) throws Exception {
// 这里注意 有同学反应使用swagger 会导致各种问题,请直接用浏览器或者用postman
try {
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("utf-8");
// 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系
if(excelVO.getExportName()==null){
excelVO.setExportName("标准预警");
}
String fileName = URLEncoder.encode(excelVO.getExportName(), "UTF-8").replaceAll("\\+", "%20");
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
List<StandWarningEO> exportExcel = earlyWarningEOService.getExportExcel(excelVO);
// 这里需要设置不关闭流
EasyExcel.write(response.getOutputStream(), SarStandIssueControlProduct.class).autoCloseStream(Boolean.FALSE).sheet("sheet1")
.doWrite(exportExcel);
} catch (Exception e) {
System.out.println(e);
// 重置response
response.reset();
response.setContentType("application/json");
response.setCharacterEncoding("utf-8");
response.getWriter().println(JSON.toJSONString(Result.error()));
}
}
}
@@ -7,8 +7,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface EarlyWarningEODao extends BaseMapper<EarlyWarningEO> {
IPage<StandWarningEO> selectWarningPage(IPage<StandWarningEO> page, @Param("waringEO") StandWarningEO warningEO);
IPage<StandWarningEO> selectWarningPage(IPage<StandWarningEO> page, @Param("waringEO") StandWarningEO warningEO,@Param("idList") List<String> ids);
}
@@ -0,0 +1,7 @@
package com.adc.da.slrs.sarStandWarning.dao;
import com.adc.da.slrs.sarStandWarning.entity.WarningDate;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface WarningDateDao extends BaseMapper<WarningDate> {
}
@@ -1,6 +1,8 @@
package com.adc.da.slrs.sarStandWarning.entity;
import com.adc.da.base.entity.BaseEntity;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
@@ -25,63 +27,79 @@ public class EarlyWarningEO extends BaseEntity {
private static final long serialVersionUID = 1L;
@ExcelIgnore
@ApiModelProperty("id")
@TableId("ID")
private String id;
@ExcelIgnore
@ApiModelProperty("标准id")
@TableField("STAND_ID")
private String standId;
@ExcelIgnore
@ApiModelProperty("标准类别")
@TableField("STAND_TYPE")
@TableField(exist = false)
private String standType;
@ExcelProperty("标准号")
@ApiModelProperty("标准号")
@TableField("STAND_CODE")
@TableField(exist = false)
private String standCode;
@ExcelProperty("标准名称")
@ApiModelProperty("标准名称")
@TableField("STAND_NAME")
@TableField(exist = false)
private String standName;
@ExcelProperty("发布日期")
@ApiModelProperty("发布日期")
@TableField("PUT_TIME")
@TableField(exist = false)
@DateTimeFormat(pattern="yyyy-MM-dd")
private Date putTime;
@ExcelIgnore
@TableField(exist = false)
private Date lastTime;
@ExcelProperty("适用车型")
@ApiModelProperty("适用车型")
@TableField("APPLY_TYPE")
@TableField(exist = false)
private String applyType;
@ExcelProperty("责任工程师")
@ApiModelProperty("责任工程师")
@TableField("DUTY_ENGINEER")
@TableField(exist = false)
private String dutyEngineer;
@ExcelIgnore
@ApiModelProperty("条款(分解单)id")
@TableField("ITEMS_ID")
@TableField(exist = false)
private String itemsId;
@ExcelProperty("条款(分解单)编号")
@ApiModelProperty("条款(分解单)编号")
@TableField("ITEMS_NUM")
@TableField(exist = false)
private String itemsNum;
@ExcelProperty("条款(分解单)名称")
@ApiModelProperty("条款(分解单)名称")
@TableField("ITEMS_NAME")
@TableField(exist = false)
private String itemsName;
@ExcelIgnore
@TableField("POLICY_ID")
private String policyId;
@TableField("POLICY_NAME")
@ExcelIgnore
@TableField(exist = false)
private String policyName;
@ExcelIgnore
@TableField("MARK")
private String mark;
@ExcelIgnore
@TableField("POWER")
private String power;
@@ -1,5 +1,7 @@
package com.adc.da.slrs.sarStandWarning.entity;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
@@ -11,62 +13,79 @@ import java.util.Date;
@Accessors(chain = true)
public class StandWarningEO extends EarlyWarningEO {
private static final long serialVersionUID = 1L;
@ExcelProperty("新车型实施日期")
@ApiModelProperty("新车型实施日期")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String XCXSSRQ;
@ExcelProperty("在产车实施日期")
@ApiModelProperty("在产车实施日期")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String ZCCSSRQ;
@ExcelProperty("实施日期")
@ApiModelProperty("实施日期")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String SSRQ;
@ExcelProperty("标准编号")
private String standNum;
@ExcelProperty("标准类别")
private String standSort;
@ExcelProperty("标准年份")
private String standYear;
@ExcelProperty("发布日期")
private String issueTime;
@ExcelIgnore
private Integer page;
@ExcelIgnore
private Integer pageSize;
@ExcelIgnore
@ApiModelProperty("范围查询新车型实施日期开始")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String startXCXSSRQ;
@ExcelIgnore
@ApiModelProperty("范围查询新车型实施日期结束")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String endXCXSSRQ;
@ExcelIgnore
@ApiModelProperty("范围查询在产车实施日期开始")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String startZCCSSRQ;
@ExcelIgnore
@ApiModelProperty("范围查询在产车实施日期结束")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String endZCCSSRQ;
@ExcelIgnore
@ApiModelProperty("范围查询实施日期开始")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String startSSRQ;
@ExcelIgnore
@ApiModelProperty("范围查询实施日期结束")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String endSSRQ;
@ExcelIgnore
@ApiModelProperty("范围查询发布日期开始")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String startPutTime;
@ExcelIgnore
@ApiModelProperty("范围查询发布日期结束")
@DateTimeFormat(pattern = "YYYY-MM-dd")
private String endPutTime;
@@ -0,0 +1,22 @@
package com.adc.da.slrs.sarStandWarning.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@Data
@TableName("warning_date")
public class WarningDate {
@TableField("id")
private String id;
@TableField("law_id")
private String lawId;
@TableField("SSRQ")
private String SSRQ;
@TableField("time_Name")
private String timeName;
}
@@ -0,0 +1,15 @@
package com.adc.da.slrs.sarStandWarning.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class WarningExcelVO {
@ApiModelProperty("文件名")
String exportName;
@ApiModelProperty("导出的ID列表")
List<String> ids;
}
@@ -3,6 +3,7 @@ package com.adc.da.slrs.sarStandWarning.service;
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
import com.adc.da.slrs.sarStandWarning.entity.WarningExcelVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
@@ -20,4 +21,6 @@ public interface EarlyWarningEOService extends IService<EarlyWarningEO> {
IPage<StandWarningEO> getStandWarning(StandWarningEO queryPage);
List<StandWarningEO> getExportExcel(WarningExcelVO excelVO);
}
@@ -0,0 +1,8 @@
package com.adc.da.slrs.sarStandWarning.service;
import com.adc.da.slrs.sarStandWarning.entity.WarningDate;
import com.baomidou.mybatisplus.extension.service.IService;
public interface IWarningDateService extends IService<WarningDate> {
}
@@ -1,12 +1,11 @@
package com.adc.da.slrs.sarStandWarning.service.Impl;
import com.adc.da.scheduled.entity.DataDTO;
import com.adc.da.slrs.sarStandWarning.dao.EarlyWarningEODao;
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
import com.adc.da.slrs.sarStandWarning.entity.StandWarningEO;
import com.adc.da.slrs.sarStandWarning.entity.WarningExcelVO;
import com.adc.da.slrs.sarStandWarning.service.EarlyWarningEOService;
import com.adc.da.sys.util.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -16,9 +15,7 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
@Service("EarlyWarningEOService")
@@ -115,9 +112,20 @@ public class EarlyWarningEOServiceImpl extends ServiceImpl<EarlyWarningEODao, Ea
@Override
public IPage<StandWarningEO> getStandWarning(StandWarningEO queryPage) {
IPage<StandWarningEO> iPage = new Page<>(queryPage.getPage(),queryPage.getPageSize());
return earlyWarningEODao.selectWarningPage(iPage,queryPage);
return earlyWarningEODao.selectWarningPage(iPage,queryPage,null);
}
/**
* 导出预警
* @return
*/
@Override
public List<StandWarningEO> getExportExcel(WarningExcelVO excelVO){
IPage<StandWarningEO> standWarningEOIPage = earlyWarningEODao.selectWarningPage(null, null, excelVO.getIds());
return standWarningEOIPage.getRecords();
}
private IPage<EarlyWarningEO> getEarlyWarningEOIPage(int current,int pageSize, QueryWrapper<EarlyWarningEO> wrapper) {
wrapper.eq("power",1);
Page<EarlyWarningEO> page = new Page<>(current, pageSize);
@@ -0,0 +1,11 @@
package com.adc.da.slrs.sarStandWarning.service.Impl;
import com.adc.da.slrs.sarStandWarning.dao.WarningDateDao;
import com.adc.da.slrs.sarStandWarning.entity.WarningDate;
import com.adc.da.slrs.sarStandWarning.service.IWarningDateService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
@Service
public class WarningDateServiceImpl extends ServiceImpl<WarningDateDao, WarningDate> implements IWarningDateService {
}
@@ -19,7 +19,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import oracle.ucp.proxy.annotation.Post;
import org.apache.commons.beanutils.BeanUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -60,7 +59,7 @@ public class SarStandardComplianceAssessResultController {
if (eo.getStandApplicationType() == 1) {
QueryWrapper<SarStandardComplianceProductAssess> queryWrapper = new QueryWrapper<>();
IPage<SarStandardComplianceProductAssess> iPage = new Page<>(eo.getCurrent(), eo.getSize());
queryWrapper.select("distinct STAND_ID, STAND_NUMBER, STAND_NAME, STAND_TYPE, INTERPRETATION_TIME,type");
queryWrapper.select("distinct STAND_ID, STAND_NUMBER, STAND_NAME, STAND_TYPE");
if (eo.getStandName() != null && !eo.getStandName().trim().equals("")) {
queryWrapper.like("STAND_NAME", eo.getStandName().trim());
}
@@ -175,6 +174,46 @@ public class SarStandardComplianceAssessResultController {
return Result.success(page);
}
@ApiOperation(value = "标准涉及项目复合性详情")
@GetMapping("/productNewDetail")
public ResponseMessage<Map<String,IPage<SarStandardComplianceProductAssess>>> selectProductDetail(SarStandardComplianceProductAssessEO eo) throws Exception {
IPage<SarStandardComplianceProductAssess> iPage = new Page<>(eo.getCurrent(), eo.getSize());
Map<String,IPage<SarStandardComplianceProductAssess>> map=new HashMap<>();
QueryWrapper<SarStandardComplianceProductAssess> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("STAND_ID", eo.getStandId());
queryWrapper.eq("product_id", eo.getProductId());
queryWrapper.isNotNull("research_completion_time");
queryWrapper.orderByAsc("product_name");
queryWrapper.orderByAsc("standard_item");
Page p1=new Page();
IPage<SarStandardComplianceProductAssess> page = iSarStandardComplianceProductAssessService.page(iPage, queryWrapper);
BeanUtils.copyProperties(page,p1);
p1.setRecords(page.getRecords());
p1.setTotal(page.getTotal());
map.put("unfit",p1);
QueryWrapper<SarStandardComplianceProductAssess> queryWrapper1 = new QueryWrapper<>();
queryWrapper1.eq("STAND_ID", eo.getStandId());
queryWrapper1.eq("product_id", eo.getProductId());
queryWrapper1.ne("research_compliance","");
queryWrapper1.orderByAsc("product_name");
queryWrapper1.orderByAsc("standard_item");
IPage<SarStandardComplianceProductAssess> page1 = iSarStandardComplianceProductAssessService.page(iPage, queryWrapper1);
map.put("fit",page1);
return Result.success(map);
}
@ApiOperation(value = "标准涉及项目复合性")
@GetMapping("/productNew")
public ResponseMessage<IPage<unCountDTO>> selectProduct(unCountDTO eo) throws Exception {
Page iPage = new Page<>();
iPage.setCurrent(eo.getCurrent());
iPage.setSize(eo.getSize());
IPage<unCountDTO> page = iSarStandardComplianceProductAssessService.selectPages(iPage, eo);
return Result.success(page);
}
@ApiOperation(value = "插入标准涉及项目符合性清单")
@PostMapping("/add")
public ResponseMessage insertProduct(@RequestBody List<SarStandardComplianceProductAssess> eo) throws Exception {
@@ -195,20 +234,12 @@ public class SarStandardComplianceAssessResultController {
public ResponseMessage<Object> selectNationalStandard(InterpretationEO eo) throws Exception {
if (eo.getPosition() == 1) {
IPage<SarInterpretationNationalStandard> iPage = new Page<>(eo.getCurrent(), eo.getSize());
QueryWrapper<SarInterpretationNationalStandard> queryWrapper = new QueryWrapper<>();
//如果查询条件里标准编号不为空,查询
if (eo.getStandNumber() != null) queryWrapper.like("STAND_NUMBER",eo.getStandNumber());
//如果查询条件里标准名称不为空,查询
if (eo.getStandName() != null) queryWrapper.like("STAND_NAME",eo.getStandName());
//如果查询条件里具体章条不为空,查询
if (eo.getSpecificItem() != null) queryWrapper.like("specific_item",eo.getSpecificItem());
if (eo.getInterpretationTime() != null) queryWrapper.eq("INTERPRETATION_TIME", eo.getInterpretationTime());
if (eo.getStandId() != null) queryWrapper.eq("STAND_ID", eo.getStandId());
IPage<SarInterpretationNationalStandard> page = iSarInterpretationNationalStandardService.page(iPage, queryWrapper);
while (page.getRecords().remove(null)) ;
return Result.success(page);
List<SarInterpretationNationalStandard> standards=iSarInterpretationNationalStandardService.getAllDatas(eo);
Integer datasCount=iSarInterpretationNationalStandardService.getAllDatasCount(eo);
iPage.setTotal(datasCount);
iPage.setRecords(standards);
while (iPage.getRecords().remove(null)) ;
return Result.success(iPage);
} else {
IPage<SarInterpretationForeignStandard> iPage = new Page<>(eo.getCurrent(), eo.getSize());
QueryWrapper<SarInterpretationForeignStandard> queryWrapper = new QueryWrapper<>();
@@ -1,9 +1,12 @@
package com.adc.da.slrs.sarStandardComplianceAssessResult.dao;
import com.adc.da.slrs.sarStandardComplianceAssessResult.entity.InterpretationEO;
import com.adc.da.slrs.sarStandardComplianceAssessResult.entity.SarInterpretationNationalStandard;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* Mapper 接口
@@ -16,4 +19,8 @@ public interface SarInterpretationNationalStandardDao extends BaseMapper<SarInte
boolean updateData(@Param("find") SarInterpretationNationalStandard findStandDto);
List<SarInterpretationNationalStandard> getAllDatas(InterpretationEO sarInterpretationNationalStandard);
Integer getAllDatasCout(InterpretationEO sarInterpretationNationalStandard);
}
@@ -1,7 +1,14 @@
package com.adc.da.slrs.sarStandardComplianceAssessResult.dao;
import com.adc.da.slrs.sarStandardComplianceAssessResult.entity.SarStandardComplianceProductAssess;
import com.adc.da.slrs.sarStandardComplianceAssessResult.entity.SarStandardComplianceProductAssessEO;
import com.adc.da.slrs.sarStandardComplianceAssessResult.entity.unCountDTO;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
@@ -13,4 +20,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface SarStandardComplianceProductAssessDao extends BaseMapper<SarStandardComplianceProductAssess> {
List<unCountDTO> selectPages(@Param("page")Long page,@Param("pageSize")Long size,@Param("product") unCountDTO productAssess);
List<Integer> selectPagesCount(@Param("product")unCountDTO productAssess);
}
@@ -1,7 +1,6 @@
package com.adc.da.slrs.sarStandardComplianceAssessResult.entity;
import com.adc.da.base.entity.BaseEntity;
import java.time.LocalDateTime;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableField;
@@ -121,7 +120,23 @@ public class SarStandardComplianceProductAssess extends BaseEntity {
@TableField("type")
private String type;
@ApiModelProperty(value = "评估时间")
@TableField("evaluation_time")
private String evaluationTime;
@ApiModelProperty(value = "评估人")
@TableField("evaluation_people")
private String evaluationPeople;
@ApiModelProperty(value = "评估人")
@TableField("evaluation_people_name")
private String evaluationPeopleName;
private String id;
@ApiModelProperty(value = "符合不符合")
@TableField(exist = false)
private String bfh;
}
@@ -0,0 +1,35 @@
package com.adc.da.slrs.sarStandardComplianceAssessResult.entity;
import lombok.Data;
@Data
public class unCountDTO {
private String standId;
private String productName;
private String productId;
private String productNumber;
private String productLine;
private String projectGroup;
private String projectManager;
private String uName;
private String unCount;
private Long current;
private Long size;
//项目编号
private String sarId;
private String type;
}
@@ -1,5 +1,6 @@
package com.adc.da.slrs.sarStandardComplianceAssessResult.service;
import com.adc.da.slrs.sarStandardComplianceAssessResult.entity.InterpretationEO;
import com.adc.da.slrs.sarStandardComplianceAssessResult.entity.SarInterpretationNationalStandard;
import com.baomidou.mybatisplus.extension.service.IService;
@@ -18,4 +19,8 @@ public interface ISarInterpretationNationalStandardService extends IService<SarI
String saveBath(List<SarInterpretationNationalStandard> sarInterpretationNationalStandards);
boolean updateData(SarInterpretationNationalStandard findStandDto);
List<SarInterpretationNationalStandard> getAllDatas(InterpretationEO sarInterpretationNationalStandard);
Integer getAllDatasCount(InterpretationEO sarInterpretationNationalStandard);
}
@@ -1,7 +1,12 @@
package com.adc.da.slrs.sarStandardComplianceAssessResult.service;
import com.adc.da.slrs.sarStandardComplianceAssessResult.entity.SarStandardComplianceProductAssess;
import com.adc.da.slrs.sarStandardComplianceAssessResult.entity.unCountDTO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Param;
/**
* <p>
@@ -13,4 +18,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface ISarStandardComplianceProductAssessService extends IService<SarStandardComplianceProductAssess> {
IPage<unCountDTO> selectPages(Page page, @Param("product") unCountDTO productAssess);
}
@@ -1,6 +1,7 @@
package com.adc.da.slrs.sarStandardComplianceAssessResult.service.impl;
import com.adc.da.slrs.sarStandardComplianceAssessResult.dao.SarStandardComplianceProductAssessDao;
import com.adc.da.slrs.sarStandardComplianceAssessResult.entity.InterpretationEO;
import com.adc.da.slrs.sarStandardComplianceAssessResult.entity.SarInterpretationNationalStandard;
import com.adc.da.slrs.sarStandardComplianceAssessResult.dao.SarInterpretationNationalStandardDao;
import com.adc.da.slrs.sarStandardComplianceAssessResult.entity.SarStandardComplianceProductAssess;
@@ -55,4 +56,14 @@ public class SarInterpretationNationalStandardServiceImpl extends ServiceImpl<Sa
public boolean updateData(SarInterpretationNationalStandard findStandDto) {
return sarInterpretationNationalStandardDao.updateData(findStandDto);
}
@Override
public List<SarInterpretationNationalStandard> getAllDatas(InterpretationEO sarInterpretationNationalStandard) {
return sarInterpretationNationalStandardDao.getAllDatas(sarInterpretationNationalStandard);
}
@Override
public Integer getAllDatasCount(InterpretationEO sarInterpretationNationalStandard) {
return sarInterpretationNationalStandardDao.getAllDatasCout(sarInterpretationNationalStandard);
}
}
@@ -2,10 +2,17 @@ package com.adc.da.slrs.sarStandardComplianceAssessResult.service.impl;
import com.adc.da.slrs.sarStandardComplianceAssessResult.entity.SarStandardComplianceProductAssess;
import com.adc.da.slrs.sarStandardComplianceAssessResult.dao.SarStandardComplianceProductAssessDao;
import com.adc.da.slrs.sarStandardComplianceAssessResult.entity.SarStandardComplianceProductAssessEO;
import com.adc.da.slrs.sarStandardComplianceAssessResult.entity.unCountDTO;
import com.adc.da.slrs.sarStandardComplianceAssessResult.service.ISarStandardComplianceProductAssessService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 服务实现类
@@ -17,4 +24,25 @@ import org.springframework.stereotype.Service;
@Service
public class SarStandardComplianceProductAssessServiceImpl extends ServiceImpl<SarStandardComplianceProductAssessDao, SarStandardComplianceProductAssess> implements ISarStandardComplianceProductAssessService {
@Autowired
SarStandardComplianceProductAssessDao sarStandardComplianceProductAssessDao;
@Override
public IPage<unCountDTO> selectPages(Page pages, unCountDTO productAssess) {
IPage<unCountDTO> productAssessIPage= new Page<>();
List<unCountDTO> res=sarStandardComplianceProductAssessDao.selectPages(pages.getCurrent(),pages.getSize(),productAssess);
res.forEach(unCountDTO -> {unCountDTO.setStandId(productAssess.getStandId());
unCountDTO.setType(productAssess.getType());});
productAssessIPage.setRecords(res);
List<Integer> a=sarStandardComplianceProductAssessDao.selectPagesCount(productAssess);
if (null!=a) {
productAssessIPage.setTotal(a.size());
}else {
productAssessIPage.setTotal(0);
}
productAssessIPage.setCurrent(pages.getCurrent());
productAssessIPage.setSize(pages.getSize());
return productAssessIPage;
}
}
@@ -46,6 +46,7 @@ import java.net.URLEncoder;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
* <p>
@@ -110,9 +111,24 @@ public class SarStandardsInfoController extends BaseController<SarStandardsInfo>
page.setUserId(LoginUserUtil.getUserId());
}
List<SarStandardsInfo> rows = sarStandardsInfoEOService.getSarStandardsInfoPage(page);
// 去掉日期时分秒
rows.forEach(item->{
Optional.ofNullable(item.getSSRQ())
.ifPresent(SSRQ -> item.setSSRQ(item.getSSRQ().replaceAll("\\s[0-6][0-9]\\:[0-6][0-9]\\:[0-6][0-9]", "")));
Optional.ofNullable(item.getXCXSSRQ())
.ifPresent(SSRQ ->item.setXCXSSRQ(item.getXCXSSRQ().replaceAll("\\s[0-6][0-9]\\:[0-6][0-9]\\:[0-6][0-9]", "")));
Optional.ofNullable(item.getZCCSSRQ())
.ifPresent(SSRQ ->item.setZCCSSRQ(item.getZCCSSRQ().replaceAll("\\s[0-6][0-9]\\:[0-6][0-9]\\:[0-6][0-9]", "")));
});
return Result.success(getPageInfo(page.getPager(), rows));
}
private void nowOrderFunc(SarStandardsInfoEOPage page) {
switch (page.getNowOrderBy()) {
case 1:
@@ -70,4 +70,6 @@ public interface SarStandardsInfoDao extends BaseMapper<SarStandardsInfo> {
List<SarStandardsInfo> selectStandardsInfoBynumber(SarStandardsInfoEOPage page);
int updateISRELATEACCESSById(@Param("IS_RELATE_ACCESS") String ACCESS,@Param("list") List<String> list);
}
@@ -142,6 +142,18 @@ public class SarStandardsInfo extends BaseEntity {
@TableField("STAND_SYSTEM")
private String standSystem;
@ApiModelProperty(value = "为符合数量")
@TableField(exist = false)
private Long unCount;
@ApiModelProperty(value = "为符合数量")
@TableField(exist = false)
private Long counts;
@ApiModelProperty(value = "整改完成时间")
@TableField(exist = false)
private String endTimes;
// 以下为非表中字段
@TableField(exist = false)
@@ -3,6 +3,9 @@ package com.adc.da.slrs.sarStandardsInfo.service.impl;
import com.adc.da.att.entity.AttFileEO;
import com.adc.da.slrs.sarPosition.entity.TsPosition;
import com.adc.da.slrs.sarPosition.service.ITsPositionService;
import com.adc.da.slrs.sarStandWarning.dao.WarningDateDao;
import com.adc.da.slrs.sarStandWarning.entity.WarningDate;
import com.adc.da.slrs.sarStandWarning.service.Impl.WarningDateServiceImpl;
import com.adc.da.slrs.sarUser.entity.TsUser;
import com.adc.da.att.service.IAttFileEOService;
import com.adc.da.att.vo.AttFileVo;
@@ -123,6 +126,9 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
@Value("${file.path}")
private String filePath;//文件存储路径
@Autowired
WarningDateServiceImpl warningDateService;
@Autowired
private ITsPositionService iTsPositionService;
@@ -1001,10 +1007,14 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
return Pattern.matches(verifyType,str);
}
public void createStandPutTime(String standId, Map<String, String> multiTimeMap) throws Exception {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
if (multiTimeMap != null && multiTimeMap.size() > 0) {
List<SarStandPutTime> standTimeList = new ArrayList<>();
List<WarningDate> warningDateList = new ArrayList<>();
for (Map.Entry<String, String> entry : multiTimeMap.entrySet()) {
String value = entry.getValue();
String field = entry.getKey();
@@ -1025,6 +1035,16 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
sarStandPutTimeEO.setPutTime(date);
standTimeList.add(sarStandPutTimeEO);
}
if ("SSRQ".equals(field) || "XCXSSRQ".equals(field) || "ZCCSSRQ".equals(field)){
WarningDate warningDate = new WarningDate();
warningDate.setId(UUIDUtils.randomUUID20());
warningDate.setLawId(standId);
warningDate.setSSRQ(val);
warningDate.setTimeName(field);
warningDateList.add(warningDate);
}
}
}
}
@@ -1032,6 +1052,13 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
if (standTimeList != null && !standTimeList.isEmpty()) {
sarStandPutTimeEODao.insertForeach(standTimeList);
}
if (warningDateList != null && warningDateList.size()>0){
QueryWrapper<WarningDate> wrapper = new QueryWrapper<>();
wrapper.eq("law_id",standId);
warningDateService.remove(wrapper);
warningDateService.saveBatch(warningDateList);
}
}
}
@@ -74,6 +74,9 @@ public class SarVppsTree extends BaseEntity {
@TableField("TYPE")
private String type;
@ApiModelProperty("查询子节点条件")
@TableField(exist = false)
private String nextCondition;
@TableField(exist=false)
private List<String> roleIds;
@@ -82,4 +85,6 @@ public class SarVppsTree extends BaseEntity {
private List<String> childMenuIds;
}
@@ -31,7 +31,10 @@ public class SarVppsTreeServiceImpl extends ServiceImpl<SarVppsTreeDao, SarVppsT
.eq("LEVEL",0);
List<SarVppsTree> list = this.baseMapper.selectList(tsResourceQueryWrapper);
list.forEach(item->item.setVppsCode("10"));
list.forEach(item->{
item.setCode(item.getVppsCode()+item.getChineseName());
item.setId("10");
});
// for(SarVppsTree tree:list){
// tree.setChildren(recursionGetChildren((tree)));
// }
@@ -47,14 +50,20 @@ public class SarVppsTreeServiceImpl extends ServiceImpl<SarVppsTreeDao, SarVppsT
public List<SarVppsTree> recursionGetChildren(SarVppsTree parent){
QueryWrapper<SarVppsTree> sarMenuQueryWrapper=new QueryWrapper<>();
sarMenuQueryWrapper.orderByAsc("SORT");
// sarMenuQueryWrapper.in("PID",parent.getId());
sarMenuQueryWrapper.eq("LEVEL", parent.getLevel()+1)
.eq("TYPE",parent.getType())
.like("VPPS_CODE",parent.getVppsCode());
.eq("TYPE",parent.getType());
if(parent.getLevel()!=0){
sarMenuQueryWrapper.like("VPPS_CODE",parent.getId());
}
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;
}
}
@@ -0,0 +1,209 @@
package com.adc.da.slrs.standardSplit.EventUtils;
/**
* @Description: TODO
* @author: super_liu
* @date: 2021年11月28日 12:28
*/
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
/**
* 文本差异高亮算法
*
* @Author : cron
* @Date: 2020-01-15
*/
@SuppressWarnings("all")
public class EventEditHistoryHighLightUtil {
/**
* 传入2个字符串进行相比高亮显示
* eg:
* 原数据一:王五张三
* 原数据二:张三李四
* <span style='color:red'>王五</span>张三
* 张三<span style='color:red'>李四</span>
*/
public static String[] getHighLightDifferentOld(String a, String b) {
String[] temp = getDiff(a, b);
String[] result = {getHighLight(a, temp[0]), getHighLight(b, temp[1])};
return result;
}
private static String getHighLight(String source, String temp) {
StringBuffer sb = new StringBuffer();
char[] sourceChars = source.toCharArray();
char[] tempChars = temp.toCharArray();
boolean flag = false;
for (int i = 0; i < sourceChars.length; i++) {
if (tempChars[i] != ' ') {
if (i == 0) {
sb.append("<span style='color:red'>").append(sourceChars[i]);
} else if (flag) {
sb.append(sourceChars[i]);
} else {
sb.append("<span style='color:red'>").append(sourceChars[i]);
}
flag = true;
if (i == sourceChars.length - 1) {
sb.append("</span>");
}
} else if (flag) {
sb.append("</span>").append(sourceChars[i]);
flag = false;
} else {
sb.append(sourceChars[i]);
}
}
return sb.toString();
}
public static String[] getDiff(String a, String b) {
String[] result = null;
//选取长度较小的字符串用来穷举子串
if (a.length() < b.length()) {
result = getDiff(a, b, 0, a.length());
} else {
result = getDiff(b, a, 0, b.length());
result = new String[]{result[1], result[0]};
}
return result;
}
/**
* 将a的指定部分与b进行比较生成比对结果
*/
private static String[] getDiff(String a, String b, int start, int end) {
String[] result = new String[]{a, b};
int len = result[0].length();
while (len > 0) {
for (int i = start; i < end - len + 1; i++) {
String sub = result[0].substring(i, i + len);
int idx = -1;
if ((idx = result[1].indexOf(sub)) != -1) {
result[0] = setEmpty(result[0], i, i + len);
result[1] = setEmpty(result[1], idx, idx + len);
if (i > 0) {
//递归获取空白区域左边差异
result = getDiff(result[0], result[1], 0, i);
}
if (i + len < end) {
//递归获取空白区域右边差异
result = getDiff(result[0], result[1], i + len, end);
}
len = 0;//退出while循环
break;
}
}
len = len / 2;
}
return result;
}
/**
* 将字符串s指定的区域设置成空格
*/
public static String setEmpty(String s, int start, int end) {
char[] array = s.toCharArray();
for (int i = start; i < end; i++) {
array[i] = ' ';
}
return new String(array);
}
//--------------new -------------------------
public static String[] getHighLightDifferent(String altbe, String altaf) {
//字符串1 altbe 字符串2 altaf
List<Integer> beList = rememberSpacing(altbe);
List<Integer> afList = rememberSpacing(altaf);
altbe = altbe.replace(" ", "");
altaf = altaf.replace(" ", "");
LinkedList<DiffMatchPatch.Diff> t = new DiffMatchPatch().diff_main(altbe, altaf);
StringBuffer s1 = new StringBuffer();
StringBuffer s2 = new StringBuffer();
Integer indexBe = 0;
Integer indexAf = 0;
for (DiffMatchPatch.Diff diff : t) {
StringBuffer diffTextBe = new StringBuffer(diff.text);
StringBuffer diffTextAf = new StringBuffer(diff.text);
if ("EQUAL".equalsIgnoreCase(diff.operation.toString())) {
addSpacing(beList, indexBe, diffTextBe);
addSpacing(afList, indexAf, diffTextAf);
s1.append(diffTextBe);
s2.append(diffTextAf);
indexBe += diffTextBe.length();
indexAf += diffTextAf.length();
}
indexBe = appendString2("DELETE", diff, s1, s2, beList, indexBe);
indexAf = appendString2("INSERT", diff, s2, s1, afList, indexAf);
}
String[] result = new String[2];
result[0] = s1.toString();
result[1] = s2.toString();
return result;
}
// public static void appendString(String type, Diff diff, StringBuffer sbOne, StringBuffer sbTwo) {
// if (type.equals(diff.operation.toString())) {
// if (" ".equals(diff.text)) {
// sbOne.append(" ");
// sbTwo.append(" ");
// } else {
// sbOne.append("<em class='f-required'>").append(diff.text).append("</em>");
// }
// }
// }
private static List<Integer> rememberSpacing(String str) {
List<Integer> list = new ArrayList<>();
for (int i = 0; i < str.length(); i++) {
if (' ' == str.charAt(i)) {
list.add(i);
}
}
return list;
}
public static void addSpacing(List<Integer> list, Integer index, StringBuffer str) {
for (Integer o : list) {
if (o >= index && o < index + str.length()) {
str.insert(o - index, ' ');
}
}
}
public static Integer appendString2(String type, DiffMatchPatch.Diff diff, StringBuffer sbOne,
StringBuffer sbTwo, List<Integer> list, Integer i) {
Integer result = i;
if (type.equals(diff.operation.toString())) {
StringBuffer sb = new StringBuffer(diff.text);
for (Integer o : list) {
if (o >= i && o < i + sb.length()) {
sb.insert(o - i, ' ');
}
}
sbOne.append("<span style='color:red;'>").append(sb).append("</span>");
result = i + sb.length();
}
return result;
}
public static void main(String[] args) {
String a = "测试测试测试仅关注界面和功能,数据准确性在暂不测试";
String b = "提交留言数据仅关注界面和功能,数据准确性在暂不测试";
String[] anb = getHighLightDifferent(a, b);
System.out.println(Arrays.toString(anb));
// String altbe = "提交留言数据仅关注界面和 功能,数据准确性在暂不测试";
// String altaf = "提交留言数据仅关注界面和功能,数据准确性在暂不测试提交 留言数据仅关注界面和功能,数据准确性在暂不测试";
// String[] highLightDifferentNew = getHighLightDifferent(altbe, altaf);
// System.out.println(Arrays.toString(highLightDifferentNew));
}
}
@@ -5,8 +5,10 @@ import com.adc.da.http.PageInfo;
import com.adc.da.person.dao.PersonCollectEODao;
import com.adc.da.person.dao.PersonShareEODao;
import com.adc.da.slrs.standardSplit.dao.SarStandCompareHisEODao;
import com.adc.da.slrs.standardSplit.entity.SarFileSplitInfoEO;
import com.adc.da.slrs.standardSplit.entity.SarStandCompareHisEO;
import com.adc.da.slrs.standardSplit.entity.SarStandCompareHisEOPage;
import com.adc.da.slrs.standardSplit.service.SarFileSplitInfoEOService;
import com.adc.da.slrs.standardSplit.service.SarItemsCompareHisEOService;
import com.adc.da.slrs.standardSplit.service.SarStandCompareHisEOService;
import com.adc.da.slrs.standardSplit.service.SarStandItemsCompareHisEOService;
@@ -36,6 +38,9 @@ public class SarStandCompareHisEOController extends BaseController<SarStandCompa
@Autowired
private SarStandCompareHisEOService sarStandCompareHisEOService;
@Autowired
private SarFileSplitInfoEOService sarFileSplitInfoEOService;
@Autowired
private SarStandItemsCompareHisEOService sarStandItemsCompareHisEOService;
@@ -124,17 +129,35 @@ public class SarStandCompareHisEOController extends BaseController<SarStandCompa
@ApiOperation(value = "条款比对")
@PostMapping("/clauseComparison")
public ResponseMessage<Map<String,Object>> clauseComparison(String oldItemId, String newItemId, String standHisId) throws Exception {
Map<String,Object> resultMap = sarStandCompareHisEOService.clauseComparison(oldItemId,newItemId,standHisId);
public ResponseMessage<Map<String,Object>> clauseComparison(String oldItemId, String newItemId, String standHisId,String flag) throws Exception {
Map<String,Object> resultMap = sarStandCompareHisEOService.clauseComparisonEvent(oldItemId,newItemId,standHisId,flag);
return Result.success(resultMap);
}
@ApiOperation(value = "全文比对")
@PostMapping("/fullTextComparison")
public ResponseMessage<String> fullTextComparison(String leftStandard, String rightStandard) throws Exception {
String id=UUIDUtils.randomUUID(32);
SarStandCompareHisEO sarStandCompareHisEO =new SarStandCompareHisEO();
SarFileSplitInfoEO leftInfo = sarFileSplitInfoEOService.selectByPrimaryKey(leftStandard);
SarFileSplitInfoEO rightInfo = sarFileSplitInfoEOService.selectByPrimaryKey(rightStandard);
//保存标准比对历史表数据
SarStandCompareHisEO sarStandCompareHisEO = new SarStandCompareHisEO();
// String id = UUIDUtils.randomUUID20();
String id=UUIDUtils.randomUUID(32);
sarStandCompareHisEO.setId(id);
sarStandCompareHisEO.setOldStandId(leftStandard);
sarStandCompareHisEO.setNewStandId(rightStandard);
sarStandCompareHisEO.setOldFileType(leftInfo.getFileType());
sarStandCompareHisEO.setNewFileType(rightInfo.getFileType());
sarStandCompareHisEO.setOldStandName(leftInfo.getStandNameSplit());
sarStandCompareHisEO.setNewStandName(rightInfo.getStandNameSplit());
sarStandCompareHisEO.setOldStandNum(leftInfo.getStandNumSplit());
sarStandCompareHisEO.setNewStandNum(rightInfo.getStandNumSplit());
sarStandCompareHisEO.setOldSarType(leftInfo.getSarType());
sarStandCompareHisEO.setNewSarType(rightInfo.getSarType());
sarStandCompareHisEO.setCreateTime(new Date());
sarStandCompareHisEO.setModifyTime(new Date());
sarStandCompareHisEO.setCreateUser(LoginUserUtil.getUserId());
sarStandCompareHisEO.setModifyUser(LoginUserUtil.getUserId());
sarStandCompareHisEO.setCompareStatus("比对中");
sarStandCompareHisEO.setCompareType("全文比对");
sarStandCompareHisEO.setCreateTime(new Date());
@@ -21,5 +21,7 @@ public interface SarStandCompareHisEOService {
Map<String,Object> clauseComparison(String oldItemId, String newItemId, String standHisId);
Map<String,Object> clauseComparisonEvent(String oldItemId, String newItemId, String standHisId,String flag);
Map<String,Object> fullTextComparison(String leftStandard, String rightStandard,String id) throws Exception;
}
@@ -383,6 +383,7 @@ public class SarFileSplitMenuEOServiceImpl implements SarFileSplitMenuEOService
sarFileSplitItemsEO.setModifyTime(new Date());
sarFileSplitItemsEO.setCreationUser(LoginUserUtil.getUserId());
sarFileSplitItemsEO.setModifyUser(LoginUserUtil.getUserId());
sarFileSplitItemsEO.setEditFlag(String.valueOf(UUID.randomUUID()));
result += sarFileSplitItemsEODao.insertSelective(sarFileSplitItemsEO);
// SAR_FILE_ITEMS_VAL 添加数据,
@@ -1,6 +1,7 @@
package com.adc.da.slrs.standardSplit.service.impl;
import com.adc.da.person.service.IPersonCollectEOService;
import com.adc.da.slrs.standardSplit.EventUtils.EventEditHistoryHighLightUtil;
import com.adc.da.slrs.standardSplit.dao.SarStandAttrDetailsEODao;
import com.adc.da.slrs.standardSplit.dao.SarStandCompareHisEODao;
import com.adc.da.slrs.standardSplit.entity.*;
@@ -14,6 +15,7 @@ import com.adc.da.utils.treetool.TreeNode;
import com.adc.da.utils.util.CompHanLPUtils;
import com.adc.da.utils.util.DiffUtils;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.util.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -112,6 +114,138 @@ public class SarStandCompareHisEOServiceImpl implements SarStandCompareHisEOServ
return sarStandCompareHisEODao.deleteByPrimaryKey(id);
}
@Override
public Map<String, Object> clauseComparisonEvent(String oldItemId, String newItemId, String standHisId, String flag) {
Map<String,Object> resultMap = new HashMap<String, Object>();
String oldTxt = "";
SarFileSplitItemsValEOPage oldPage = new SarFileSplitItemsValEOPage();
oldPage.setItemId(oldItemId);
oldPage.setType("TEXT");
oldPage.setOrderBy("DISPLAY_SEQ,ID");
List<SarFileSplitItemsValEO> oldList = sarFileSplitItemsValEOService.queryByList(oldPage);
if(oldList!=null && !oldList.isEmpty()){
for(int i = 1;i<=oldList.size();i++){
if(i==oldList.size()) {
oldTxt += oldList.get(i-1).getItemContent();
}else{
oldTxt += oldList.get(i-1).getItemContent() + "i#2\n";
}
}
}
String newTxt = "";
SarFileSplitItemsValEOPage newPage = new SarFileSplitItemsValEOPage();
newPage.setItemId(newItemId);
newPage.setType("TEXT");
newPage.setOrderBy("DISPLAY_SEQ,ID");
List<SarFileSplitItemsValEO> newList = sarFileSplitItemsValEOService.queryByList(newPage);
if(newList!=null && !newList.isEmpty()){
for(int i = 1;i<=newList.size();i++){
if(i==newList.size()) {
newTxt += newList.get(i-1).getItemContent();
}else{
newTxt += newList.get(i-1).getItemContent() + "i#2\n";
}
}
}
String similarityDegree="";
double similarity = 100.00;
if(!StringUtils.isNotBlank(oldTxt.trim()) && !StringUtils.isNotBlank(newTxt.trim())){
similarityDegree = "100.00";
}else if(StringUtils.isNotBlank(oldTxt.trim()) && StringUtils.isNotBlank(newTxt.trim())){
similarity = CompHanLPUtils.findSimilarity(oldTxt.trim(), newTxt.trim());
NumberFormat nf = java.text.NumberFormat.getPercentInstance();
//nf.setMaximumIntegerDigits(2);//小数点前保留几位
nf.setMinimumFractionDigits(2);// 小数点后保留几位
similarityDegree = nf.format(similarity);
}else{
similarity = 0.00;
similarityDegree = "0.00";
}
resultMap.put("similarityDegree",similarityDegree);
List<String> leftString = new ArrayList<>();
List<String> rightString = new ArrayList<>();
if(similarity >= 0.6){
// DiffUtils diffUtils = new DiffUtils();
// List<String> htmlDiffStr = diffUtils.getHtmlDiffStr(oldTxt.trim(), newTxt.trim());
// List<String> stringList1 = Arrays.asList(htmlDiffStr.get(0).split("<br/>"));
// for(String left : stringList1){
// StringBuilder stringBuilder = new StringBuilder(left);
// stringBuilder.append("</br>");
// leftString.add(stringBuilder.toString());
// }
// List<String> stringList2 = Arrays.asList(htmlDiffStr.get(1).split("<br/>"));
// for(String right : stringList2){
// StringBuilder stringBuilder = new StringBuilder(right);
// stringBuilder.append("</br>");
// rightString.add(stringBuilder.toString());
// }
String[] anb = EventEditHistoryHighLightUtil.getHighLightDifferent(oldTxt.trim(), newTxt.trim());
if(StringUtils.isNotBlank(flag) && flag.equals("2")){
anb[0] = anb[0].replaceAll("red;", "#000000;background-color: red;").replaceAll("i#2\n", "<br/>");
anb[1] = anb[1].replaceAll("red;", "#000000;background-color: rgb(51, 145, 206);").replaceAll("i#2\n", "<br/>");
}else {
anb[0] = anb[0].replaceAll("red;", "#000000;background-color: rgb(51, 145, 206);").replaceAll("i#2\n", "<br/>");
anb[1] = anb[1].replaceAll("red;", "#000000;background-color: red;").replaceAll("i#2\n", "<br/>");
}
resultMap.put("leftString",anb[0]);
resultMap.put("rightString",anb[1]);
}else{
String oldTxtTemp = oldTxt.replace("i#2\n", "<br/>");
List<String> stringList1 = Arrays.asList(oldTxtTemp.split("<br/>"));
for(String left : stringList1){
StringBuilder stringBuilder = new StringBuilder(left);
stringBuilder.append("</div>");
stringBuilder.insert(0,"<div>");
leftString.add(stringBuilder.toString());
}
resultMap.put("leftString",leftString);
String newTxtTemp = newTxt.replace("i#2\n", "<br/>");
List<String> stringList2 = Arrays.asList(newTxtTemp.split("<br/>"));
for(String right : stringList2){
StringBuilder stringBuilder = new StringBuilder(right);
stringBuilder.append("</div>");
stringBuilder.insert(0,"<div>");
rightString.add(stringBuilder.toString());
}
resultMap.put("rightString",rightString);
}
//往条款比对历史表中添加数据
if(standHisId != null && !standHisId.isEmpty()){
SarFileSplitItemsEO leftEo = sarFileSplitItemsEOService.selectByPrimaryKey(oldItemId);
SarFileSplitItemsEO rightEo = sarFileSplitItemsEOService.selectByPrimaryKey(newItemId);
String leftItemsText = "";
if(leftString != null && !leftString.isEmpty()){
for(String left : leftString){
leftItemsText += left;
}
}
String rightItemsText = "";
if(rightString != null && !rightString.isEmpty()){
for(String right : rightString){
rightItemsText += right;
}
}
SarItemsCompareHisEO sarItemsCompareHisEO = new SarItemsCompareHisEO();
sarItemsCompareHisEO.setId(UUIDUtils.randomUUID20());
sarItemsCompareHisEO.setOldItemsId(leftEo.getId());
sarItemsCompareHisEO.setOldItemsName(leftEo.getItemsName());
sarItemsCompareHisEO.setOldItemsNum(leftEo.getItemsNum());
sarItemsCompareHisEO.setOldItemsText(leftItemsText);
sarItemsCompareHisEO.setNewItemsId(rightEo.getId());
sarItemsCompareHisEO.setNewItemsName(rightEo.getItemsName());
sarItemsCompareHisEO.setNewItemsNum(rightEo.getItemsNum());
sarItemsCompareHisEO.setNewItemsText(rightItemsText);
sarItemsCompareHisEO.setStandHisId(standHisId);
sarItemsCompareHisEO.setSimilarityDegree(similarityDegree);
sarItemsCompareHisEO.setCreateUser(LoginUserUtil.getUserId());
sarItemsCompareHisEO.setModifyUser(LoginUserUtil.getUserId());
sarItemsCompareHisEO.setModifyTime(new Date());
sarItemsCompareHisEO.setCreateTime(new Date());
sarItemsCompareHisEOService.insertSelective(sarItemsCompareHisEO);
}
return resultMap;
}
@Override
public Map<String, Object> clauseComparison(String oldItemId, String newItemId, String standHisId) {
Map<String,Object> resultMap = new HashMap<String, Object>();
@@ -326,20 +460,6 @@ public class SarStandCompareHisEOServiceImpl implements SarStandCompareHisEOServ
SarStandCompareHisEO sarStandCompareHisEO = new SarStandCompareHisEO();
// String id = UUIDUtils.randomUUID20();
sarStandCompareHisEO.setId(id);
sarStandCompareHisEO.setOldStandId(leftStandId);
sarStandCompareHisEO.setNewStandId(rightStandId);
sarStandCompareHisEO.setOldFileType(leftInfo.getFileType());
sarStandCompareHisEO.setNewFileType(rightInfo.getFileType());
sarStandCompareHisEO.setOldStandName(leftInfo.getStandNameSplit());
sarStandCompareHisEO.setNewStandName(rightInfo.getStandNameSplit());
sarStandCompareHisEO.setOldStandNum(leftInfo.getStandNumSplit());
sarStandCompareHisEO.setNewStandNum(rightInfo.getStandNumSplit());
sarStandCompareHisEO.setOldSarType(leftInfo.getSarType());
sarStandCompareHisEO.setNewSarType(rightInfo.getSarType());
sarStandCompareHisEO.setCreateTime(new Date());
sarStandCompareHisEO.setModifyTime(new Date());
sarStandCompareHisEO.setCreateUser(LoginUserUtil.getUserId());
sarStandCompareHisEO.setModifyUser(LoginUserUtil.getUserId());
sarStandCompareHisEO.setCompareType(compareType);
sarStandCompareHisEO.setCompareStatus("比对完成");
dao.updateByPrimaryKeySelective(sarStandCompareHisEO);
@@ -58,5 +58,12 @@ public class WgDept extends BaseEntity {
@TableField("join_id")
private String joinId;
@ApiModelProperty(value = "手机号")
@TableField("phone")
private String phone;
@ApiModelProperty(value = "邮箱")
@TableField("email")
private String email;
}
@@ -44,5 +44,14 @@ public class WgNetInfo extends BaseEntity {
@TableField("join_id")
private String joinId;
@ApiModelProperty(value = "手机号")
@TableField("phone")
private String phone;
@ApiModelProperty(value = "邮箱")
@TableField("email")
private String email;
}
@@ -2,6 +2,7 @@ package com.adc.da.utils.util;
import com.adc.da.util.LoginUserUtil;
import com.adc.da.util.UUIDUtils;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
import java.io.BufferedReader;
@@ -11,7 +12,10 @@ import java.sql.Clob;
import java.sql.SQLException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* @Description: 处理各类型字段
@@ -99,11 +103,17 @@ public class FieldConvertUtil {
* @Return: java.lang.String
*/
public static String changeTimeValue (String timeStr) {
if (StringUtils.isNotBlank(timeStr)) {
timeStr = "str_to_date('" + timeStr + "','%Y-%m-%d %H:%i:%s')";
} else {
timeStr = "null";
}
if (StringUtils.isNotBlank(timeStr)) {
List<String> timeList = Arrays.asList(timeStr.split(","));
List<String> collect = timeList.stream()
.map(item -> "str_to_date('" + item + "','%Y-%m-%d %H:%i:%s')")
.collect(Collectors.toList());
timeStr ="concat(" + String.join(", \',\' ,", collect) + ")";
} else {
timeStr = "null";
}
return timeStr;
}
@@ -17,7 +17,10 @@
wg_leader,
draft_time,
release_time,
unit
unit,
(SELECT GROUP_CONCAT(UNAME) from ts_user WHERE find_in_set(USID,drafter) ) as drafterName,
(SELECT GROUP_CONCAT(UNAME) from ts_user WHERE find_in_set(USID,res_person) ) as res_personName,
(SELECT GROUP_CONCAT(UNAME) from ts_user WHERE find_in_set(USID,wg_leader) ) as wg_leaderName
</sql>
<resultMap id="BaseInfoMap" type="com.adc.da.slrs.esRevisePlan.entity.EsRevisePlan">
<id property="id" column="id"></id>
@@ -206,4 +209,12 @@
#{id}
</foreach>
</delete>
<select id="selectPageByName" resultMap="BaseInfoMap">
select <include refid="BaseInfo"></include> from es_revise_plan
where es_name = #{esName}
<if test="id != null and id != '' ">
and id != #{id}
</if>
</select>
</mapper>
@@ -0,0 +1,5 @@
<?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.evaluationIndex.dao.EvaluationIndexDao">
</mapper>
@@ -37,19 +37,20 @@
<result column="standSortShow" property="standSortShow" />
<result column="stand_year" property="standYear" />
<result column="text_status_buss" property="textStatusBuss" />
<result column="stand_number" property="standNumber" />
</resultMap>
<!-- SAR_BUSSIONESS_STAND table all fields -->
<sql id="Base_Column_List" >
modify_time, creation_time, valid_flag, stand_status, replaced_stand_num,replace_stand_num,
put_time, issue_time,stand_en_name,stand_name, stand_code, id,apply_country, stand_nature, stand_sort,text_status_buss
put_time, issue_time,stand_en_name,stand_name, stand_code, id,apply_country, stand_nature, stand_sort,text_status_buss,stand_number
</sql>
<sql id="Base_Column_List_show" >
SAR_BUSSIONESS_STAND.modify_time,
SAR_BUSSIONESS_STAND.creation_time, SAR_BUSSIONESS_STAND.valid_flag,
SAR_BUSSIONESS_STAND.apply_country, SAR_BUSSIONESS_STAND.stand_nature,SAR_BUSSIONESS_STAND.stand_sort,SAR_BUSSIONESS_STAND.stand_year,
stand_status, replaced_stand_num,replace_stand_num,put_time,issue_time,stand_en_name,
stand_name, stand_code,SAR_BUSSIONESS_STAND.id,SAR_BUSSIONESS_STAND.text_status_buss
stand_name, stand_code,SAR_BUSSIONESS_STAND.id,SAR_BUSSIONESS_STAND.text_status_buss,SAR_BUSSIONESS_STAND.stand_number
</sql>
<sql id="Group_Column_List_show" >
@@ -168,6 +169,7 @@
<if test="standNature != null" >stand_Nature,</if>
<if test="standSort != null" >stand_sort,</if>
<if test="standYear != null" >stand_year,</if>
<if test="standNumber != null" >stand_number,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="modifyTime != null" >#{modifyTime, jdbcType=TIMESTAMP},</if>
@@ -187,6 +189,7 @@
<if test="standNature != null" >#{standNature, jdbcType=VARCHAR},</if>
<if test="standSort != null" >#{standSort, jdbcType=VARCHAR},</if>
<if test="standYear != null" >#{standYear, jdbcType=VARCHAR},</if>
<if test="standNumber != null" >#{standNumber, jdbcType=VARCHAR},</if>
</trim>
</insert>
@@ -246,6 +249,9 @@
<if test="standYear != null" >
stand_year = #{standYear},
</if>
<if test="standNumber != null" >
stand_number = #{standNumber},
</if>
</set>
where id = #{id}
</update>
@@ -301,6 +307,9 @@
<if test="standYear != null" >
stand_year = #{standYear},
</if>
<if test="standNumber != null" >
stand_number = #{standNumber},
</if>
</set>
where id = #{id}
</update>
@@ -373,7 +382,7 @@
when tmp_tb.stand_code like concat('%', 'Q/QCFLC', '%') THEN 16
ELSE 17
END,
tmp_tb.stand_sort ASC
tmp_tb.stand_sort ASC,CAST(tmp_tb.STAND_NUMBER AS decimal(9,2)) ASC,tmp_tb.STAND_YEAR DESC,tmp_tb.id
</sql>
<sql id="standSort_out">
ORDER BY
@@ -0,0 +1,5 @@
<?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.sarEnterpriseStandardEvaluation.dao.EvaluationIndexDao">
</mapper>
@@ -0,0 +1,24 @@
<?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.sarEnterpriseStandardEvaluation.dao.QualityEvaluationDao">
<select id="getHistory"
resultType="com.adc.da.slrs.sarEnterpriseStandardEvaluation.entity.QualityEvaluation">
SELECT
`user`.UNAME AS userName,
eva.user_id,
avg(eva.score * iex.weight) AS score,
iex.index_type as valueType
FROM
quality_evaluation AS eva
LEFT JOIN ts_user `user` ON eva.user_id = `user`.USID
LEFT JOIN evaluation_index AS iex ON eva.evaluation_index = iex.id
GROUP BY
userName,
eva.user_id,
index_type
${ew.customSqlSegment}
</select>
</mapper>
@@ -40,9 +40,11 @@
select ts_user.EMAIL,ts_user.ACCOUNT,ts_user.CREATION_TIME,ts_user.DISABLE_FLAG,ts_user.EXT_INFO,ts_user.USID,
ts_user.INSTITUTION_ID,ts_user.INSTITUTION_NAME,ts_user.MODIFY_TIME,ts_user.OPER_USER,ts_user.PASSWORD,ts_user.PHONE,
ts_user.POSITION_ID,ts_user.POSITION_NAME,ts_user.SEX,ts_user.SSO_ID,ts_user.STATE,ts_user.UNLOCK_FLAG,ts_user.USER_SOURCE,
ts_user.USER_TYPE,ts_user.VALID_FLAG,ts_user.WORK_NUM,concat(ts_user.UNAME,concat(concat("(",ts_user.ACCOUNT),")")) as uname
ts_user.USER_TYPE,ts_user.VALID_FLAG,ts_user.WORK_NUM,concat(ts_user.UNAME,concat(concat("(",ts_user.ACCOUNT),")")) as uname,
ts_institution.name as unit,ts_institution.id as unitId
from ts_user
WHERE institution_id=#{institutionId}
left join ts_institution ON ts_institution.id = (SELECT parent_id from ts_institution WHERE id = ts_user.INSTITUTION_ID)
WHERE institution_id=#{institutionId}
<if test="userName != null and userName != '' ">
and ( ts_user.ACCOUNT like concat(concat('%',#{userName}),'%') or ts_user.UNAME like concat(concat('%',#{userName}),'%') )
</if>
@@ -44,6 +44,86 @@
#{item}
</foreach>
</where>
UNION ALL
SELECT
a.ID,
a.STAND_CODE AS standNumber,
a.STAND_NAME AS standName,
a.STAND_EN_NAME,
b.NYLXCLASS,
null AS SSRQ,
null AS XCXSSRQGJ,
null AS ZCCSSRQGJ,
null as ZRBM,
null as SYCPX,
null as CYCVPPSBM,
null as CYCVPPSCN,
null as KCCVPPSBM,
null as KCCVPPSCN,
null as typeApplicable,
dicstandSort.DIC_TYPE_NAME AS standSortShow,
null as standYear,
null as issueTime,
null asstandType,
null AS textStatus
FROM
sar_bussioness_stand a
LEFT JOIN sar_buss_stand_attr_info b ON a.ID = b.STAND_ID
LEFT JOIN TS_DICTYPE dicstandSort ON (
dicstandSort.dic_type_code = a.stand_sort
AND dicstandSort.dic_id IS NOT NULL
AND dicstandSort.valid_flag = 0
AND dicstandSort.PARENT_ID IS NULL
)
<where>
a.ID IN
<foreach collection="param1" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</where>
UNION ALL
SELECT
a.ID,
a.LAWS_NUMBER AS standNumber,
a.LAWS_NAME AS standName,
a.LAWS_EN_NAME as STAND_EN_NAME,
b.NYLXLAWS,
b.SSRQLAWS AS SSRQ,
b.XCXSSRQLAWS AS XCXSSRQGJ,
b.ZCXSSRQLAWS AS ZCCSSRQGJ,
b.ZRBMLAWS as ZRBM,
null as SYCPX,
null as CYCVPPSBM,
null as CYCVPPSCN,
null as KCCVPPSBM,
null as KCCVPPSCN,
null as typeApplicable,
dicstandSort.DIC_TYPE_NAME AS standSortShow,
a.LAWS_YEAR as standYear,
a.ISSUE_TIME as issueTime,
null asstandType,
null AS textStatus
FROM
sar_laws_stand_info a
LEFT JOIN sar_laws_attr_info b ON a.ID = b.LAWS_ID
LEFT JOIN TS_DICTYPE dicstandSort ON (
dicstandSort.dic_type_code = a.LAWS_TYPE
AND dicstandSort.dic_id IS NOT NULL
AND dicstandSort.valid_flag = 0
AND dicstandSort.PARENT_ID IS NULL
)
<where>
a.ID IN
<foreach collection="param1" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</where>
</select>
<select id="selectLawsByIdE" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto">
@@ -99,95 +179,43 @@
order by number
</select>
<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,
b.ZRBM,b.SYCPX,b.CYCVPPSBM,b.CYCVPPSCN,b.KCCVPPSBM,b.KCCVPPSCN,b.CLLX as typeApplicable,a.STAND_SORT as standSortShow,
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_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
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},'%'))
and
</if>
<if test="fileType !=null">
ssi.FILE_TYPE = #{fileType} and
and ssi.FILE_TYPE = #{fileType}
</if>
<if test="standType !=null">
a.STAND_TYPE = #{standType} and
and a.STAND_TYPE = #{standType}
</if>
a.ID IN
<foreach collection="param1" index="index" item="item" open="(" separator="," close=")">
#{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
<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
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_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
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">
@@ -196,21 +224,82 @@
or a.STAND_NAME LIKE concat ('%',#{standName,jdbcType=VARCHAR},'%'))
</if>
<if test="fileType !=null">
and
ssi.FILE_TYPE = #{fileType}
and ssi.FILE_TYPE = #{fileType}
</if>
<if test="standType !=null">
and
a.STAND_TYPE = #{standType}
and a.STAND_TYPE = #{standType}
</if>
<if test="param1 !=null and param1.size()>0 " >
and
a.ID IN
<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
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 id="selectTimes" resultType="com.adc.da.slrs.sarLawsAttrDetailedList.entity.StandRegionalTimeDto">
@@ -7,4 +7,21 @@
INNER JOIN sar_public_idea_all on sar_public_idea_all.idea_id = sar_public_idea.id
WHERE sar_public_idea_all.idea_id IS NOT NULL and sar_public_idea.uniques = #{unique}
</select>
<select id="getAllDataByIdea" resultType="com.adc.da.slrs.sarStandIdea.entity.SarPublicIdeaAll">
SELECT sar_public_idea_all.id,sar_public_idea_all.reason,ts_user.INSTITUTION_NAME as dept_name,sar_public_idea_all.old_text,
sar_public_idea_all.new_text,ts_user.INSTITUTION_ID as dept_id,sar_public_idea_all.part_code,sar_public_idea_all.user_name,
sar_public_idea_all.user_id,sar_public_idea_all.content,sar_public_idea_all.idea_id,sar_public_idea_all.cid
FROM sar_public_idea_all
left join ts_user on sar_public_idea_all.user_id=ts_user.USID
WHERE
sar_public_idea_all.idea_id = #{ideaId}
LIMIT ${(page-1)*size},${page*size}
</select>
<select id="getAllDataByIdeaCount" resultType="java.lang.Integer">
SELECT count(id)
FROM sar_public_idea_all WHERE
idea_id = #{ideaId}
</select>
</mapper>

Some files were not shown because too many files have changed in this diff Show More