srms接口修改
This commit is contained in:
+15
-14
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
import com.jero.modules.docking.srms.service.SrmsApiService;
|
||||
import com.jero.modules.docking.srms.vo.ByFileRows;
|
||||
import com.jero.modules.docking.srms.vo.StandardPageVO;
|
||||
@@ -44,7 +45,7 @@ public class SrmsApiController {
|
||||
try {
|
||||
Result<JSONObject> re = srmsApiService.getByToken(json);
|
||||
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(),re.getCode()));
|
||||
}
|
||||
String token = re.getResult().get("token").toString();
|
||||
JSONObject jsonResponses = ResponsesUtil.getJsonOk();
|
||||
@@ -52,7 +53,7 @@ public class SrmsApiController {
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),jsonResponses);
|
||||
}catch (Exception e){
|
||||
log.error("获取token异常:",e);
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErr("操作失败"));
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErr("操作失败",CommonConstant.SC_INTERNAL_SERVER_ERROR_500));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +64,7 @@ public class SrmsApiController {
|
||||
try {
|
||||
Result<List<ByFileRows>> re = srmsApiService.getByLawsFileList(json,req);
|
||||
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(),re.getCode()));
|
||||
}
|
||||
List<ByFileRows> list = re.getResult();
|
||||
JSONObject jsonResponses = ResponsesUtil.getJsonOk();
|
||||
@@ -71,7 +72,7 @@ public class SrmsApiController {
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),jsonResponses);
|
||||
}catch (Exception e){
|
||||
log.error("标准法规文档查询异常:",e);
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErr("操作失败"));
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErr("操作失败", CommonConstant.SC_INTERNAL_SERVER_ERROR_500));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +83,7 @@ public class SrmsApiController {
|
||||
try {
|
||||
Result<List<JSONObject>> re = srmsApiService.getByLawsProductDesign(json,req);
|
||||
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(),re.getCode()));
|
||||
}
|
||||
List<JSONObject> list = re.getResult();
|
||||
JSONObject jsonResponses = ResponsesUtil.getJsonOk();
|
||||
@@ -90,7 +91,7 @@ public class SrmsApiController {
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),jsonResponses);
|
||||
}catch (Exception e){
|
||||
log.error("设计导航-产品设计条款查询异常:",e);
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErr("操作失败"));
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErr("操作失败",CommonConstant.SC_INTERNAL_SERVER_ERROR_500));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +102,7 @@ public class SrmsApiController {
|
||||
try {
|
||||
Result<List<StandardTree>> re = srmsApiService.getByLawsSystem(json,req);
|
||||
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(),re.getCode()));
|
||||
}
|
||||
List<StandardTree> list = re.getResult();
|
||||
JSONObject jsonResponses = ResponsesUtil.getJsonOk();
|
||||
@@ -109,7 +110,7 @@ public class SrmsApiController {
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),jsonResponses);
|
||||
}catch (Exception e){
|
||||
log.error("获取所有体系数据异常:",e);
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErr("操作失败"));
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErr("操作失败",CommonConstant.SC_INTERNAL_SERVER_ERROR_500));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,7 +121,7 @@ public class SrmsApiController {
|
||||
try {
|
||||
Result<IPage<StandardPageVO>> re = srmsApiService.getByLawsStandardPage(json,req);
|
||||
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(),re.getCode()));
|
||||
}
|
||||
IPage<StandardPageVO> page = re.getResult();
|
||||
JSONObject jsonPage = new JSONObject();
|
||||
@@ -134,7 +135,7 @@ public class SrmsApiController {
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),jsonResponses);
|
||||
}catch (Exception e){
|
||||
log.error("分页查询标准数据异常:",e);
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErr("操作失败"));
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErr("操作失败",CommonConstant.SC_INTERNAL_SERVER_ERROR_500));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,14 +146,14 @@ public class SrmsApiController {
|
||||
try {
|
||||
Result<String> re = srmsApiService.syncPartData(json,req);
|
||||
if(!re.isSuccess()){
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErrUpper(re.getMessage()));
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErrUpper(re.getMessage(),re.getCode()));
|
||||
}
|
||||
JSONObject jsonResponses = ResponsesUtil.getJsonOkUpper();
|
||||
jsonResponses.put("Result",re.getResult());
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),jsonResponses);
|
||||
}catch (Exception e){
|
||||
log.error("零部件分类树同步接口异常:",e);
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErrUpper("操作失败"));
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErrUpper("操作失败",CommonConstant.SC_INTERNAL_SERVER_ERROR_500));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -166,7 +167,7 @@ public class SrmsApiController {
|
||||
// todo
|
||||
Result<List<JSONObject>> re = srmsApiService.getEStandardInfo(json,req);
|
||||
if(!re.isSuccess()){
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErrUpper(re.getMessage()));
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErrUpper(re.getMessage(),re.getCode()));
|
||||
}
|
||||
List<JSONObject> page = re.getResult();
|
||||
JSONObject jsonPage = new JSONObject();
|
||||
@@ -175,7 +176,7 @@ public class SrmsApiController {
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),jsonResponses);
|
||||
}catch (Exception e){
|
||||
log.error("E采通获取标准信息异常:",e);
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErrUpper("操作失败"));
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErrUpper("操作失败",CommonConstant.SC_INTERNAL_SERVER_ERROR_500));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-2
@@ -11,6 +11,7 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: ASMS国内法规
|
||||
@@ -38,8 +39,8 @@ public interface LawsStandardMapper{
|
||||
* @param queryLabels
|
||||
* @return java.util.List<com.jero.modules.docking.srms.vo.ByFileRows>
|
||||
*/
|
||||
String getStandardByProductDesign(@Param("standardNumber") String standardNumber,
|
||||
@Param("queryLabels") String queryLabels);
|
||||
List<Map<String,String>> getStandardByProductDesign(@Param("standardNumber") String standardNumber,
|
||||
@Param("queryLabels") String queryLabels);
|
||||
|
||||
IPage<StandardPageVO> getByLawsStandardPage(Page<StandardPageVO> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<StandardPageVO> queryWrapper);
|
||||
|
||||
+58
-40
@@ -5,13 +5,16 @@
|
||||
<select id="getStandard" resultType="com.jero.modules.docking.srms.vo.ByFileRows">
|
||||
select law.*,
|
||||
#{standard.partCategoryNum} as partCategoryNum,
|
||||
l1.name as partCategoryName
|
||||
(select name from laws_part_name where code = #{standard.partCategoryNum} limit 1) as partCategoryName
|
||||
from (
|
||||
select id,standard_number,standard_name,standard_english_name,standard_state,
|
||||
DATE_FORMAT(release_date,'%Y-%m-%d') as release_date,
|
||||
DATE_FORMAT(implementation_date,'%Y-%m-%d') as implementation_date
|
||||
DATE_FORMAT(implementation_date,'%Y-%m-%d') as implementation_date,
|
||||
part_name,
|
||||
(select GROUP_CONCAT(name) from laws_part_name where
|
||||
FIND_IN_SET(code,laws_domestic_standard.part_name) ) as p_name
|
||||
from laws_domestic_standard
|
||||
where del_flag = 0 and instr(part_name,#{standard.partCategoryNum}) > 0
|
||||
where del_flag = 0
|
||||
<if test="standard.standardNumber != '' and standard.standardNumber != null">
|
||||
and standard_number like concat(concat('%',#{standard.standardNumber}),'%')
|
||||
</if>
|
||||
@@ -21,12 +24,18 @@
|
||||
<if test="standard.standardState != '' and standard.standardState != null">
|
||||
and standard_state = #{standard.standardState}
|
||||
</if>
|
||||
<if test="standard.partCategoryNum != '' and standard.partCategoryNum != null">
|
||||
and FIND_IN_SET(#{standard.partCategoryNum},part_name)
|
||||
</if>
|
||||
union all
|
||||
select id,standard_number,standard_name,standard_english_name,standard_state,
|
||||
DATE_FORMAT(release_date,'%Y-%m-%d') as release_date,
|
||||
DATE_FORMAT(implementation_date,'%Y-%m-%d') as implementation_date
|
||||
DATE_FORMAT(implementation_date,'%Y-%m-%d') as implementation_date,
|
||||
part_name,
|
||||
(select GROUP_CONCAT(name) from laws_part_name where
|
||||
FIND_IN_SET(code,laws_overseas_standard.part_name) ) as p_name
|
||||
from laws_overseas_standard
|
||||
where del_flag = 0 and instr(part_name,#{standard.partCategoryNum}) > 0
|
||||
where del_flag = 0
|
||||
<if test="standard.standardNumber != '' and standard.standardNumber != null">
|
||||
and standard_number like concat(concat('%',#{standard.standardNumber}),'%')
|
||||
</if>
|
||||
@@ -36,12 +45,18 @@
|
||||
<if test="standard.standardState != '' and standard.standardState != null">
|
||||
and standard_state = #{standard.standardState}
|
||||
</if>
|
||||
<if test="standard.partCategoryNum != '' and standard.partCategoryNum != null">
|
||||
and FIND_IN_SET(#{standard.partCategoryNum},part_name)
|
||||
</if>
|
||||
union all
|
||||
select id,standard_number,standard_name,standard_english_name,standard_state,
|
||||
DATE_FORMAT(release_date,'%Y-%m-%d') as release_date,
|
||||
DATE_FORMAT(implementation_date,'%Y-%m-%d') as implementation_date
|
||||
DATE_FORMAT(implementation_date,'%Y-%m-%d') as implementation_date,
|
||||
part_name,
|
||||
(select GROUP_CONCAT(name) from laws_part_name where
|
||||
FIND_IN_SET(code,laws_enterprise_standard.part_name) ) as p_name
|
||||
from laws_enterprise_standard
|
||||
where del_flag = 0 and instr(part_name,#{standard.partCategoryNum}) > 0
|
||||
where del_flag = 0
|
||||
<if test="standard.standardNumber != '' and standard.standardNumber != null">
|
||||
and standard_number like concat(concat('%',#{standard.standardNumber}),'%')
|
||||
</if>
|
||||
@@ -51,12 +66,14 @@
|
||||
<if test="standard.standardState != '' and standard.standardState != null">
|
||||
and standard_state = #{standard.standardState}
|
||||
</if>
|
||||
<if test="standard.partCategoryNum != '' and standard.partCategoryNum != null">
|
||||
and FIND_IN_SET(#{standard.partCategoryNum},part_name)
|
||||
</if>
|
||||
) law
|
||||
left join laws_part_name l1 on l1.code = #{standard.partCategoryNum} and l1.del_flag = 0
|
||||
left join sar_file_split_info s1 on s1.standard_id = law.id and s1.file_type = 'publish_of_original' and s1.publish_before_id is null and s1.del_flag = 0
|
||||
<where>
|
||||
<if test="standard.partCategoryName != '' and standard.partCategoryName != null">
|
||||
and l1.name like concat(concat('%',#{standard.partCategoryName}),'%')
|
||||
and p_name like concat(concat('%',#{standard.partCategoryName}),'%')
|
||||
</if>
|
||||
<if test="standard.hasSplit == 1">
|
||||
and s1.split_result = '成功'
|
||||
@@ -66,37 +83,7 @@
|
||||
</if>
|
||||
</where>
|
||||
</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>
|
||||
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>
|
||||
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>
|
||||
) 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 != ''
|
||||
<if test="queryLabels != null and queryLabels != ''">
|
||||
and
|
||||
<foreach collection="queryLabels.split(',')" item="item" separator="and" open="(" close=")">
|
||||
FIND_IN_SET(#{item},l.property_tag)
|
||||
</foreach>
|
||||
</if>
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getByLawsStandardPage" resultType="com.jero.modules.docking.srms.vo.StandardPageVO">
|
||||
select laws.* from (
|
||||
@@ -124,4 +111,35 @@
|
||||
left join laws_node_relation l on l.unique_relation_flag = laws.id
|
||||
where ${ew.sqlSegment}
|
||||
</select>
|
||||
<select id="getStandardByProductDesign" resultType="java.util.Map">
|
||||
select l.item_content,law.standard_number
|
||||
from (
|
||||
select id,standard_number from laws_domestic_standard where del_flag = 0 and standard_state = 6
|
||||
<if test="standardNumber != null and standardNumber != ''">
|
||||
and standard_number like concat(concat('%',#{standardNumber}),'%')
|
||||
</if>
|
||||
union all
|
||||
select id,standard_number from laws_overseas_standard where del_flag = 0 and standard_state = 6
|
||||
<if test="standardNumber != null and standardNumber != ''">
|
||||
and standard_number like concat(concat('%',#{standardNumber}),'%')
|
||||
</if>
|
||||
union all
|
||||
select id,standard_number from laws_enterprise_standard where del_flag = 0 and standard_state = 6
|
||||
<if test="standardNumber != null and standardNumber != ''">
|
||||
and standard_number like concat(concat('%',#{standardNumber}),'%')
|
||||
</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 != ''
|
||||
<if test="queryLabels != null and queryLabels != ''">
|
||||
and
|
||||
<foreach collection="queryLabels.split(',')" item="item" separator="and" open="(" close=")">
|
||||
FIND_IN_SET(#{item},l.property_tag)
|
||||
</foreach>
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
+45
-20
@@ -100,7 +100,7 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
||||
private String ettonSysUser;
|
||||
|
||||
private static final String REQUESTS = "Requests";
|
||||
private static final String SYS_ERR = "系统验证失败";
|
||||
private static final String SYS_ERR = "访问受限,token授权过期";
|
||||
private static final String STANDARD_NAME = "standardName";
|
||||
private static final String STANDARD_NUMBER = "standardNumber";
|
||||
private static final String PUBLISH_OF_ORIGINAL = "publish_of_original";
|
||||
@@ -122,7 +122,7 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
||||
queryLawsSysApiInfo.eq(LawsSysApiInfo::getSecret,byTokenRequests.getSecret());
|
||||
LawsSysApiInfo lawsSysApiInfo = lawsSysApiInfoService.getOne(queryLawsSysApiInfo,false);
|
||||
if(Objects.isNull(lawsSysApiInfo)){
|
||||
return Result.error(SYS_ERR);
|
||||
return Result.error(403,SYS_ERR);
|
||||
}
|
||||
Result<JSONObject> re;
|
||||
// E彩通访问,使用默认账户
|
||||
@@ -145,8 +145,14 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
||||
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)){
|
||||
return Result.error(SYS_ERR);
|
||||
try {
|
||||
// 验证Token有效性
|
||||
boolean tokenOK = TokenUtils.verifyToken(req, sysBaseAPI, redisUtil);
|
||||
if(!tokenOK){
|
||||
return Result.error(403,SYS_ERR);
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
return Result.error(403,SYS_ERR);
|
||||
}
|
||||
JSONObject requests = JSON.parseObject(JSON.toJSONString(json.get(REQUESTS)));
|
||||
// 零部件-分类内部码(精准查询)
|
||||
@@ -284,9 +290,14 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
||||
@Override
|
||||
public Result<List<JSONObject>> getByLawsProductDesign(JSONObject json, HttpServletRequest req) {
|
||||
// 验证token
|
||||
String token = req.getHeader(X_ACCESS_TOKEN);
|
||||
if(StringUtils.isBlank(token) || !Objects.equals(TokenUtils.getTokenByRequest(req),token)){
|
||||
return Result.error(SYS_ERR);
|
||||
try {
|
||||
// 验证Token有效性
|
||||
boolean tokenOK = TokenUtils.verifyToken(req, sysBaseAPI, redisUtil);
|
||||
if(!tokenOK){
|
||||
return Result.error(403,SYS_ERR);
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
return Result.error(403,SYS_ERR);
|
||||
}
|
||||
JSONObject requests = JSON.parseObject(JSON.toJSONString(json.get(REQUESTS)));
|
||||
JSONArray rows = JSON.parseArray(JSON.toJSONString(requests.get("Rows")));
|
||||
@@ -313,13 +324,16 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
||||
try {
|
||||
List<JSONObject> listObj = new ArrayList<>();
|
||||
for (ProductDesign productDesign : listProductDesign) {
|
||||
String str = lawsStandardMapper.getStandardByProductDesign(productDesign.getStandardNumber(),productDesign.getQueryLabels());
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("ID",productDesign.getId());
|
||||
obj.put(queryLabels,productDesign.getQueryLabels());
|
||||
obj.put("itemContent",str);
|
||||
obj.put(STANDARD_NUMBER,productDesign.getStandardNumber());
|
||||
listObj.add(obj);
|
||||
List<Map<String,String>> list = lawsStandardMapper.getStandardByProductDesign(productDesign.getStandardNumber(),productDesign.getQueryLabels());
|
||||
for (Map<String, String> stringStringMap : list) {
|
||||
JSONObject obj = new JSONObject();
|
||||
obj.put("ID",productDesign.getId());
|
||||
obj.put(queryLabels,productDesign.getQueryLabels());
|
||||
obj.put("itemContent",stringStringMap.get("item_content"));
|
||||
obj.put(STANDARD_NUMBER,stringStringMap.get("standard_number"));
|
||||
listObj.add(obj);
|
||||
}
|
||||
|
||||
}
|
||||
return Result.OK(listObj);
|
||||
}catch (Exception e){
|
||||
@@ -331,9 +345,14 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
||||
@Override
|
||||
public Result<List<StandardTree>> getByLawsSystem(JSONObject json, HttpServletRequest req) {
|
||||
// 验证token
|
||||
String token = req.getHeader(X_ACCESS_TOKEN);
|
||||
if(StringUtils.isBlank(token) || !Objects.equals(TokenUtils.getTokenByRequest(req),token)){
|
||||
return Result.error(SYS_ERR);
|
||||
try {
|
||||
// 验证Token有效性
|
||||
boolean tokenOK = TokenUtils.verifyToken(req, sysBaseAPI, redisUtil);
|
||||
if(!tokenOK){
|
||||
return Result.error(403,SYS_ERR);
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
return Result.error(403,SYS_ERR);
|
||||
}
|
||||
JSONObject requests = JSON.parseObject(JSON.toJSONString(json.get(REQUESTS)));
|
||||
String nodeName = "";
|
||||
@@ -409,8 +428,14 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
||||
public Result<IPage<StandardPageVO>> getByLawsStandardPage(JSONObject json, HttpServletRequest req) {
|
||||
// 验证token
|
||||
String token = req.getHeader(X_ACCESS_TOKEN);
|
||||
if(StringUtils.isBlank(token) || !Objects.equals(TokenUtils.getTokenByRequest(req),token)){
|
||||
return Result.error(SYS_ERR);
|
||||
try {
|
||||
// 验证Token有效性
|
||||
boolean tokenOK = TokenUtils.verifyToken(req, sysBaseAPI, redisUtil);
|
||||
if(!tokenOK){
|
||||
return Result.error(403,SYS_ERR);
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
return Result.error(403,SYS_ERR);
|
||||
}
|
||||
|
||||
JSONObject requests = JSON.parseObject(JSON.toJSONString(json.get(REQUESTS)));
|
||||
@@ -561,7 +586,7 @@ public class SrmsApiServiceImpl implements SrmsApiService {
|
||||
// 验证token
|
||||
String token = req.getHeader(X_ACCESS_TOKEN);
|
||||
if(StringUtils.isBlank(token) || !Objects.equals(TokenUtils.getTokenByRequest(req),token)){
|
||||
return Result.error(SYS_ERR);
|
||||
return Result.error(403,SYS_ERR);
|
||||
}
|
||||
JSONObject requests = JSON.parseObject(JSON.toJSONString(json.get(REQUESTS)));
|
||||
JSONArray rows = JSON.parseArray(JSON.toJSONString(requests.get("Rows")));
|
||||
|
||||
+6
-6
@@ -45,12 +45,12 @@ public class ResponsesUtil {
|
||||
}
|
||||
|
||||
public static JSONObject getJsonErrUpper() {
|
||||
return getJsonErrUpper("");
|
||||
return getJsonErrUpper("",CommonConstant.SC_INTERNAL_SERVER_ERROR_500);
|
||||
}
|
||||
|
||||
public static JSONObject getJsonErrUpper(String message) {
|
||||
public static JSONObject getJsonErrUpper(String message,Integer code) {
|
||||
JSONObject jsonResponses = new JSONObject();
|
||||
jsonResponses.put("SrmsCode",CommonConstant.SC_INTERNAL_SERVER_ERROR_500);
|
||||
jsonResponses.put("SrmsCode",code);
|
||||
jsonResponses.put("Message",message);
|
||||
jsonResponses.put("Success",false);
|
||||
jsonResponses.put("Timestamp",System.currentTimeMillis());
|
||||
@@ -58,12 +58,12 @@ public class ResponsesUtil {
|
||||
}
|
||||
|
||||
public static JSONObject getJsonErr() {
|
||||
return getJsonErr("");
|
||||
return getJsonErr("",CommonConstant.SC_INTERNAL_SERVER_ERROR_500);
|
||||
}
|
||||
|
||||
public static JSONObject getJsonErr(String message) {
|
||||
public static JSONObject getJsonErr(String message,Integer code) {
|
||||
JSONObject jsonResponses = new JSONObject();
|
||||
jsonResponses.put("srmsCode",CommonConstant.SC_INTERNAL_SERVER_ERROR_500);
|
||||
jsonResponses.put("srmsCode",code);
|
||||
jsonResponses.put("message",message);
|
||||
jsonResponses.put("success",false);
|
||||
jsonResponses.put("timestamp",System.currentTimeMillis());
|
||||
|
||||
Reference in New Issue
Block a user