添加srms接口
This commit is contained in:
@@ -150,6 +150,13 @@ public class ShiroConfig {
|
|||||||
//拆分标准查看图片
|
//拆分标准查看图片
|
||||||
filterChainDefinitionMap.put("/sys/split/file/getImage", "anon");
|
filterChainDefinitionMap.put("/sys/split/file/getImage", "anon");
|
||||||
|
|
||||||
|
// 获取token
|
||||||
|
filterChainDefinitionMap.put("/srms/getByToken", "anon");
|
||||||
|
// 标准法规文档查询
|
||||||
|
filterChainDefinitionMap.put("/srms/getByLawsFileList", "anon");
|
||||||
|
// 设计导航-产品设计条款查询
|
||||||
|
filterChainDefinitionMap.put("/srms/getByLawsProductDesign", "anon");
|
||||||
|
|
||||||
// 添加自己的过滤器并且取名为jwt
|
// 添加自己的过滤器并且取名为jwt
|
||||||
Map<String, Filter> filterMap = new HashMap<>(1);
|
Map<String, Filter> filterMap = new HashMap<>(1);
|
||||||
//如果cloudServer为空 则说明是单体 需要加载跨域配置【微服务跨域切换】
|
//如果cloudServer为空 则说明是单体 需要加载跨域配置【微服务跨域切换】
|
||||||
|
|||||||
+18
-17
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
|
|||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.jero.common.api.vo.Result;
|
import com.jero.common.api.vo.Result;
|
||||||
|
import com.jero.modules.docking.srms.dto.ProductDesign;
|
||||||
import com.jero.modules.docking.srms.service.SrmsApiService;
|
import com.jero.modules.docking.srms.service.SrmsApiService;
|
||||||
import com.jero.modules.docking.srms.vo.ByFileRows;
|
import com.jero.modules.docking.srms.vo.ByFileRows;
|
||||||
import com.jero.modules.docking.utils.ResponsesUtil;
|
import com.jero.modules.docking.utils.ResponsesUtil;
|
||||||
@@ -68,21 +69,21 @@ public class SrmsApiController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ApiOperation("设计导航-产品设计条款查询")
|
@ApiOperation("设计导航-产品设计条款查询")
|
||||||
// @PostMapping("/getByLawsDesignNavigation")
|
@PostMapping("/getByLawsProductDesign")
|
||||||
// public JSONObject getByLawsDesignNavigation(@RequestBody JSONObject json, HttpServletRequest req){
|
public JSONObject getByLawsProductDesign(@RequestBody JSONObject json, HttpServletRequest req){
|
||||||
// try {
|
try {
|
||||||
// Result<JSONArray> re = srmsApiService.getByLawsFileList(json,req);
|
Result<List<ProductDesign>> re = srmsApiService.getByLawsProductDesign(json,req);
|
||||||
// if(!re.isSuccess()){
|
if(!re.isSuccess()){
|
||||||
// return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErr(re.getMessage()));
|
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErr(re.getMessage()));
|
||||||
// }
|
}
|
||||||
// JSONArray jsonArray = re.getResult();
|
List<ProductDesign> list = re.getResult();
|
||||||
// JSONObject jsonResponses = ResponsesUtil.getJsonOk();
|
JSONObject jsonResponses = ResponsesUtil.getJsonOk();
|
||||||
// jsonResponses.put("Rows",jsonArray);
|
jsonResponses.put("Rows",list);
|
||||||
// return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),jsonResponses);
|
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),jsonResponses);
|
||||||
// }catch (Exception e){
|
}catch (Exception e){
|
||||||
// log.error("获取token异常:",e);
|
log.error("获取token异常:",e);
|
||||||
// return ResponsesUtil.getJsonResult(json.get("MessageHeader"),ResponsesUtil.getJsonErr("操作失败"));
|
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErr("操作失败"));
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+30
@@ -0,0 +1,30 @@
|
|||||||
|
package com.jero.modules.docking.srms.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lqt
|
||||||
|
* @version 1.0
|
||||||
|
* @date 2024/1/19 17:48
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class ProductDesign implements Serializable {
|
||||||
|
/**
|
||||||
|
* 设计导航唯一值
|
||||||
|
*/
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 标准编号
|
||||||
|
*/
|
||||||
|
private String standardNumber;
|
||||||
|
/**
|
||||||
|
* 条款标签
|
||||||
|
*/
|
||||||
|
private String queryLabels;
|
||||||
|
/**
|
||||||
|
* 条款内容
|
||||||
|
*/
|
||||||
|
private String itemContent;
|
||||||
|
}
|
||||||
+12
-1
@@ -1,6 +1,6 @@
|
|||||||
package com.jero.modules.docking.srms.mapper;
|
package com.jero.modules.docking.srms.mapper;
|
||||||
|
|
||||||
import com.jero.modules.docking.srms.dto.StandardVO;
|
import com.jero.modules.docking.srms.vo.StandardVO;
|
||||||
import com.jero.modules.docking.srms.vo.ByFileRows;
|
import com.jero.modules.docking.srms.vo.ByFileRows;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
@@ -25,4 +25,15 @@ public interface LawsStandardMapper{
|
|||||||
*/
|
*/
|
||||||
List<ByFileRows> getStandard(@Param("standard") StandardVO standard);
|
List<ByFileRows> getStandard(@Param("standard") StandardVO standard);
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author LQT
|
||||||
|
* @date 2024/1/19 15:43
|
||||||
|
* @param standardNumber
|
||||||
|
* @param queryLabels
|
||||||
|
* @return java.util.List<com.jero.modules.docking.srms.vo.ByFileRows>
|
||||||
|
*/
|
||||||
|
String getStandardByProductDesign(@Param("standardNumber") String standardNumber,
|
||||||
|
@Param("queryLabels") String queryLabels);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+37
-6
@@ -13,10 +13,10 @@
|
|||||||
from laws_domestic_standard
|
from laws_domestic_standard
|
||||||
where del_flag = 0 and instr(part_name,#{standard.partCategoryNum}) > 0
|
where del_flag = 0 and instr(part_name,#{standard.partCategoryNum}) > 0
|
||||||
<if test="standard.standardNumber != '' and standard.standardNumber != null">
|
<if test="standard.standardNumber != '' and standard.standardNumber != null">
|
||||||
and standard_number = #{standard.standardNumber}
|
and standard_number like concat(concat('%',#{standard.standardNumber}),'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="standard.standardName != '' and standard.standardName != null">
|
<if test="standard.standardName != '' and standard.standardName != null">
|
||||||
and standard_name = #{standard.standardName}
|
and standard_name like concat(concat('%',#{standard.standardName}),'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="standard.standardState != '' and standard.standardState != null">
|
<if test="standard.standardState != '' and standard.standardState != null">
|
||||||
and standard_state = #{standard.standardState}
|
and standard_state = #{standard.standardState}
|
||||||
@@ -28,10 +28,10 @@
|
|||||||
from laws_overseas_standard
|
from laws_overseas_standard
|
||||||
where del_flag = 0 and instr(part_name,#{standard.partCategoryNum}) > 0
|
where del_flag = 0 and instr(part_name,#{standard.partCategoryNum}) > 0
|
||||||
<if test="standard.standardNumber != '' and standard.standardNumber != null">
|
<if test="standard.standardNumber != '' and standard.standardNumber != null">
|
||||||
and standard_number = #{standard.standardNumber}
|
and standard_number like concat(concat('%',#{standard.standardNumber}),'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="standard.standardName != '' and standard.standardName != null">
|
<if test="standard.standardName != '' and standard.standardName != null">
|
||||||
and standard_name = #{standard.standardName}
|
and standard_name like concat(concat('%',#{standard.standardName}),'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="standard.standardState != '' and standard.standardState != null">
|
<if test="standard.standardState != '' and standard.standardState != null">
|
||||||
and standard_state = #{standard.standardState}
|
and standard_state = #{standard.standardState}
|
||||||
@@ -43,10 +43,10 @@
|
|||||||
from laws_enterprise_standard
|
from laws_enterprise_standard
|
||||||
where del_flag = 0 and instr(part_name,#{standard.partCategoryNum}) > 0
|
where del_flag = 0 and instr(part_name,#{standard.partCategoryNum}) > 0
|
||||||
<if test="standard.standardNumber != '' and standard.standardNumber != null">
|
<if test="standard.standardNumber != '' and standard.standardNumber != null">
|
||||||
and standard_number = #{standard.standardNumber}
|
and standard_number like concat(concat('%',#{standard.standardNumber}),'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="standard.standardName != '' and standard.standardName != null">
|
<if test="standard.standardName != '' and standard.standardName != null">
|
||||||
and standard_name = #{standardVO.standardName}
|
and standard_name like concat(concat('%',#{standard.standardName}),'%')
|
||||||
</if>
|
</if>
|
||||||
<if test="standard.standardState != '' and standard.standardState != null">
|
<if test="standard.standardState != '' and standard.standardState != null">
|
||||||
and standard_state = #{standard.standardState}
|
and standard_state = #{standard.standardState}
|
||||||
@@ -66,4 +66,35 @@
|
|||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getStandardByProductDesign" resultType="java.lang.String">
|
||||||
|
select l.item_content
|
||||||
|
from (
|
||||||
|
select id from laws_domestic_standard where del_flag = 0 and standard_state = 6
|
||||||
|
<if test="standardNumber != null and standardNumber != ''">
|
||||||
|
and standard_number = #{standardNumber}
|
||||||
|
</if>
|
||||||
|
<if test="queryLabels != null and queryLabels != ''">
|
||||||
|
and standard_number = #{queryLabels}
|
||||||
|
</if>
|
||||||
|
union all
|
||||||
|
select id from laws_overseas_standard where del_flag = 0 and standard_state = 6
|
||||||
|
<if test="standardNumber != null and standardNumber != ''">
|
||||||
|
and standard_number = #{standardNumber}
|
||||||
|
</if>
|
||||||
|
<if test="queryLabels != null and queryLabels != ''">
|
||||||
|
and standard_number = #{queryLabels}
|
||||||
|
</if>
|
||||||
|
union all
|
||||||
|
select id from laws_enterprise_standard where del_flag = 0 and standard_state = 6
|
||||||
|
<if test="standardNumber != null and standardNumber != ''">
|
||||||
|
and standard_number = #{standardNumber}
|
||||||
|
</if>
|
||||||
|
<if test="queryLabels != null and queryLabels != ''">
|
||||||
|
and standard_number = #{queryLabels}
|
||||||
|
</if>
|
||||||
|
) law
|
||||||
|
left join sar_file_split_info s on s.standard_id = law.id and s.del_flag = 0
|
||||||
|
left join laws_document_split l on s.id = l.info_id and l.del_flag = 0
|
||||||
|
where l.item_content is not null and l.item_content != '' limit 1
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
+11
@@ -2,6 +2,7 @@ package com.jero.modules.docking.srms.service;
|
|||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.jero.common.api.vo.Result;
|
import com.jero.common.api.vo.Result;
|
||||||
|
import com.jero.modules.docking.srms.dto.ProductDesign;
|
||||||
import com.jero.modules.docking.srms.vo.ByFileRows;
|
import com.jero.modules.docking.srms.vo.ByFileRows;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
@@ -32,4 +33,14 @@ public interface SrmsApiService {
|
|||||||
* @return com.alibaba.fastjson.JSONObject
|
* @return com.alibaba.fastjson.JSONObject
|
||||||
*/
|
*/
|
||||||
Result<List<ByFileRows>> getByLawsFileList(JSONObject json, HttpServletRequest req);
|
Result<List<ByFileRows>> getByLawsFileList(JSONObject json, HttpServletRequest req);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设计导航-产品设计条款查询
|
||||||
|
* @author LQT
|
||||||
|
* @date 2024/1/19 17:32
|
||||||
|
* @param json
|
||||||
|
* @param req
|
||||||
|
* @return com.jero.common.api.vo.Result<com.alibaba.fastjson.JSONObject>
|
||||||
|
*/
|
||||||
|
Result<List<ProductDesign>> getByLawsProductDesign(JSONObject json, HttpServletRequest req);
|
||||||
}
|
}
|
||||||
|
|||||||
+141
-96
@@ -1,6 +1,7 @@
|
|||||||
package com.jero.modules.docking.srms.service.impl;
|
package com.jero.modules.docking.srms.service.impl;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.jero.common.api.vo.Result;
|
import com.jero.common.api.vo.Result;
|
||||||
@@ -9,7 +10,8 @@ import com.jero.common.system.util.JwtUtil;
|
|||||||
import com.jero.common.util.RedisUtil;
|
import com.jero.common.util.RedisUtil;
|
||||||
import com.jero.common.util.TokenUtils;
|
import com.jero.common.util.TokenUtils;
|
||||||
import com.jero.modules.docking.srms.dto.ByTokenRequests;
|
import com.jero.modules.docking.srms.dto.ByTokenRequests;
|
||||||
import com.jero.modules.docking.srms.dto.StandardVO;
|
import com.jero.modules.docking.srms.dto.ProductDesign;
|
||||||
|
import com.jero.modules.docking.srms.vo.StandardVO;
|
||||||
import com.jero.modules.docking.srms.mapper.LawsStandardMapper;
|
import com.jero.modules.docking.srms.mapper.LawsStandardMapper;
|
||||||
import com.jero.modules.docking.srms.service.SrmsApiService;
|
import com.jero.modules.docking.srms.service.SrmsApiService;
|
||||||
import com.jero.modules.docking.srms.vo.ByFileRows;
|
import com.jero.modules.docking.srms.vo.ByFileRows;
|
||||||
@@ -18,9 +20,6 @@ import com.jero.modules.docking.srms.vo.SarFileSplitMenu;
|
|||||||
import com.jero.modules.docking.srms.vo.SplitResult;
|
import com.jero.modules.docking.srms.vo.SplitResult;
|
||||||
import com.jero.modules.laws.documenttool.entity.LawsDocumentSplit;
|
import com.jero.modules.laws.documenttool.entity.LawsDocumentSplit;
|
||||||
import com.jero.modules.laws.documenttool.mapper.LawsDocumentSplitMapper;
|
import com.jero.modules.laws.documenttool.mapper.LawsDocumentSplitMapper;
|
||||||
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
|
|
||||||
import com.jero.modules.laws.standard.service.ILawsEnterpriseStandardService;
|
|
||||||
import com.jero.modules.laws.standard.service.ILawsOverseasStandardService;
|
|
||||||
import com.jero.modules.oss.entity.OSSFile;
|
import com.jero.modules.oss.entity.OSSFile;
|
||||||
import com.jero.modules.oss.service.IOSSFileService;
|
import com.jero.modules.oss.service.IOSSFileService;
|
||||||
import com.jero.modules.split.entity.SarFileSplitInfoEO;
|
import com.jero.modules.split.entity.SarFileSplitInfoEO;
|
||||||
@@ -32,12 +31,12 @@ import com.jero.modules.system.service.ILoginService;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -58,12 +57,6 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
|||||||
@Resource
|
@Resource
|
||||||
private RedisUtil redisUtil;
|
private RedisUtil redisUtil;
|
||||||
@Resource
|
@Resource
|
||||||
private ILawsDomesticStandardService lawsDomesticStandardService;
|
|
||||||
@Resource
|
|
||||||
private ILawsOverseasStandardService lawsOverseasStandardService;
|
|
||||||
@Resource
|
|
||||||
private ILawsEnterpriseStandardService lawsEnterpriseStandardService;
|
|
||||||
@Resource
|
|
||||||
private ISarFileSplitMenuEOService sarFileSplitMenuEOService;
|
private ISarFileSplitMenuEOService sarFileSplitMenuEOService;
|
||||||
@Resource
|
@Resource
|
||||||
private ISarFileSplitInfoService sarFileSplitInfoService;
|
private ISarFileSplitInfoService sarFileSplitInfoService;
|
||||||
@@ -83,12 +76,15 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
|||||||
private String secret;
|
private String secret;
|
||||||
|
|
||||||
private static final String SRMS_TOKEN = "srms_token_";
|
private static final String SRMS_TOKEN = "srms_token_";
|
||||||
|
private static final String REQUESTS = "Requests";
|
||||||
|
private static final String SYS_ERR = "系统验证失败";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result<JSONObject> getByToken(JSONObject json) {
|
public Result<JSONObject> getByToken(JSONObject json) {
|
||||||
try {
|
try {
|
||||||
ByTokenRequests byTokenRequests = JSON.parseObject(JSON.toJSONString(json.get("Requests")),ByTokenRequests.class);
|
ByTokenRequests byTokenRequests = JSON.parseObject(JSON.toJSONString(json.get(REQUESTS)),ByTokenRequests.class);
|
||||||
// 验证数据必填项
|
// 验证数据必填项
|
||||||
if(StringUtils.isAllBlank(byTokenRequests.getUsername())
|
if(StringUtils.isAllBlank(byTokenRequests.getUsername())
|
||||||
|| StringUtils.isBlank(byTokenRequests.getAppkey())
|
|| StringUtils.isBlank(byTokenRequests.getAppkey())
|
||||||
@@ -96,7 +92,7 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
|||||||
return Result.error("必填项不能为空");
|
return Result.error("必填项不能为空");
|
||||||
}
|
}
|
||||||
if(!Objects.equals(appKey,byTokenRequests.getAppkey()) || !Objects.equals(secret,byTokenRequests.getSecret())){
|
if(!Objects.equals(appKey,byTokenRequests.getAppkey()) || !Objects.equals(secret,byTokenRequests.getSecret())){
|
||||||
return Result.error("系统验证失败");
|
return Result.error(SYS_ERR);
|
||||||
}
|
}
|
||||||
Result<JSONObject> re = Result.OK();
|
Result<JSONObject> re = Result.OK();
|
||||||
String tokenKey = SRMS_TOKEN + byTokenRequests.getUsername();
|
String tokenKey = SRMS_TOKEN + byTokenRequests.getUsername();
|
||||||
@@ -119,19 +115,19 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result<List<ByFileRows>> getByLawsFileList(JSONObject json, HttpServletRequest req) {
|
public Result<List<ByFileRows>> getByLawsFileList(JSONObject json, HttpServletRequest req) {
|
||||||
|
// 验证token
|
||||||
|
String token = req.getHeader("X-Access-Token");
|
||||||
|
if(StringUtils.isBlank(token) || !Objects.equals(TokenUtils.getTokenByRequest(req),token)){
|
||||||
|
Result.error(SYS_ERR);
|
||||||
|
}
|
||||||
|
JSONObject requests = JSON.parseObject(JSON.toJSONString(json.get(REQUESTS)));
|
||||||
|
// 零部件-分类内部码(精准查询)
|
||||||
|
String partCategoryNum = getStr(requests, "partCategoryNum");
|
||||||
|
if(StringUtils.isBlank(partCategoryNum)){
|
||||||
|
Result.error("零部件-分类内部码不能为空");
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
// 验证token
|
|
||||||
String token = req.getHeader("X-Access-Token");
|
|
||||||
if(StringUtils.isBlank(token) || !Objects.equals(TokenUtils.getTokenByRequest(req),token)){
|
|
||||||
Result.error("系统验证失败");
|
|
||||||
}
|
|
||||||
JSONObject requests = JSON.parseObject(JSON.toJSONString(json.get("Requests")));
|
|
||||||
StandardVO standardVO = new StandardVO();
|
StandardVO standardVO = new StandardVO();
|
||||||
// 零部件-分类内部码(精准查询)
|
|
||||||
String partCategoryNum = getStr(requests, "partCategoryNum");
|
|
||||||
if(StringUtils.isBlank(partCategoryNum)){
|
|
||||||
Result.error("零部件-分类内部码不能为空");
|
|
||||||
}
|
|
||||||
standardVO.setPartCategoryNum(partCategoryNum);
|
standardVO.setPartCategoryNum(partCategoryNum);
|
||||||
// 零部件-分类名称
|
// 零部件-分类名称
|
||||||
String partCategoryName = getStr(requests, "partCategoryName");
|
String partCategoryName = getStr(requests, "partCategoryName");
|
||||||
@@ -146,14 +142,7 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
|||||||
String standardState = getStr(requests, "standardState");
|
String standardState = getStr(requests, "standardState");
|
||||||
standardVO.setStandardState(standardState);
|
standardVO.setStandardState(standardState);
|
||||||
// 是否存在拆分信息,默认false; true-是,false-否
|
// 是否存在拆分信息,默认false; true-是,false-否
|
||||||
if(!Objects.isNull(requests.get("hasSplit"))){
|
setHasSplit(requests, standardVO);
|
||||||
Boolean hasSplit = Boolean.parseBoolean(requests.get("hasSplit").toString());
|
|
||||||
if(hasSplit){
|
|
||||||
standardVO.setHasSplit("1");
|
|
||||||
}else{
|
|
||||||
standardVO.setHasSplit("2");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 备用字段1
|
// 备用字段1
|
||||||
String remark1 = getStr(requests, "Remark1");
|
String remark1 = getStr(requests, "Remark1");
|
||||||
// 备用字段2
|
// 备用字段2
|
||||||
@@ -162,70 +151,7 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
|||||||
String remark3 = getStr(requests, "Remark3");
|
String remark3 = getStr(requests, "Remark3");
|
||||||
// 备用字段4
|
// 备用字段4
|
||||||
String remark4 = getStr(requests, "Remark4");
|
String remark4 = getStr(requests, "Remark4");
|
||||||
|
List<ByFileRows> listByFileRows = getByFileRows(partCategoryNum, standardVO);
|
||||||
List<ByFileRows> listByFileRows = lawsStandardMapper.getStandard(standardVO);
|
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
||||||
if(!CollectionUtils.isEmpty(listByFileRows)){
|
|
||||||
List<String> listFileId = listByFileRows.stream().map(ByFileRows::getId).collect(Collectors.toList());
|
|
||||||
LambdaQueryWrapper<OSSFile> queryOssFile = new LambdaQueryWrapper<>();
|
|
||||||
queryOssFile.in(OSSFile::getStandardId,listFileId);
|
|
||||||
queryOssFile.eq(OSSFile::getStandardFileType,"publish_of_original");
|
|
||||||
queryOssFile.orderByDesc(OSSFile::getCreateTime);
|
|
||||||
List<OSSFile> listOssFile = ossFileService.list(queryOssFile);
|
|
||||||
for (ByFileRows byFileRows : listByFileRows) {
|
|
||||||
byFileRows.setPartCategoryNum(partCategoryNum);
|
|
||||||
byFileRows.setStandardState_dictText(sysBaseAPI.translateDict("standard_state", byFileRows.getStandardState()));
|
|
||||||
if(!CollectionUtils.isEmpty(listOssFile)){
|
|
||||||
List<OSSFile> listFile = listOssFile.stream().filter(o->Objects.equals(o.getStandardId(),byFileRows.getId())).collect(Collectors.toList());
|
|
||||||
if(!CollectionUtils.isEmpty(listFile)){
|
|
||||||
listFile = listFile.stream().sorted(Comparator.comparing(OSSFile::getCreateTime).reversed()).collect(Collectors.toList());
|
|
||||||
byFileRows.setStandardUrl(listFile.get(0).getUrl());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
LambdaQueryWrapper<SarFileSplitInfoEO> querySarFileSplitInfoEo = new LambdaQueryWrapper<>();
|
|
||||||
querySarFileSplitInfoEo.eq(SarFileSplitInfoEO::getStandardId,byFileRows.getId());
|
|
||||||
querySarFileSplitInfoEo.isNull(SarFileSplitInfoEO::getPublishBeforeId);
|
|
||||||
querySarFileSplitInfoEo.eq(SarFileSplitInfoEO::getFileType,"publish_of_original");
|
|
||||||
SarFileSplitInfoEO sarFileSplitInfoEo = sarFileSplitInfoService.getOne(querySarFileSplitInfoEo,false);
|
|
||||||
if(!Objects.isNull(sarFileSplitInfoEo)){
|
|
||||||
SarFileSplitMenuEOPage page = new SarFileSplitMenuEOPage();
|
|
||||||
page.setValidFlag("0");
|
|
||||||
page.setOrderBy("display_seq asc");
|
|
||||||
page.setInfoId(sarFileSplitInfoEo.getId());
|
|
||||||
List<SarFileSplitMenuEO> getList = sarFileSplitMenuEOService.queryByApiList(page);
|
|
||||||
if(!CollectionUtils.isEmpty(getList)){
|
|
||||||
List<SarFileSplitMenu> listSarFileSplitMenu = new ArrayList<>();
|
|
||||||
for (SarFileSplitMenuEO sarFileSplitMenuEo : getList) {
|
|
||||||
SarFileSplitMenu sarFileSplitMenu = new SarFileSplitMenu();
|
|
||||||
sarFileSplitMenu.setId(sarFileSplitMenuEo.getId());
|
|
||||||
sarFileSplitMenu.setPid(sarFileSplitMenuEo.getPId());
|
|
||||||
sarFileSplitMenu.setItemName(sarFileSplitMenuEo.getItemName());
|
|
||||||
sarFileSplitMenu.setName(sarFileSplitMenuEo.getName());
|
|
||||||
listSarFileSplitMenu.add(sarFileSplitMenu);
|
|
||||||
}
|
|
||||||
SplitResult splitResult = new SplitResult();
|
|
||||||
if(!CollectionUtils.isEmpty(listSarFileSplitMenu)){
|
|
||||||
List<String> listIds = listSarFileSplitMenu.stream().map(SarFileSplitMenu::getId).collect(Collectors.toList());
|
|
||||||
LambdaQueryWrapper<LawsDocumentSplit> queryLawsDocumentSplit = new LambdaQueryWrapper<>();
|
|
||||||
queryLawsDocumentSplit.in(LawsDocumentSplit::getMenuId,listIds);
|
|
||||||
queryLawsDocumentSplit.eq(LawsDocumentSplit::getDelFlag,"0");
|
|
||||||
List<LawsDocumentSplit> listLawsDocumentSplit = lawsDocumentSplitMapper.selectList(queryLawsDocumentSplit);
|
|
||||||
if(!CollectionUtils.isEmpty(listLawsDocumentSplit)){
|
|
||||||
List<DocumentSplitDetail> listDocumentSplitDetail = JSON.parseArray(JSON.toJSONString(listLawsDocumentSplit),DocumentSplitDetail.class);
|
|
||||||
splitResult.setDocumentSplitDetail(listDocumentSplitDetail);
|
|
||||||
}
|
|
||||||
|
|
||||||
List<SarFileSplitMenu> finalResult = listSarFileSplitMenu;
|
|
||||||
listSarFileSplitMenu = listSarFileSplitMenu.stream().filter(v -> StringUtils.isBlank(v.getPid()))
|
|
||||||
.peek(v -> v.setChildren(createChildList(v, finalResult))).collect(Collectors.toList());
|
|
||||||
splitResult.setSarFileSplitMenuEO(JSON.toJSONString(listSarFileSplitMenu));
|
|
||||||
}
|
|
||||||
|
|
||||||
byFileRows.setSplitResult(splitResult);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return Result.OK(listByFileRows);
|
return Result.OK(listByFileRows);
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
log.error("标准法规文档查询异常:",e);
|
log.error("标准法规文档查询异常:",e);
|
||||||
@@ -233,6 +159,85 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
private List<ByFileRows> getByFileRows(String partCategoryNum, StandardVO standardVO) {
|
||||||
|
List<ByFileRows> listByFileRows = lawsStandardMapper.getStandard(standardVO);
|
||||||
|
if(CollectionUtils.isEmpty(listByFileRows)) {
|
||||||
|
return listByFileRows;
|
||||||
|
}
|
||||||
|
List<String> listFileId = listByFileRows.stream().map(ByFileRows::getId).collect(Collectors.toList());
|
||||||
|
LambdaQueryWrapper<OSSFile> queryOssFile = new LambdaQueryWrapper<>();
|
||||||
|
queryOssFile.in(OSSFile::getStandardId,listFileId);
|
||||||
|
queryOssFile.eq(OSSFile::getStandardFileType,"publish_of_original");
|
||||||
|
queryOssFile.orderByDesc(OSSFile::getCreateTime);
|
||||||
|
List<OSSFile> listOssFile = ossFileService.list(queryOssFile);
|
||||||
|
for (ByFileRows byFileRows : listByFileRows) {
|
||||||
|
byFileRows.setPartCategoryNum(partCategoryNum);
|
||||||
|
byFileRows.setStandardState_dictText(sysBaseAPI.translateDict("standard_state", byFileRows.getStandardState()));
|
||||||
|
if(!CollectionUtils.isEmpty(listOssFile)){
|
||||||
|
List<OSSFile> listFile = listOssFile.stream().filter(o-> Objects.equals(o.getStandardId(),byFileRows.getId())).collect(Collectors.toList());
|
||||||
|
if(!CollectionUtils.isEmpty(listFile)){
|
||||||
|
listFile = listFile.stream().sorted(Comparator.comparing(OSSFile::getCreateTime).reversed()).collect(Collectors.toList());
|
||||||
|
byFileRows.setStandardUrl(listFile.get(0).getUrl());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
LambdaQueryWrapper<SarFileSplitInfoEO> querySarFileSplitInfoEo = new LambdaQueryWrapper<>();
|
||||||
|
querySarFileSplitInfoEo.eq(SarFileSplitInfoEO::getStandardId,byFileRows.getId());
|
||||||
|
querySarFileSplitInfoEo.isNull(SarFileSplitInfoEO::getPublishBeforeId);
|
||||||
|
querySarFileSplitInfoEo.eq(SarFileSplitInfoEO::getFileType,"publish_of_original");
|
||||||
|
SarFileSplitInfoEO sarFileSplitInfoEo = sarFileSplitInfoService.getOne(querySarFileSplitInfoEo,false);
|
||||||
|
if(!Objects.isNull(sarFileSplitInfoEo)){
|
||||||
|
SarFileSplitMenuEOPage page = new SarFileSplitMenuEOPage();
|
||||||
|
page.setValidFlag("0");
|
||||||
|
page.setOrderBy("display_seq asc");
|
||||||
|
page.setInfoId(sarFileSplitInfoEo.getId());
|
||||||
|
List<SarFileSplitMenuEO> getList = sarFileSplitMenuEOService.queryByApiList(page);
|
||||||
|
if(!CollectionUtils.isEmpty(getList)){
|
||||||
|
List<SarFileSplitMenu> listSarFileSplitMenu = new ArrayList<>();
|
||||||
|
for (SarFileSplitMenuEO sarFileSplitMenuEo : getList) {
|
||||||
|
SarFileSplitMenu sarFileSplitMenu = new SarFileSplitMenu();
|
||||||
|
sarFileSplitMenu.setId(sarFileSplitMenuEo.getId());
|
||||||
|
sarFileSplitMenu.setPid(sarFileSplitMenuEo.getPId());
|
||||||
|
sarFileSplitMenu.setItemName(sarFileSplitMenuEo.getItemName());
|
||||||
|
sarFileSplitMenu.setName(sarFileSplitMenuEo.getName());
|
||||||
|
listSarFileSplitMenu.add(sarFileSplitMenu);
|
||||||
|
}
|
||||||
|
SplitResult splitResult = new SplitResult();
|
||||||
|
if(!CollectionUtils.isEmpty(listSarFileSplitMenu)){
|
||||||
|
List<String> listIds = listSarFileSplitMenu.stream().map(SarFileSplitMenu::getId).collect(Collectors.toList());
|
||||||
|
LambdaQueryWrapper<LawsDocumentSplit> queryLawsDocumentSplit = new LambdaQueryWrapper<>();
|
||||||
|
queryLawsDocumentSplit.in(LawsDocumentSplit::getMenuId,listIds);
|
||||||
|
queryLawsDocumentSplit.eq(LawsDocumentSplit::getDelFlag,"0");
|
||||||
|
List<LawsDocumentSplit> listLawsDocumentSplit = lawsDocumentSplitMapper.selectList(queryLawsDocumentSplit);
|
||||||
|
if(!CollectionUtils.isEmpty(listLawsDocumentSplit)){
|
||||||
|
List<DocumentSplitDetail> listDocumentSplitDetail = JSON.parseArray(JSON.toJSONString(listLawsDocumentSplit),DocumentSplitDetail.class);
|
||||||
|
splitResult.setDocumentSplitDetail(listDocumentSplitDetail);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<SarFileSplitMenu> finalResult = listSarFileSplitMenu;
|
||||||
|
listSarFileSplitMenu = listSarFileSplitMenu.stream().filter(v -> StringUtils.isBlank(v.getPid()))
|
||||||
|
.peek(v -> v.setChildren(createChildList(v, finalResult))).collect(Collectors.toList());
|
||||||
|
splitResult.setSarFileSplitMenuEO(JSON.toJSONString(listSarFileSplitMenu));
|
||||||
|
}
|
||||||
|
|
||||||
|
byFileRows.setSplitResult(splitResult);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return listByFileRows;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setHasSplit(JSONObject requests, StandardVO standardVO) {
|
||||||
|
if(!Objects.isNull(requests.get("hasSplit"))){
|
||||||
|
Boolean hasSplit = Boolean.parseBoolean(requests.get("hasSplit").toString());
|
||||||
|
if(hasSplit){
|
||||||
|
standardVO.setHasSplit("1");
|
||||||
|
}else{
|
||||||
|
standardVO.setHasSplit("2");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private String getStr(JSONObject requests, String partCategoryNum) {
|
private String getStr(JSONObject requests, String partCategoryNum) {
|
||||||
return requests.containsKey(partCategoryNum) ? requests.get(partCategoryNum).toString() : "";
|
return requests.containsKey(partCategoryNum) ? requests.get(partCategoryNum).toString() : "";
|
||||||
}
|
}
|
||||||
@@ -242,4 +247,44 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
|||||||
.peek(v -> v.setChildren(createChildList(v, treeList)))
|
.peek(v -> v.setChildren(createChildList(v, treeList)))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Result<List<ProductDesign>> getByLawsProductDesign(JSONObject json, HttpServletRequest req) {
|
||||||
|
// 验证token
|
||||||
|
String token = req.getHeader("X-Access-Token");
|
||||||
|
if(StringUtils.isBlank(token) || !Objects.equals(TokenUtils.getTokenByRequest(req),token)){
|
||||||
|
Result.error(SYS_ERR);
|
||||||
|
}
|
||||||
|
JSONArray requests = JSON.parseArray(JSON.toJSONString(json.get(REQUESTS)));
|
||||||
|
if(CollectionUtils.isEmpty(requests)){
|
||||||
|
Result.error("必填项不能为空");
|
||||||
|
}
|
||||||
|
List<ProductDesign> listProductDesign = new ArrayList<>();
|
||||||
|
for (Object request : requests) {
|
||||||
|
JSONObject js = JSON.parseObject(JSON.toJSONString(request));
|
||||||
|
// todo || !js.containsKey("queryLabels")
|
||||||
|
if(!js.containsKey("ID") || !js.containsKey("standardNumber") ){
|
||||||
|
Result.error("必填项不能为空");
|
||||||
|
}
|
||||||
|
// todo || Objects.isNull(js.get("queryLabels"))
|
||||||
|
if(Objects.isNull(js.get("ID")) || Objects.isNull(js.get("standardNumber"))){
|
||||||
|
Result.error("必填项不能为空");
|
||||||
|
}
|
||||||
|
ProductDesign productDesign = new ProductDesign();
|
||||||
|
productDesign.setId(js.get("ID").toString());
|
||||||
|
productDesign.setStandardNumber(js.get("standardNumber").toString());
|
||||||
|
productDesign.setQueryLabels(js.get("queryLabels").toString());
|
||||||
|
listProductDesign.add(productDesign);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
for (ProductDesign productDesign : listProductDesign) {
|
||||||
|
String str = lawsStandardMapper.getStandardByProductDesign(productDesign.getStandardNumber(),productDesign.getQueryLabels());
|
||||||
|
productDesign.setItemContent(str);
|
||||||
|
}
|
||||||
|
return Result.OK(listProductDesign);
|
||||||
|
}catch (Exception e){
|
||||||
|
log.error("标准法规文档查询异常:",e);
|
||||||
|
return Result.error("操作失败" + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package com.jero.modules.docking.srms.dto;
|
package com.jero.modules.docking.srms.vo;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
Reference in New Issue
Block a user