Merge branch 'thirdApiStage' into fourthStage
# Conflicts: # laws-base/laws-base-core/src/main/java/com/jero/config/filter/csrf/CsrfFilter.java
This commit is contained in:
+182
@@ -0,0 +1,182 @@
|
||||
package com.jero.modules.docking.srms.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
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;
|
||||
import com.jero.modules.docking.srms.vo.StandardTree;
|
||||
import com.jero.modules.docking.utils.ResponsesUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lqt
|
||||
* @version 1.0
|
||||
* @date 2024/1/18 9:52
|
||||
*/
|
||||
@Slf4j
|
||||
@Api(tags="srms")
|
||||
@RestController
|
||||
@RequestMapping("/srms")
|
||||
public class SrmsApiController {
|
||||
@Resource
|
||||
private SrmsApiService srmsApiService;
|
||||
|
||||
private static final String MESSAGE_HEADER = "MessageHeader";
|
||||
|
||||
@ApiOperation("获取token")
|
||||
@AutoLog(value = "获取token")
|
||||
@PostMapping("/getByToken")
|
||||
public JSONObject getByToken(@RequestBody JSONObject json){
|
||||
try {
|
||||
Result<JSONObject> re = srmsApiService.getByToken(json);
|
||||
if(!re.isSuccess()){
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErr(re.getMessage(),re.getCode()));
|
||||
}
|
||||
String token = re.getResult().get("token").toString();
|
||||
JSONObject jsonResponses = ResponsesUtil.getJsonOk();
|
||||
jsonResponses.put("token",token);
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),jsonResponses);
|
||||
}catch (Exception e){
|
||||
log.error("获取token异常:",e);
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErr("操作失败",CommonConstant.SC_INTERNAL_SERVER_ERROR_500));
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("标准法规文档查询")
|
||||
@AutoLog(value = "标准法规文档查询")
|
||||
@PostMapping("/getByLawsFileList")
|
||||
public JSONObject getByLawsFileList(@RequestBody JSONObject json, HttpServletRequest req){
|
||||
try {
|
||||
Result<List<ByFileRows>> re = srmsApiService.getByLawsFileList(json,req);
|
||||
if(!re.isSuccess()){
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErr(re.getMessage(),re.getCode()));
|
||||
}
|
||||
List<ByFileRows> list = re.getResult();
|
||||
JSONObject jsonResponses = ResponsesUtil.getJsonOk();
|
||||
jsonResponses.put("Rows",list);
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),jsonResponses);
|
||||
}catch (Exception e){
|
||||
log.error("标准法规文档查询异常:",e);
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErr("操作失败", CommonConstant.SC_INTERNAL_SERVER_ERROR_500));
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("设计导航-产品设计条款查询")
|
||||
@AutoLog(value = "设计导航-产品设计条款查询")
|
||||
@PostMapping("/getByLawsProductDesign")
|
||||
public JSONObject getByLawsProductDesign(@RequestBody JSONObject json, HttpServletRequest req){
|
||||
try {
|
||||
Result<List<JSONObject>> re = srmsApiService.getByLawsProductDesign(json,req);
|
||||
if(!re.isSuccess()){
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErr(re.getMessage(),re.getCode()));
|
||||
}
|
||||
List<JSONObject> list = re.getResult();
|
||||
JSONObject jsonResponses = ResponsesUtil.getJsonOk();
|
||||
jsonResponses.put("Rows",list);
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),jsonResponses);
|
||||
}catch (Exception e){
|
||||
log.error("设计导航-产品设计条款查询异常:",e);
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErr("操作失败",CommonConstant.SC_INTERNAL_SERVER_ERROR_500));
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("获取所有体系数据")
|
||||
@AutoLog(value = "获取所有体系数据")
|
||||
@PostMapping("/getByLawsSystem")
|
||||
public JSONObject getByLawsSystem(@RequestBody JSONObject json, HttpServletRequest req){
|
||||
try {
|
||||
Result<List<StandardTree>> re = srmsApiService.getByLawsSystem(json,req);
|
||||
if(!re.isSuccess()){
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErr(re.getMessage(),re.getCode()));
|
||||
}
|
||||
List<StandardTree> list = re.getResult();
|
||||
JSONObject jsonResponses = ResponsesUtil.getJsonOk();
|
||||
jsonResponses.put("result",JSON.toJSONString(list));
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),jsonResponses);
|
||||
}catch (Exception e){
|
||||
log.error("获取所有体系数据异常:",e);
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErr("操作失败",CommonConstant.SC_INTERNAL_SERVER_ERROR_500));
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation("分页查询标准数据")
|
||||
@AutoLog(value = "分页查询标准数据")
|
||||
@PostMapping("/getByLawsStandardPage")
|
||||
public JSONObject getByLawsStandardPage(@RequestBody JSONObject json, HttpServletRequest req){
|
||||
try {
|
||||
Result<IPage<StandardPageVO>> re = srmsApiService.getByLawsStandardPage(json,req);
|
||||
if(!re.isSuccess()){
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErr(re.getMessage(),re.getCode()));
|
||||
}
|
||||
IPage<StandardPageVO> page = re.getResult();
|
||||
JSONObject jsonPage = new JSONObject();
|
||||
jsonPage.put("current",page.getCurrent());
|
||||
jsonPage.put("pages",page.getPages());
|
||||
jsonPage.put("size",page.getSize());
|
||||
jsonPage.put("total",page.getTotal());
|
||||
jsonPage.put("Rows_Result",page.getRecords());
|
||||
JSONObject jsonResponses = ResponsesUtil.getJsonOk();
|
||||
jsonResponses.put("Result",jsonPage);
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),jsonResponses);
|
||||
}catch (Exception e){
|
||||
log.error("分页查询标准数据异常:",e);
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErr("操作失败",CommonConstant.SC_INTERNAL_SERVER_ERROR_500));
|
||||
}
|
||||
}
|
||||
|
||||
// @ApiOperation("零部件分类树同步接口")
|
||||
@AutoLog(value = "零部件分类树同步接口")
|
||||
@PostMapping("/syncPartData")
|
||||
public JSONObject syncPartData(@RequestBody JSONObject json, HttpServletRequest req){
|
||||
try {
|
||||
Result<String> re = srmsApiService.syncPartData(json,req);
|
||||
if(!re.isSuccess()){
|
||||
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("操作失败",CommonConstant.SC_INTERNAL_SERVER_ERROR_500));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// @ApiOperation("E采通获取标准信息")
|
||||
@AutoLog(value = "E采通获取标准信息")
|
||||
@PostMapping("/getEStandardInfo")
|
||||
public JSONObject getEStandardInfo(@RequestBody JSONObject json, HttpServletRequest req){
|
||||
try {
|
||||
// todo
|
||||
Result<List<JSONObject>> re = srmsApiService.getEStandardInfo(json,req);
|
||||
if(!re.isSuccess()){
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErrUpper(re.getMessage(),re.getCode()));
|
||||
}
|
||||
List<JSONObject> page = re.getResult();
|
||||
JSONObject jsonPage = new JSONObject();
|
||||
JSONObject jsonResponses = ResponsesUtil.getJsonOkUpper();
|
||||
jsonResponses.put("Result",jsonPage);
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),jsonResponses);
|
||||
}catch (Exception e){
|
||||
log.error("E采通获取标准信息异常:",e);
|
||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),ResponsesUtil.getJsonErrUpper("操作失败",CommonConstant.SC_INTERNAL_SERVER_ERROR_500));
|
||||
}
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.jero.modules.docking.srms.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lqt
|
||||
* @version 1.0
|
||||
* @date 2024/1/18 10:10
|
||||
*/
|
||||
@Data
|
||||
public class ByFileListRequests implements Serializable {
|
||||
|
||||
/**
|
||||
* 工号(唯一值)
|
||||
*/
|
||||
private String partCategoryNum;
|
||||
/**
|
||||
* 系统的key值(对接时SRMS提供)
|
||||
*/
|
||||
private String partCategoryName;
|
||||
/**
|
||||
* 系统对应秘钥(对接时SRMS提供)
|
||||
*/
|
||||
private String secret;
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.jero.modules.docking.srms.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lqt
|
||||
* @version 1.0
|
||||
* @date 2024/1/18 10:10
|
||||
*/
|
||||
@Data
|
||||
public class ByTokenRequests implements Serializable {
|
||||
|
||||
/**
|
||||
* 工号(唯一值)
|
||||
*/
|
||||
private String username;
|
||||
/**
|
||||
* 系统的key值(对接时SRMS提供)
|
||||
*/
|
||||
private String appkey;
|
||||
/**
|
||||
* 系统对应秘钥(对接时SRMS提供)
|
||||
*/
|
||||
private String secret;
|
||||
}
|
||||
+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;
|
||||
}
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
package com.jero.modules.docking.srms.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.jero.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 系统对接信息
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-10-18
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("laws_sys_api_info")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="laws_sys_api_info对象", description="系统对接信息")
|
||||
public class LawsSysApiInfo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键ID*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键ID")
|
||||
private String id;
|
||||
/**系统中文名称*/
|
||||
@ApiModelProperty(value = "系统中文名称")
|
||||
private String sysName;
|
||||
/**系统唯一标识*/
|
||||
@ApiModelProperty(value = "系统唯一标识")
|
||||
private String sysCode;
|
||||
/**系统的key值*/
|
||||
@ApiModelProperty(value = "系统的key值")
|
||||
private String appKey;
|
||||
/**系统对应秘钥*/
|
||||
@ApiModelProperty(value = "系统对应秘钥")
|
||||
private String secret;
|
||||
/**限制IP*/
|
||||
@ApiModelProperty(value = "限制IP")
|
||||
private String ip;
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package com.jero.modules.docking.srms.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.modules.docking.srms.vo.ByFileRows;
|
||||
import com.jero.modules.docking.srms.vo.StandardPageVO;
|
||||
import com.jero.modules.docking.srms.vo.StandardVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Description: ASMS国内法规
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-10-20
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface LawsStandardMapper{
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LQT
|
||||
* @date 2024/1/19 15:43
|
||||
* @param standard
|
||||
* @return java.util.List<com.jero.modules.docking.srms.vo.ByFileRows>
|
||||
*/
|
||||
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>
|
||||
*/
|
||||
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);
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.jero.modules.docking.srms.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.docking.srms.entity.LawsSysApiInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-10-18
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface LawsSysApiInfoMapper extends BaseMapper<LawsSysApiInfo> {
|
||||
|
||||
}
|
||||
+145
@@ -0,0 +1,145 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jero.modules.docking.srms.mapper.LawsStandardMapper">
|
||||
|
||||
<select id="getStandard" resultType="com.jero.modules.docking.srms.vo.ByFileRows">
|
||||
select law.*,
|
||||
#{standard.partCategoryNum} as partCategoryNum,
|
||||
(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,
|
||||
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
|
||||
<if test="standard.standardNumber != '' and standard.standardNumber != null">
|
||||
and standard_number like concat(concat('%',#{standard.standardNumber}),'%')
|
||||
</if>
|
||||
<if test="standard.standardName != '' and standard.standardName != null">
|
||||
and standard_name like concat(concat('%',#{standard.standardName}),'%')
|
||||
</if>
|
||||
<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,
|
||||
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
|
||||
<if test="standard.standardNumber != '' and standard.standardNumber != null">
|
||||
and standard_number like concat(concat('%',#{standard.standardNumber}),'%')
|
||||
</if>
|
||||
<if test="standard.standardName != '' and standard.standardName != null">
|
||||
and standard_name like concat(concat('%',#{standard.standardName}),'%')
|
||||
</if>
|
||||
<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,
|
||||
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
|
||||
<if test="standard.standardNumber != '' and standard.standardNumber != null">
|
||||
and standard_number like concat(concat('%',#{standard.standardNumber}),'%')
|
||||
</if>
|
||||
<if test="standard.standardName != '' and standard.standardName != null">
|
||||
and standard_name like concat(concat('%',#{standard.standardName}),'%')
|
||||
</if>
|
||||
<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 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 p_name like concat(concat('%',#{standard.partCategoryName}),'%')
|
||||
</if>
|
||||
<if test="standard.hasSplit == 1">
|
||||
and s1.split_result = '成功'
|
||||
</if>
|
||||
<if test="standard.hasSplit == 2">
|
||||
and s1.split_result is null
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getByLawsStandardPage" resultType="com.jero.modules.docking.srms.vo.StandardPageVO">
|
||||
select laws.* from (
|
||||
SELECT
|
||||
id,standard_number,standard_name,standard_english_name,standard_state,standard_system,
|
||||
DATE_FORMAT( release_date, '%Y-%m-%d' ) AS release_date,
|
||||
DATE_FORMAT( implementation_date, '%Y-%m-%d' ) AS implementation_date,
|
||||
part_name as partCategoryNum
|
||||
FROM laws_domestic_standard
|
||||
union all
|
||||
SELECT
|
||||
id,standard_number,standard_name,standard_english_name,standard_state,standard_system,
|
||||
DATE_FORMAT( release_date, '%Y-%m-%d' ) AS release_date,
|
||||
DATE_FORMAT( implementation_date, '%Y-%m-%d' ) AS implementation_date,
|
||||
part_name as partCategoryNum
|
||||
FROM laws_enterprise_standard
|
||||
union all
|
||||
SELECT
|
||||
id,standard_number,standard_name,standard_english_name,standard_state,standard_system,
|
||||
DATE_FORMAT( release_date, '%Y-%m-%d' ) AS release_date,
|
||||
DATE_FORMAT( implementation_date, '%Y-%m-%d' ) AS implementation_date,
|
||||
part_name as partCategoryNum
|
||||
FROM laws_overseas_standard
|
||||
) laws
|
||||
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>
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jero.modules.docking.srms.mapper.LawsSysApiInfoMapper">
|
||||
|
||||
</mapper>
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.jero.modules.docking.srms.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.docking.srms.entity.LawsSysApiInfo;
|
||||
|
||||
/**
|
||||
* @Description: 系统对接信息
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-10-18
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ILawsSysApiInfoService extends IService<LawsSysApiInfo> {
|
||||
|
||||
}
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
package com.jero.modules.docking.srms.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.modules.docking.srms.vo.ByFileRows;
|
||||
import com.jero.modules.docking.srms.vo.StandardPageVO;
|
||||
import com.jero.modules.docking.srms.vo.StandardTree;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lqt
|
||||
* @version 1.0
|
||||
* @date 2024/1/18 9:49
|
||||
*/
|
||||
public interface SrmsApiService {
|
||||
|
||||
/**
|
||||
* 获取token
|
||||
* @author LQT
|
||||
* @date 2024/1/18 15:41
|
||||
* @param json
|
||||
* @return com.jero.common.api.vo.Result<com.alibaba.fastjson.JSONObject>
|
||||
*/
|
||||
Result<JSONObject> getByToken(JSONObject json);
|
||||
|
||||
/**
|
||||
* 标准法规文档查询
|
||||
* @author LQT
|
||||
* @date 2024/1/18 16:59
|
||||
* @param json
|
||||
* @param req
|
||||
* @return com.alibaba.fastjson.JSONObject
|
||||
*/
|
||||
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<JSONObject>> getByLawsProductDesign(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<StandardTree>> getByLawsSystem(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<IPage<StandardPageVO>> getByLawsStandardPage(JSONObject json, HttpServletRequest req);
|
||||
|
||||
/**
|
||||
* 零部件分类树同步接口
|
||||
* @author LQT
|
||||
* @date 2024/1/26 16:05
|
||||
* @param json
|
||||
* @param req
|
||||
* @return com.jero.common.api.vo.Result<java.lang.String>
|
||||
*/
|
||||
Result<String> syncPartData(JSONObject json, HttpServletRequest req);
|
||||
|
||||
/**
|
||||
* E采通获取标准信息
|
||||
* @author LQT
|
||||
* @date 2024/1/26 15:08
|
||||
* @param json
|
||||
* @param req
|
||||
* @return com.jero.common.api.vo.Result<java.util.List<com.alibaba.fastjson.JSONObject>>
|
||||
*/
|
||||
Result<List<JSONObject>> getEStandardInfo(JSONObject json, HttpServletRequest req);
|
||||
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package com.jero.modules.docking.srms.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.modules.docking.srms.entity.LawsSysApiInfo;
|
||||
import com.jero.modules.docking.srms.mapper.LawsSysApiInfoMapper;
|
||||
import com.jero.modules.docking.srms.service.ILawsSysApiInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: jero-boot
|
||||
* @Date: 2023-10-18
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class ILawsSysApiInfoServiceImpl extends ServiceImpl<LawsSysApiInfoMapper, LawsSysApiInfo> implements ILawsSysApiInfoService {
|
||||
|
||||
}
|
||||
+619
@@ -0,0 +1,619 @@
|
||||
package com.jero.modules.docking.srms.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.common.base.CaseFormat;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.system.api.ISysBaseAPI;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.MD5Util;
|
||||
import com.jero.common.util.RedisUtil;
|
||||
import com.jero.common.util.TokenUtils;
|
||||
import com.jero.modules.docking.srms.dto.ByTokenRequests;
|
||||
import com.jero.modules.docking.srms.dto.ProductDesign;
|
||||
import com.jero.modules.docking.srms.entity.LawsSysApiInfo;
|
||||
import com.jero.modules.docking.srms.mapper.LawsStandardMapper;
|
||||
import com.jero.modules.docking.srms.service.ILawsSysApiInfoService;
|
||||
import com.jero.modules.docking.srms.service.SrmsApiService;
|
||||
import com.jero.modules.docking.srms.vo.*;
|
||||
import com.jero.modules.laws.documenttool.entity.LawsDocumentSplit;
|
||||
import com.jero.modules.laws.documenttool.mapper.LawsDocumentSplitMapper;
|
||||
import com.jero.modules.laws.enterprise.entity.vo.LawsTreeNodeModel;
|
||||
import com.jero.modules.laws.standard.entity.PartName;
|
||||
import com.jero.modules.laws.standard.service.ILawsTreeNodeService;
|
||||
import com.jero.modules.laws.standard.service.PartNameService;
|
||||
import com.jero.modules.oss.entity.OSSFile;
|
||||
import com.jero.modules.oss.service.IOSSFileService;
|
||||
import com.jero.modules.split.entity.SarFileSplitInfoEO;
|
||||
import com.jero.modules.split.entity.SarFileSplitMenuEO;
|
||||
import com.jero.modules.split.page.SarFileSplitMenuEOPage;
|
||||
import com.jero.modules.split.service.ISarFileSplitInfoService;
|
||||
import com.jero.modules.split.service.ISarFileSplitMenuEOService;
|
||||
import com.jero.modules.system.service.ILoginService;
|
||||
import com.jero.modules.tag.enums.TableNameEnum;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author lqt
|
||||
* @version 1.0
|
||||
* @date 2024/1/18 9:53
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class SrmsApiServiceImpl implements SrmsApiService {
|
||||
|
||||
@Resource
|
||||
private ILoginService loginService;
|
||||
@Resource
|
||||
private RedisUtil redisUtil;
|
||||
@Resource
|
||||
private ISarFileSplitMenuEOService sarFileSplitMenuEOService;
|
||||
@Resource
|
||||
private ISarFileSplitInfoService sarFileSplitInfoService;
|
||||
@Resource
|
||||
private LawsDocumentSplitMapper lawsDocumentSplitMapper;
|
||||
@Resource
|
||||
private LawsStandardMapper lawsStandardMapper;
|
||||
@Resource
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
@Resource
|
||||
private IOSSFileService ossFileService;
|
||||
@Resource
|
||||
private ILawsTreeNodeService lawsTreeNodeService;
|
||||
@Resource
|
||||
private PartNameService partNameService;
|
||||
@Resource
|
||||
private ILawsSysApiInfoService lawsSysApiInfoService;
|
||||
|
||||
@Value("${srms.font_url_pdf}")
|
||||
private String fontUrlPdf;
|
||||
@Value("${srms.back_url_pdf}")
|
||||
private String backUrlPdf;
|
||||
@Value("${srms.font_url_other}")
|
||||
private String fontUrlOther;
|
||||
@Value("${srms.back_url_other}")
|
||||
private String backUrlOther;
|
||||
@Value("${srms.other_md5_mark}")
|
||||
private String otherMd5Mark;
|
||||
@Value("${srms.etton_sys_code}")
|
||||
private String ettonSysCode;
|
||||
@Value("${srms.etton_sys_user}")
|
||||
private String ettonSysUser;
|
||||
|
||||
private static final String REQUESTS = "Requests";
|
||||
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";
|
||||
private static final String X_ACCESS_TOKEN = "X-Access-Token";
|
||||
private static final String ADD_NOT_NULL = "必填项不能为空";
|
||||
|
||||
@Override
|
||||
public Result<JSONObject> getByToken(JSONObject json) {
|
||||
try {
|
||||
ByTokenRequests byTokenRequests = JSON.parseObject(JSON.toJSONString(json.get(REQUESTS)),ByTokenRequests.class);
|
||||
// 验证数据必填项
|
||||
if(StringUtils.isAllBlank(byTokenRequests.getUsername())
|
||||
|| StringUtils.isBlank(byTokenRequests.getAppkey())
|
||||
|| StringUtils.isBlank(byTokenRequests.getSecret())){
|
||||
return Result.error(ADD_NOT_NULL);
|
||||
}
|
||||
LambdaQueryWrapper<LawsSysApiInfo> queryLawsSysApiInfo = new LambdaQueryWrapper<>();
|
||||
queryLawsSysApiInfo.eq(LawsSysApiInfo::getAppKey,byTokenRequests.getAppkey());
|
||||
queryLawsSysApiInfo.eq(LawsSysApiInfo::getSecret,byTokenRequests.getSecret());
|
||||
LawsSysApiInfo lawsSysApiInfo = lawsSysApiInfoService.getOne(queryLawsSysApiInfo,false);
|
||||
if(Objects.isNull(lawsSysApiInfo)){
|
||||
return Result.error(403,SYS_ERR);
|
||||
}
|
||||
Result<JSONObject> re;
|
||||
// E彩通访问,使用默认账户
|
||||
if(Objects.equals(ettonSysCode,lawsSysApiInfo.getSysCode())){
|
||||
re = loginService.srmsByToken(ettonSysUser);
|
||||
String token = re.getResult().get("token").toString();
|
||||
String tokenKey = byTokenRequests.getUsername() + token;
|
||||
redisUtil.set(tokenKey,token,3600);
|
||||
}else{
|
||||
re = loginService.srmsByToken(byTokenRequests.getUsername());
|
||||
}
|
||||
return re;
|
||||
}catch (Exception e){
|
||||
log.error("获取token异常:",e);
|
||||
return Result.error("操作失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<List<ByFileRows>> getByLawsFileList(JSONObject json, HttpServletRequest req) {
|
||||
// 验证token
|
||||
String token = req.getHeader(X_ACCESS_TOKEN);
|
||||
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 partCategoryNum = getStr(requests, "partCategoryNum");
|
||||
if(StringUtils.isBlank(partCategoryNum)){
|
||||
return Result.error("零部件-分类内部码不能为空");
|
||||
}
|
||||
try {
|
||||
StandardVO standardVO = new StandardVO();
|
||||
standardVO.setPartCategoryNum(partCategoryNum);
|
||||
// 零部件-分类名称
|
||||
String partCategoryName = getStr(requests, "partCategoryName");
|
||||
standardVO.setPartCategoryName(partCategoryName);
|
||||
// 标准编号
|
||||
String standardNumber = getStr(requests, STANDARD_NUMBER);
|
||||
standardVO.setStandardNumber(standardNumber);
|
||||
// 标准名称
|
||||
String standardName = getStr(requests, STANDARD_NAME);
|
||||
standardVO.setStandardName(standardName);
|
||||
// 标准状态
|
||||
String standardState = getStr(requests, "standardState");
|
||||
standardVO.setStandardState(standardState);
|
||||
// 是否存在拆分信息,默认false; true-是,false-否
|
||||
setHasSplit(requests, standardVO);
|
||||
List<ByFileRows> listByFileRows = getByFileRows(partCategoryNum, standardVO,token);
|
||||
return Result.OK(listByFileRows);
|
||||
}catch (Exception e){
|
||||
log.error("标准法规文档查询异常:",e);
|
||||
return Result.error("操作失败" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private List<ByFileRows> getByFileRows(String partCategoryNum, StandardVO standardVO,String token) {
|
||||
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);
|
||||
// 查询零件名称
|
||||
LambdaQueryWrapper<PartName> queryPartName = new LambdaQueryWrapper<>();
|
||||
queryPartName.eq(PartName::getCode,partCategoryNum);
|
||||
PartName partName = partNameService.getOne(queryPartName,false);
|
||||
|
||||
for (ByFileRows byFileRows : listByFileRows) {
|
||||
byFileRows.setPartCategoryNum(partCategoryNum);
|
||||
if(!Objects.isNull(partName)){
|
||||
byFileRows.setPartCategoryName(partName.getName());
|
||||
}
|
||||
|
||||
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(getUrl(listFile.get(0),token));
|
||||
}
|
||||
}
|
||||
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);
|
||||
addSarFileSplitInfoEO(byFileRows, sarFileSplitInfoEo);
|
||||
}
|
||||
return listByFileRows;
|
||||
}
|
||||
|
||||
private void addSarFileSplitInfoEO(ByFileRows byFileRows, SarFileSplitInfoEO sarFileSplitInfoEo) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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) {
|
||||
return requests.containsKey(partCategoryNum) ? requests.get(partCategoryNum).toString() : "";
|
||||
}
|
||||
|
||||
private List<SarFileSplitMenu> createChildList(SarFileSplitMenu testTree, List<SarFileSplitMenu> treeList) {
|
||||
return treeList.stream().filter(v -> testTree.getId().equals(v.getPid()))
|
||||
.peek(v -> v.setChildren(createChildList(v, treeList)))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<List<JSONObject>> getByLawsProductDesign(JSONObject json, HttpServletRequest req) {
|
||||
// 验证token
|
||||
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")));
|
||||
if(CollectionUtils.isEmpty(rows)){
|
||||
return Result.error(ADD_NOT_NULL);
|
||||
}
|
||||
List<ProductDesign> listProductDesign = new ArrayList<>();
|
||||
String queryLabels = "queryLabels";
|
||||
for (Object request : rows) {
|
||||
JSONObject js = JSON.parseObject(JSON.toJSONString(request));
|
||||
if(!js.containsKey("ID") || !js.containsKey(STANDARD_NUMBER) || !js.containsKey(queryLabels)){
|
||||
return Result.error(ADD_NOT_NULL);
|
||||
}
|
||||
if(StringUtils.isBlank(js.getString("ID")) || StringUtils.isBlank(js.getString(STANDARD_NUMBER))
|
||||
|| StringUtils.isBlank(js.getString(queryLabels))){
|
||||
return Result.error(ADD_NOT_NULL);
|
||||
}
|
||||
ProductDesign productDesign = new ProductDesign();
|
||||
productDesign.setId(js.getString("ID"));
|
||||
productDesign.setStandardNumber(js.getString(STANDARD_NUMBER));
|
||||
productDesign.setQueryLabels(js.getString(queryLabels));
|
||||
listProductDesign.add(productDesign);
|
||||
}
|
||||
try {
|
||||
List<JSONObject> listObj = new ArrayList<>();
|
||||
for (ProductDesign productDesign : listProductDesign) {
|
||||
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){
|
||||
log.error("设计导航-产品设计条款查询异常:",e);
|
||||
return Result.error("操作失败" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<List<StandardTree>> getByLawsSystem(JSONObject json, HttpServletRequest req) {
|
||||
// 验证token
|
||||
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 = "";
|
||||
if(!Objects.isNull(requests) && requests.containsKey("nodeName")){
|
||||
nodeName = requests.get("nodeName").toString();
|
||||
}
|
||||
try {
|
||||
List<StandardTree> listStandardTreeAll = new ArrayList<>();
|
||||
// 国内标准
|
||||
List<LawsTreeNodeModel> listDomestic = lawsTreeNodeService.queryTreeNodeList(TableNameEnum.DOMESTIC_REGULATIONS.getValue(), nodeName, "1");
|
||||
getStandardTree(listStandardTreeAll, listDomestic,nodeName);
|
||||
// 海外标准
|
||||
List<LawsTreeNodeModel> listForeign = lawsTreeNodeService.queryTreeNodeList(TableNameEnum.FOREIGN_REGULATIONS.getValue(), nodeName, "1");
|
||||
getStandardTree(listStandardTreeAll, listForeign,nodeName);
|
||||
// 企业标准
|
||||
List<LawsTreeNodeModel> listEnterprise = lawsTreeNodeService.queryTreeNodeList(TableNameEnum.ENTERPRISE_STANDARDS.getValue(), nodeName, "1");
|
||||
getStandardTree(listStandardTreeAll, listEnterprise,nodeName);
|
||||
return Result.OK(listStandardTreeAll);
|
||||
}catch (Exception e){
|
||||
log.error("获取所有体系数据异常:",e);
|
||||
return Result.error("操作失败" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private void getStandardTree(List<StandardTree> listStandardTreeAll, List<LawsTreeNodeModel> listEnterprise,String nodeName) {
|
||||
if (CollectionUtils.isEmpty(listEnterprise)) {
|
||||
return;
|
||||
}
|
||||
Optional<LawsTreeNodeModel> op = listEnterprise.stream().filter(o -> StringUtils.isBlank(o.getParentId())).findFirst();
|
||||
if (op.isPresent()) {
|
||||
LawsTreeNodeModel lawsTreeNodeModel = op.get();
|
||||
StandardTree standardTree = new StandardTree();
|
||||
standardTree.setNodeCode(lawsTreeNodeModel.getNodeCode());
|
||||
standardTree.setNodeName(lawsTreeNodeModel.getNodeName());
|
||||
if (!CollectionUtils.isEmpty(lawsTreeNodeModel.getChildren())) {
|
||||
List<StandardTree> sub = getTree(lawsTreeNodeModel.getChildren());
|
||||
if (!CollectionUtils.isEmpty(sub)) {
|
||||
standardTree.setChildren(sub);
|
||||
}
|
||||
}
|
||||
if(!StringUtils.isBlank(nodeName)){
|
||||
if(!CollectionUtils.isEmpty(lawsTreeNodeModel.getChildren()) || lawsTreeNodeModel.getNodeName().contains(nodeName)){
|
||||
listStandardTreeAll.add(standardTree);
|
||||
}
|
||||
}else{
|
||||
listStandardTreeAll.add(standardTree);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<StandardTree> getTree(List<LawsTreeNodeModel> listEnterprise){
|
||||
if(CollectionUtils.isEmpty(listEnterprise)){
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<StandardTree> list = new ArrayList<>();
|
||||
for (LawsTreeNodeModel treeNodeModel : listEnterprise) {
|
||||
StandardTree obj = new StandardTree();
|
||||
obj.setNodeCode(treeNodeModel.getNodeCode());
|
||||
obj.setNodeName(treeNodeModel.getNodeName());
|
||||
List<LawsTreeNodeModel> listSub = treeNodeModel.getChildren();
|
||||
if(!CollectionUtils.isEmpty(listSub)){
|
||||
List<StandardTree> listStandardTree = getTree(listSub);
|
||||
if(!CollectionUtils.isEmpty(listStandardTree)){
|
||||
obj.setChildren(listStandardTree);
|
||||
}
|
||||
}
|
||||
list.add(obj);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<IPage<StandardPageVO>> getByLawsStandardPage(JSONObject json, HttpServletRequest req) {
|
||||
// 验证token
|
||||
String token = req.getHeader(X_ACCESS_TOKEN);
|
||||
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)));
|
||||
if(Objects.isNull(requests)){
|
||||
return Result.error(ADD_NOT_NULL);
|
||||
}
|
||||
String pageNoKey = "pageNo";
|
||||
String pageSizeKey = "pageSize";
|
||||
if(!requests.containsKey(pageNoKey) || !requests.containsKey(pageSizeKey) ){
|
||||
return Result.error(ADD_NOT_NULL);
|
||||
}
|
||||
try {
|
||||
Long.parseLong(requests.get(pageNoKey).toString());
|
||||
Long.parseLong(requests.get(pageSizeKey).toString());
|
||||
}catch (Exception e){
|
||||
return Result.error(ADD_NOT_NULL);
|
||||
}
|
||||
QueryWrapper<StandardPageVO> queryStandardPageVO = new QueryWrapper<>();
|
||||
setQuery(requests, queryStandardPageVO);
|
||||
String columnKey = "column";
|
||||
if(requests.containsKey(columnKey) && !StringUtils.isBlank(requests.get(columnKey).toString())){
|
||||
String[] column = requests.get(columnKey).toString().split(",");
|
||||
String[] order = null;
|
||||
String orderKey = "order";
|
||||
if(requests.containsKey(orderKey) && StringUtils.isBlank(requests.get(orderKey).toString())){
|
||||
order = requests.get(orderKey).toString().split(",");
|
||||
if(column.length != order.length){
|
||||
return Result.error("排序参数异常");
|
||||
}
|
||||
}
|
||||
setOrder(queryStandardPageVO, column, order);
|
||||
}
|
||||
Page<StandardPageVO> page = new Page<>(Long.parseLong(requests.get(pageNoKey).toString()),
|
||||
Long.parseLong(requests.get(pageSizeKey).toString()));
|
||||
IPage<StandardPageVO> pageList = lawsStandardMapper.getByLawsStandardPage(page,queryStandardPageVO);
|
||||
getListStandardPageVO(pageList,token);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
private void setQuery(JSONObject requests, QueryWrapper<StandardPageVO> queryStandardPageVO) {
|
||||
queryStandardPageVO.eq("'1'","1");
|
||||
String nodeCodeKey = "nodeCode";
|
||||
if(requests.containsKey(nodeCodeKey) && !StringUtils.isEmpty(requests.get(nodeCodeKey).toString())){
|
||||
String nodeCode = requests.get(nodeCodeKey).toString();
|
||||
queryStandardPageVO.eq(!StringUtils.isEmpty(nodeCode),"l.node_code",nodeCode);
|
||||
}
|
||||
if(requests.containsKey(STANDARD_NUMBER) && !StringUtils.isEmpty(requests.get(STANDARD_NUMBER).toString())){
|
||||
String standardNumber = requests.get(STANDARD_NUMBER).toString();
|
||||
queryStandardPageVO.like("standard_number",standardNumber);
|
||||
}
|
||||
if(requests.containsKey(STANDARD_NAME) && !StringUtils.isEmpty(requests.get(STANDARD_NAME).toString())){
|
||||
String standardName = requests.get(STANDARD_NAME).toString();
|
||||
queryStandardPageVO.like("standard_name",standardName);
|
||||
}
|
||||
}
|
||||
|
||||
private void setOrder(QueryWrapper<StandardPageVO> queryStandardPageVO, String[] column, String[] order) {
|
||||
for (int i = 0; i < column.length; i++) {
|
||||
String c = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, column[i]);
|
||||
if(Objects.isNull(order)){
|
||||
queryStandardPageVO.orderByDesc(c);
|
||||
}else{
|
||||
if(Objects.equals(order[i],"asc") || Objects.equals(order[i],"ASC")){
|
||||
queryStandardPageVO.orderByAsc(c);
|
||||
}else{
|
||||
queryStandardPageVO.orderByDesc(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void getListStandardPageVO(IPage<StandardPageVO> pageList,String token) {
|
||||
List<StandardPageVO> listStandardPageVO = pageList.getRecords();
|
||||
if(CollectionUtils.isEmpty(listStandardPageVO)){
|
||||
return;
|
||||
}
|
||||
List<String> listFileId = listStandardPageVO.stream().map(StandardPageVO::getId).collect(Collectors.toList());
|
||||
QueryWrapper<OSSFile> queryOssFile = new QueryWrapper<>();
|
||||
queryOssFile.eq("lower(right(url, 4))",".pdf");
|
||||
queryOssFile.lambda().in(OSSFile::getStandardId,listFileId);
|
||||
queryOssFile.lambda().eq(OSSFile::getStandardFileType,PUBLISH_OF_ORIGINAL);
|
||||
queryOssFile.lambda().orderByDesc(OSSFile::getCreateTime);
|
||||
List<OSSFile> listOssFile = ossFileService.list(queryOssFile);
|
||||
|
||||
List<StandardPageVO> listStandardPageVOPartName = listStandardPageVO.stream().filter(o->!StringUtils.isBlank(o.getPartCategoryNum())).collect(Collectors.toList());
|
||||
List<PartName> listPartName = getPartNames(listStandardPageVOPartName);
|
||||
|
||||
for (StandardPageVO standardPageVO : listStandardPageVO) {
|
||||
standardPageVO.setStandardState_dictText(sysBaseAPI.translateDict("standard_state", standardPageVO.getStandardState()));
|
||||
if(!CollectionUtils.isEmpty(listOssFile)){
|
||||
List<OSSFile> listOssFileOne = listOssFile.stream().filter(o-> Objects.equals(o.getStandardId(),standardPageVO.getId())).collect(Collectors.toList());
|
||||
if(!CollectionUtils.isEmpty(listOssFileOne)){
|
||||
listOssFileOne = listOssFileOne.stream().sorted(Comparator.comparing(OSSFile::getCreateTime).reversed()).collect(Collectors.toList());
|
||||
standardPageVO.setStandardUrl(getUrl(listOssFileOne.get(0),token));
|
||||
}
|
||||
}
|
||||
// 零件号查询
|
||||
if(!CollectionUtils.isEmpty(listPartName) && !StringUtils.isBlank(standardPageVO.getPartCategoryNum())){
|
||||
List<PartName> listPartNameNew = listPartName.stream().filter(o->Arrays.asList(standardPageVO.getPartCategoryNum().split(",")).contains(o.getCode())).collect(Collectors.toList());
|
||||
if(!CollectionUtils.isEmpty(listPartNameNew)){
|
||||
List<String> listName = listPartNameNew.stream().map(PartName::getName).collect(Collectors.toList());
|
||||
standardPageVO.setPartCategoryName(String.join(",",listName));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<PartName> getPartNames(List<StandardPageVO> listStandardPageVOPartName) {
|
||||
List<PartName> listPartName = new ArrayList<>();
|
||||
if(!CollectionUtils.isEmpty(listStandardPageVOPartName)){
|
||||
List<String> listPartCategoryNum = listStandardPageVOPartName.stream().map(StandardPageVO::getPartCategoryNum).collect(Collectors.toList());
|
||||
if(!CollectionUtils.isEmpty(listPartCategoryNum)){
|
||||
// 零件号查询
|
||||
LambdaQueryWrapper<PartName> queryPartName = new LambdaQueryWrapper<>();
|
||||
queryPartName.in(PartName::getCode, Arrays.stream(String.join(",",listPartCategoryNum).split(",")).collect(Collectors.toList()).stream().distinct().collect(Collectors.toList()));
|
||||
listPartName = partNameService.list(queryPartName);
|
||||
}
|
||||
}
|
||||
return listPartName;
|
||||
}
|
||||
|
||||
private String getUrl(OSSFile ossFile,String token){
|
||||
String url = "";
|
||||
try{
|
||||
if(ossFile.getFileName().toUpperCase().lastIndexOf(".PDF") > 0){
|
||||
// 拼接url pdf预览
|
||||
String back = backUrlPdf.replace("{id}",ossFile.getId()).replace("{token}",token);
|
||||
url = fontUrlPdf.replace("{back_url_pdf}", URLEncoder.encode(back, StandardCharsets.UTF_8.name()));
|
||||
}else{
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
String mark = loginUser.getUsername() + loginUser.getRealname() + LocalDateTime.now();
|
||||
String markMd5 = MD5Util.MD5Encode(mark + otherMd5Mark,null);
|
||||
String backOther = backUrlOther.replace("{id}",ossFile.getId()).replace("{token}",token)
|
||||
.replace("{file_name}",ossFile.getFileName());
|
||||
url = fontUrlOther.replace("{back_url_other}",URLEncoder.encode(Base64.getEncoder().encodeToString(backOther.getBytes(StandardCharsets.UTF_8)), StandardCharsets.UTF_8.name()))
|
||||
.replace("{mark}",URLEncoder.encode(mark, StandardCharsets.UTF_8.name()))
|
||||
.replace("{mark_md5}",markMd5);
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.error("拼接url异常",e);
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Result<List<JSONObject>> getEStandardInfo(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(403,SYS_ERR);
|
||||
}
|
||||
JSONObject requests = JSON.parseObject(JSON.toJSONString(json.get(REQUESTS)));
|
||||
JSONArray rows = JSON.parseArray(JSON.toJSONString(requests.get("Rows")));
|
||||
if(CollectionUtils.isEmpty(rows)){
|
||||
return Result.error(ADD_NOT_NULL);
|
||||
}
|
||||
for (Object request : rows) {
|
||||
JSONObject js = JSON.parseObject(JSON.toJSONString(request));
|
||||
if(js.containsKey("PartNum") && StringUtils.isBlank(js.getString("PartNum"))){
|
||||
return Result.error(ADD_NOT_NULL);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
List<JSONObject> listObj = new ArrayList<>();
|
||||
for (Object request : rows) {
|
||||
// todo
|
||||
}
|
||||
return Result.OK(listObj);
|
||||
}catch (Exception e){
|
||||
log.error("设计导航-产品设计条款查询异常:",e);
|
||||
return Result.error("操作失败" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<String> syncPartData(JSONObject json, HttpServletRequest req) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.jero.modules.docking.srms.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lqt
|
||||
* @version 1.0
|
||||
* @date 2024/1/19 8:51
|
||||
*/
|
||||
@Data
|
||||
public class ByFileRows implements Serializable {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 零部件-分类内部码(精准查询)
|
||||
*/
|
||||
private String partCategoryNum;
|
||||
/**
|
||||
* 零部件-分类名称
|
||||
*/
|
||||
private String partCategoryName;
|
||||
/**
|
||||
* 标准编号
|
||||
*/
|
||||
private String standardNumber;
|
||||
/**
|
||||
* 标准名称
|
||||
*/
|
||||
private String standardName;
|
||||
/**
|
||||
* 标准英文名称
|
||||
*/
|
||||
private String standardEnglishName;
|
||||
|
||||
/**
|
||||
* 标准状态
|
||||
*/
|
||||
private String standardState;
|
||||
/**
|
||||
* 标准状态
|
||||
*/
|
||||
private String standardState_dictText;
|
||||
/**
|
||||
* 发布日期(转成字符串传)
|
||||
* 示例:2024-01-05
|
||||
*/
|
||||
private String releaseDate;
|
||||
/**
|
||||
* 实施日期
|
||||
* 示例:2024-01-05
|
||||
*/
|
||||
private String implementationDate;
|
||||
/**
|
||||
* 标准跳转链接,即发布稿查看链接(url+at信息),试验存在
|
||||
*/
|
||||
private String standardUrl;
|
||||
|
||||
private SplitResult splitResult;
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
package com.jero.modules.docking.srms.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lqt
|
||||
* @version 1.0
|
||||
* @date 2024/1/19 8:58
|
||||
*/
|
||||
@Data
|
||||
public class DocumentSplitDetail implements Serializable {
|
||||
|
||||
/**
|
||||
* 条款主键
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 目录id 和sarFileSplitMenuEO中对应
|
||||
*/
|
||||
private String menuId;
|
||||
/**
|
||||
* 条款内容
|
||||
*/
|
||||
private String itemContent;
|
||||
/**
|
||||
* 条款号
|
||||
*/
|
||||
private String itemNum;
|
||||
/**
|
||||
* 条款标题
|
||||
*/
|
||||
private String itemTitle;
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
package com.jero.modules.docking.srms.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lqt
|
||||
* @version 1.0
|
||||
* @date 2024/1/19 13:55
|
||||
*/
|
||||
@Data
|
||||
public class SarFileSplitMenu implements Serializable {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String itemName;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String pid;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private List<SarFileSplitMenu> children;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.jero.modules.docking.srms.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lqt
|
||||
* @version 1.0
|
||||
* @date 2024/1/19 8:57
|
||||
*/
|
||||
@Data
|
||||
public class SplitResult implements Serializable {
|
||||
|
||||
/**
|
||||
* 文档拆分详情
|
||||
*/
|
||||
private List<DocumentSplitDetail> documentSplitDetail;
|
||||
/**
|
||||
* 条款信息的全部内容
|
||||
*/
|
||||
private String sarFileSplitMenuEO;
|
||||
}
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
package com.jero.modules.docking.srms.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lqt
|
||||
* @version 1.0
|
||||
* @date 2024/1/19 14:58
|
||||
*/
|
||||
@Data
|
||||
public class StandardPageVO implements Serializable {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 零部件-分类内部码(精准查询)
|
||||
*/
|
||||
private String partCategoryNum;
|
||||
/**
|
||||
* 零部件-分类名称
|
||||
*/
|
||||
private String partCategoryName;
|
||||
/**
|
||||
* 标准编号
|
||||
*/
|
||||
private String standardNumber;
|
||||
/**
|
||||
* 标准名称
|
||||
*/
|
||||
private String standardName;
|
||||
/**
|
||||
* 标准英文名称
|
||||
*/
|
||||
private String standardEnglishName;
|
||||
|
||||
/**
|
||||
* 标准状态
|
||||
*/
|
||||
private String standardState;
|
||||
/**
|
||||
* 标准状态
|
||||
*/
|
||||
private String standardState_dictText;
|
||||
/**
|
||||
* 发布日期(转成字符串传)
|
||||
* 示例:2024-01-05
|
||||
*/
|
||||
private String releaseDate;
|
||||
/**
|
||||
* 实施日期
|
||||
* 示例:2024-01-05
|
||||
*/
|
||||
private String implementationDate;
|
||||
/**
|
||||
* 标准跳转链接,即发布稿查看链接(url+at信息),试验存在
|
||||
*/
|
||||
private String standardUrl;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.jero.modules.docking.srms.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author lqt
|
||||
* @version 1.0
|
||||
* @date 2024/1/21 18:44
|
||||
*/
|
||||
@Data
|
||||
public class StandardTree implements Serializable {
|
||||
/**
|
||||
* 节点编码
|
||||
*/
|
||||
private String nodeCode;
|
||||
/**
|
||||
* 节点名称
|
||||
*/
|
||||
private String nodeName;
|
||||
/**
|
||||
* 子集
|
||||
*/
|
||||
private List<StandardTree> children;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.jero.modules.docking.srms.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author lqt
|
||||
* @version 1.0
|
||||
* @date 2024/1/19 14:58
|
||||
*/
|
||||
@Data
|
||||
public class StandardVO implements Serializable {
|
||||
|
||||
/**
|
||||
* 零部件-分类内部码(精准查询)
|
||||
*/
|
||||
private String partCategoryNum;
|
||||
/**
|
||||
* 零部件-分类名称
|
||||
*/
|
||||
private String partCategoryName;
|
||||
/**
|
||||
* 标准编号
|
||||
*/
|
||||
private String standardNumber;
|
||||
/**
|
||||
* 标准名称
|
||||
*/
|
||||
private String standardName;
|
||||
/**
|
||||
* 标准状态
|
||||
*/
|
||||
private String standardState;
|
||||
/**
|
||||
* 是否存在拆分信息,1 成功 2 null
|
||||
*/
|
||||
private String hasSplit;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.jero.modules.docking.utils;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jero.common.constant.CommonConstant;
|
||||
|
||||
/**
|
||||
* @author lqt
|
||||
* @version 1.0
|
||||
* @date 2024/1/18 14:45
|
||||
*/
|
||||
public class ResponsesUtil {
|
||||
private ResponsesUtil(){}
|
||||
|
||||
public static JSONObject getJsonResult(Object jsonMessageHeader,JSONObject jsonResponses) {
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("MessageHeader",jsonMessageHeader);
|
||||
json.put("Responses",jsonResponses);
|
||||
return json;
|
||||
}
|
||||
|
||||
public static JSONObject getJsonOk() {
|
||||
return getJsonOk("");
|
||||
}
|
||||
|
||||
public static JSONObject getJsonOkUpper() {
|
||||
return getJsonOkUpper("");
|
||||
}
|
||||
|
||||
public static JSONObject getJsonOkUpper(String message) {
|
||||
JSONObject jsonResponses = new JSONObject();
|
||||
jsonResponses.put("SrmsCode",CommonConstant.SC_OK_200);
|
||||
jsonResponses.put("Message",message);
|
||||
jsonResponses.put("Success",true);
|
||||
jsonResponses.put("Timestamp",System.currentTimeMillis());
|
||||
return jsonResponses;
|
||||
}
|
||||
|
||||
public static JSONObject getJsonOk(String message) {
|
||||
JSONObject jsonResponses = new JSONObject();
|
||||
jsonResponses.put("srmsCode",CommonConstant.SC_OK_200);
|
||||
jsonResponses.put("message",message);
|
||||
jsonResponses.put("success",true);
|
||||
jsonResponses.put("timestamp",System.currentTimeMillis());
|
||||
return jsonResponses;
|
||||
}
|
||||
|
||||
public static JSONObject getJsonErrUpper() {
|
||||
return getJsonErrUpper("",CommonConstant.SC_INTERNAL_SERVER_ERROR_500);
|
||||
}
|
||||
|
||||
public static JSONObject getJsonErrUpper(String message,Integer code) {
|
||||
JSONObject jsonResponses = new JSONObject();
|
||||
jsonResponses.put("SrmsCode",code);
|
||||
jsonResponses.put("Message",message);
|
||||
jsonResponses.put("Success",false);
|
||||
jsonResponses.put("Timestamp",System.currentTimeMillis());
|
||||
return jsonResponses;
|
||||
}
|
||||
|
||||
public static JSONObject getJsonErr() {
|
||||
return getJsonErr("",CommonConstant.SC_INTERNAL_SERVER_ERROR_500);
|
||||
}
|
||||
|
||||
public static JSONObject getJsonErr(String message,Integer code) {
|
||||
JSONObject jsonResponses = new JSONObject();
|
||||
jsonResponses.put("srmsCode",code);
|
||||
jsonResponses.put("message",message);
|
||||
jsonResponses.put("success",false);
|
||||
jsonResponses.put("timestamp",System.currentTimeMillis());
|
||||
return jsonResponses;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user