Merge branch 'develop_master' into develop_migration
This commit is contained in:
@@ -43,6 +43,12 @@
|
||||
<version>5.5.13</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt</artifactId>
|
||||
<version>0.9.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.adc.da.util;
|
||||
|
||||
import io.jsonwebtoken.Claims;
|
||||
import io.jsonwebtoken.ExpiredJwtException;
|
||||
import io.jsonwebtoken.Jwts;
|
||||
import io.jsonwebtoken.SignatureAlgorithm;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* token 工具类
|
||||
*
|
||||
* @author ch
|
||||
* @version 1.0.0
|
||||
* @since 1.0.0
|
||||
* <p>
|
||||
* Created at 2020/7/30 2:23 下午
|
||||
*/
|
||||
@Component
|
||||
public class JwtSysUtils {
|
||||
|
||||
// 过期时间
|
||||
private static long expire = 6048000;
|
||||
// 秘钥
|
||||
private static String secret = "HSyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9";
|
||||
|
||||
/**
|
||||
* 创建一个token
|
||||
*
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
public String generateToken(String userId) {
|
||||
Date now = new Date();
|
||||
Date expireDate = new Date(now.getTime() + expire);
|
||||
return Jwts.builder().setHeaderParam("type", "JWT").setSubject(userId).setIssuedAt(now)
|
||||
.setExpiration(expireDate).signWith(
|
||||
SignatureAlgorithm.HS512, secret).compact();
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析token
|
||||
*/
|
||||
public Claims getClaimsByToken(String token) {
|
||||
Claims claims;
|
||||
try {
|
||||
claims = Jwts.parser()
|
||||
.setSigningKey(secret) // 设置标识名
|
||||
.parseClaimsJws(token) //解析token
|
||||
.getBody();
|
||||
} catch (ExpiredJwtException e) {
|
||||
claims = e.getClaims();
|
||||
}
|
||||
return claims;
|
||||
}
|
||||
|
||||
public String getUserIdByToken(){
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
String user = "";
|
||||
if(attributes != null){
|
||||
HttpServletRequest request = attributes.getRequest();
|
||||
Claims claim = getClaimsByToken(request.getHeader("token"));
|
||||
user = claim.getSubject();
|
||||
}
|
||||
return user;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,21 +15,7 @@ public class LoginUserUtil {
|
||||
*
|
||||
*/
|
||||
public static String getUserId() {
|
||||
String userId = null;
|
||||
try {
|
||||
Subject subject = SecurityUtils.getSubject();
|
||||
Object object=subject.getPrincipal();
|
||||
if(object!=null){
|
||||
String json = JSONObject.toJSONString(object);
|
||||
if(json!=null && json.length()>0){
|
||||
Map<String, Object> userInfo=JSONObject.parseObject(json, Map.class);
|
||||
userId=userInfo.get("id").toString();
|
||||
}
|
||||
}
|
||||
} catch (UnavailableSecurityManagerException e) {
|
||||
} catch (InvalidSessionException e) {
|
||||
}
|
||||
return userId;
|
||||
return UserSysUtils.getUserId();
|
||||
}
|
||||
|
||||
public static String getUserParamValue() {
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
package com.adc.da.util;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.apache.shiro.UnavailableSecurityManagerException;
|
||||
import org.apache.shiro.authz.SimpleAuthorizationInfo;
|
||||
import org.apache.shiro.session.InvalidSessionException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class UserSysUtils {
|
||||
|
||||
private UserSysUtils() {
|
||||
super();
|
||||
}
|
||||
|
||||
private static Logger logger = LoggerFactory.getLogger(UserSysUtils.class);
|
||||
|
||||
/**
|
||||
* 当前登陆用户
|
||||
*/
|
||||
public static final String CURRENT_USER = "currentUser";
|
||||
|
||||
/**
|
||||
* 角色信息
|
||||
*/
|
||||
public static final String CACHE_ROLE_LIST = "roleList";
|
||||
/**
|
||||
* 菜单信息
|
||||
*/
|
||||
public static final String CACHE_MENU_LIST = "menuList";
|
||||
public static final String CACHE_MENU_TREE = "menuTree";
|
||||
public static final String CACHE_AREA_LIST = "areaList";
|
||||
public static final String CACHE_OFFICE_LIST = "officeList";
|
||||
|
||||
/**
|
||||
* @see JwtSysUtils
|
||||
*/
|
||||
private static JwtSysUtils jwtUtils = SpringContextHolder1.getBean(JwtSysUtils.class);
|
||||
|
||||
/**
|
||||
* 退出
|
||||
*/
|
||||
public static void logout() {
|
||||
try {
|
||||
SecurityUtils.getSubject().logout();
|
||||
} catch (UnavailableSecurityManagerException e) {
|
||||
logger.error(e.getMessage(),e);
|
||||
} catch (InvalidSessionException e) {
|
||||
logger.error(e.getMessage(),e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取当前登陆用户ID
|
||||
* @throws Exception
|
||||
*/
|
||||
public static String getUserId() {
|
||||
return jwtUtils.getUserIdByToken();
|
||||
}
|
||||
|
||||
|
||||
public static void flush() {
|
||||
CacheUtils.removeCache(CURRENT_USER);
|
||||
}
|
||||
|
||||
private static final class CacheUtils {
|
||||
|
||||
public static Object getCache(String key) {
|
||||
return getCache(key, null);
|
||||
}
|
||||
|
||||
public static Object getCache(String key, Object defaultValue) {
|
||||
Object obj = getCacheMap().get(key);
|
||||
return obj == null ? defaultValue : obj;
|
||||
}
|
||||
|
||||
public static void putCache(String key, Object value) {
|
||||
getCacheMap().put(key, value);
|
||||
}
|
||||
|
||||
public static void removeCache(String key) {
|
||||
getCacheMap().remove(key);
|
||||
}
|
||||
|
||||
public static Map<String, Object> getCacheMap() {
|
||||
Map<String, Object> map = Maps.newHashMap();
|
||||
return map;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -90,7 +90,7 @@ public class DocConverterPdf {
|
||||
System.out.println("源文件不存在");
|
||||
return;
|
||||
}
|
||||
SocketOpenOfficeConnection connection = new SocketOpenOfficeConnection("0.0.0.0", 8100);
|
||||
SocketOpenOfficeConnection connection = new SocketOpenOfficeConnection("10.100.5.122", 8100);
|
||||
// SocketOpenOfficeConnection connection = new SocketOpenOfficeConnection("10.10.66.176", 8100);
|
||||
try {
|
||||
connection.connect();
|
||||
|
||||
@@ -65,9 +65,9 @@ public class SendConvertMQService {
|
||||
private static final Logger logger = LoggerFactory.getLogger(SendConvertMQService.class);
|
||||
|
||||
@RabbitListener(bindings = @QueueBinding(
|
||||
value = @Queue(value = "createConvertStandMQ_SQ_GSAR", durable = "true"),
|
||||
exchange = @Exchange(value = "convert-exchange_SQ_GSAR", ignoreDeclarationExceptions = "true"),
|
||||
key = "convert-key_SQ_GSAR"))
|
||||
value = @Queue(value = "createConvertStandMQ_SQ_GSAR_RELEASE", durable = "true"),
|
||||
exchange = @Exchange(value = "convert-exchange_SQ_GSAR_RELEASE", ignoreDeclarationExceptions = "true"),
|
||||
key = "convert-key_SQ_GSAR_RELEASE"))
|
||||
public void createMQ(Map<String,Object> convertInfo, Message message, Channel channel) throws Exception{
|
||||
try{
|
||||
try{
|
||||
|
||||
@@ -62,6 +62,12 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
||||
addInterceptor.excludePathPatterns("/api/att/attFile/downloadFileForSar");
|
||||
//水印下载
|
||||
addInterceptor.excludePathPatterns("/api/att/attFile/downloadFileForSarWaterMark");
|
||||
//企业标准导出
|
||||
addInterceptor.excludePathPatterns("/api/lawss/sarBussionessStand/exportSarBussionessStand");
|
||||
|
||||
//OCR回调存储文件
|
||||
addInterceptor.excludePathPatterns("/api/ocr/OCRRestful/OcrHandleResult");
|
||||
|
||||
|
||||
// //测试接口使用
|
||||
// addInterceptor.excludePathPatterns("/api/**");
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
# dev config
|
||||
|
||||
#=============================================
|
||||
# 数据库配置
|
||||
#=============================================
|
||||
spring.datasource.driverClassName = com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.url = jdbc:mysql://39.100.23.127:3306/foton_slrs_test2?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC&useSSL=false
|
||||
#spring.datasource.url = jdbc:mysql://10.96.10.54/foton_slrs_test?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC&useSSL=false
|
||||
spring.datasource.username = root
|
||||
spring.datasource.password = root
|
||||
spring.datasource.url = jdbc:mysql://10.100.5.111:3306/foton_slrs?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC&useSSL=false
|
||||
spring.datasource.username = tempuser
|
||||
spring.datasource.password = Fting&8g35g#geg2
|
||||
|
||||
|
||||
|
||||
@@ -16,10 +15,10 @@ spring.application.name=FotonLAWSSystem
|
||||
application.code=20200101
|
||||
application.center=1
|
||||
#==============================================
|
||||
#Eruept
|
||||
#Eureka
|
||||
eureka.client.allow-redirects=true
|
||||
eureka.client.register-with-eureka=true
|
||||
eureka.client.service-url.defaultZone=http://62.234.136.153:8761/eureka/
|
||||
eureka.client.service-url.defaultZone=http://10.100.5.117:4201/eureka/
|
||||
|
||||
#==============================================
|
||||
# 邮箱配置1
|
||||
@@ -35,24 +34,18 @@ spring.mail.properties.smtp.starttls.required=false
|
||||
spring.mail.properties.mail.smtp.ssl.enable=false
|
||||
spring.mail.port=587
|
||||
|
||||
# ==============================================
|
||||
# rabbitMQ
|
||||
# ==============================================
|
||||
#spring.rabbitmq.host=rabbitmq-cluster-01.vs.test.geely.svc
|
||||
#spring.rabbitmq.port=5672
|
||||
#spring.rabbitmq.virtual-host=uat_pcms
|
||||
#spring.rabbitmq.username=uat_pcms
|
||||
#spring.rabbitmq.password=VxsBLL5bJruwzXfS
|
||||
# spring.rabbitmq.publisher-confirms=true
|
||||
spring.rabbitmq.host=62.234.136.153
|
||||
#==============================================
|
||||
# MQ配置
|
||||
#==============================================
|
||||
spring.rabbitmq.host=10.100.5.119
|
||||
spring.rabbitmq.port=5672
|
||||
spring.rabbitmq.username=guest
|
||||
spring.rabbitmq.password=guest
|
||||
spring.rabbitmq.username=admin
|
||||
spring.rabbitmq.password=foton@admin
|
||||
spring.rabbitmq.listener.simple.acknowledge-mode= manual
|
||||
# 生产者 默认关闭 发版 需改为 true
|
||||
spring.rabbitmq.listener.direct.auto-startup=false
|
||||
spring.rabbitmq.listener.direct.auto-startup=true
|
||||
# 消费者 默认关闭 发版 需改为 true
|
||||
spring.rabbitmq.listener.simple.auto-startup=false
|
||||
spring.rabbitmq.listener.simple.auto-startup=true
|
||||
#消费失败消息干掉
|
||||
spring.rabbitmq.listener.simple.default-requeue-rejected= true
|
||||
#5秒
|
||||
@@ -63,19 +56,19 @@ spring.rabbitmq.listener.simple.retry.max-attempts= 5
|
||||
# ==============================================
|
||||
# 文档存储路径指向
|
||||
# ==============================================
|
||||
file.path=/usr/laws/file/
|
||||
file.path=/data/slrs/file
|
||||
|
||||
# 云端OCR识别集成配置参数
|
||||
#OCR请求识别URL地址
|
||||
OCR.handleFileUrl = http://61.136.1.103:8091/WebService.asmx/FileConversion
|
||||
# OCR回调接口地址 配置客户本地的IP及端口号
|
||||
OCR.callBackUrl = http://62.234.136.153:10010/api/ocr/OCRRestful/OcrHandleResult
|
||||
OCR.callBackUrl = https://slrs.foton.com.cn/api/ocr/OCRRestful/OcrHandleResult
|
||||
OCR.userId =dayuzhou1234
|
||||
OCR.authCode =123456
|
||||
OCR.publicKey =EC4KKA6ZDTCPAOCRBC5M
|
||||
# OCR文件存储路径
|
||||
OCR.ocrPath=/opt/foton-slrs/front/dist/file/
|
||||
OCR.ocrPath=/data/slrs/ocrResultFile
|
||||
# OCR文件请求下载或在线预览时URL
|
||||
OCR.ocrDownPath=http://62.234.136.153:8038/file/
|
||||
OCR.ocrDownPath=/data/slrs/ocrResultFile
|
||||
OCR.times=20
|
||||
OCR.convertType=BOTH
|
||||
@@ -9,12 +9,12 @@ spring.profiles.active=dev
|
||||
server.compression.enabled=true
|
||||
server.compression.mime-types=application/json,application/xml,text/html,text/plain,text/css,application/x-javascript
|
||||
# 端口号设置
|
||||
server.port=9999
|
||||
server.port=4202
|
||||
#主服务session超时
|
||||
server.servlet.session.timeout =600
|
||||
|
||||
#tomcat /resource/local/version-manager 创建tomcat指定临时目录
|
||||
server.tomcat.basedir=/resource/local/version-manager
|
||||
server.tomcat.basedir=/data/slrs/temp
|
||||
|
||||
# http-only
|
||||
server.session.cookie.http-only=true
|
||||
@@ -30,20 +30,14 @@ logging.level.org.springframework=info
|
||||
|
||||
# 请求前缀
|
||||
restPath=/api
|
||||
#server.servlet.context-path=/api
|
||||
|
||||
#是否将自己注册到Eureka Server上,默认为true
|
||||
eureka.client.register-with-eureka=true
|
||||
##是否从Eureka Server上获取注册信息,默认为true
|
||||
eureka.client.fetch-registry=true
|
||||
eureka.instance.prefer-ip-address=true
|
||||
|
||||
|
||||
#eureka.client.service-url.defaultZone=http://10.5.116.172:8672/eureka/
|
||||
#eureka.client.service-url.defaultZone=http://127.0.0.1:8671/eureka/
|
||||
#eureka.client.service-url.defaultZone=http://10.5.116.172:8672/eureka/
|
||||
|
||||
eureka.client.service-url.defaultZone=http://62.234.136.153:8761/eureka/
|
||||
#eureka.client.service-url.defaultZone=http://10.96.10.171:8761/eureka/
|
||||
eureka.client.service-url.defaultZone=http://10.100.5.117:4201/eureka/
|
||||
|
||||
# 请求连接的超时时间 默认的时间为 1 秒
|
||||
ribbon.ConnectTimeout=500000
|
||||
@@ -137,9 +131,9 @@ verifyCodeMode=1
|
||||
# 文件上传管控及配置
|
||||
# =============================================================================
|
||||
# file模块上传文件的服务器地址
|
||||
file.path=D:/uploadfile/bus
|
||||
# 文件下载地址参数
|
||||
file.downloadUrl=http://39.98.140.126:10001/uploadPath
|
||||
file.path=/data/slrs/file
|
||||
# 文件下载地址参数(弃用)
|
||||
file.downloadUrl=
|
||||
#上传文件白名单-以,分隔
|
||||
upload.file.white.lists = doc,docx,xls,xlsx,pdf,PDF,png,jpg,pptx,ppt
|
||||
|
||||
@@ -147,14 +141,13 @@ upload.file.white.lists = doc,docx,xls,xlsx,pdf,PDF,png,jpg,pptx,ppt
|
||||
# elasticsearch 配置
|
||||
# =============================================================================
|
||||
elasticsearch.clustername=elasticsearch
|
||||
elasticsearch.ip=172.17.0.1
|
||||
elasticsearch.ip=10.100.5.122
|
||||
elasticsearch.port=9300
|
||||
elasticsearch.poolSize=5
|
||||
elas.flag=true
|
||||
|
||||
# 文档转换TCP通讯地址
|
||||
convert.host=127.0.0.1
|
||||
#convert.host=0.0.0.0
|
||||
|
||||
# =============================================================================
|
||||
# scheduled 配置
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<!-- 项目名称 -->
|
||||
<property name="PROJECT_NAME" value="adc-da" />
|
||||
<!-- 定义日志文件的存储地址,勿在 LogBack的配置中使用相对路径 -->
|
||||
<property name="LOG_HOME" value="/tmp/applog/pcms-rest" />
|
||||
<property name="LOG_HOME" value="/tmp/applog/pcms-rest-system" />
|
||||
<!-- <property name="LOG_HOME" value="../logs/pcms-rest" />-->
|
||||
<!-- 定义系统日志文件的存储地址,勿在 LogBack的配置中使用相对路径 -->
|
||||
<property name="LOG_HOME_SYSTEM" value="system" />
|
||||
|
||||
@@ -71,7 +71,7 @@ public class CreateMQService {
|
||||
}
|
||||
|
||||
//发送消息队列
|
||||
this.rabbitTemplate.convertAndSend("convert-exchange_SQ_GSAR", "convert-key_SQ_GSAR", convertInfo);
|
||||
this.rabbitTemplate.convertAndSend("convert-exchange_SQ_GSAR_RELEASE", "convert-key_SQ_GSAR_RELEASE", convertInfo);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class CreateStandMQService {
|
||||
standMap.put("addOrUpdate", addOrUpdate);
|
||||
|
||||
//发送消息队列
|
||||
this.rabbitTemplate.convertAndSend("stand-exchange_SQ_GSAR", "stand-key_SQ_GSAR", standMap);
|
||||
this.rabbitTemplate.convertAndSend("stand-exchange_SQ_GSAR_RELEASE", "stand-key_SQ_GSAR_RELEASE", standMap);
|
||||
}
|
||||
|
||||
public void sendLawsMQ(SarLawsInfo sarLawsInfoEO, String addOrUpdate) throws Exception{
|
||||
@@ -51,7 +51,7 @@ public class CreateStandMQService {
|
||||
bussMap.put("addOrUpdate", addOrUpdate);
|
||||
|
||||
//发送消息队列
|
||||
this.rabbitTemplate.convertAndSend("buss-exchange_SQ_GSAR", "buss-key_SQ_GSAR", bussMap);
|
||||
this.rabbitTemplate.convertAndSend("buss-exchange_SQ_GSAR_RELEASE", "buss-key_SQ_GSAR_RELEASE", bussMap);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -45,9 +45,9 @@ public class SendBussMQService {
|
||||
|
||||
|
||||
@RabbitListener(bindings = @QueueBinding(
|
||||
value = @Queue(value = "createBussMQ_SQ_GSAR", durable = "true"),
|
||||
exchange = @Exchange(value = "buss-exchange_SQ_GSAR", ignoreDeclarationExceptions = "true"),
|
||||
key = "buss-key_SQ_GSAR"))
|
||||
value = @Queue(value = "createBussMQ_SQ_GSAR_RELEASE", durable = "true"),
|
||||
exchange = @Exchange(value = "buss-exchange_SQ_GSAR_RELEASE", ignoreDeclarationExceptions = "true"),
|
||||
key = "buss-key_SQ_GSAR_RELEASE"))
|
||||
public void createMQ(Map<String,Object> bussMap, Message message, Channel channel) throws Exception{
|
||||
try{
|
||||
try{
|
||||
|
||||
@@ -46,9 +46,9 @@ public class SendStandMQService {
|
||||
private static final Logger logger = LoggerFactory.getLogger(SendStandMQService.class);
|
||||
|
||||
@RabbitListener(bindings = @QueueBinding(
|
||||
value = @Queue(value = "createStandMQ_SQ_GSAR", durable = "true"),
|
||||
exchange = @Exchange(value = "stand-exchange_SQ_GSAR", ignoreDeclarationExceptions = "true"),
|
||||
key = "stand-key_SQ_GSAR"))
|
||||
value = @Queue(value = "createStandMQ_SQ_GSAR_RELEASE", durable = "true"),
|
||||
exchange = @Exchange(value = "stand-exchange_SQ_GSAR_RELEASE", ignoreDeclarationExceptions = "true"),
|
||||
key = "stand-key_SQ_GSAR_RELEASE"))
|
||||
public void createMQ(Map<String,Object> standMap, Message message, Channel channel) throws Exception{
|
||||
try{
|
||||
try{
|
||||
|
||||
+19
-4
@@ -4,6 +4,7 @@ import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.common.ReadExcel;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.slrs.ImportExcelDatas.comment.ExclErrorOut;
|
||||
import com.adc.da.slrs.ImportExcelDatas.comment.ExclExport;
|
||||
import com.adc.da.slrs.ImportExcelDatas.entity.ImportDto;
|
||||
import com.adc.da.slrs.ImportExcelDatas.service.ImportExcelService;
|
||||
import com.adc.da.slrs.ImportExcelDatas.service.impl.ImportExcelServiceImpl;
|
||||
@@ -34,7 +35,7 @@ import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@Api(description = "|SarStandPutTime|")
|
||||
@RequestMapping("/ImportExcel")
|
||||
@RequestMapping("/api/ImportExcel")
|
||||
public class ImportExcelController extends BaseController<ImportDto> {
|
||||
|
||||
@Autowired
|
||||
@@ -43,14 +44,24 @@ public class ImportExcelController extends BaseController<ImportDto> {
|
||||
@Autowired
|
||||
private ExclErrorOut exclErrorOut;
|
||||
|
||||
@ApiOperation("批量删除用户收藏")
|
||||
|
||||
@ApiOperation("从excl中导入标准信息")
|
||||
@PostMapping("/import")
|
||||
public void deleteList(MultipartFile file, MultipartFile file2, HttpServletResponse response, HttpServletRequest request) throws IOException {
|
||||
Map<String, List<ImportDto>> mapMap=importExcelService.getExcelData(file,file2);
|
||||
/**
|
||||
* 导入系统
|
||||
*/
|
||||
List<ImportDto> errorList = importExcelService.storageExclData(mapMap);
|
||||
// mapMap.put("导入后的信息",errorList);
|
||||
// List<ImportDto> guonei= mapMap.get("GNBZ");
|
||||
// List<ImportDto> haiwai = mapMap.get("HWBZ");
|
||||
// List<ImportDto> qibiao = mapMap.get("QYBZ");
|
||||
|
||||
|
||||
/**
|
||||
* 生成错误表格
|
||||
*/
|
||||
OutputStream os = null;
|
||||
Workbook workbook = null;
|
||||
try {
|
||||
@@ -61,7 +72,11 @@ public class ImportExcelController extends BaseController<ImportDto> {
|
||||
response.setContentType("application/force-download");
|
||||
//导出数据
|
||||
String headStr="标准号,标准名称,英文名称,发布时间,实施时间,标准状态,代替标准号,附件路径,错误原因";
|
||||
workbook = exclErrorOut.exportDatas(errorList,headStr);
|
||||
// workbook = exclErrorOut.exportDatas(guonei,headStr);
|
||||
|
||||
ExclExport exclExport = new ExclExport();
|
||||
workbook = exclExport.exportData(mapMap, headStr);
|
||||
|
||||
os = response.getOutputStream();
|
||||
workbook.write(os);
|
||||
os.flush();
|
||||
@@ -75,8 +90,8 @@ public class ImportExcelController extends BaseController<ImportDto> {
|
||||
}
|
||||
|
||||
|
||||
|
||||
// return responseMessage;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+208
-130
@@ -2,7 +2,6 @@ package com.adc.da.slrs.ImportExcelDatas.service.impl;
|
||||
|
||||
import com.adc.da.att.service.IAttFileEOService;
|
||||
import com.adc.da.att.vo.AttFileVo;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.ImportExcelDatas.dao.ImportExcelDao;
|
||||
import com.adc.da.slrs.ImportExcelDatas.entity.ImportDto;
|
||||
import com.adc.da.slrs.ImportExcelDatas.service.ImportExcelService;
|
||||
@@ -10,9 +9,7 @@ import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
|
||||
import com.adc.da.slrs.sarBussionessStand.service.ISarBussionessStandService;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||
import com.adc.da.slrs.sarStandardsInfo.service.ISarStandardsInfoService;
|
||||
import com.adc.da.sys.dao.DicTypeEODao;
|
||||
import com.adc.da.sys.entity.DicTypeEO;
|
||||
import com.adc.da.sys.entity.DictionaryEO;
|
||||
import com.adc.da.sys.service.impl.DicTypeEOServiceImpl;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.adc.da.utils.util.InitStandAttrUtil;
|
||||
@@ -26,13 +23,13 @@ import org.apache.poi.xssf.usermodel.XSSFRow;
|
||||
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@Service
|
||||
@@ -54,7 +51,9 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
// private SarBussionessStandServiceImpl sarBussionessStandService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 标准类别
|
||||
*/
|
||||
private final static String GN = "GB,GB/T,QC/T,GJB,JB,JT,HG,YV,SY,SH,GA,HJ,QB,JG,NB,JC,YS/T,FZ/T,TB/T,JJG,SJ/T,T/TBPS" +
|
||||
",NB/T,CJ/T,YS/T,SJ/T,BB/T,SN/T,SB/T,MH/T,DB11,SZDB/Z,HKG,T/ZSA,CSAE,T/CAS,T/CADA,T/CHTS,T/ITS,T/BJQC";
|
||||
private final static String QB = "Q/QCBFC,Q/FT,Q/FL,Q/QCFLC,Q/BQB,Q/SGT," +
|
||||
@@ -70,6 +69,7 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
dates.add("—" + i);
|
||||
dates.add("- " + i);
|
||||
dates.add("— " + i);
|
||||
dates.add("-" + i);
|
||||
}
|
||||
|
||||
if (file == null || file.getSize() == 0) {
|
||||
@@ -118,12 +118,18 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
//中间的Map 判断标准号属于哪种类型
|
||||
Map<String, String> middle = new HashMap<>();
|
||||
datas.forEach(items -> {
|
||||
System.out.print(".");
|
||||
//判断是否是正确的数据
|
||||
String[] as = items.split(",");
|
||||
if (!inDate(as[0], dates)) {
|
||||
if( as.length < 8){
|
||||
ImportDto importDto = new ImportDto();
|
||||
importDto.setErrorStr(items);
|
||||
error.add(importDto);
|
||||
|
||||
} else if (!inDate(as[0], dates) ) {
|
||||
ImportDto importDto = getImportDto(as);
|
||||
error.add(importDto);
|
||||
middle.put(as[0].trim(), "error-" + error.size());
|
||||
middle.put(as[7].trim(), "error-" + error.size());
|
||||
} else {
|
||||
//数据二次拆解 针对标准进行拆解
|
||||
String[] step2 = as[0].trim().split(" ");
|
||||
@@ -131,15 +137,15 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
if (isCheck(GNS, step2[0].trim())) {
|
||||
ImportDto importDto = getImportDto(as);
|
||||
InCountry.add(importDto);
|
||||
middle.put(as[0].trim(), "GNBZ-" + InCountry.size());
|
||||
middle.put(as[7].trim(), "GNBZ-" + InCountry.size());
|
||||
} else if (isCheck(QBS, step2[0].trim())) {
|
||||
ImportDto importDto = getImportDto(as);
|
||||
QiBiao.add(importDto);
|
||||
middle.put(as[0].trim(), "QYBZ-" + QiBiao.size());
|
||||
middle.put(as[7].trim(), "QYBZ-" + QiBiao.size());
|
||||
} else {
|
||||
ImportDto importDto = getImportDto(as);
|
||||
OutCountry.add(importDto);
|
||||
middle.put(as[0].trim(), "HWBZ-" + OutCountry.size());
|
||||
middle.put(as[7].trim(), "HWBZ-" + OutCountry.size());
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -151,9 +157,11 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
fujian.forEach(items2 -> {
|
||||
String[] fj = items2.split(",");
|
||||
if (fj.length > 2) {
|
||||
if (null != middle.get(null != fj[2] ? fj[2].trim() : "")) {
|
||||
if (null != middle.get(null != fj[1] ? fj[1].trim() : "")) {
|
||||
//对应数据位置
|
||||
String[] location = middle.get(fj[2].trim()).split("-");
|
||||
String[] location = middle.get(fj[1].trim()).split("-");
|
||||
// List<ImportDto> importDtos = res.get(location[0]);
|
||||
|
||||
res.get(location[0]).get(Integer.parseInt(location[1]) - 1).setPath(fj[3]);
|
||||
}
|
||||
}
|
||||
@@ -189,10 +197,15 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 数据数组转换为实体类
|
||||
* @param as
|
||||
* @return
|
||||
*/
|
||||
//赋值方法
|
||||
private ImportDto getImportDto(String[] as) {
|
||||
ImportDto importDto = new ImportDto();
|
||||
if (as.length == 7) {
|
||||
if (as.length == 8) {
|
||||
importDto.setStandId(null != as[0] ? as[0].trim() : "");
|
||||
importDto.setStandName(null != as[1] ? as[1].trim() : "");
|
||||
importDto.setStandNameEN(null != as[2] ? as[2].trim() : "");
|
||||
@@ -200,7 +213,7 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
importDto.setImplementedTime(null != as[4] ? as[4].trim() : "");
|
||||
importDto.setStandStatus(null != as[5] ? as[5].trim() : "");
|
||||
importDto.setReplaceId(null != as[6] ? as[6].trim() : "");
|
||||
} else if (as.length == 6) {
|
||||
} else if (as.length == 7) {
|
||||
importDto.setStandId(null != as[0] ? as[0].trim() : "");
|
||||
importDto.setStandName(null != as[1] ? as[1].trim() : "");
|
||||
importDto.setStandNameEN(null != as[2] ? as[2].trim() : "");
|
||||
@@ -225,9 +238,10 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
HSSFSheet sheet = workbook.getSheetAt(i);
|
||||
// 获取有多少行
|
||||
int lastNum = sheet.getLastRowNum();
|
||||
for (int j = 1; j <= lastNum; j++) {
|
||||
for (int j = 0; j <= lastNum; j++) {
|
||||
HSSFRow row = sheet.getRow(j);
|
||||
if (null != row) {
|
||||
System.out.println("正在读取第"+j+"行...");
|
||||
strings.add(row.getCell(0).getStringCellValue());
|
||||
}
|
||||
}
|
||||
@@ -248,11 +262,12 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
// 遍历sheet页
|
||||
for (int i = 0; i <= sheetNum; i++) {
|
||||
XSSFSheet sheet = workbook.getSheetAt(i);
|
||||
// 获取有多少行
|
||||
// 获取有多少行 0行开始
|
||||
int lastNum = sheet.getLastRowNum();
|
||||
for (int j = 1; j <= lastNum; j++) {
|
||||
for (int j = 0; j <= lastNum; j++) {
|
||||
XSSFRow row = sheet.getRow(j);
|
||||
if (null != row) {
|
||||
System.out.println("正在读取第"+j+"行...");
|
||||
strings.add(row.getCell(0).getStringCellValue());
|
||||
}
|
||||
}
|
||||
@@ -266,9 +281,7 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
|
||||
|
||||
|
||||
private List<ImportDto> error = new ArrayList<>();
|
||||
|
||||
private List<ImportDto> fileError = new ArrayList<>();
|
||||
|
||||
@Autowired
|
||||
private ISarStandardsInfoService sarStandardsInfoService;
|
||||
@@ -278,12 +291,38 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
|
||||
@Autowired
|
||||
private ISarBussionessStandService sarBussionessStandService;
|
||||
|
||||
|
||||
private List<ImportDto> error = new ArrayList<>();
|
||||
|
||||
private List<ImportDto> fileError = new ArrayList<>();
|
||||
|
||||
private HashSet<String> sarSort = new HashSet<>();
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public List<ImportDto> storageExclData(Map<String, List<ImportDto>> importListMap) {
|
||||
|
||||
//TODO 利用stream把list变为set
|
||||
// List<DicTypeEO> list = dicTypeEOService.list();
|
||||
// list.stream().flatMap(dicTypeEO -> {
|
||||
// return dicTypeEO;
|
||||
// }.co)
|
||||
List<DicTypeEO> isExist = dicTypeEOService.getTypeIdByDicIdAndTypeName("JKSADFH564S", null, null, null);
|
||||
isExist.forEach(item->{
|
||||
sarSort.add(item.getDicTypeCode());
|
||||
});
|
||||
|
||||
|
||||
error = importListMap.get("error");
|
||||
|
||||
AtomicInteger QYBZcount= new AtomicInteger();
|
||||
AtomicInteger QYBZcountUpdate= new AtomicInteger();
|
||||
AtomicInteger HWBZcount= new AtomicInteger();
|
||||
AtomicInteger HWBZcountUpdate= new AtomicInteger();
|
||||
AtomicInteger GNBZcount= new AtomicInteger();
|
||||
AtomicInteger GNBZcountUpdate= new AtomicInteger();
|
||||
|
||||
/**
|
||||
* 初始化国内外标准属性字段
|
||||
*/
|
||||
@@ -296,24 +335,26 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
/**
|
||||
* 海外标准
|
||||
*/
|
||||
importListMap.get("HWBZ").forEach(item -> {
|
||||
|
||||
String standID = UUIDUtils.randomUUID20();
|
||||
|
||||
//使用初始化的属性字段映射 获得key值,value为""
|
||||
Map<String, String> mapField = standAttrMap;
|
||||
SarStandardsInfo ForeignEO = parseImportDtoToStandardsInfo(item,mapField, standID);
|
||||
/*importListMap.get("HWBZ").forEach(item -> {
|
||||
if (true ) {
|
||||
String standID = UUIDUtils.randomUUID20();
|
||||
|
||||
if (ForeignEO != null) {
|
||||
ForeignEO.setValidFlag("0");
|
||||
ForeignEO.setStandType("FOREIGN");
|
||||
QueryWrapper<SarStandardsInfo> standSaveWrapper = new QueryWrapper<>();
|
||||
standSaveWrapper
|
||||
.eq("STAND_SORT", ForeignEO.getStandSort())
|
||||
.eq("STAND_NUMBER", ForeignEO.getStandNumber())
|
||||
.eq("STAND_YEAR", ForeignEO.getStandYear());
|
||||
//使用初始化的属性字段映射 获得key值,value为""
|
||||
Map<String, String> mapField = standAttrMap;
|
||||
SarStandardsInfo ForeignEO = parseImportDtoToStandardsInfo(item,mapField, standID);
|
||||
|
||||
SarStandardsInfo one = sarStandardsInfoService.getOne(standSaveWrapper);
|
||||
if (ForeignEO != null) {
|
||||
ForeignEO.setValidFlag("0");
|
||||
ForeignEO.setStandType("FOREIGN");
|
||||
QueryWrapper<SarStandardsInfo> standSaveWrapper = new QueryWrapper<>();
|
||||
standSaveWrapper
|
||||
.eq("STAND_SORT", ForeignEO.getStandSort())
|
||||
.eq("STAND_NUMBER", ForeignEO.getStandNumber())
|
||||
.eq("STAND_YEAR", ForeignEO.getStandYear());
|
||||
|
||||
SarStandardsInfo one = sarStandardsInfoService.getOne(standSaveWrapper);
|
||||
|
||||
|
||||
|
||||
@@ -322,6 +363,9 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
|
||||
try {
|
||||
sarStandardsInfoService.updateSarStandardsInfo(ForeignEO);
|
||||
HWBZcountUpdate.getAndIncrement();
|
||||
HWBZcount.getAndIncrement();
|
||||
System.out.println("海外标准执行更新===第: "+HWBZcount+"行");
|
||||
} catch (Exception e) {
|
||||
item.setErrorStr("标准更新失败");
|
||||
error.add(item);
|
||||
@@ -331,6 +375,8 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
} else {
|
||||
try {
|
||||
sarStandardsInfoService.createSarStandardsInfo(ForeignEO);
|
||||
HWBZcount.getAndIncrement();
|
||||
System.out.println("海外标准执行新增===第: "+HWBZcount+"行");
|
||||
} catch (Exception e) {
|
||||
item.setErrorStr("标准新增失败");
|
||||
error.add(item);
|
||||
@@ -340,72 +386,80 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
item.setErrorStr("标准号无法解析");
|
||||
error.add(item);
|
||||
} else {
|
||||
item.setErrorStr("标准号无法解析");
|
||||
error.add(item);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
});*/
|
||||
|
||||
|
||||
/**
|
||||
* 国内标准
|
||||
*/
|
||||
|
||||
importListMap.get("GNBZ").forEach(item -> {
|
||||
String standID = UUIDUtils.randomUUID20();
|
||||
//使用初始化的属性字段映射 获得key值,value为""
|
||||
Map<String, String> mapStandField = standAttrMap;
|
||||
SarStandardsInfo InlandEO = parseImportDtoToStandardsInfo(item, mapStandField,standID);
|
||||
|
||||
if (InlandEO != null) {
|
||||
/*importListMap.get("GNBZ").forEach(item -> {
|
||||
|
||||
|
||||
InlandEO.setValidFlag("0");
|
||||
InlandEO.setStandType("INLAND");
|
||||
if (true) {
|
||||
String standID = UUIDUtils.randomUUID20();
|
||||
//使用初始化的属性字段映射 获得key值,value为""
|
||||
Map<String, String> mapStandField = standAttrMap;
|
||||
SarStandardsInfo InlandEO = parseImportDtoToStandardsInfo(item, mapStandField, standID);
|
||||
|
||||
if (InlandEO != null) {
|
||||
|
||||
|
||||
QueryWrapper<SarStandardsInfo> standSaveWrapper = new QueryWrapper<>();
|
||||
standSaveWrapper
|
||||
.eq("STAND_SORT", InlandEO.getStandSort())
|
||||
.eq("STAND_NUMBER", InlandEO.getStandNumber())
|
||||
.eq("STAND_YEAR", InlandEO.getStandYear());
|
||||
InlandEO.setValidFlag("0");
|
||||
InlandEO.setStandType("INLAND");
|
||||
|
||||
|
||||
SarStandardsInfo one = sarStandardsInfoService.getOne(standSaveWrapper);
|
||||
if (one != null) {
|
||||
QueryWrapper<SarStandardsInfo> standSaveWrapper = new QueryWrapper<>();
|
||||
standSaveWrapper
|
||||
.eq("STAND_SORT", InlandEO.getStandSort())
|
||||
.eq("STAND_NUMBER", InlandEO.getStandNumber())
|
||||
.eq("STAND_YEAR", InlandEO.getStandYear());
|
||||
|
||||
|
||||
InlandEO.setId(one.getId());
|
||||
try {
|
||||
sarStandardsInfoService.updateSarStandardsInfo(InlandEO);
|
||||
} catch (Exception e) {
|
||||
item.setErrorStr("国内标准更新失败");
|
||||
error.add(item);
|
||||
e.printStackTrace();
|
||||
SarStandardsInfo one = sarStandardsInfoService.getOne(standSaveWrapper);
|
||||
if (one != null) {
|
||||
|
||||
|
||||
InlandEO.setId(one.getId());
|
||||
try {
|
||||
sarStandardsInfoService.updateSarStandardsInfo(InlandEO);
|
||||
} catch (Exception e) {
|
||||
item.setErrorStr("国内标准更新失败");
|
||||
error.add(item);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
try {
|
||||
sarStandardsInfoService.createSarStandardsInfo(InlandEO);
|
||||
} catch (Exception e) {
|
||||
item.setErrorStr("国内标准新增失败");
|
||||
error.add(item);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
try {
|
||||
sarStandardsInfoService.createSarStandardsInfo(InlandEO);
|
||||
} catch (Exception e) {
|
||||
item.setErrorStr("国内标准新增失败");
|
||||
error.add(item);
|
||||
e.printStackTrace();
|
||||
}
|
||||
item.setErrorStr("标准号无法解析");
|
||||
error.add(item);
|
||||
importListMap.replace("error", error);
|
||||
}
|
||||
} else {
|
||||
item.setErrorStr("标准号无法解析");
|
||||
error.add(item);
|
||||
importListMap.replace("error", error);
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
});*/
|
||||
|
||||
|
||||
/**
|
||||
@@ -420,38 +474,61 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
listStandBussField.forEach(item->{
|
||||
bussAttrMap.put(item,"");
|
||||
});
|
||||
|
||||
importListMap.get("QYBZ").forEach(item -> {
|
||||
String standId = UUIDUtils.randomUUID20();
|
||||
SarBussionessStand BussEO = parseImportDtoToSarBussionessStand(item, bussAttrMap,standId);
|
||||
|
||||
if (BussEO != null) {
|
||||
|
||||
try {
|
||||
QueryWrapper<SarBussionessStand> saveWrapper = new QueryWrapper<>();
|
||||
saveWrapper.eq("STAND_CODE", item.getStandId());
|
||||
SarBussionessStand one = sarBussionessStandService.getOne(saveWrapper);
|
||||
if (one != null) {
|
||||
BussEO.setId(one.getId());
|
||||
sarBussionessStandService.updateSarBussionessStand(BussEO);
|
||||
} else {
|
||||
sarBussionessStandService.createSarBussionessStand(BussEO);
|
||||
if (true){
|
||||
// if (item.getStandId().contains("Q/FT T396—2021") ){
|
||||
|
||||
String standId = UUIDUtils.randomUUID20();
|
||||
SarBussionessStand BussEO = parseImportDtoToSarBussionessStand(item, bussAttrMap,standId);
|
||||
|
||||
if (BussEO != null) {
|
||||
|
||||
try {
|
||||
QueryWrapper<SarBussionessStand> saveWrapper = new QueryWrapper<>();
|
||||
saveWrapper.eq("STAND_CODE", item.getStandId());
|
||||
SarBussionessStand one = sarBussionessStandService.getOne(saveWrapper);
|
||||
if (one != null) {
|
||||
BussEO.setId(one.getId());
|
||||
sarBussionessStandService.updateSarBussionessStand(BussEO);
|
||||
QYBZcountUpdate.getAndIncrement();
|
||||
QYBZcount.getAndIncrement();
|
||||
System.out.println("企业标准执行更新====第: "+QYBZcount+"行");
|
||||
|
||||
} else {
|
||||
sarBussionessStandService.createSarBussionessStand(BussEO);
|
||||
QYBZcount.getAndIncrement();
|
||||
System.out.println("企业标准执行新增第: "+QYBZcount+"行");
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
item.setErrorStr("数据格式错误");
|
||||
error.add(item);
|
||||
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
|
||||
|
||||
} catch (Exception e) {
|
||||
item.setErrorStr("数据格式错误");
|
||||
error.add(item);
|
||||
|
||||
e.printStackTrace();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
error.addAll(fileError);
|
||||
System.out.println("执行结束");
|
||||
System.out.println("执行国内标准"+GNBZcount+"条");
|
||||
System.out.println("国内标准执行更新"+GNBZcountUpdate+"条");
|
||||
System.out.println("执行国外标准"+HWBZcount+"条");
|
||||
System.out.println("海外标准执行更新"+HWBZcountUpdate+"条");
|
||||
System.out.println("执行企业标准"+QYBZcount+"条");
|
||||
System.out.println("企业标准执行更新"+QYBZcountUpdate+"条");
|
||||
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
@@ -464,13 +541,10 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
* @return
|
||||
*/
|
||||
public SarStandardsInfo parseImportDtoToStandardsInfo(ImportDto importDto,Map<String,String> fieldMap, String standId) {
|
||||
|
||||
|
||||
HashMap<String, String> analysis = analysisStandId(importDto);
|
||||
if (analysis == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
SarStandardsInfo sarStandardsInfoEO = new SarStandardsInfo();
|
||||
sarStandardsInfoEO.setId(standId);
|
||||
|
||||
@@ -507,21 +581,21 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
if (importDto.getPath() != null) {
|
||||
String path[] = importDto.getPath().split("/");
|
||||
String realPath = "";
|
||||
for (int i = 4; i < path.length; i++) {
|
||||
for (int i = 3; i < path.length; i++) {
|
||||
realPath = realPath + "/" + path[i];
|
||||
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
// File file = new File("C:\\Users\\22501\\Desktop\\foton\\2021\\" + realPath);
|
||||
// File file = new File("C:\\Users\\22501\\Desktop\\foton\\" + realPath);
|
||||
// File file = new File(importPath + realPath);
|
||||
File file = new File("/home/file/2021/" + realPath);
|
||||
File file = new File("/data/from12/Attach_swf_bak" + realPath);
|
||||
if (file.exists()) {
|
||||
AttFileVo fileInfo = attFileEOService.saveFileInfo(file);
|
||||
|
||||
if (importDto.getImplementedTime() != null) {
|
||||
fieldMap.put("FBGJBD", fileInfo.getAttId());
|
||||
fieldMap.put("FBGBJBD", fileInfo.getAttId());
|
||||
} else {
|
||||
fieldMap.put("GLWJ", fileInfo.getAttId());
|
||||
}
|
||||
@@ -585,16 +659,16 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
if (importDto.getPath() != null) {
|
||||
String path[] = importDto.getPath().split("/");
|
||||
String realPath = "";
|
||||
for (int i = 4; i < path.length; i++) {
|
||||
for (int i = 3; i < path.length; i++) {
|
||||
realPath = realPath + "/" + path[i];
|
||||
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
// File file = new File("C:\\Users\\22501\\Desktop\\foton\\2021\\" + realPath);
|
||||
// File file = new File("C:\\Users\\22501\\Desktop\\foton\\" + realPath);
|
||||
// File file = new File(importPath + realPath);
|
||||
File file = new File("/home/file/2021/" + realPath);
|
||||
File file = new File("/data/from12/Attach_swf_bak" + realPath);
|
||||
|
||||
if (file.exists()) {
|
||||
AttFileVo fileInfo = attFileEOService.saveFileInfo(file);
|
||||
@@ -639,12 +713,14 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
*/
|
||||
public HashMap<String, String> analysisStandId(ImportDto importDto) {
|
||||
HashMap<String, String> result = new HashMap<>();
|
||||
if (importDto.getStandId() == null) {
|
||||
String standId = importDto.getStandId();
|
||||
|
||||
if (standId == null) {
|
||||
importDto.setErrorStr("标准号为空");
|
||||
error.add(importDto);
|
||||
return null;
|
||||
} else {
|
||||
String standId = importDto.getStandId();
|
||||
// String standId = importDto.getStandId();
|
||||
//格式 非空格字符+空格+非空格字符+‘-’或‘—’或空格+年份 如Q/FT F003—2001
|
||||
Pattern pattern = Pattern.compile("^\\S*\\s\\S*[\\u2014\\u002d\\s]\\d{4}$");
|
||||
if (!pattern.matcher(standId).matches()) {
|
||||
@@ -656,7 +732,7 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
String sort = "";
|
||||
String number = "";
|
||||
String year = "";
|
||||
String[] split = importDto.getStandId().split("[\\u2014\\u002d\\s]");//以空格或'-'或'—'分割
|
||||
String[] split = standId.split("[\\u2014\\u002d\\s]");//以空格或'-'或'—'分割
|
||||
|
||||
|
||||
// 多种格式(╯‵□′)╯︵┻━┻ Q-FL T015-2021 Q/ FL T015-2021 Q/FL T015-2021
|
||||
@@ -670,25 +746,27 @@ public class ImportExcelServiceImpl extends ServiceImpl<ImportExcelDao, ImportDt
|
||||
result.put("sort", sort);
|
||||
result.put("number", number);
|
||||
result.put("year", year);
|
||||
//标准类别不存在,新增标准类别
|
||||
List<DicTypeEO> isExist = dicTypeEOService.getTypeIdByDicIdAndTypeName("JKSADFH564S", null, sort, null);
|
||||
if (isExist == null || isExist.isEmpty() || isExist.size()==0){
|
||||
|
||||
DicTypeEO dicTypeVO = new DicTypeEO();
|
||||
dicTypeVO.setId(null);
|
||||
dicTypeVO.setDicId("JKSADFH564S");
|
||||
dicTypeVO.setDicTypeCode(sort);
|
||||
dicTypeVO.setDicTypeName(sort);
|
||||
dicTypeVO.setShowIndex(1);
|
||||
Integer dicTypeEO = dicTypeEOService.saveDictype(dicTypeVO);
|
||||
if (dicTypeEO>0){
|
||||
importDto.setErrorStr("标准类别不存在,已新增");
|
||||
}else {
|
||||
importDto.setErrorStr("标准类别不存在,新增失败");
|
||||
}
|
||||
error.add(importDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 标准类别不存在,新增标准类别
|
||||
*/
|
||||
// List<DicTypeEO> isExist = dicTypeEOService.getTypeIdByDicIdAndTypeName("JKSADFH564S", null, sort, null);
|
||||
// if (!sarSort.contains(sort)){
|
||||
//
|
||||
// DicTypeEO dicTypeVO = new DicTypeEO();
|
||||
// dicTypeVO.setId(null);
|
||||
// dicTypeVO.setDicId("JKSADFH564S");
|
||||
// dicTypeVO.setDicTypeCode(sort);
|
||||
// dicTypeVO.setDicTypeName(sort);
|
||||
// dicTypeVO.setShowIndex(1);
|
||||
// Integer dicTypeEO = dicTypeEOService.saveDictype(dicTypeVO);
|
||||
// if (dicTypeEO>0){
|
||||
// sarSort.add(sort);
|
||||
// importDto.setErrorStr("标准类别不存在,已新增");
|
||||
// }else {
|
||||
// importDto.setErrorStr("标准类别不存在,新增失败");
|
||||
// }
|
||||
// error.add(importDto);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
+10
@@ -194,6 +194,16 @@ public class SarBussionessStandController extends BaseController<SarBussionessSt
|
||||
return Result.success(result);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "|SarBussionessStandEO|详情")
|
||||
@GetMapping("/getStandInfoUpdateById")
|
||||
//@RequiresPermissions("lawss:sarStandardsInfo:get")
|
||||
public ResponseMessage<SarBussionessStand> getStandInfoUpdateById(String id) throws Exception {
|
||||
SarBussionessStand result = sarBussionessStandEOService.selectStandardsInfoUpdateByKey(id);
|
||||
String collectId = personCollectEOService.queryCollectByUserAndId(id);
|
||||
result.setCollectId(collectId);
|
||||
return Result.success(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 给指定标准配置目录
|
||||
* @param standardsInfoEO
|
||||
|
||||
+2
@@ -30,6 +30,8 @@ public interface ISarBussionessStandService extends IService<SarBussionessStand>
|
||||
|
||||
SarBussionessStand selectStandardsInfoByKey(String id) throws Exception;
|
||||
|
||||
SarBussionessStand selectStandardsInfoUpdateByKey(String id) throws Exception;
|
||||
|
||||
SarBussionessStandEOPage updateStandardsMenu(SarBussionessStandEOPage standardsInfoEO);
|
||||
|
||||
List<SarBussionessStand> queryByList(SarBussionessStandEOPage sarBussionessStandEOPage);
|
||||
|
||||
+28
-8
@@ -35,6 +35,7 @@ import com.adc.da.slrs.sarStandAttrInfo.dao.SarStandAttrInfoDao;
|
||||
import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarAdvanceSearchVO;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarBussionessStandEOPage;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||
import com.adc.da.slrs.sarUpdLog.service.ISarUpdLogService;
|
||||
import com.adc.da.slrs.sarUser.service.ITsUserService;
|
||||
import com.adc.da.slrs.sysInfo.service.SysInfoEOService;
|
||||
@@ -60,6 +61,7 @@ import org.springframework.stereotype.Service;
|
||||
import java.sql.Clob;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -708,6 +710,19 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
return sarBussionessStandEO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SarBussionessStand selectStandardsInfoUpdateByKey(String id) throws Exception{
|
||||
List<SarBussionessStand> sarBussionessStandlist = this.baseMapper.selectStandardsInfoByKey(id);
|
||||
SarBussionessStand sarBussionessStandEO = new SarBussionessStand();
|
||||
if(!sarBussionessStandlist.isEmpty()) {
|
||||
List<SarBussionessStand> newStandList = new ArrayList<>();
|
||||
newStandList.add(sarBussionessStandlist.get(0));
|
||||
attrInfo(newStandList);
|
||||
sarBussionessStandEO = newStandList.get(0);
|
||||
}
|
||||
return sarBussionessStandEO;
|
||||
}
|
||||
|
||||
public void attrInfoShowDetails(List<SarBussionessStand> sarlist) throws Exception {
|
||||
for (SarBussionessStand row : sarlist) {
|
||||
attrInfoDetails(row);
|
||||
@@ -802,7 +817,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
Integer rowCount = this.baseMapper.getBussionessStandInfoCount(page);
|
||||
page.getPager().setRowCount(rowCount);
|
||||
List<SarBussionessStand> sarlist = this.baseMapper.getBussionessStandInfoPage(page);
|
||||
attrInfo(sarlist);
|
||||
attrInfoCollect(sarlist);
|
||||
return sarlist;
|
||||
}
|
||||
|
||||
@@ -817,6 +832,17 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
}
|
||||
}
|
||||
|
||||
public void attrInfoCollect (List<SarBussionessStand> sarlist) throws Exception {
|
||||
List<String> collectResIds = sarlist.stream().map(SarBussionessStand::getId).collect(Collectors.toList());
|
||||
Map<String,String> collectMap = personCollectEOService.queryCollectByUserAndIds(collectResIds);
|
||||
for (SarBussionessStand row : sarlist) {
|
||||
if(collectMap != null && collectMap.get(row.getId()) != null){
|
||||
row.setCollectId(collectMap.get(row.getId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void attrInfo1 (SarBussionessStand row) throws Exception {
|
||||
String fieldInfo = InitStandAttrUtil.queryFieldBuss;
|
||||
String collectId = personCollectEOService.queryCollectByUserAndId(row.getId());
|
||||
@@ -939,13 +965,7 @@ public class SarBussionessStandServiceImpl extends ServiceImpl<SarBussionessStan
|
||||
if (value1 != null && value1.toString().equals("\"null\"")){
|
||||
entry.setValue("");
|
||||
}
|
||||
if ("SVPPS".equals(name)) {
|
||||
Object value = entry.getValue();
|
||||
if (value != null && StringUtils.isNotBlank(value.toString())) {
|
||||
value = sysInfoEOService.getSvppsNamesByIds(value.toString());
|
||||
}
|
||||
newMap.put(name + "Name",value);
|
||||
} else if (entry.getValue() != null && InitStandAttrUtil.selectionFieldListBuss != null && InitStandAttrUtil.selectionFieldListBuss.size() > 0 && InitStandAttrUtil.selectionFieldListBuss.contains(name)) {
|
||||
if (entry.getValue() != null && InitStandAttrUtil.selectionFieldListBuss != null && InitStandAttrUtil.selectionFieldListBuss.size() > 0 && InitStandAttrUtil.selectionFieldListBuss.contains(name)) {
|
||||
String value = entry.getValue().toString();
|
||||
String selVal = InitStandAttrUtil.selectFieldMapBuss.get(name);
|
||||
if (SelectionTypeEnum.ORGLIST.getValue().equals(selVal)) {
|
||||
|
||||
+8
@@ -93,6 +93,14 @@ public class TsInstitutionController extends BaseController<TsInstitution> {
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("通过部门机构名称查询部门树形结构 废弃使用")
|
||||
@GetMapping("/findInstitution")
|
||||
public List<TsInstitution> findInstitution(String institutionName){
|
||||
//TODO 调用业务接口
|
||||
tsInstitutionService.findInstitutionTreeByName(institutionName);
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
// System.out.println(json);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.adc.da.slrs.sarInstitution.dao;
|
||||
import com.adc.da.slrs.sarInstitution.entity.InstitutionAndUser;
|
||||
import com.adc.da.slrs.sarInstitution.entity.TsInstitution;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
@@ -29,7 +30,7 @@ public interface TsInstitutionDao extends BaseMapper<TsInstitution> {
|
||||
List<TsInstitution> selectNextUser(String institutionId);
|
||||
|
||||
|
||||
|
||||
List<TsInstitution> selectTreeByIds(@Param("rootIds") List<String> rootIds);
|
||||
|
||||
/**
|
||||
* 查询最高级机构及其人员
|
||||
|
||||
@@ -11,6 +11,8 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -73,4 +75,12 @@ public class TsInstitution extends BaseEntity {
|
||||
this.parentId = parentId;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
// public void addChildren(TsInstitution node){
|
||||
// if (this.children==null){
|
||||
// this.children=Arrays.asList(node);
|
||||
// }else {
|
||||
// this.children.add(node);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
+8
@@ -43,5 +43,13 @@ public interface ITsInstitutionService extends IService<TsInstitution> {
|
||||
*/
|
||||
public List<TsInstitution> getFirst();
|
||||
|
||||
|
||||
/**
|
||||
* 根据机构部门名称查询机构树
|
||||
* @param institutionName
|
||||
* @return
|
||||
*/
|
||||
public List<TsInstitution> findInstitutionTreeByName(String institutionName);
|
||||
|
||||
int clearData();
|
||||
}
|
||||
|
||||
+52
-18
@@ -6,6 +6,7 @@ import com.adc.da.slrs.sarInstitution.entity.SyncInstitution;
|
||||
import com.adc.da.slrs.sarInstitution.entity.TsInstitution;
|
||||
import com.adc.da.slrs.sarInstitution.entity.TsUserVO;
|
||||
import com.adc.da.slrs.sarInstitution.service.ITsInstitutionService;
|
||||
import com.adc.da.slrs.sarInstitution.util.TreeUtil;
|
||||
import com.adc.da.sync.service.SyncUserService;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
@@ -15,8 +16,8 @@ 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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -38,17 +39,21 @@ public class TsInstitutionServiceImpl extends ServiceImpl<TsInstitutionDao, TsIn
|
||||
*/
|
||||
@Override
|
||||
public List<TsInstitution> getInstitution() {
|
||||
List<TsInstitution> institutionList = this.list();//查询所有的的数据
|
||||
|
||||
//查询第一层机构
|
||||
List<TsInstitution> institutionRoot=tsInstitutionDao.selectRoot();
|
||||
for(TsInstitution tsInstitution:institutionRoot){
|
||||
tsInstitution.setChildren(recursionGetInstitution(tsInstitution));
|
||||
}
|
||||
return institutionRoot;
|
||||
List<TsInstitution> root=tsInstitutionDao.selectRoot();
|
||||
|
||||
TreeUtil treeUtil = new TreeUtil();
|
||||
List<TsInstitution> institutionTree = treeUtil.treeAsList(institutionList, root);
|
||||
|
||||
return institutionTree;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 递归获取子机构
|
||||
* @param tsInstitution:父机构
|
||||
@@ -109,21 +114,29 @@ public class TsInstitutionServiceImpl extends ServiceImpl<TsInstitutionDao, TsIn
|
||||
*/
|
||||
@Override
|
||||
public List<TsInstitution> getInstitutionAndUser(String userName) {
|
||||
//查询第一层机构
|
||||
List<TsInstitution> institutionRoot=tsInstitutionDao.selectRootAndUser(userName);
|
||||
List<TsInstitution> tsInstitutions = new ArrayList<>();
|
||||
|
||||
//把查到的数据结构修改,把用户放
|
||||
for(TsInstitution tsInstitution:institutionRoot){
|
||||
tsInstitution.setDisabled(true);
|
||||
tsInstitution.setChildren( recursionGetInstitutionAndUser(tsInstitution) );
|
||||
for(TsUserVO user:tsInstitution.getUsers()){
|
||||
if(tsInstitution.getChildren()==null){
|
||||
tsInstitution.setChildren(new ArrayList<>());
|
||||
//当条件为null时避免查询全部,直接返回第一级
|
||||
if (userName==null||userName==""){
|
||||
tsInstitutions=this.getFirst();
|
||||
}else {
|
||||
//查询第一层机构
|
||||
tsInstitutions=tsInstitutionDao.selectRootAndUser(userName);
|
||||
|
||||
//把查到的数据结构修改,把用户放
|
||||
for(TsInstitution tsInstitution:tsInstitutions){
|
||||
tsInstitution.setDisabled(true);
|
||||
// tsInstitution.setChildren( recursionGetInstitutionAndUser(tsInstitution) );
|
||||
for(TsUserVO user:tsInstitution.getUsers()){
|
||||
if(tsInstitution.getChildren()==null){
|
||||
tsInstitution.setChildren(new ArrayList<>());
|
||||
}
|
||||
// tsInstitution.getChildren().add(user);
|
||||
}
|
||||
tsInstitution.getChildren().add(user);
|
||||
}
|
||||
}
|
||||
return institutionRoot;
|
||||
|
||||
return tsInstitutions;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -213,6 +226,27 @@ public class TsInstitutionServiceImpl extends ServiceImpl<TsInstitutionDao, TsIn
|
||||
return tsInstitutions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TsInstitution> findInstitutionTreeByName(String institutionName) {
|
||||
|
||||
QueryWrapper<TsInstitution> tsInstitutionQuery = new QueryWrapper<>();
|
||||
tsInstitutionQuery.select("id")
|
||||
.like("name",institutionName);
|
||||
|
||||
/**
|
||||
* 查询出id的数据集合并转换成String类型
|
||||
*/
|
||||
List<String> rootIds = this.listObjs(tsInstitutionQuery)
|
||||
.stream()
|
||||
.map(item -> item.toString())
|
||||
.collect(Collectors.toList());
|
||||
|
||||
List<TsInstitution> tsInstitutions = tsInstitutionDao.selectTreeByIds(rootIds);
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int clearData() {
|
||||
return tsInstitutionDao.clearData();
|
||||
|
||||
@@ -0,0 +1,132 @@
|
||||
package com.adc.da.slrs.sarInstitution.util;
|
||||
|
||||
import com.adc.da.slrs.sarInstitution.entity.TsInstitution;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
public class TreeUtil {
|
||||
|
||||
public List<TsInstitution> treeAsList(List<TsInstitution> institutionList,List<TsInstitution> rootList){
|
||||
|
||||
//转换为hashSet
|
||||
List<String> root = rootList.stream()
|
||||
.map(item -> item.getId())
|
||||
.collect(Collectors.toList());
|
||||
HashSet<String> rootSet = new HashSet<>(root);
|
||||
|
||||
//获取父节点,0表示父节点
|
||||
List<TsInstitution> tree = institutionList.stream()
|
||||
.filter(e -> rootSet.contains(e.getId()))
|
||||
.map(e -> {
|
||||
|
||||
List<TsInstitution> childNode = getChildNode(e, institutionList);
|
||||
|
||||
e.setChildren(new ArrayList<>(childNode));
|
||||
return e;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
return tree;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归查询子节点
|
||||
* @param root
|
||||
* @param contentKnowledgeList
|
||||
* @return
|
||||
*/
|
||||
private List<TsInstitution> getChildNode(TsInstitution root, List<TsInstitution> contentKnowledgeList) {
|
||||
List<TsInstitution> childrenList = contentKnowledgeList.stream()
|
||||
.filter(e -> Objects.equals(e.getParentId(), root.getId()))
|
||||
.map(e -> {
|
||||
List<TsInstitution> childNode = getChildNode(e, contentKnowledgeList);
|
||||
e.setChildren(new ArrayList<>(childNode));
|
||||
return e;
|
||||
}
|
||||
).collect(Collectors.toList());
|
||||
return childrenList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// public List<TsInstitution> getChildAsHash(TsInstitution root, Map<String, TsInstitution> hashInstitution){
|
||||
// String id = root.getId();
|
||||
// if (hashInstitution.containsKey(id)){
|
||||
//
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
|
||||
|
||||
// //TODO 利用HashMap组装树结构
|
||||
//
|
||||
// public List<TsInstitution> treeAsHash(List<TsInstitution> institutionList,List<TsInstitution> rootList) {
|
||||
//
|
||||
// Map<String, TsInstitution> idMap = institutionList.stream()
|
||||
// .collect(Collectors.toMap(TsInstitution::getId, tsInstitution -> tsInstitution));
|
||||
//
|
||||
// Map<String, TsInstitution> pid_institution = institutionList.stream()
|
||||
// .collect(Collectors.toMap(TsInstitution::getParentId, institution -> institution));
|
||||
//
|
||||
// for (TsInstitution institution : rootList) {
|
||||
//
|
||||
// String id = institution.getId();
|
||||
// if (pid_institution.containsKey(id)) {
|
||||
// institution.addChildren(pid_institution.get(id));
|
||||
//
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
//
|
||||
// Set<String> rootSet = rootList.stream()
|
||||
// .map(TsInstitution::getId)
|
||||
// .collect(Collectors.toSet());
|
||||
//
|
||||
// Iterator<TsInstitution> it = institutionList.iterator();
|
||||
//
|
||||
// ArrayList<TsInstitution> resultList = new ArrayList<>();
|
||||
//
|
||||
//
|
||||
// HashMap<String, TsInstitution> id_obj = new HashMap<>();
|
||||
// while (it.hasNext()) {
|
||||
// TsInstitution next = it.next();
|
||||
//
|
||||
// String parentId = next.getParentId();
|
||||
// id_obj.put(next.getId(), next);
|
||||
// if (rootSet.contains(parentId)) {
|
||||
// id_obj.put(next.getId(), next);
|
||||
// } else if (id_obj.containsKey(parentId)) {
|
||||
// id_obj.get(parentId).addChildren(next);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// return null ;
|
||||
//
|
||||
// }
|
||||
|
||||
|
||||
|
||||
//
|
||||
//
|
||||
//
|
||||
// List<TreeNodeDTO> list = dbMapper.getNodeList();
|
||||
// ArrayList<TreeNodeDTO> rootNodes = new ArrayList<>();
|
||||
// Map<Integer, TreeNodeDTO> map = new HashMap<>();
|
||||
// for (TreeNodeDTO node :list) {
|
||||
// map.put(node.getId(), node);
|
||||
// Integer parentId = node.getParentId();
|
||||
// // 判断是否有父节点 (没有父节点本身就是个父菜单)
|
||||
// if (parentId.equals('0')){
|
||||
// rootNodes.add(node);
|
||||
// // 找出不是父级菜单的且集合中包括其父菜单ID
|
||||
// } else if (map.containsKey(parentId)){
|
||||
// map.get(parentId).getChildren().add(node);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
}
|
||||
+7
-1
@@ -143,7 +143,13 @@ public class SarLawsAttrDetailedListServiceImpl extends ServiceImpl<SarLawsAttrD
|
||||
}
|
||||
}
|
||||
}
|
||||
String completedString = builder.delete(builder.length()-1,builder.length()).toString();
|
||||
/**
|
||||
* 当""时索引异常
|
||||
*/
|
||||
String completedString="";
|
||||
if (!"".equals(builder.toString())){
|
||||
completedString = builder.delete(builder.length()-1,builder.length()).toString();
|
||||
}
|
||||
list1.setZRBM(completedString);
|
||||
}
|
||||
else {
|
||||
|
||||
+3
-6
@@ -3,13 +3,10 @@ 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.ResponseResult;
|
||||
import com.adc.da.slrs.sarModelTree.service.ISarModelTreeService;
|
||||
import com.adc.da.slrs.sarModelTree.service.ISarModuleTreeService;
|
||||
import com.adc.da.slrs.sarModelTree.service.impl.SarModuleTreeServiceImpl;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.Company;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.Head;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.ResponseDto;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.Head;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.ResponseDto;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -42,7 +39,7 @@ public class SarModelTreeController extends BaseController<SarModelTree> {
|
||||
@GetMapping("/list")
|
||||
public ResponseMessage<List<SarModelTree>> getAll(){
|
||||
List<SarModelTree> tsResources = iSarModelTreeService.getAll(null);
|
||||
// List<SarModelTree> tsResources = iSarModuleTreeService.getAll(null);
|
||||
// TODO List<SarModelTree> tsResources = iSarModuleTreeService.getAll(null);
|
||||
return Result.success(tsResources);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
package com.adc.da.slrs.sarModelTree.service;
|
||||
|
||||
import com.adc.da.slrs.sarModelTree.entity.SarModelTree;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.Head;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.Head;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
+45
-13
@@ -4,7 +4,7 @@ import com.adc.da.slrs.sarModelTree.dao.SarModuleTreeDao;
|
||||
import com.adc.da.slrs.sarModelTree.entity.SarModelTree;
|
||||
import com.adc.da.slrs.sarModelTree.entity.SarModuleTree;
|
||||
import com.adc.da.slrs.sarModelTree.service.ISarModuleTreeService;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.Head;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.Head;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@@ -17,6 +17,7 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@@ -25,27 +26,38 @@ public class SarModuleTreeServiceImpl extends ServiceImpl<SarModuleTreeDao, SarM
|
||||
@Autowired()
|
||||
private SarModuleTreeServiceImpl sarModuleTreeService;
|
||||
|
||||
|
||||
/**
|
||||
* @param sarModelTree
|
||||
* @return 所有的根节点
|
||||
*/
|
||||
@Override
|
||||
public List<SarModelTree> getAll(SarModelTree sarModelTree) {
|
||||
QueryWrapper<SarModuleTree> treeQueryWrapper = new QueryWrapper<>();
|
||||
treeQueryWrapper.groupBy("FTVSTYPE1");
|
||||
List<SarModuleTree> moduleTreeList = this.baseMapper.selectList(treeQueryWrapper);
|
||||
|
||||
//把SarModuleTree类型的list集合转换为SarModelTree类型的list集合
|
||||
List<SarModelTree> sarModelTreeList = moduleTreeList.stream().map(SarModuleTree -> {
|
||||
SarModelTree modelTree = new SarModelTree();
|
||||
modelTree.setId(SarModuleTree.getGuid());
|
||||
modelTree.setName(SarModuleTree.getFtvstype1());
|
||||
// modelTree.setModel("TS"+SarModuleTree.get);
|
||||
return modelTree;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
return sarModelTreeList;
|
||||
//返回转换元素后的数组
|
||||
return listTransform(moduleTreeList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据根节点查询其所有的子节点
|
||||
* @param parent
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<SarModelTree> recursionGetChildren(SarModelTree parent) {
|
||||
|
||||
QueryWrapper<SarModuleTree> treeQueryWrapper = new QueryWrapper<>();
|
||||
treeQueryWrapper.eq("GUID",parent.getId());
|
||||
List<SarModuleTree> moduleTreeList = this.baseMapper.selectList(treeQueryWrapper);
|
||||
|
||||
|
||||
Map<String, List<SarModuleTree>> collect = moduleTreeList.stream().collect(Collectors.groupingBy(SarModuleTree::getFtvstype1));
|
||||
collect.forEach((k, v)->{
|
||||
SarModelTree modelTree = new SarModelTree();
|
||||
//TODO 生成树型结构
|
||||
// modelTree
|
||||
});
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -93,5 +105,25 @@ public class SarModuleTreeServiceImpl extends ServiceImpl<SarModuleTreeDao, SarM
|
||||
return head;
|
||||
}
|
||||
|
||||
/**
|
||||
* 把SarModuleTree类型的list集合转换为SarModelTree类型的list集合,这样就不用修改前端代码( •̀ ω •́ )✧
|
||||
* --->对修改关闭,对扩展开放
|
||||
* @param moduleTreeList
|
||||
* @return
|
||||
*/
|
||||
public List<SarModelTree> listTransform(List<SarModuleTree> moduleTreeList){
|
||||
|
||||
return moduleTreeList.stream().map(SarModuleTree -> {
|
||||
SarModelTree modelTree = new SarModelTree();
|
||||
modelTree.setId(SarModuleTree.getGuid());
|
||||
modelTree.setName(SarModuleTree.getFtvstype1());
|
||||
modelTree.setModel("TS"
|
||||
+SarModuleTree.getFtvstype2().substring(SarModuleTree.getFtvstype2().length()-2)
|
||||
+SarModuleTree.getSeriesid()
|
||||
+SarModuleTree.getReserved()
|
||||
+SarModuleTree.getStarted()); //"TS"+SF_ID+SE_ID+SU_ID 拼接模块编号ID
|
||||
return modelTree;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -57,6 +57,14 @@ public interface TsPositionDao extends BaseMapper<TsPosition> {
|
||||
*/
|
||||
List<TsPosition> selectPositionAndRole(TsPosition tsPosition);
|
||||
|
||||
/**
|
||||
* 总数
|
||||
* @param tsPosition
|
||||
* @return
|
||||
*/
|
||||
Integer countPositionAndRole(TsPosition tsPosition);
|
||||
|
||||
|
||||
/**
|
||||
* 通过岗位列表查询绑定的角色列表
|
||||
* @param positionIds:岗位列表
|
||||
|
||||
+3
-2
@@ -44,9 +44,10 @@ public class TsPositionServiceImpl extends ServiceImpl<TsPositionDao, TsPosition
|
||||
@Override
|
||||
public IPage<TsPosition> getPosition(TsPosition tsPosition) {
|
||||
IPage page=new Page();
|
||||
|
||||
page.setTotal(tsPositionDao.pageTotal());
|
||||
// page.setTotal(tsPositionDao.pageTotal());
|
||||
page.setTotal(tsPositionDao.countPositionAndRole(tsPosition));
|
||||
page.setRecords(tsPositionDao.selectPositionAndRole(tsPosition));
|
||||
page.setTotal(page.getTotal());
|
||||
page.setCurrent(tsPosition.getCurrent());
|
||||
page.setSize(tsPosition.getPageSize());
|
||||
System.out.println(page.getTotal());
|
||||
|
||||
+6
-16
@@ -2,17 +2,13 @@ package com.adc.da.slrs.sarStandProjectLibrary.controller;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.*;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.Head;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.ResponseDto;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.service.impl.SarStandProjectLibraryServiceImpl;
|
||||
import com.adc.da.sys.util.UUIDUtils;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
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.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -21,8 +17,6 @@ import com.adc.da.base.web.BaseController;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
/**
|
||||
* <p>
|
||||
@@ -50,7 +44,7 @@ public class SarStandProjectLibraryController extends BaseController<SarStandPro
|
||||
**/
|
||||
@GetMapping("/queryProject")
|
||||
@ApiOperation("车型/项目库")
|
||||
public ResponseMessage queryMaintenanceProject(@RequestParam(defaultValue = "1", value = "Page")int Page, @RequestParam(defaultValue = "10", value = "PageSize") int PageSize,
|
||||
public ResponseMessage queryMaintenanceProject(@RequestParam(defaultValue = "1", required=false,value = "page")int Page, @RequestParam(defaultValue = "10", required=false,value = "pageSize") int PageSize,
|
||||
SarStandProjectLibraryDto sarDto) {
|
||||
IPage<SarStandProjectLibrary> MaintenanceList = sarStandProjectLibraryService.queryMaintenanceProject(Page,PageSize,sarDto);
|
||||
IPage<SarStandProjectLibrary> notMaintenanceList = sarStandProjectLibraryService.queryNotMaintenanceProject(Page,PageSize,sarDto);
|
||||
@@ -231,13 +225,9 @@ public class SarStandProjectLibraryController extends BaseController<SarStandPro
|
||||
public ResponseDto save(@RequestBody String jsonStr){
|
||||
log.info(jsonStr);
|
||||
Head head = sarStandProjectLibraryService.AnalysisJsonAndStorage(jsonStr);
|
||||
ArrayList<Company> companies = new ArrayList<>();
|
||||
ResponseDto responseDto = new ResponseDto(head,companies);
|
||||
//todo 未确定返回内容
|
||||
Company company = new Company();
|
||||
company.setCOMPANY_CODE("");
|
||||
company.setFISCAL_YEAR("");
|
||||
companies.add(company);
|
||||
|
||||
ResponseDto responseDto = new ResponseDto(head);
|
||||
|
||||
return responseDto;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
package com.adc.da.slrs.sarStandProjectLibrary.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Company {
|
||||
private String COMPANY_CODE;
|
||||
|
||||
private String FISCAL_YEAR;
|
||||
}
|
||||
-1
@@ -74,7 +74,6 @@ public class SarStandProjectLibrary extends BaseEntity {
|
||||
private String projectManager;
|
||||
|
||||
@ApiModelProperty(value = "项目经理名称")
|
||||
|
||||
@TableField(exist = false)
|
||||
private String uName;
|
||||
|
||||
|
||||
+28
-1
@@ -1,6 +1,7 @@
|
||||
package com.adc.da.slrs.sarStandProjectLibrary.entity;
|
||||
package com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse;
|
||||
|
||||
import com.adc.da.base.entity.BaseEntity;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@@ -24,4 +25,30 @@ public class Head extends BaseEntity {
|
||||
}
|
||||
|
||||
public Head(){};
|
||||
|
||||
|
||||
@JsonProperty("BIZTRANSACTIONID")
|
||||
public String getBIZTRANSACTIONID() {
|
||||
return BIZTRANSACTIONID;
|
||||
}
|
||||
@JsonProperty("RESULT")
|
||||
public String getRESULT() {
|
||||
return RESULT;
|
||||
}
|
||||
@JsonProperty("ERRORCODE")
|
||||
public String getERRORCODE() {
|
||||
return ERRORCODE;
|
||||
}
|
||||
@JsonProperty("ERRORINFO")
|
||||
public String getERRORINFO() {
|
||||
return ERRORINFO;
|
||||
}
|
||||
@JsonProperty("COMMENTS")
|
||||
public String getCOMMENTS() {
|
||||
return COMMENTS;
|
||||
}
|
||||
@JsonProperty("SUCCESSCOUNT")
|
||||
public String getSUCCESSCOUNT() {
|
||||
return SUCCESSCOUNT;
|
||||
}
|
||||
}
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
package com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MyResult {
|
||||
// private String COMPANY_CODE;
|
||||
//
|
||||
// private String FISCAL_YEAR;
|
||||
|
||||
private String msg;
|
||||
|
||||
private String code;
|
||||
|
||||
private boolean success;
|
||||
|
||||
|
||||
public MyResult(){
|
||||
this.msg="";
|
||||
this.code="";
|
||||
this.success=true;
|
||||
}
|
||||
}
|
||||
+16
-8
@@ -1,9 +1,10 @@
|
||||
package com.adc.da.slrs.sarStandProjectLibrary.entity;
|
||||
package com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@Data
|
||||
public class ResponseDto {
|
||||
@@ -26,12 +27,19 @@ public class ResponseDto {
|
||||
}
|
||||
|
||||
public ResponseDto(Head HEAD) {
|
||||
ArrayList<Company> companies = new ArrayList<>();
|
||||
Company company = new Company();
|
||||
company.setCOMPANY_CODE("");
|
||||
company.setFISCAL_YEAR("");
|
||||
companies.add(company);
|
||||
this.LIST=companies;
|
||||
|
||||
|
||||
this.LIST=Arrays.asList(new MyResult());
|
||||
this.HEAD=HEAD;
|
||||
}
|
||||
|
||||
@JsonProperty("HEAD")
|
||||
public Head getHEAD() {
|
||||
return HEAD;
|
||||
}
|
||||
|
||||
@JsonProperty("LIST")
|
||||
public List<?> getLIST() {
|
||||
return LIST;
|
||||
}
|
||||
}
|
||||
+1
@@ -1,6 +1,7 @@
|
||||
package com.adc.da.slrs.sarStandProjectLibrary.service;
|
||||
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.*;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.Head;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
||||
+16
-15
@@ -4,6 +4,7 @@ import com.adc.da.slrs.sarStandAttrInfo.dao.SarStandAttrInfoDao;
|
||||
import com.adc.da.slrs.sarStandAttrInfo.entity.SarStandAttrInfo;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.*;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.dao.SarStandProjectLibraryDao;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.Head;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.service.SarStandProjectLibraryService;
|
||||
import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao;
|
||||
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||
@@ -75,25 +76,23 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
|
||||
//把刚刚拿到的值存到实体类里
|
||||
SarStandProjectLibrary projectInfo = new SarStandProjectLibrary();
|
||||
projectInfo
|
||||
.setProjectPlatfor(projectObject.get("projectPlatfor").getAsString())
|
||||
.setProjectNumber(projectObject.get("projectNumber").getAsString())
|
||||
.setProjectName(projectObject.get("projectName").getAsString())
|
||||
.setProjectClassification(projectObject.get("projectClassification").getAsString())
|
||||
.setProjectStatus(projectObject.get("projectStatus").getAsString())
|
||||
.setProjectGroup(projectObject.get("projectGroup").getAsString())
|
||||
.setCurrentNode(projectObject.get("currentNode").getAsString())
|
||||
.setProjectLevel(projectObject.get("projectLevel").getAsString())
|
||||
.setProductLine(projectObject.get("productLine").getAsString());
|
||||
|
||||
projectObject.get("projectEndDate").getAsString();
|
||||
.setProjectPlatfor(projectObject.get("eng_platform").getAsString())
|
||||
.setProjectNumber(projectObject.get("code").getAsString())
|
||||
.setProjectName(projectObject.get("name").getAsString())
|
||||
.setProjectClassification(projectObject.get("catalog_name").getAsString())
|
||||
.setProjectStatus(projectObject.get("project_status").getAsString())
|
||||
.setProjectGroup(projectObject.get("project_group_name").getAsString())
|
||||
.setCurrentNode(projectObject.get("project_current_milestone").getAsString())
|
||||
.setProjectLevel(projectObject.get("project_level").getAsString())
|
||||
.setProductLine(projectObject.get("eng_product_line").getAsString());
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
|
||||
Date targetBeginOn = null;
|
||||
try {
|
||||
targetBeginOn = simpleDateFormat.parse(projectObject.get("projectStartDate").getAsString());
|
||||
|
||||
Date targetEndOn = simpleDateFormat.parse(projectObject.get("projectEndDate").getAsString());
|
||||
try {
|
||||
Date targetBeginOn = simpleDateFormat.parse(projectObject.get("target_begin_on").getAsString());
|
||||
|
||||
Date targetEndOn = simpleDateFormat.parse(projectObject.get("target_end_on").getAsString());
|
||||
projectInfo
|
||||
.setProjectStartDate(targetBeginOn)
|
||||
.setProjectEndDate(targetEndOn);
|
||||
@@ -436,6 +435,7 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
|
||||
Page<SarStandProjectLibrary> page = new Page<>(current, pageSize);
|
||||
IPage<SarStandProjectLibrary> userIPage = new Page<>();
|
||||
if (3!=flag) {
|
||||
//6922
|
||||
List<SarStandProjectLibrary> sarStandProjectLibraries = sarStandProjectLibraryDao.selectPages(current, pageSize, wrapper, flag);
|
||||
Integer count = sarStandProjectLibraryDao.selectCount(wrapper, flag);
|
||||
userIPage.setCurrent(current);
|
||||
@@ -445,6 +445,7 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
|
||||
return userIPage;
|
||||
}
|
||||
else {
|
||||
//6922
|
||||
flag=2;
|
||||
List<SarStandProjectLibrary> sarStandProjectLibraries = sarStandProjectLibraryDao.selectPagesWorkFlow(current, pageSize, wrapper, flag);
|
||||
Integer count = sarStandProjectLibraryDao.selectCountWorkFlow(wrapper, flag);
|
||||
|
||||
+3
-11
@@ -2,9 +2,8 @@ package com.adc.da.slrs.sarStandProjectTeam.controller;
|
||||
|
||||
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.Company;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.Head;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.ResponseDto;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.Head;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.ResponseDto;
|
||||
import com.adc.da.slrs.sarStandProjectTeam.entity.SarStandProjectTeam;
|
||||
import com.adc.da.slrs.sarStandProjectTeam.service.ISarStandProjectTeamService;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -16,8 +15,6 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -41,13 +38,8 @@ public class SarStandProjectTeamController extends BaseController<SarStandProjec
|
||||
public ResponseDto save(@RequestBody String jsonStr){
|
||||
log.info(jsonStr);
|
||||
Head head = sarStandProjectTeamService.AnalysisJsonAndStorage(jsonStr);
|
||||
ArrayList<Company> companies = new ArrayList<>();
|
||||
//todo 未确定返回内容
|
||||
Company company = new Company();
|
||||
company.setCOMPANY_CODE("");
|
||||
company.setFISCAL_YEAR("");
|
||||
companies.add(company);
|
||||
ResponseDto responseDto = new ResponseDto(head,companies);
|
||||
ResponseDto responseDto = new ResponseDto(head);
|
||||
return responseDto;
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package com.adc.da.slrs.sarStandProjectTeam.service;
|
||||
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.Head;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.Head;
|
||||
import com.adc.da.slrs.sarStandProjectTeam.entity.SarStandProjectTeam;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
|
||||
+1
-3
@@ -1,15 +1,13 @@
|
||||
package com.adc.da.slrs.sarStandProjectTeam.service.impl;
|
||||
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.Head;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.myResponse.Head;
|
||||
import com.adc.da.slrs.sarStandProjectTeam.entity.SarStandProjectTeam;
|
||||
import com.adc.da.slrs.sarStandProjectTeam.dao.SarStandProjectTeamDao;
|
||||
import com.adc.da.slrs.sarStandProjectTeam.service.ISarStandProjectTeamService;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
+14
-6
@@ -96,22 +96,22 @@ public class SarStandardsInfoController extends BaseController<SarStandardsInfo>
|
||||
if (null != page.getNowOrderBy()) {
|
||||
switch (page.getNowOrderBy()) {
|
||||
case 1:
|
||||
page.setOrderBy1("issueTime");//发布日期
|
||||
page.setOrderByA("issueTime");//发布日期
|
||||
break;
|
||||
case 2:
|
||||
page.setOrderBy1("SAR_STAND_ATTR_INFO.ZCCSSRQ");//新车型实施日期
|
||||
page.setOrderByA("SAR_STAND_ATTR_INFO.ZCCSSRQ");//新车型实施日期
|
||||
break;
|
||||
case 3:
|
||||
page.setOrderBy1("SAR_STAND_ATTR_INFO.XCXSSRQ");//在产车实施日期
|
||||
page.setOrderByA("SAR_STAND_ATTR_INFO.XCXSSRQ");//在产车实施日期
|
||||
break;
|
||||
case 4:
|
||||
page.setOrderBy1("SAR_STANDARDS_INFO.text_status");//文本状态
|
||||
page.setOrderByA("SAR_STANDARDS_INFO.text_status");//文本状态
|
||||
break;
|
||||
case 5:
|
||||
page.setOrderBy1("paixu");
|
||||
page.setOrderByA("paixu");
|
||||
break;
|
||||
case 6:
|
||||
page.setOrderBy1("SAR_STAND_ATTR_INFO.SSRQ");
|
||||
page.setOrderByA("SAR_STAND_ATTR_INFO.SSRQ");
|
||||
break;
|
||||
default:
|
||||
page.setNowOrder(null);
|
||||
@@ -466,6 +466,14 @@ public class SarStandardsInfoController extends BaseController<SarStandardsInfo>
|
||||
return Result.success(result);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "|SarStandardsInfoEO|修改详情")
|
||||
@GetMapping("/getStandInfoUpdateById")
|
||||
//@RequiresPermissions("lawss:sarStandardsInfo:get")
|
||||
public ResponseMessage<SarStandardsInfo> findUpdateById(String id) throws Exception {
|
||||
SarStandardsInfo result = sarStandardsInfoEOService.selectStandardsInfoUpdateByKey(id);
|
||||
return Result.success(result);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "|SarStandardsInfoEO|确认配置标准")
|
||||
@PostMapping("/saveStandardsMenu")
|
||||
//@RequiresPermissions("lawss:sarStandardsInfo:saveStandardsMenu")
|
||||
|
||||
+6
@@ -199,6 +199,12 @@ public class SarStandardsInfo extends BaseEntity {
|
||||
private String jspg;
|
||||
@TableField(exist = false)
|
||||
private String CHJL;
|
||||
@TableField(exist = false)
|
||||
private String SSRQ;
|
||||
@TableField(exist = false)
|
||||
private String ZCCSSRQ;
|
||||
@TableField(exist = false)
|
||||
private String XCXSSRQ;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String putTime2;
|
||||
|
||||
+1
@@ -84,6 +84,7 @@ public class SarStandardsInfoEOPage extends BasePage {
|
||||
private String productId;
|
||||
private Integer nowOrder;
|
||||
private Integer nowOrderBy;
|
||||
private String orderByA = "a.issue_time";
|
||||
private String orderBy1 = "SAR_STANDARDS_INFO.issue_time";
|
||||
private String order1 = "desc";
|
||||
|
||||
|
||||
+2
@@ -37,6 +37,8 @@ public interface ISarStandardsInfoService extends IService<SarStandardsInfo> {
|
||||
|
||||
SarStandardsInfo selectStandardsInfoByKey(String id) throws Exception;
|
||||
|
||||
SarStandardsInfo selectStandardsInfoUpdateByKey(String id) throws Exception;
|
||||
|
||||
public void attrInfoDetails (SarStandardsInfo row) throws Exception;
|
||||
|
||||
boolean updateStandardsMenu(SarStandardsInfoEOPage standardsInfoEO);
|
||||
|
||||
+69
-38
@@ -1,6 +1,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.sarUser.entity.TsUser;
|
||||
import com.adc.da.att.service.IAttFileEOService;
|
||||
import com.adc.da.att.vo.AttFileVo;
|
||||
import com.adc.da.common.*;
|
||||
@@ -69,6 +72,7 @@ import com.alibaba.fastjson.serializer.SerializerFeature;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.apache.catalina.User;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.pdfbox.pdmodel.PDDocument;
|
||||
import org.apache.pdfbox.util.PDFTextStripper;
|
||||
@@ -116,6 +120,9 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
@Value("${file.path}")
|
||||
private String filePath;//文件存储路径
|
||||
|
||||
@Autowired
|
||||
private ITsPositionService iTsPositionService;
|
||||
|
||||
@Autowired
|
||||
private SarStandardsInfoDao dao;
|
||||
|
||||
@@ -300,10 +307,16 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
Integer rowCount = dao.getSarStandardsInfoCount(page);
|
||||
page.getPager().setRowCount(rowCount);
|
||||
List<SarStandardsInfo> sarlist = dao.getSarStandardsInfoPage(page);
|
||||
attrInfo(sarlist);
|
||||
attrInfoCollect(sarlist);
|
||||
return sarlist;
|
||||
}
|
||||
|
||||
public void attrInfo(List<SarStandardsInfo> sarlist) throws Exception {
|
||||
for (SarStandardsInfo row : sarlist) {
|
||||
attrInfoDetails(row);
|
||||
}
|
||||
}
|
||||
|
||||
/***
|
||||
* @Description: 处理属性表数据
|
||||
* @Author: super_liu
|
||||
@@ -311,9 +324,13 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
* @Param: [sarlist]
|
||||
* @Return: void
|
||||
*/
|
||||
public void attrInfo(List<SarStandardsInfo> sarlist) throws Exception {
|
||||
public void attrInfoCollect(List<SarStandardsInfo> sarlist) throws Exception {
|
||||
List<String> collectResIds = sarlist.stream().map(SarStandardsInfo::getId).collect(Collectors.toList());
|
||||
Map<String,String> collectMap = personCollectEOService.queryCollectByUserAndIds(collectResIds);
|
||||
for (SarStandardsInfo row : sarlist) {
|
||||
attrInfoDetails(row);
|
||||
if(collectMap != null && collectMap.get(row.getId()) != null){
|
||||
row.setCollectId(collectMap.get(row.getId()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -337,44 +354,11 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
Map<String, Object> newMap = new HashMap<>();
|
||||
if (getAttrMap != null) {
|
||||
for (Map.Entry<String, Object> entry : getAttrMap.entrySet()) {
|
||||
if ("EOPSSRQ".equals(entry.getKey())) {
|
||||
if (entry.getValue() != null && entry.getValue().toString().length() > 10) {
|
||||
String time = DateUtil.formatStrUTCToDateStr(entry.getValue().toString());
|
||||
entry.setValue(time);
|
||||
}
|
||||
}
|
||||
String name = entry.getKey();
|
||||
if ("\"null\"".equals(entry.getValue())) {
|
||||
entry.setValue("");
|
||||
}
|
||||
if ("SVPPS".equals(name)) {
|
||||
Set<String> set = new HashSet();
|
||||
// 查询条款svpps
|
||||
Set<String> itemSvpps = sarStandItemsEODao.selectSvppsByStandId(row.getId(), null, null);
|
||||
if (itemSvpps != null && !itemSvpps.isEmpty()) {
|
||||
set.addAll(itemSvpps);
|
||||
}
|
||||
Object value = entry.getValue();
|
||||
if (value != null && StringUtils.isNotBlank(value.toString())) {
|
||||
set.addAll(Arrays.asList(value.toString().split(",")));
|
||||
}
|
||||
String allVal = ConcatStringUtil.concatSet(set);
|
||||
if (StringUtils.isNotBlank(allVal)) {
|
||||
entry.setValue(allVal);
|
||||
value = sysInfoEOService.getSvppsNamesByIds(allVal);
|
||||
}
|
||||
newMap.put(name + "Name", value);
|
||||
} else if ("YQLX".equals(name)) {
|
||||
//要求类型来源于条款
|
||||
SarStandItems sarStandItemsEO = new SarStandItems();
|
||||
sarStandItemsEO.setStandId(row.getId());
|
||||
Set<String> itemClaimType = sarStandItemsEODao.selectClaimTypesByStandId(row.getId(), null, null);
|
||||
if (itemClaimType != null && itemClaimType.size() > 1) {
|
||||
entry.setValue("RENVECPFGT");
|
||||
} else if (itemClaimType != null && itemClaimType.size() == 1) {
|
||||
entry.setValue(itemClaimType.toArray()[0]);
|
||||
}
|
||||
} else if (entry.getValue() != null && InitStandAttrUtil.selectionFieldList != null && InitStandAttrUtil.selectionFieldList.size() > 0 && InitStandAttrUtil.selectionFieldList.contains(name)) {
|
||||
if (entry.getValue() != null && InitStandAttrUtil.selectionFieldList != null && InitStandAttrUtil.selectionFieldList.size() > 0 && InitStandAttrUtil.selectionFieldList.contains(name)) {
|
||||
String value = entry.getValue().toString();
|
||||
String selVal = InitStandAttrUtil.selectFieldMap.get(name);
|
||||
if (SelectionTypeEnum.ORGLIST.getValue().equals(selVal)) {
|
||||
@@ -482,7 +466,30 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
}else if (entry.getValue() != null && InitStandAttrUtil.selectionFieldList != null && InitStandAttrUtil.selectionFieldList.size() > 0 && InitStandAttrUtil.selectionFieldList.contains(name)) {
|
||||
value = entry.getValue().toString();
|
||||
List<String> valArr = Arrays.asList(value.split(","));
|
||||
value = dicTypeEODao.getDicNamesByCodes(valArr);
|
||||
|
||||
switch (name){
|
||||
//通过id绑定责任工程师名称
|
||||
case "ZRGCS":{
|
||||
QueryWrapper<TsUser> tsUserQW = new QueryWrapper<>();
|
||||
tsUserQW.select("UNAME")
|
||||
.in("USID",valArr);
|
||||
List<String> stringList = tsUserService.listObjs(tsUserQW, o ->o.toString());
|
||||
value= String.join(",", stringList);
|
||||
break;
|
||||
}
|
||||
//通过id绑定责任部门师名称
|
||||
case "ZRBM":{
|
||||
QueryWrapper<TsPosition> tsPositionQW = new QueryWrapper<>();
|
||||
tsPositionQW.select("name")
|
||||
.in("id",valArr);
|
||||
List<String> stringList = iTsPositionService.listObjs(tsPositionQW, o -> o.toString());
|
||||
value = String.join(",", stringList);
|
||||
break;
|
||||
}
|
||||
default:value = dicTypeEODao.getDicNamesByCodes(valArr);
|
||||
}
|
||||
|
||||
|
||||
entry.setValue(value);
|
||||
}
|
||||
}
|
||||
@@ -2126,6 +2133,30 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
|
||||
return sarStandardsInfoEO;
|
||||
}
|
||||
|
||||
public SarStandardsInfo selectStandardsInfoUpdateByKey(String id) throws Exception {
|
||||
//查询出详情信息
|
||||
List<SarStandardsInfo> resultlist = dao.selectStandardsInfoByKey(id);
|
||||
SarStandardsInfo sarStandardsInfoEO = new SarStandardsInfo();
|
||||
if (resultlist.size() > 0) {
|
||||
List<SarStandardsInfo> sarStandardsInfoEOList = new ArrayList<>();
|
||||
sarStandardsInfoEOList.add(resultlist.get(0));
|
||||
attrInfo(sarStandardsInfoEOList);
|
||||
sarStandardsInfoEO = sarStandardsInfoEOList.get(0);
|
||||
}
|
||||
// 查询纳入清单的国家地区
|
||||
if (sarStandardsInfoEO != null) {
|
||||
if(sarStandardsInfoEO.getStandSystem() != null){
|
||||
SarMenuStandard menu = sarMenuStandardService.selectMenuById(sarStandardsInfoEO.getStandSystem());
|
||||
if(menu != null){
|
||||
sarStandardsInfoEO.setStandSystemName(menu.getMenuName() == null ? "" : menu.getMenuName());
|
||||
}
|
||||
}
|
||||
String accessCountry = sarSarAccessEOService.getCountryByRes(sarStandardsInfoEO.getId(), sarStandardsInfoEO.getStandType() + "_STAND");
|
||||
sarStandardsInfoEO.setAccessCountry(accessCountry);
|
||||
}
|
||||
return sarStandardsInfoEO;
|
||||
}
|
||||
|
||||
public boolean updateStandardsMenu(SarStandardsInfoEOPage standardsInfoEO) {
|
||||
SarStandMenu sarStandMenuEO = new SarStandMenu();
|
||||
String nowMenuId = standardsInfoEO.getMenuId();
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@
|
||||
<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.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
|
||||
</sql>
|
||||
|
||||
@@ -40,6 +40,24 @@
|
||||
select * from ts_user
|
||||
WHERE institution_id=#{institutionId}
|
||||
</select>
|
||||
|
||||
<select id="selectTreeByIds" resultMap="TsInstitution">
|
||||
<foreach collection="rootIds" item="id">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
ts_institution
|
||||
WHERE
|
||||
FIND_IN_SET(
|
||||
id,
|
||||
GET_PARENT_NODE (#{id})
|
||||
);
|
||||
</foreach>
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectRootAndUser" resultMap="InstitutionAndUser">
|
||||
select i.*,u.usid,u.account,u.uname,u.institution_id from ts_institution i
|
||||
left join ts_user u
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
<where>
|
||||
<if test="name!=null">
|
||||
p.name like concat(concat('%',#{name}),'%')
|
||||
order by locate(#{name},p.name)
|
||||
</if>
|
||||
</where>
|
||||
<if test=" null!= pageSize ">
|
||||
@@ -37,6 +38,20 @@
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="countPositionAndRole" resultType="java.lang.Integer">
|
||||
select count(1) from ts_position p
|
||||
left join ts_position_role pr
|
||||
on p.id=pr.position_id
|
||||
left join ts_role r
|
||||
on pr.role_id=r.id
|
||||
<where>
|
||||
<if test="name!=null">
|
||||
p.name like concat(concat('%',#{name}),'%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="pageTotal" resultType="Long">
|
||||
select count(1) as total from ts_position
|
||||
</select>
|
||||
|
||||
+93
-71
@@ -41,57 +41,59 @@
|
||||
|
||||
<select id="selectCount" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
count(sar_stand_project_library.id ) as total
|
||||
count(
|
||||
library.id
|
||||
) AS total
|
||||
FROM
|
||||
sar_stand_project_library
|
||||
LEFT JOIN ts_user tu ON project_manager = tu.USID
|
||||
sar_stand_project_library as library
|
||||
LEFT JOIN sar_stand_project_team as team ON team.project_code = library.project_number
|
||||
WHERE
|
||||
|
||||
<if test="flag == 1">
|
||||
id NOT IN ( SELECT project_id FROM sar_stand_project_relation )
|
||||
library.id NOT IN ( SELECT project_id FROM sar_stand_project_relation )
|
||||
</if>
|
||||
<if test="flag == 2">
|
||||
id IN ( SELECT project_id FROM sar_stand_project_relation )
|
||||
library.id IN ( SELECT project_id FROM sar_stand_project_relation )
|
||||
</if>
|
||||
<if test="flag == 4">
|
||||
1=1
|
||||
</if>
|
||||
<if test="qu != null">
|
||||
<if test="qu.projectNumber != null">
|
||||
AND project_number LIKE concat(concat('%',#{qu.projectNumber}),'%')
|
||||
AND library.project_number LIKE concat(concat('%',#{qu.projectNumber}),'%')
|
||||
</if>
|
||||
<if test="qu.projectName != null">
|
||||
AND project_name LIKE concat(concat('%',#{qu.projectName}),'%')
|
||||
AND library.project_name LIKE concat(concat('%',#{qu.projectName}),'%')
|
||||
</if>
|
||||
<if test="qu.projectClassification != null">
|
||||
AND project_classification LIKE concat(concat('%',#{qu.projectClassification}),'%')
|
||||
AND library.project_classification LIKE concat(concat('%',#{qu.projectClassification}),'%')
|
||||
</if>
|
||||
<if test="qu.projectPlatfor != null">
|
||||
AND project_platfor LIKE concat(concat('%',#{qu.projectPlatfor}),'%')
|
||||
AND library.project_platfor LIKE concat(concat('%',#{qu.projectPlatfor}),'%')
|
||||
</if>
|
||||
<if test="qu.projectGroup != null">
|
||||
AND project_group LIKE concat(concat('%',#{qu.projectGroup}),'%')
|
||||
AND library.project_group LIKE concat(concat('%',#{qu.projectGroup}),'%')
|
||||
</if>
|
||||
<if test="qu.projectStatus != null">
|
||||
AND project_status LIKE concat(concat('%',#{qu.projectStatus}),'%')
|
||||
AND library.project_status LIKE concat(concat('%',#{qu.projectStatus}),'%')
|
||||
</if>
|
||||
<if test="qu.currentNode != null">
|
||||
AND current_node LIKE concat(concat('%',#{qu.currentNode}),'%')
|
||||
AND library.current_node LIKE concat(concat('%',#{qu.currentNode}),'%')
|
||||
</if>
|
||||
<if test="qu.projectLevel != null">
|
||||
AND project_level LIKE concat(concat('%',#{qu.projectLevel}),'%')
|
||||
AND library.project_level LIKE concat(concat('%',#{qu.projectLevel}),'%')
|
||||
</if>
|
||||
<if test="qu.projectManager != null">
|
||||
AND project_manager LIKE concat(concat('%',#{qu.projectManager}),'%')
|
||||
AND team.name LIKE concat(concat('%',#{qu.projectManager}),'%')
|
||||
</if>
|
||||
<if test="qu.productLine != null">
|
||||
AND product_line LIKE concat(concat('%',#{qu.productLine}),'%')
|
||||
AND library.product_line LIKE concat(concat('%',#{qu.productLine}),'%')
|
||||
</if>
|
||||
<if test="qu.projectStartDate != null">
|
||||
AND project_start_date >= #{qu.projectStartDate}
|
||||
AND library.project_start_date >= #{qu.projectStartDate}
|
||||
</if>
|
||||
<if test="qu.projectEndDate != null">
|
||||
AND project_end_date <= #{qu.projectEndDate}
|
||||
AND library.project_end_date <= #{qu.projectEndDate}
|
||||
</if>
|
||||
</if>
|
||||
|
||||
@@ -99,57 +101,59 @@
|
||||
|
||||
<select id="selectPages" resultType="com.adc.da.slrs.sarStandProjectLibrary.entity.SarStandProjectLibrary">
|
||||
SELECT
|
||||
sar_stand_project_library.*,
|
||||
tu.UNAME as uName
|
||||
library.*,
|
||||
team.`name` as uName
|
||||
FROM
|
||||
sar_stand_project_library
|
||||
LEFT JOIN ts_user tu ON project_manager = tu.USID
|
||||
sar_stand_project_library as library
|
||||
LEFT JOIN sar_stand_project_team as team
|
||||
ON team.project_code = library.project_number
|
||||
WHERE
|
||||
<if test="flag == 1">
|
||||
id NOT IN ( SELECT project_id FROM sar_stand_project_relation )
|
||||
library.id NOT IN ( SELECT project_id FROM sar_stand_project_relation )
|
||||
</if>
|
||||
<if test="flag == 2">
|
||||
id IN ( SELECT project_id FROM sar_stand_project_relation )
|
||||
library.id IN ( SELECT project_id FROM sar_stand_project_relation )
|
||||
</if>
|
||||
<if test="flag == 4">
|
||||
1=1
|
||||
</if>
|
||||
<if test="qu != null">
|
||||
|
||||
<if test="qu.projectNumber != null">
|
||||
AND project_number LIKE concat(concat('%',#{qu.projectNumber}),'%')
|
||||
AND library.project_number LIKE concat(concat('%',#{qu.projectNumber}),'%')
|
||||
</if>
|
||||
<if test="qu.projectName != null">
|
||||
AND project_name LIKE concat(concat('%',#{qu.projectName}),'%')
|
||||
AND library.project_name LIKE concat(concat('%',#{qu.projectName}),'%')
|
||||
</if>
|
||||
<if test="qu.projectClassification != null">
|
||||
AND project_classification LIKE concat(concat('%',#{qu.projectClassification}),'%')
|
||||
AND library.project_classification LIKE concat(concat('%',#{qu.projectClassification}),'%')
|
||||
</if>
|
||||
<if test="qu.projectPlatfor != null">
|
||||
AND project_platfor LIKE concat(concat('%',#{qu.projectPlatfor}),'%')
|
||||
AND library.project_platfor LIKE concat(concat('%',#{qu.projectPlatfor}),'%')
|
||||
</if>
|
||||
<if test="qu.projectGroup != null">
|
||||
AND project_group LIKE concat(concat('%',#{qu.projectGroup}),'%')
|
||||
AND library.project_group LIKE concat(concat('%',#{qu.projectGroup}),'%')
|
||||
</if>
|
||||
<if test="qu.projectStatus != null">
|
||||
AND project_status LIKE concat(concat('%',#{qu.projectStatus}),'%')
|
||||
AND library.project_status LIKE concat(concat('%',#{qu.projectStatus}),'%')
|
||||
</if>
|
||||
<if test="qu.currentNode != null">
|
||||
AND current_node LIKE concat(concat('%',#{qu.currentNode}),'%')
|
||||
AND library.current_node LIKE concat(concat('%',#{qu.currentNode}),'%')
|
||||
</if>
|
||||
<if test="qu.projectLevel != null">
|
||||
AND project_level LIKE concat(concat('%',#{qu.projectLevel}),'%')
|
||||
AND library.project_level LIKE concat(concat('%',#{qu.projectLevel}),'%')
|
||||
</if>
|
||||
<if test="qu.projectManager != null">
|
||||
AND project_manager LIKE concat(concat('%',#{qu.projectManager}),'%')
|
||||
AND team.name LIKE concat(concat('%',#{qu.projectManager}),'%')
|
||||
</if>
|
||||
<if test="qu.productLine != null">
|
||||
AND product_line LIKE concat(concat('%',#{qu.productLine}),'%')
|
||||
AND library.product_line LIKE concat(concat('%',#{qu.productLine}),'%')
|
||||
</if>
|
||||
<if test="qu.projectStartDate != null">
|
||||
AND project_start_date >= #{qu.projectStartDate}
|
||||
AND library.project_start_date >= #{qu.projectStartDate}
|
||||
</if>
|
||||
<if test="qu.projectEndDate != null">
|
||||
AND project_end_date <= #{qu.projectEndDate}
|
||||
AND library.project_end_date <= #{qu.projectEndDate}
|
||||
</if>
|
||||
</if>
|
||||
|
||||
@@ -158,54 +162,61 @@
|
||||
<select id="selectPagesWorkFlow"
|
||||
resultType="com.adc.da.slrs.sarStandProjectLibrary.entity.SarStandProjectLibrary">
|
||||
SELECT
|
||||
sar_stand_project_library.*,
|
||||
tu.UNAME as uName
|
||||
library.*, team.`name` AS uName
|
||||
FROM
|
||||
sar_stand_project_library
|
||||
LEFT JOIN ts_user tu ON project_manager = tu.USID
|
||||
sar_stand_project_library as library
|
||||
LEFT JOIN sar_stand_project_team as team ON team.project_code = library.project_number
|
||||
WHERE
|
||||
(
|
||||
id IN ( SELECT DISTINCT project_id FROM sar_stand_project_relation WHERE project_id NOT in ( SELECT DISTINCT
|
||||
STAND_ID FROM
|
||||
library.id IN (
|
||||
SELECT DISTINCT
|
||||
project_id
|
||||
FROM
|
||||
sar_stand_project_relation
|
||||
WHERE
|
||||
project_id NOT IN (
|
||||
SELECT DISTINCT
|
||||
STAND_ID
|
||||
FROM
|
||||
sar_stand_items
|
||||
)
|
||||
)
|
||||
<if test="qu != null">
|
||||
<if test="qu.projectNumber != null">
|
||||
AND project_number LIKE concat(concat('%',#{qu.projectNumber}),'%')
|
||||
AND library.project_number LIKE concat(concat('%',#{qu.projectNumber}),'%')
|
||||
</if>
|
||||
<if test="qu.projectName != null">
|
||||
AND project_name LIKE concat(concat('%',#{qu.projectName}),'%')
|
||||
AND library.project_name LIKE concat(concat('%',#{qu.projectName}),'%')
|
||||
</if>
|
||||
<if test="qu.projectClassification != null">
|
||||
AND project_classification LIKE concat(concat('%',#{qu.projectClassification}),'%')
|
||||
AND library.project_classification LIKE concat(concat('%',#{qu.projectClassification}),'%')
|
||||
</if>
|
||||
<if test="qu.projectPlatfor != null">
|
||||
AND project_platfor LIKE concat(concat('%',#{qu.projectPlatfor}),'%')
|
||||
AND library.project_platfor LIKE concat(concat('%',#{qu.projectPlatfor}),'%')
|
||||
</if>
|
||||
<if test="qu.projectGroup != null">
|
||||
AND project_group LIKE concat(concat('%',#{qu.projectGroup}),'%')
|
||||
AND library.project_group LIKE concat(concat('%',#{qu.projectGroup}),'%')
|
||||
</if>
|
||||
<if test="qu.projectStatus != null">
|
||||
AND project_status LIKE concat(concat('%',#{qu.projectStatus}),'%')
|
||||
AND library.project_status LIKE concat(concat('%',#{qu.projectStatus}),'%')
|
||||
</if>
|
||||
<if test="qu.currentNode != null">
|
||||
AND current_node LIKE concat(concat('%',#{qu.currentNode}),'%')
|
||||
AND library.current_node LIKE concat(concat('%',#{qu.currentNode}),'%')
|
||||
</if>
|
||||
<if test="qu.projectLevel != null">
|
||||
AND project_level LIKE concat(concat('%',#{qu.projectLevel}),'%')
|
||||
AND library.project_level LIKE concat(concat('%',#{qu.projectLevel}),'%')
|
||||
</if>
|
||||
<if test="qu.projectManager != null">
|
||||
AND project_manager LIKE concat(concat('%',#{qu.projectManager}),'%')
|
||||
AND team.name LIKE concat(concat('%',#{qu.projectManager}),'%')
|
||||
</if>
|
||||
<if test="qu.productLine != null">
|
||||
AND product_line LIKE concat(concat('%',#{qu.productLine}),'%')
|
||||
AND library.product_line LIKE concat(concat('%',#{qu.productLine}),'%')
|
||||
</if>
|
||||
<if test="qu.projectStartDate != null">
|
||||
AND project_start_date >= #{qu.projectStartDate}
|
||||
AND library.project_start_date >= #{qu.projectStartDate}
|
||||
</if>
|
||||
<if test="qu.projectEndDate != null">
|
||||
AND project_end_date <= #{qu.projectEndDate}
|
||||
AND library.project_end_date <= #{qu.projectEndDate}
|
||||
</if>
|
||||
</if>
|
||||
)
|
||||
@@ -214,53 +225,64 @@
|
||||
</select>
|
||||
<select id="selectCountWorkFlow" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
count(sar_stand_project_library.id ) as total
|
||||
count(
|
||||
library.id
|
||||
) AS total
|
||||
FROM
|
||||
sar_stand_project_library
|
||||
LEFT JOIN ts_user tu ON project_manager = tu.USID
|
||||
sar_stand_project_library AS library
|
||||
LEFT JOIN sar_stand_project_team AS team ON team.project_code = library.project_number
|
||||
WHERE
|
||||
(
|
||||
id IN ( SELECT DISTINCT project_id FROM sar_stand_project_relation WHERE project_id NOT in ( SELECT DISTINCT
|
||||
STAND_ID FROM
|
||||
library.id IN (
|
||||
SELECT DISTINCT
|
||||
project_id
|
||||
FROM
|
||||
sar_stand_project_relation
|
||||
WHERE
|
||||
project_id NOT IN (
|
||||
SELECT DISTINCT
|
||||
STAND_ID
|
||||
FROM
|
||||
sar_stand_items
|
||||
))
|
||||
)
|
||||
)
|
||||
|
||||
<if test="qu != null">
|
||||
<if test="qu.projectNumber != null">
|
||||
AND project_number LIKE concat(concat('%',#{qu.projectNumber}),'%')
|
||||
AND library.project_number LIKE concat(concat('%',#{qu.projectNumber}),'%')
|
||||
</if>
|
||||
<if test="qu.projectName != null">
|
||||
AND project_name LIKE concat(concat('%',#{qu.projectName}),'%')
|
||||
AND library.project_name LIKE concat(concat('%',#{qu.projectName}),'%')
|
||||
</if>
|
||||
<if test="qu.projectClassification != null">
|
||||
AND project_classification LIKE concat(concat('%',#{qu.projectClassification}),'%')
|
||||
AND library.project_classification LIKE concat(concat('%',#{qu.projectClassification}),'%')
|
||||
</if>
|
||||
<if test="qu.projectPlatfor != null">
|
||||
AND project_platfor LIKE concat(concat('%',#{qu.projectPlatfor}),'%')
|
||||
AND library.project_platfor LIKE concat(concat('%',#{qu.projectPlatfor}),'%')
|
||||
</if>
|
||||
<if test="qu.projectGroup != null">
|
||||
AND project_group LIKE concat(concat('%',#{qu.projectGroup}),'%')
|
||||
AND library.project_group LIKE concat(concat('%',#{qu.projectGroup}),'%')
|
||||
</if>
|
||||
<if test="qu.projectStatus != null">
|
||||
AND project_status LIKE concat(concat('%',#{qu.projectStatus}),'%')
|
||||
AND library.project_status LIKE concat(concat('%',#{qu.projectStatus}),'%')
|
||||
</if>
|
||||
<if test="qu.currentNode != null">
|
||||
AND current_node LIKE concat(concat('%',#{qu.currentNode}),'%')
|
||||
AND library.current_node LIKE concat(concat('%',#{qu.currentNode}),'%')
|
||||
</if>
|
||||
<if test="qu.projectLevel != null">
|
||||
AND project_level LIKE concat(concat('%',#{qu.projectLevel}),'%')
|
||||
AND library.project_level LIKE concat(concat('%',#{qu.projectLevel}),'%')
|
||||
</if>
|
||||
<if test="qu.projectManager != null">
|
||||
AND project_manager LIKE concat(concat('%',#{qu.projectManager}),'%')
|
||||
AND team.name LIKE concat(concat('%',#{qu.projectManager}),'%')
|
||||
</if>
|
||||
<if test="qu.productLine != null">
|
||||
AND product_line LIKE concat(concat('%',#{qu.productLine}),'%')
|
||||
AND library.product_line LIKE concat(concat('%',#{qu.productLine}),'%')
|
||||
</if>
|
||||
<if test="qu.projectStartDate != null">
|
||||
AND project_start_date >= #{qu.projectStartDate}
|
||||
AND library.project_start_date >= #{qu.projectStartDate}
|
||||
</if>
|
||||
<if test="qu.projectEndDate != null">
|
||||
AND project_end_date <= #{qu.projectEndDate}
|
||||
AND library.project_end_date <= #{qu.projectEndDate}
|
||||
</if>
|
||||
</if>
|
||||
)
|
||||
|
||||
+224
-42
@@ -503,7 +503,7 @@
|
||||
and SAR_STANDARDS_INFO.STAND_YEAR = #{standYear}
|
||||
</if>
|
||||
<if test="issueTime != null and issueTime != ''">
|
||||
and SAR_STANDARDS_INFO.ISSUE_TIME = #{issueTime}
|
||||
and DATE_FORMAT(SAR_STANDARDS_INFO.ISSUE_TIME ,'%Y-%m-%d') = #{issueTime}
|
||||
</if>
|
||||
<!--内容摘要-->
|
||||
<if test="synopsis != null and synopsis != ''" >
|
||||
@@ -544,53 +544,234 @@
|
||||
</trim>
|
||||
</sql>
|
||||
|
||||
<sql id="SarStandardsInfo_in_left">
|
||||
left join SAR_STAND_MENU ON SAR_STANDARDS_INFO.id = SAR_STAND_MENU.stand_id
|
||||
where 1=1 and SAR_STANDARDS_INFO.valid_flag=0
|
||||
<trim suffixOverrides=",">
|
||||
<!-- 标准分类 国内标准,国外标准 必要搜索项 -->
|
||||
<if test='standType != null and standType != "ALL"'>
|
||||
and stand_type = #{standType}
|
||||
</if>
|
||||
<!-- 基本搜索项 -->
|
||||
<!-- 国家、地区 -->
|
||||
<if test="country != null and country != ''">
|
||||
and country = #{country}
|
||||
</if>
|
||||
<!-- 标准编号111 -->
|
||||
<if test="standNumber != null and standNumber != ''">
|
||||
and (
|
||||
(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',
|
||||
SAR_STANDARDS_INFO.STAND_YEAR) like concat(concat('%',#{standNumber}),'%') and SAR_STANDARDS_INFO.STAND_YEAR != '')
|
||||
or (concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER) like concat(concat('%',#{standNumber}),'%')
|
||||
and SAR_STANDARDS_INFO.STAND_YEAR = '')
|
||||
or (stand_name like concat(concat('%',#{standNumber}),'%'))
|
||||
)
|
||||
</if>
|
||||
<!-- 标准名称 -->
|
||||
<if test="standName != null and standName != ''">
|
||||
and stand_name like concat(concat('%',#{standName}),'%')
|
||||
or STAND_NUMBER like concat(concat('%',#{standName}),'%')
|
||||
or STAND_YEAR like concat(concat('%',#{standName}),'%')
|
||||
or STAND_SORT like concat(concat('%',#{standName}),'%')
|
||||
</if>
|
||||
<if test="standEnName != null and standEnName != ''">
|
||||
and stand_en_name like concat(concat('%',#{standEnName}),'%')
|
||||
</if>
|
||||
<!-- 标准状态 -->
|
||||
<if test="standState != null and standState != ''">
|
||||
and stand_state = #{standState}
|
||||
</if>
|
||||
<!-- 高级检索项 -->
|
||||
<!-- 标准性质 -->
|
||||
<if test="standNature != null and standNature != ''">
|
||||
and stand_nature = #{standNature}
|
||||
</if>
|
||||
<!-- 代替标准 允许输入的时候输入多个-->
|
||||
<if test="replaceStandNum != null and replaceStandNum != ''">
|
||||
and replace_stand_num like concat(concat('%',#{replaceStandNum}),'%')
|
||||
</if>
|
||||
<!-- 被代替标准 -->
|
||||
<if test="replacedStandNum != null and replacedStandNum != ''">
|
||||
and replaced_stand_num like concat(concat('%',#{replacedStandNum}),'%')
|
||||
</if>
|
||||
<if test="isRelateAccess != null and isRelateAccess != ''" >
|
||||
and is_relate_access = #{isRelateAccess}
|
||||
</if>
|
||||
<!-- 目录判断 -->
|
||||
<if test="menuId != null and menuId !='nomenu' and menuAllChildrenIdList != null">
|
||||
and SAR_STAND_MENU.MENU_ID in
|
||||
<foreach collection="menuAllChildrenIdList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
|
||||
</if>
|
||||
<!-- 游离态标准查询 -->
|
||||
<!-- <if test="menuId != null and menuId =='nomenu' and standType =='INLAND'">
|
||||
and SAR_STAND_MENU.MENU_ID = (select TS_RESOURCE.id from TS_RESOURCE WHERE parent_id is null and sor_divide
|
||||
='INLAND_STAND')
|
||||
<!–-查询游离态标准,编号和名称是分开的 –>
|
||||
<if test="standNumber != null">
|
||||
and ((concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',
|
||||
SAR_STANDARDS_INFO.STAND_YEAR) like concat(concat('%',#{standNumber}),'%') and SAR_STANDARDS_INFO.STAND_YEAR is not null)
|
||||
or (concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER) like concat(concat('%',#{standNumber}),'%')
|
||||
and SAR_STANDARDS_INFO.STAND_YEAR is null))
|
||||
</if>
|
||||
</if>
|
||||
<if test="menuId != null and menuId =='nomenu' and standType =='FOREIGN'">
|
||||
and SAR_STAND_MENU.MENU_ID = (select TS_RESOURCE.id from TS_RESOURCE WHERE parent_id is null and sor_divide
|
||||
='FOREIGN_STAND')
|
||||
<if test="standNumber != null">
|
||||
and ((concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER,'-',
|
||||
SAR_STANDARDS_INFO.STAND_YEAR) like concat(concat('%',#{standNumber}),'%') and SAR_STANDARDS_INFO.STAND_YEAR is not null)
|
||||
or (concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER) like concat(concat('%',#{standNumber}),'%')
|
||||
and SAR_STANDARDS_INFO.STAND_YEAR is null))
|
||||
</if>
|
||||
</if> -->
|
||||
<!-- 当第一次进入页面未选择记录时-->
|
||||
<!-- <if test="(menuId == null or menuId =='') and standType =='INLAND'">-->
|
||||
<!-- and SAR_STAND_MENU.MENU_ID in (-->
|
||||
<!-- select TS_RESOURCE.id from TS_RESOURCE start with id=(select TS_RESOURCE.id from TS_RESOURCE WHERE parent_id is null-->
|
||||
<!-- and sor_divide-->
|
||||
<!-- ='INLAND_STAND') connect by prior id= parent_id-->
|
||||
<!-- )-->
|
||||
<!-- </if>-->
|
||||
<!-- 新修改需求,根据角色查询有权限的菜单数据-->
|
||||
<if test="menuRoleList != null">
|
||||
and SAR_STAND_MENU.MENU_ID in
|
||||
<foreach collection="menuRoleList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<!-- <if test="(menuId == null or menuId =='') and standType =='FOREIGN'">-->
|
||||
<!-- and SAR_STAND_MENU.MENU_ID in (-->
|
||||
<!-- select TS_RESOURCE.id from TS_RESOURCE start with id=(select TS_RESOURCE.id from TS_RESOURCE WHERE parent_id is null-->
|
||||
<!-- and sor_divide-->
|
||||
<!-- ='FOREIGN_STAND') connect by prior id= parent_id-->
|
||||
<!-- )-->
|
||||
<!-- </if>-->
|
||||
<!-- 导出数据过程中,选择的id -->
|
||||
<if test="idlist != null">
|
||||
and SAR_STANDARDS_INFO.id in
|
||||
<foreach collection="idlist" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="standSort != null and standSort != ''" >
|
||||
and SAR_STANDARDS_INFO.stand_sort = #{standSort}
|
||||
</if>
|
||||
<!--标准年份-->
|
||||
<if test="standYear != null and standYear != ''">
|
||||
and SAR_STANDARDS_INFO.STAND_YEAR = #{standYear}
|
||||
</if>
|
||||
<if test="issueTime != null and issueTime != ''">
|
||||
and DATE_FORMAT(SAR_STANDARDS_INFO.ISSUE_TIME ,'%Y-%m-%d') = #{issueTime}
|
||||
</if>
|
||||
<!--内容摘要-->
|
||||
<if test="synopsis != null and synopsis != ''" >
|
||||
AND dbms_lob.instr(SYNOPSIS, #{synopsis} ,1,1) > 0
|
||||
</if>
|
||||
|
||||
<!--文本状态-->
|
||||
<if test="textStatus != null and textStatus != ''" >
|
||||
and SAR_STANDARDS_INFO.TEXT_STATUS = #{textStatus}
|
||||
</if>
|
||||
<!--是否纳入法规清单-->
|
||||
<if test="isRelateAccess != null and isRelateAccess != ''" >
|
||||
and SAR_STANDARDS_INFO.IS_RELATE_ACCESS = #{isRelateAccess}
|
||||
</if>
|
||||
|
||||
<if test="collectMenuId != null and collectMenuId != ''">
|
||||
and SAR_STANDARDS_INFO.id in (
|
||||
select COLLECT_RES_ID from TS_PERSON_COLLECT where TS_PERSON_COLLECT.VALID_FLAG=0
|
||||
and (collect_type='INLAND_STAND' or collect_type='FOREIGN_STAND')
|
||||
and TS_PERSON_COLLECT.user_id=#{userId}
|
||||
)
|
||||
</if>
|
||||
|
||||
<if test='labelMenuId != null and labelMenuId == "gxhbq"'>
|
||||
and SAR_STAND_ATTR_INFO.GXHBQ is not null
|
||||
</if>
|
||||
<if test='labelMenuId != null and labelMenuId != "gxhbq"'>
|
||||
and SAR_STAND_ATTR_INFO.GXHBQ like concat(concat('%',#{labelMenuId}),'%')
|
||||
</if>
|
||||
<!--适用车型-->
|
||||
<if test="applyArctic != null and applyArctic != ''">
|
||||
and SAR_STAND_ATTR_INFO.CLLX = #{applyArctic}
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
<sql id="SarStandardsInfo_out_left">
|
||||
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)
|
||||
LEFT JOIN TS_DICTYPE dicstandTextStatus ON (
|
||||
dicstandTextStatus.dic_type_code = a.text_status
|
||||
AND dicstandTextStatus.dic_id IS NOT NULL
|
||||
AND dicstandTextStatus.valid_flag = 0
|
||||
)
|
||||
left join SAR_STAND_ATTR_INFO on (SAR_STAND_ATTR_INFO.stand_id = a.id and SAR_STAND_ATTR_INFO.valid_flag=0)
|
||||
where 1=1
|
||||
<trim suffixOverrides=",">
|
||||
<if test="advanceSearchStr != null and advanceSearchStr != ''">
|
||||
and (${advanceSearchStr})
|
||||
</if>
|
||||
</trim>
|
||||
</sql>
|
||||
|
||||
|
||||
<!-- 分页查询-->
|
||||
<select id="getSarStandardsInfoPage" resultMap="BaseResultMap"
|
||||
parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage">
|
||||
select * from
|
||||
select
|
||||
a.*,
|
||||
SAR_STAND_ATTR_INFO.CHJL AS CHJL,
|
||||
dicstandSort.DIC_TYPE_NAME AS standSortShow,
|
||||
dicstandTextStatus.DIC_TYPE_NAME AS standTextStatusShow,
|
||||
(
|
||||
CASE
|
||||
WHEN SAR_STAND_ATTR_INFO.SSRQ ='' THEN '9999-01-01'
|
||||
ELSE SAR_STAND_ATTR_INFO.SSRQ
|
||||
END
|
||||
) AS SSRQ,
|
||||
(
|
||||
CASE
|
||||
WHEN SAR_STAND_ATTR_INFO.ZCCSSRQ ='' THEN '9999-01-01'
|
||||
ELSE SAR_STAND_ATTR_INFO.ZCCSSRQ
|
||||
END
|
||||
) AS ZCCSSRQ,
|
||||
(
|
||||
CASE
|
||||
WHEN SAR_STAND_ATTR_INFO.XCXSSRQ ='' THEN '9999-01-01'
|
||||
ELSE SAR_STAND_ATTR_INFO.XCXSSRQ
|
||||
END
|
||||
) AS XCXSSRQ
|
||||
from
|
||||
(select tmp_tb.* from
|
||||
(select
|
||||
<include refid="Base_Column_List_Show"/>,SAR_STAND_ATTR_INFO.CHJL AS CHJL,
|
||||
|
||||
(
|
||||
CASE
|
||||
WHEN ZCCSSRQ = 'TBD' THEN '6999-01-01'
|
||||
WHEN ZCCSSRQ = '已发布' THEN '7000-01-01'
|
||||
WHEN ZCCSSRQ = '已实施' THEN '7999-01-01'
|
||||
WHEN ZCCSSRQ = 'N/A' THEN '8999-01-01'
|
||||
WHEN ZCCSSRQ IS NULL THEN '9999-01-01'
|
||||
WHEN ZCCSSRQ ='' THEN '9999-01-01'
|
||||
ELSE ZCCSSRQ
|
||||
END
|
||||
) AS ZCCSSRQPAIXU,
|
||||
(
|
||||
CASE
|
||||
WHEN XCXSSRQ = 'TBD' THEN '6999-01-01'
|
||||
WHEN XCXSSRQ = '已发布' THEN '7000-01-01'
|
||||
WHEN XCXSSRQ = '已实施' THEN '7999-01-01'
|
||||
WHEN XCXSSRQ = 'N/A' THEN '8999-01-01'
|
||||
WHEN XCXSSRQ IS NULL THEN '9999-01-01'
|
||||
WHEN XCXSSRQ ='' THEN '9999-01-01'
|
||||
ELSE XCXSSRQ
|
||||
END
|
||||
) AS XCXSSRQPAIXU,
|
||||
(
|
||||
CASE
|
||||
WHEN SAR_STANDARDS_INFO.issue_time = 'TBD' THEN '6999-01-01'
|
||||
WHEN SAR_STANDARDS_INFO.issue_time = '已发布' THEN '7000-01-01'
|
||||
WHEN SAR_STANDARDS_INFO.issue_time = '已实施' THEN '7999-01-01'
|
||||
WHEN SAR_STANDARDS_INFO.issue_time = 'N/A' THEN '8999-01-01'
|
||||
WHEN SAR_STANDARDS_INFO.issue_time IS NULL THEN '9999-01-01'
|
||||
WHEN SAR_STANDARDS_INFO.issue_time ='' THEN '9999-01-01'
|
||||
ELSE SAR_STANDARDS_INFO.issue_time
|
||||
END
|
||||
) AS issueTime
|
||||
SELECT
|
||||
DISTINCT SAR_STANDARDS_INFO.id,
|
||||
SAR_STANDARDS_INFO.stand_type,
|
||||
SAR_STANDARDS_INFO.country,
|
||||
SAR_STANDARDS_INFO.stand_sort,
|
||||
SAR_STANDARDS_INFO.stand_number,
|
||||
SAR_STANDARDS_INFO.stand_year,
|
||||
SAR_STANDARDS_INFO.stand_name,
|
||||
SAR_STANDARDS_INFO.stand_en_name,
|
||||
SAR_STANDARDS_INFO.stand_state,
|
||||
SAR_STANDARDS_INFO.stand_nature,
|
||||
SAR_STANDARDS_INFO.issue_time,
|
||||
SAR_STANDARDS_INFO.put_time,
|
||||
SAR_STANDARDS_INFO.text_status,
|
||||
SAR_STANDARDS_INFO.creation_user,
|
||||
SAR_STANDARDS_INFO.valid_flag,
|
||||
SAR_STANDARDS_INFO.creation_time,
|
||||
SAR_STANDARDS_INFO.modify_time,
|
||||
SAR_STANDARDS_INFO.STAND_SYSTEM
|
||||
from SAR_STANDARDS_INFO
|
||||
<include refid="SarStandardsInfo_Where_Clause"/>
|
||||
GROUP BY <include refid="Group_Column_List_Show"/>,CHJL,SAR_STAND_ATTR_INFO.XCXSSRQ,SAR_STAND_ATTR_INFO.ZCCSSRQ,SAR_STAND_ATTR_INFO.SSRQ
|
||||
order by
|
||||
${orderBy1} ${order1},SAR_STANDARDS_INFO.id
|
||||
<include refid="SarStandardsInfo_in_left"/>
|
||||
) tmp_tb limit ${pager.startIndex-1},${pageSize}) a
|
||||
<include refid="SarStandardsInfo_out_left"/>
|
||||
order by
|
||||
${orderByA} ${order1},a.id
|
||||
</select>
|
||||
<!--FIELD(SAR_STANDARDS_INFO.issue_time,'已发布'), FIELD(SAR_STANDARDS_INFO.issue_time,'TBD'), FIELD(SAR_STANDARDS_INFO.issue_time,'N/A') ,-->
|
||||
<!--if(isnull(SAR_STANDARDS_INFO.issue_time),0,1) desc ,-->
|
||||
@@ -598,7 +779,8 @@
|
||||
<select id="getSarStandardsInfoCount" resultType="java.lang.Integer"
|
||||
parameterType="com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfoEOPage">
|
||||
select count(1) from (select count(*) from SAR_STANDARDS_INFO
|
||||
<include refid="SarStandardsInfo_Where_Clause"/>
|
||||
left join SAR_STAND_ATTR_INFO on (SAR_STAND_ATTR_INFO.stand_id = SAR_STANDARDS_INFO.id and SAR_STAND_ATTR_INFO.valid_flag=0)
|
||||
<include refid="SarStandardsInfo_in_left"/>
|
||||
GROUP BY SAR_STANDARDS_INFO.id) a
|
||||
</select>
|
||||
|
||||
|
||||
@@ -34,7 +34,11 @@
|
||||
on u.usid=up.user_id
|
||||
left join ts_position p
|
||||
on up.position_id=p.id
|
||||
where u.institution_id=#{TsUser.institutionId}
|
||||
where 1=1
|
||||
<if test="TsUser.institutionId !=null and TsUser.institutionId!=''">
|
||||
and u.institution_id=#{TsUser.institutionId}
|
||||
</if>
|
||||
|
||||
<if test="TsUser.uname != null and TsUser.uname != '' ">
|
||||
and u.uname like concat('%',#{TsUser.uname},'%')
|
||||
</if>
|
||||
@@ -50,7 +54,10 @@
|
||||
on u.usid=up.user_id
|
||||
left join ts_position p
|
||||
on up.position_id=p.id
|
||||
where u.institution_id=#{TsUser.institutionId}
|
||||
where 1=1
|
||||
<if test="TsUser.institutionId != null and TsUser.institutionId != '' ">
|
||||
and u.institution_id=#{TsUser.institutionId}
|
||||
</if>
|
||||
<if test="TsUser.uname != null and TsUser.uname != '' ">
|
||||
and u.uname like concat('%',#{TsUser.uname},'%')
|
||||
</if>
|
||||
|
||||
@@ -25,6 +25,7 @@ public class PersonCollectEOPage extends BasePage {
|
||||
private String validFlag;
|
||||
private String validFlagOperator = "=";
|
||||
private String collectResId;
|
||||
private List<String> collectResIds;
|
||||
private String collectResIdOperator = "LIKE";
|
||||
private String collectInfoUri;
|
||||
private String collectInfoUriOperator = "LIKE";
|
||||
@@ -40,6 +41,14 @@ public class PersonCollectEOPage extends BasePage {
|
||||
private List<String> collectTypeList = new ArrayList<>();
|
||||
|
||||
|
||||
public List<String> getCollectResIds() {
|
||||
return collectResIds;
|
||||
}
|
||||
|
||||
public void setCollectResIds(List<String> collectResIds) {
|
||||
this.collectResIds = collectResIds;
|
||||
}
|
||||
|
||||
public String getModifyTime() {
|
||||
return this.modifyTime;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface IPersonCollectEOService extends IService<TsPersonCollect> {
|
||||
|
||||
@@ -18,6 +19,8 @@ public interface IPersonCollectEOService extends IService<TsPersonCollect> {
|
||||
|
||||
public String queryCollectByUserAndId(String collectResId);
|
||||
|
||||
public Map<String,String> queryCollectByUserAndIds(List<String> collectResIds);
|
||||
|
||||
public int deleteByIdList(List<String> idList);
|
||||
|
||||
public int deleteByResId(String resId);
|
||||
|
||||
+18
-1
@@ -19,7 +19,8 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
@@ -96,6 +97,22 @@ public class PersonCollectEOServiceImpl extends ServiceImpl<PersonCollectEODao,
|
||||
return collectId;
|
||||
}
|
||||
|
||||
public Map<String,String> queryCollectByUserAndIds(List<String> collectResIds) {
|
||||
Map<String,String> resultMap = new TreeMap<>();
|
||||
String userId = LoginUserUtil.getUserId();
|
||||
PersonCollectEOPage page = new PersonCollectEOPage();
|
||||
page.setUserId(userId);
|
||||
page.setValidFlag("0");
|
||||
page.setCollectResIds(collectResIds);
|
||||
List<TsPersonCollect> getCollects = this.baseMapper.queryByList(page);
|
||||
List<TsPersonCollect> distinctList = getCollects.stream().collect(
|
||||
Collectors.collectingAndThen(
|
||||
Collectors.toCollection(
|
||||
() -> new TreeSet<>(Comparator.comparing(o -> o.getCollectResId()))), ArrayList::new));
|
||||
resultMap = distinctList.stream().collect(Collectors.toMap(TsPersonCollect::getCollectResId, TsPersonCollect::getId));
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
public int deleteByIdList(List<String> idList){
|
||||
return this.baseMapper.deleteByIdList(idList);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class SyncUserService {
|
||||
*/
|
||||
public List<String> syncFotonUser()throws Exception{
|
||||
String appuser = "app_slrs";
|
||||
String appkey = "wj5iDTqyguQCxnsoo5VU21BoRSZqevhI";
|
||||
String appkey = "Fxi5LHbI5yGbQQDpVp86GcCdXeC5Bjfe";
|
||||
AuthUtils util = new AuthUtils(appuser, appkey, null);
|
||||
|
||||
List<String> json=new ArrayList<>();
|
||||
@@ -45,7 +45,7 @@ public class SyncUserService {
|
||||
params.put("basedn", "ou=People,o=foton.com.cn,o=isp");
|
||||
System.out.println("RequestBody:" + params.toString());
|
||||
// 用户测试
|
||||
String rs = util.getResponseFromServer("http://172.24.224.42:82/rest/users/getUserList", params);
|
||||
String rs = util.getResponseFromServer("http://idmsync.foton.com.cn/rest/users/getUserList", params);
|
||||
|
||||
json.add(rs);
|
||||
|
||||
@@ -76,7 +76,7 @@ public class SyncUserService {
|
||||
|
||||
public List<String> syncFotonOrg()throws Exception{
|
||||
String appuser = "app_slrs";
|
||||
String appkey = "wj5iDTqyguQCxnsoo5VU21BoRSZqevhI";
|
||||
String appkey = "Fxi5LHbI5yGbQQDpVp86GcCdXeC5Bjfe";
|
||||
AuthUtils util = new AuthUtils(appuser, appkey, null);
|
||||
|
||||
byte[] cookie = null;
|
||||
@@ -90,7 +90,7 @@ public class SyncUserService {
|
||||
params.put("filter", "(orgNumber=*)");
|
||||
params.put("basedn", "ou=Organizations,o=foton.com.cn,o=isp");
|
||||
// 组织测试
|
||||
String rs = util.getResponseFromServer("http://172.24.224.42:82/rest/orgs/getOrgList", params);
|
||||
String rs = util.getResponseFromServer("http://idmsync.foton.com.cn/rest/orgs/getOrgList", params);
|
||||
json.add(rs);
|
||||
|
||||
|
||||
|
||||
@@ -101,6 +101,8 @@ public class DicTypeEOServiceImpl extends ServiceImpl<DicTypeEODao,DicTypeEO> im
|
||||
if(!StringUtils.isNotEmpty(dicTypeEO.getDicTypeCode())){
|
||||
dicTypeEO.setDicTypeCode(UUIDUtils.randomUUID10());
|
||||
}
|
||||
}else {
|
||||
dicTypeEO.setDicTypeCode(dicTypeEO.getDicTypeName());
|
||||
}
|
||||
String id = UUIDUtils.randomUUID20();
|
||||
dicTypeEO.setId(id);
|
||||
|
||||
@@ -49,6 +49,12 @@
|
||||
<if test="collectResId != null">
|
||||
and collect_res_id ${collectResIdOperator} #{collectResId}
|
||||
</if>
|
||||
<if test="collectResIds != null and collectResIds.size !=0">
|
||||
and collect_res_id IN
|
||||
<foreach collection="collectResIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="collectInfoUri != null">
|
||||
and collect_info_uri ${collectInfoUriOperator} #{collectInfoUri}
|
||||
</if>
|
||||
|
||||
Reference in New Issue
Block a user