style: 删除无用模块
This commit is contained in:
-179
@@ -1,179 +0,0 @@
|
|||||||
package com.jero.modules.docking.asms.controller;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import com.jero.common.api.vo.Result;
|
|
||||||
import com.jero.modules.docking.asms.entity.LawsAsmsDomestic;
|
|
||||||
import com.jero.modules.docking.asms.service.ILawsAsmsDomesticService;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.jero.modules.docking.asms.service.impl.SynchronizationAsmsService;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import com.jero.common.system.base.controller.JeroController;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import com.jero.common.aspect.annotation.AutoLog;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.apache.poi.ss.formula.functions.T;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: ASMS国内法规
|
|
||||||
* @Author: jero-boot
|
|
||||||
* @Date: 2023-10-20
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
@Api(tags="ASMS国内法规")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/docking/asms/lawsAsmsDomestic")
|
|
||||||
@Slf4j
|
|
||||||
public class LawsAsmsDomesticController extends JeroController<LawsAsmsDomestic, ILawsAsmsDomesticService> {
|
|
||||||
@Autowired
|
|
||||||
private ILawsAsmsDomesticService lawsAsmsDomesticService;
|
|
||||||
@Resource
|
|
||||||
private SynchronizationAsmsService synchronizationAsmsService;
|
|
||||||
/**
|
|
||||||
* 分页列表查询
|
|
||||||
*
|
|
||||||
* @param lawsAsmsDomestic
|
|
||||||
* @param pageNo
|
|
||||||
* @param pageSize
|
|
||||||
* @param req
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "ASMS国内法规-分页列表查询")
|
|
||||||
@ApiOperation(value="ASMS国内法规-分页列表查询", notes="ASMS国内法规-分页列表查询")
|
|
||||||
@GetMapping(value = "/page")
|
|
||||||
public Result<IPage<LawsAsmsDomestic>> queryPageList(LawsAsmsDomestic lawsAsmsDomestic,
|
|
||||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
||||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
||||||
HttpServletRequest req) {
|
|
||||||
IPage<LawsAsmsDomestic> pageList = lawsAsmsDomesticService.queryPage(lawsAsmsDomestic, pageNo, pageSize, req);
|
|
||||||
return Result.OK(pageList);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 列表查询
|
|
||||||
*
|
|
||||||
* @param lawsAsmsDomestic
|
|
||||||
* @param req
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "ASMS国内法规-列表查询")
|
|
||||||
@ApiOperation(value="ASMS国内法规-列表查询", notes="ASMS国内法规-列表查询")
|
|
||||||
@GetMapping(value = "/list")
|
|
||||||
public Result<List<LawsAsmsDomestic>> queryList(LawsAsmsDomestic lawsAsmsDomestic, HttpServletRequest req) {
|
|
||||||
List<LawsAsmsDomestic> list = lawsAsmsDomesticService.queryList(lawsAsmsDomestic, req);
|
|
||||||
return Result.OK(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加
|
|
||||||
*
|
|
||||||
* @param lawsAsmsDomestic
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "ASMS国内法规-添加")
|
|
||||||
@ApiOperation(value="ASMS国内法规-添加", notes="ASMS国内法规-添加")
|
|
||||||
@PostMapping(value = "/add")
|
|
||||||
public Result<T> add(@Validated @RequestBody LawsAsmsDomestic lawsAsmsDomestic) {
|
|
||||||
lawsAsmsDomesticService.add(lawsAsmsDomestic);
|
|
||||||
return Result.OK("操作成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑
|
|
||||||
*
|
|
||||||
* @param lawsAsmsDomestic
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "ASMS国内法规-编辑")
|
|
||||||
@ApiOperation(value="ASMS国内法规-编辑", notes="ASMS国内法规-编辑")
|
|
||||||
@PostMapping(value = "/edit")
|
|
||||||
public Result<T> edit(@Validated @RequestBody LawsAsmsDomestic lawsAsmsDomestic) {
|
|
||||||
lawsAsmsDomesticService.editById(lawsAsmsDomestic);
|
|
||||||
return Result.OK("操作成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id删除
|
|
||||||
*
|
|
||||||
* @param map
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "ASMS国内法规-通过id删除")
|
|
||||||
@ApiOperation(value="ASMS国内法规-通过id删除", notes="ASMS国内法规-通过id删除")
|
|
||||||
@PostMapping(value = "/delete")
|
|
||||||
public Result<T> delete(@RequestBody Map<String, String> map) {
|
|
||||||
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
|
|
||||||
return Result.error("请选择数据!");
|
|
||||||
}
|
|
||||||
lawsAsmsDomesticService.deleteById(map.get("id"));
|
|
||||||
return Result.OK("删除成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除
|
|
||||||
*
|
|
||||||
* @param map
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "ASMS国内法规-批量删除")
|
|
||||||
@ApiOperation(value="ASMS国内法规-批量删除", notes="ASMS国内法规-批量删除")
|
|
||||||
@PostMapping(value = "/deleteBatch")
|
|
||||||
public Result<T> deleteBatch(@RequestBody Map<String, String> map) {
|
|
||||||
if(!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))){
|
|
||||||
return Result.error("请选择数据!");
|
|
||||||
}
|
|
||||||
this.lawsAsmsDomesticService.deleteByIds(Arrays.asList(map.get("ids").split(",")));
|
|
||||||
return Result.OK("批量删除成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id查询
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "ASMS国内法规-通过id查询")
|
|
||||||
@ApiOperation(value="ASMS国内法规-通过id查询", notes="ASMS国内法规-通过id查询")
|
|
||||||
@GetMapping(value = "/queryById")
|
|
||||||
public Result<LawsAsmsDomestic> queryById(@RequestParam(name="id") String id) {
|
|
||||||
LawsAsmsDomestic lawsAsmsDomestic = lawsAsmsDomesticService.queryById(id);
|
|
||||||
if(lawsAsmsDomestic==null) {
|
|
||||||
return Result.error("未找到对应数据");
|
|
||||||
}
|
|
||||||
return Result.OK(lawsAsmsDomestic);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 清理数据接口
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "ASMS国内法规-清理数据接口")
|
|
||||||
@ApiOperation(value="ASMS国内法规-清理数据接口", notes="ASMS国内法规-清理数据接口")
|
|
||||||
@GetMapping(value = "/cleanData")
|
|
||||||
public Result<LawsAsmsDomestic> cleanData() {
|
|
||||||
lawsAsmsDomesticService.cleanData();
|
|
||||||
return Result.OK("清理成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据标准号同步拆分
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@GetMapping(value = "/syncSplitByStandardNumber")
|
|
||||||
public Result<LawsAsmsDomestic> syncSplitByStandardNumber(@RequestParam(name="standardNumber") String standardNumber) {
|
|
||||||
synchronizationAsmsService.syncSplitByStandardNumber(standardNumber);
|
|
||||||
return Result.OK("!");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-188
@@ -1,188 +0,0 @@
|
|||||||
package com.jero.modules.docking.asms.controller;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.jero.common.api.vo.Result;
|
|
||||||
import com.jero.modules.docking.asms.entity.LawsAsmsOpenApi;
|
|
||||||
import com.jero.modules.docking.asms.service.ILawsAsmsOpenApiService;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.jero.modules.docking.asms.util.AsmsPostUtil;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import com.jero.common.system.base.controller.JeroController;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import com.jero.common.aspect.annotation.AutoLog;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.apache.poi.ss.formula.functions.T;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 汽车标准数字化平台ASMS开放API接口管理
|
|
||||||
* @Author: jero-boot
|
|
||||||
* @Date: 2023-10-18
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
@Api(tags="汽车标准数字化平台ASMS开放API接口管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/docking/asms/api/lawsAsmsOpenApi")
|
|
||||||
@Slf4j
|
|
||||||
public class LawsAsmsOpenApiController extends JeroController<LawsAsmsOpenApi, ILawsAsmsOpenApiService> {
|
|
||||||
@Autowired
|
|
||||||
private ILawsAsmsOpenApiService lawsAsmsOpenApiService;
|
|
||||||
@Autowired
|
|
||||||
private AsmsPostUtil asmsPostUtil;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页列表查询
|
|
||||||
*
|
|
||||||
* @param lawsAsmsOpenApi
|
|
||||||
* @param pageNo
|
|
||||||
* @param pageSize
|
|
||||||
* @param req
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "汽车标准数字化平台ASMS开放API接口管理-分页列表查询")
|
|
||||||
@ApiOperation(value="汽车标准数字化平台ASMS开放API接口管理-分页列表查询", notes="汽车标准数字化平台ASMS开放API接口管理-分页列表查询")
|
|
||||||
@GetMapping(value = "/page")
|
|
||||||
public Result<IPage<LawsAsmsOpenApi>> queryPageList(LawsAsmsOpenApi lawsAsmsOpenApi,
|
|
||||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
||||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
||||||
HttpServletRequest req) {
|
|
||||||
IPage<LawsAsmsOpenApi> pageList = lawsAsmsOpenApiService.queryPage(lawsAsmsOpenApi, pageNo, pageSize, req);
|
|
||||||
return Result.OK(pageList);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 列表查询
|
|
||||||
*
|
|
||||||
* @param lawsAsmsOpenApi
|
|
||||||
* @param req
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "汽车标准数字化平台ASMS开放API接口管理-列表查询")
|
|
||||||
@ApiOperation(value="汽车标准数字化平台ASMS开放API接口管理-列表查询", notes="汽车标准数字化平台ASMS开放API接口管理-列表查询")
|
|
||||||
@GetMapping(value = "/list")
|
|
||||||
public Result<List<LawsAsmsOpenApi>> queryList(LawsAsmsOpenApi lawsAsmsOpenApi, HttpServletRequest req) {
|
|
||||||
List<LawsAsmsOpenApi> list = lawsAsmsOpenApiService.queryList(lawsAsmsOpenApi, req);
|
|
||||||
return Result.OK(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加
|
|
||||||
*
|
|
||||||
* @param lawsAsmsOpenApi
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "汽车标准数字化平台ASMS开放API接口管理-添加")
|
|
||||||
@ApiOperation(value="汽车标准数字化平台ASMS开放API接口管理-添加", notes="汽车标准数字化平台ASMS开放API接口管理-添加")
|
|
||||||
@PostMapping(value = "/add")
|
|
||||||
public Result<T> add(@Validated @RequestBody LawsAsmsOpenApi lawsAsmsOpenApi) {
|
|
||||||
lawsAsmsOpenApi.setStatus("0");
|
|
||||||
lawsAsmsOpenApiService.add(lawsAsmsOpenApi);
|
|
||||||
return Result.OK("操作成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑
|
|
||||||
*
|
|
||||||
* @param lawsAsmsOpenApi
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "汽车标准数字化平台ASMS开放API接口管理-编辑")
|
|
||||||
@ApiOperation(value="汽车标准数字化平台ASMS开放API接口管理-编辑", notes="汽车标准数字化平台ASMS开放API接口管理-编辑")
|
|
||||||
@PostMapping(value = "/edit")
|
|
||||||
public Result<T> edit(@Validated @RequestBody LawsAsmsOpenApi lawsAsmsOpenApi) {
|
|
||||||
lawsAsmsOpenApiService.editById(lawsAsmsOpenApi);
|
|
||||||
return Result.OK("操作成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id删除
|
|
||||||
*
|
|
||||||
* @param map
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "汽车标准数字化平台ASMS开放API接口管理-通过id删除")
|
|
||||||
@ApiOperation(value="汽车标准数字化平台ASMS开放API接口管理-通过id删除", notes="汽车标准数字化平台ASMS开放API接口管理-通过id删除")
|
|
||||||
@PostMapping(value = "/delete")
|
|
||||||
public Result<T> delete(@RequestBody Map<String, String> map) {
|
|
||||||
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
|
|
||||||
return Result.error("请选择数据!");
|
|
||||||
}
|
|
||||||
lawsAsmsOpenApiService.deleteById(map.get("id"));
|
|
||||||
return Result.OK("删除成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除
|
|
||||||
*
|
|
||||||
* @param map
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "汽车标准数字化平台ASMS开放API接口管理-批量删除")
|
|
||||||
@ApiOperation(value="汽车标准数字化平台ASMS开放API接口管理-批量删除", notes="汽车标准数字化平台ASMS开放API接口管理-批量删除")
|
|
||||||
@PostMapping(value = "/deleteBatch")
|
|
||||||
public Result<T> deleteBatch(@RequestBody Map<String, String> map) {
|
|
||||||
if(!map.containsKey("ids") || StringUtils.isEmpty(map.get("ids"))){
|
|
||||||
return Result.error("请选择数据!");
|
|
||||||
}
|
|
||||||
this.lawsAsmsOpenApiService.deleteByIds(Arrays.asList(map.get("ids").split(",")));
|
|
||||||
return Result.OK("批量删除成功!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id查询
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@AutoLog(value = "汽车标准数字化平台ASMS开放API接口管理-通过id查询")
|
|
||||||
@ApiOperation(value="汽车标准数字化平台ASMS开放API接口管理-通过id查询", notes="汽车标准数字化平台ASMS开放API接口管理-通过id查询")
|
|
||||||
@GetMapping(value = "/queryById")
|
|
||||||
public Result<LawsAsmsOpenApi> queryById(@RequestParam(name="id",required=true) String id) {
|
|
||||||
LawsAsmsOpenApi lawsAsmsOpenApi = lawsAsmsOpenApiService.queryById(id);
|
|
||||||
if(lawsAsmsOpenApi==null) {
|
|
||||||
return Result.error("未找到对应数据");
|
|
||||||
}
|
|
||||||
return Result.OK(lawsAsmsOpenApi);
|
|
||||||
}
|
|
||||||
|
|
||||||
@AutoLog(value = "查询接口返回信息")
|
|
||||||
@ApiOperation(value="查询接口返回信息", notes="查询接口返回信息")
|
|
||||||
@GetMapping(value = "/getInfoById")
|
|
||||||
public Result<Object> getInfoById(@RequestParam(name="id") String id) {
|
|
||||||
LawsAsmsOpenApi lawsAsmsOpenApi = lawsAsmsOpenApiService.queryById(id);
|
|
||||||
if(lawsAsmsOpenApi==null) {
|
|
||||||
return Result.error("未找到对应数据");
|
|
||||||
}
|
|
||||||
Map<String, String> map = null;
|
|
||||||
if (StringUtils.isNotBlank(lawsAsmsOpenApi.getQueryParamJson())) {
|
|
||||||
map = (Map<String, String>) JSON.parse(lawsAsmsOpenApi.getQueryParamJson());
|
|
||||||
}
|
|
||||||
return Result.OK(asmsPostUtil.sendGetReq(lawsAsmsOpenApi.getApiUrl(), map));
|
|
||||||
}
|
|
||||||
|
|
||||||
@AutoLog(value = "批量同步")
|
|
||||||
@ApiOperation(value="批量同步", notes="批量同步")
|
|
||||||
@GetMapping(value = "/syncBatch")
|
|
||||||
public Result<Object> syncBatch(@RequestParam(name="ids") String ids) {
|
|
||||||
lawsAsmsOpenApiService.syncBatch(Arrays.asList(ids.split(",")));
|
|
||||||
return Result.OK("操作成功");
|
|
||||||
}
|
|
||||||
|
|
||||||
@AutoLog(value = "批量删除原字典配置项")
|
|
||||||
@ApiOperation(value="批量删除原字典配置项", notes="批量删除原字典配置项")
|
|
||||||
@GetMapping(value = "/removeDictItemBatch")
|
|
||||||
public Result<Object> removeDictItemBatch(@RequestParam(name="ids") String ids) {
|
|
||||||
lawsAsmsOpenApiService.removeDictItemBatch(Arrays.asList(ids.split(",")));
|
|
||||||
return Result.OK("操作成功");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
-143
@@ -1,143 +0,0 @@
|
|||||||
package com.jero.modules.docking.asms.entity;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import lombok.Data;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
|
||||||
import com.jero.common.aspect.annotation.Dict;
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: ASMS国内法规
|
|
||||||
* @Author: jero-boot
|
|
||||||
* @Date: 2023-10-20
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@TableName("laws_asms_domestic")
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@ApiModel(value="laws_asms_domestic对象", description="ASMS国内法规")
|
|
||||||
public class LawsAsmsDomestic implements Serializable {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/**主键ID*/
|
|
||||||
@TableId(type = IdType.ASSIGN_ID)
|
|
||||||
@ApiModelProperty(value = "主键ID")
|
|
||||||
private java.lang.String id;
|
|
||||||
/**标准法规编号/标准号*/
|
|
||||||
@Excel(name = "标准法规编号/标准号", width = 15)
|
|
||||||
@ApiModelProperty(value = "标准法规编号/标准号")
|
|
||||||
private java.lang.String code;
|
|
||||||
/**标准法规名称/标准名称*/
|
|
||||||
@Excel(name = "标准法规名称/标准名称", width = 15)
|
|
||||||
@ApiModelProperty(value = "标准法规名称/标准名称")
|
|
||||||
private java.lang.String name;
|
|
||||||
/**法规英文名称*/
|
|
||||||
@Excel(name = "法规英文名称", width = 15)
|
|
||||||
@ApiModelProperty(value = "法规英文名称")
|
|
||||||
private java.lang.String englishName;
|
|
||||||
/**标准法规类别/标准类别*/
|
|
||||||
@Excel(name = "标准法规类别/标准类别", width = 15)
|
|
||||||
@ApiModelProperty(value = "标准法规类别/标准类别")
|
|
||||||
private java.lang.String type;
|
|
||||||
/**适用认证*/
|
|
||||||
@Excel(name = "适用认证", width = 15)
|
|
||||||
@ApiModelProperty(value = "适用认证")
|
|
||||||
private java.lang.String applicableCertificationListString;
|
|
||||||
/**适用车型拼接名称*/
|
|
||||||
@Excel(name = "适用车型拼接名称", width = 15)
|
|
||||||
@ApiModelProperty(value = "适用车型拼接名称")
|
|
||||||
private java.lang.String applicableModelsListString;
|
|
||||||
/**采标程度*/
|
|
||||||
@Excel(name = "采标程度", width = 15)
|
|
||||||
@ApiModelProperty(value = "采标程度")
|
|
||||||
private java.lang.String degreeAdoption;
|
|
||||||
/**起草人*/
|
|
||||||
@Excel(name = "起草人", width = 15)
|
|
||||||
@ApiModelProperty(value = "起草人")
|
|
||||||
private java.lang.String draftingPeople;
|
|
||||||
/**起草单位*/
|
|
||||||
@Excel(name = "起草单位", width = 15)
|
|
||||||
@ApiModelProperty(value = "起草单位")
|
|
||||||
private java.lang.String draftingUnit;
|
|
||||||
/**标准领域名称*/
|
|
||||||
@Excel(name = "标准领域名称", width = 15)
|
|
||||||
@ApiModelProperty(value = "标准领域名称")
|
|
||||||
private java.lang.String focalPointName;
|
|
||||||
/**实施日期*/
|
|
||||||
@Excel(name = "实施日期", width = 15)
|
|
||||||
@ApiModelProperty(value = "实施日期")
|
|
||||||
private java.lang.String implementationDate;
|
|
||||||
/**采用国际标准号*/
|
|
||||||
@Excel(name = "采用国际标准号", width = 15)
|
|
||||||
@ApiModelProperty(value = "采用国际标准号")
|
|
||||||
private java.lang.String internationalStandard;
|
|
||||||
/**新车实施日期*/
|
|
||||||
@Excel(name = "新车实施日期", width = 15)
|
|
||||||
@ApiModelProperty(value = "新车实施日期")
|
|
||||||
private java.lang.String newCarImplementationDate;
|
|
||||||
/**新注册车实施日期*/
|
|
||||||
@Excel(name = "新注册车实施日期", width = 15)
|
|
||||||
@ApiModelProperty(value = "新注册车实施日期")
|
|
||||||
private java.lang.String newRegisterCarImplementationDate;
|
|
||||||
/**动力类型*/
|
|
||||||
@Excel(name = "动力类型", width = 15)
|
|
||||||
@ApiModelProperty(value = "动力类型")
|
|
||||||
private java.lang.String powerTypeListString;
|
|
||||||
/**在产车实施日期*/
|
|
||||||
@Excel(name = "在产车实施日期", width = 15)
|
|
||||||
@ApiModelProperty(value = "在产车实施日期")
|
|
||||||
private java.lang.String productionCarImplementationDate;
|
|
||||||
/**提出部门*/
|
|
||||||
@Excel(name = "提出部门", width = 15)
|
|
||||||
@ApiModelProperty(value = "提出部门")
|
|
||||||
private java.lang.String proposingDepartment;
|
|
||||||
/**发布日期*/
|
|
||||||
@Excel(name = "发布日期", width = 15)
|
|
||||||
@ApiModelProperty(value = "发布日期")
|
|
||||||
private java.lang.String publishDate;
|
|
||||||
/**代替标准号*/
|
|
||||||
@Excel(name = "代替标准号", width = 15)
|
|
||||||
@ApiModelProperty(value = "代替标准号")
|
|
||||||
private java.lang.String replaceCode;
|
|
||||||
/**适用范围*/
|
|
||||||
@Excel(name = "适用范围", width = 15)
|
|
||||||
@ApiModelProperty(value = "适用范围")
|
|
||||||
private java.lang.String scopeApplication;
|
|
||||||
/**标准性质*/
|
|
||||||
@Excel(name = "标准性质", width = 15)
|
|
||||||
@ApiModelProperty(value = "标准性质")
|
|
||||||
private java.lang.String standardNature;
|
|
||||||
/**标准状态*/
|
|
||||||
@Excel(name = "标准状态", width = 15)
|
|
||||||
@ApiModelProperty(value = "标准状态")
|
|
||||||
private java.lang.String standardStatus;
|
|
||||||
/**分标委*/
|
|
||||||
@Excel(name = "分标委", width = 15)
|
|
||||||
@ApiModelProperty(value = "分标委")
|
|
||||||
private java.lang.String subcommittee;
|
|
||||||
/**创建时间*/
|
|
||||||
@ApiModelProperty(value = "创建时间")
|
|
||||||
private java.lang.String createTimeString;
|
|
||||||
/**更新时间*/
|
|
||||||
@ApiModelProperty(value = "更新时间")
|
|
||||||
private java.lang.String updateTimeString;
|
|
||||||
/**同步标识*/
|
|
||||||
@Excel(name = "同步标识", width = 15)
|
|
||||||
@ApiModelProperty(value = "同步标识")
|
|
||||||
@Dict(dicCode = "sync_flag")
|
|
||||||
private java.lang.String syncFlag;
|
|
||||||
}
|
|
||||||
-67
@@ -1,67 +0,0 @@
|
|||||||
package com.jero.modules.docking.asms.entity;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import lombok.Data;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
|
||||||
import com.jero.common.aspect.annotation.Dict;
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 汽车标准数字化平台ASMS开放API接口管理
|
|
||||||
* @Author: jero-boot
|
|
||||||
* @Date: 2023-10-18
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@TableName("laws_asms_open_api")
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@ApiModel(value="laws_asms_open_api对象", description="汽车标准数字化平台ASMS开放API接口管理")
|
|
||||||
public class LawsAsmsOpenApi implements Serializable {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/**主键ID*/
|
|
||||||
@TableId(type = IdType.ASSIGN_ID)
|
|
||||||
@ApiModelProperty(value = "主键ID")
|
|
||||||
private java.lang.String id;
|
|
||||||
/**api名称*/
|
|
||||||
@Excel(name = "api名称", width = 15)
|
|
||||||
@ApiModelProperty(value = "api名称")
|
|
||||||
private java.lang.String apiName;
|
|
||||||
/**api路径*/
|
|
||||||
@Excel(name = "api路径", width = 15)
|
|
||||||
@ApiModelProperty(value = "api路径")
|
|
||||||
private java.lang.String apiUrl;
|
|
||||||
/**数据字典id*/
|
|
||||||
@Excel(name = "数据字典id", width = 15)
|
|
||||||
@ApiModelProperty(value = "数据字典id")
|
|
||||||
@Dict(dictTable = "sys_dict", dicCode = "id", dicText = "dict_name")
|
|
||||||
private java.lang.String dictId;
|
|
||||||
/**接口类型(1字典,2分标委,3法规)*/
|
|
||||||
@Excel(name = "接口类型(1字典,2分标委,3法规)", width = 15)
|
|
||||||
@ApiModelProperty(value = "接口类型(1字典,2分标委,3法规)")
|
|
||||||
@Dict(dicCode = "asms_open_api_type")
|
|
||||||
private java.lang.String apiType;
|
|
||||||
/**参数map*/
|
|
||||||
@Excel(name = "参数map", width = 15)
|
|
||||||
@ApiModelProperty(value = "参数map")
|
|
||||||
private java.lang.String queryParamJson;
|
|
||||||
/**状态(0未同步、1已同步)*/
|
|
||||||
@Excel(name = "状态(0未同步、1已同步)", width = 15)
|
|
||||||
@ApiModelProperty(value = "状态(0未同步、1已同步)")
|
|
||||||
@Dict(dicCode = "sync_status")
|
|
||||||
private java.lang.String status;
|
|
||||||
}
|
|
||||||
-20
@@ -1,20 +0,0 @@
|
|||||||
package com.jero.modules.docking.asms.job;
|
|
||||||
|
|
||||||
import com.jero.common.util.SpringContextUtils;
|
|
||||||
import com.jero.modules.docking.asms.service.impl.SynchronizationAsmsService;
|
|
||||||
import org.quartz.Job;
|
|
||||||
import org.quartz.JobExecutionContext;
|
|
||||||
import org.quartz.JobExecutionException;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/11/3 13:43
|
|
||||||
* @Description: 同步asms国内法规
|
|
||||||
*/
|
|
||||||
public class AsmsDomesticJob implements Job {
|
|
||||||
@Override
|
|
||||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
|
||||||
SynchronizationAsmsService bean = SpringContextUtils.getBean(SynchronizationAsmsService.class);
|
|
||||||
bean.syncDomestic();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-20
@@ -1,20 +0,0 @@
|
|||||||
package com.jero.modules.docking.asms.job;
|
|
||||||
|
|
||||||
import com.jero.common.util.SpringContextUtils;
|
|
||||||
import com.jero.modules.docking.asms.service.impl.SynchronizationAsmsService;
|
|
||||||
import org.quartz.Job;
|
|
||||||
import org.quartz.JobExecutionContext;
|
|
||||||
import org.quartz.JobExecutionException;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/11/3 13:44
|
|
||||||
* @Description: 同步asms文档拆分
|
|
||||||
*/
|
|
||||||
public class AsmsSplitJob implements Job {
|
|
||||||
@Override
|
|
||||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
|
||||||
SynchronizationAsmsService bean = SpringContextUtils.getBean(SynchronizationAsmsService.class);
|
|
||||||
bean.syncSplit();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-17
@@ -1,17 +0,0 @@
|
|||||||
package com.jero.modules.docking.asms.mapper;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
import com.jero.modules.docking.asms.entity.LawsAsmsDomestic;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: ASMS国内法规
|
|
||||||
* @Author: jero-boot
|
|
||||||
* @Date: 2023-10-20
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
public interface LawsAsmsDomesticMapper extends BaseMapper<LawsAsmsDomestic> {
|
|
||||||
|
|
||||||
}
|
|
||||||
-33
@@ -1,33 +0,0 @@
|
|||||||
package com.jero.modules.docking.asms.mapper;
|
|
||||||
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
import com.jero.modules.docking.asms.entity.LawsAsmsOpenApi;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 汽车标准数字化平台ASMS开放API接口管理
|
|
||||||
* @Author: jero-boot
|
|
||||||
* @Date: 2023-10-18
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
@Mapper
|
|
||||||
public interface LawsAsmsOpenApiMapper extends BaseMapper<LawsAsmsOpenApi> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/18 16:25
|
|
||||||
* @Description: 物理删除字典配置项数据
|
|
||||||
**/
|
|
||||||
void removeDictItemBatch(@Param("dictIdList") List<String> dictIdList);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/23 9:54
|
|
||||||
* @Description: 获取asms国内法规的标准性质列表
|
|
||||||
**/
|
|
||||||
List<String> getStandardTypeList();
|
|
||||||
|
|
||||||
}
|
|
||||||
-33
@@ -1,33 +0,0 @@
|
|||||||
<?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.asms.mapper.LawsAsmsDomesticMapper">
|
|
||||||
<resultMap id="LawsAsmsDomesticResultMap" type="com.jero.modules.docking.asms.entity.LawsAsmsDomestic">
|
|
||||||
<id column="id" property="id" />
|
|
||||||
<result column="code" property="code" />
|
|
||||||
<result column="name" property="name" />
|
|
||||||
<result column="english_name" property="englishName" />
|
|
||||||
<result column="type" property="type" />
|
|
||||||
<result column="applicable_certification_list_string" property="applicableCertificationListString" />
|
|
||||||
<result column="applicable_models_list_string" property="applicableModelsListString" />
|
|
||||||
<result column="degree_adoption" property="degreeAdoption" />
|
|
||||||
<result column="drafting_people" property="draftingPeople" />
|
|
||||||
<result column="drafting_unit" property="draftingUnit" />
|
|
||||||
<result column="focal_point_name" property="focalPointName" />
|
|
||||||
<result column="implementation_date" property="implementationDate" />
|
|
||||||
<result column="international_standard" property="internationalStandard" />
|
|
||||||
<result column="new_car_implementation_date" property="newCarImplementationDate" />
|
|
||||||
<result column="new_register_car_implementation_date" property="newRegisterCarImplementationDate" />
|
|
||||||
<result column="power_type_list_string" property="powerTypeListString" />
|
|
||||||
<result column="production_car_implementation_date" property="productionCarImplementationDate" />
|
|
||||||
<result column="proposing_department" property="proposingDepartment" />
|
|
||||||
<result column="publish_date" property="publishDate" />
|
|
||||||
<result column="replace_code" property="replaceCode" />
|
|
||||||
<result column="scope_application" property="scopeApplication" />
|
|
||||||
<result column="standard_nature" property="standardNature" />
|
|
||||||
<result column="standard_status" property="standardStatus" />
|
|
||||||
<result column="subcommittee" property="subcommittee" />
|
|
||||||
<result column="create_time" property="createTime" />
|
|
||||||
<result column="update_time" property="updateTime" />
|
|
||||||
<result column="sync_flag" property="syncFlag" />
|
|
||||||
</resultMap>
|
|
||||||
</mapper>
|
|
||||||
-22
@@ -1,22 +0,0 @@
|
|||||||
<?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.asms.mapper.LawsAsmsOpenApiMapper">
|
|
||||||
<resultMap id="LawsAsmsOpenApiResultMap" type="com.jero.modules.docking.asms.entity.LawsAsmsOpenApi">
|
|
||||||
<id column="id" property="id" />
|
|
||||||
<result column="api_name" property="apiName" />
|
|
||||||
<result column="api_url" property="apiUrl" />
|
|
||||||
<result column="dict_id" property="dictId" />
|
|
||||||
<result column="api_type" property="apiType" />
|
|
||||||
<result column="query_param_json" property="queryParamJson" />
|
|
||||||
</resultMap>
|
|
||||||
<delete id="removeDictItemBatch">
|
|
||||||
DELETE FROM sys_dict_item WHERE dict_id IN
|
|
||||||
<foreach collection="dictIdList" item="item" index="index" open="(" close=")" separator=",">
|
|
||||||
#{item}
|
|
||||||
</foreach>
|
|
||||||
</delete>
|
|
||||||
<select id="getStandardTypeList" resultType="java.lang.String">
|
|
||||||
SELECT DISTINCT SUBSTRING_INDEX(code, ' ', 1) AS standard_class
|
|
||||||
FROM laws_asms_domestic;
|
|
||||||
</select>
|
|
||||||
</mapper>
|
|
||||||
-81
@@ -1,81 +0,0 @@
|
|||||||
package com.jero.modules.docking.asms.service;
|
|
||||||
|
|
||||||
import com.jero.modules.docking.asms.entity.LawsAsmsDomestic;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: ASMS国内法规
|
|
||||||
* @Author: jero-boot
|
|
||||||
* @Date: 2023-10-20
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
public interface ILawsAsmsDomesticService extends IService<LawsAsmsDomestic> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param lawsAsmsDomestic
|
|
||||||
* @param pageNo
|
|
||||||
* @param pageSize
|
|
||||||
* @param req
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
IPage<LawsAsmsDomestic> queryPage(LawsAsmsDomestic lawsAsmsDomestic, Integer pageNo, Integer pageSize, HttpServletRequest req);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 列表查询
|
|
||||||
*
|
|
||||||
* @param lawsAsmsDomestic
|
|
||||||
* @param req
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<LawsAsmsDomestic> queryList(LawsAsmsDomestic lawsAsmsDomestic, HttpServletRequest req);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存
|
|
||||||
*
|
|
||||||
* @param lawsAsmsDomestic
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
void add(LawsAsmsDomestic lawsAsmsDomestic);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新
|
|
||||||
*
|
|
||||||
* @param lawsAsmsDomestic
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
void editById(LawsAsmsDomestic lawsAsmsDomestic);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id删除
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
void deleteById(String id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除
|
|
||||||
*
|
|
||||||
* @param ids
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
void deleteByIds(List<String> ids);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id查询
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
LawsAsmsDomestic queryById(String id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 清理同步进来的脏数据
|
|
||||||
*/
|
|
||||||
void cleanData();
|
|
||||||
}
|
|
||||||
-100
@@ -1,100 +0,0 @@
|
|||||||
package com.jero.modules.docking.asms.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.jero.modules.docking.asms.entity.LawsAsmsOpenApi;
|
|
||||||
import com.jero.modules.laws.documenttool.entity.LawsDocumentSplit;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 汽车标准数字化平台ASMS开放API接口管理
|
|
||||||
* @Author: jero-boot
|
|
||||||
* @Date: 2023-10-18
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
public interface ILawsAsmsOpenApiService extends IService<LawsAsmsOpenApi> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param lawsAsmsOpenApi
|
|
||||||
* @param pageNo
|
|
||||||
* @param pageSize
|
|
||||||
* @param req
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
IPage<LawsAsmsOpenApi> queryPage(LawsAsmsOpenApi lawsAsmsOpenApi, Integer pageNo, Integer pageSize, HttpServletRequest req);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 列表查询
|
|
||||||
*
|
|
||||||
* @param lawsAsmsOpenApi
|
|
||||||
* @param req
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<LawsAsmsOpenApi> queryList(LawsAsmsOpenApi lawsAsmsOpenApi, HttpServletRequest req);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存
|
|
||||||
*
|
|
||||||
* @param lawsAsmsOpenApi
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
void add(LawsAsmsOpenApi lawsAsmsOpenApi);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新
|
|
||||||
*
|
|
||||||
* @param lawsAsmsOpenApi
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
void editById(LawsAsmsOpenApi lawsAsmsOpenApi);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id删除
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
void deleteById(String id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除
|
|
||||||
*
|
|
||||||
* @param ids
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
void deleteByIds(List<String> ids);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id查询
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
LawsAsmsOpenApi queryById(String id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/18 13:46
|
|
||||||
* @Description: 批量同步
|
|
||||||
**/
|
|
||||||
void syncBatch(List<String> idList);
|
|
||||||
|
|
||||||
@NotNull
|
|
||||||
String disposeImg(String articleContent);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/18 16:20
|
|
||||||
* @Description: 批量删除原字典配置项
|
|
||||||
**/
|
|
||||||
void removeDictItemBatch(List<String> idList);
|
|
||||||
|
|
||||||
void disposeItemVal(LawsDocumentSplit lawsDocumentSplit, String articleContent);
|
|
||||||
|
|
||||||
String judgeStandardProperty(String standardNumber);
|
|
||||||
}
|
|
||||||
-206
@@ -1,206 +0,0 @@
|
|||||||
package com.jero.modules.docking.asms.service.impl;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.jero.modules.docking.asms.entity.LawsAsmsDomestic;
|
|
||||||
import com.jero.modules.docking.asms.mapper.LawsAsmsDomesticMapper;
|
|
||||||
import com.jero.modules.docking.asms.service.ILawsAsmsDomesticService;
|
|
||||||
import com.jero.modules.laws.standard.entity.LawsDomesticStandard;
|
|
||||||
import com.jero.modules.laws.standard.entity.LawsOverseasStandard;
|
|
||||||
import com.jero.modules.laws.standard.mapper.LawsDomesticStandardMapper;
|
|
||||||
import com.jero.modules.laws.standard.mapper.LawsOverseasStandardMapper;
|
|
||||||
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
|
|
||||||
import com.jero.modules.laws.standard.service.ILawsOverseasStandardService;
|
|
||||||
import org.hibernate.validator.constraints.pl.REGON;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
import com.jero.common.exception.JeroBootException;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.jero.common.system.query.QueryGenerator;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: ASMS国内法规
|
|
||||||
* @Author: jero-boot
|
|
||||||
* @Date: 2023-10-20
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
@Transactional(rollbackFor = JeroBootException.class)
|
|
||||||
public class LawsAsmsDomesticServiceImpl extends ServiceImpl<LawsAsmsDomesticMapper, LawsAsmsDomestic> implements ILawsAsmsDomesticService {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private LawsDomesticStandardMapper lawsDomesticStandardMapper;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private LawsOverseasStandardMapper lawsOverseasStandardMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param lawsAsmsDomestic
|
|
||||||
* @param pageNo
|
|
||||||
* @param pageSize
|
|
||||||
* @param req
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public IPage<LawsAsmsDomestic> queryPage(LawsAsmsDomestic lawsAsmsDomestic, Integer pageNo, Integer pageSize,
|
|
||||||
HttpServletRequest req) {
|
|
||||||
QueryWrapper<LawsAsmsDomestic> queryWrapper = QueryGenerator.initQueryWrapper(lawsAsmsDomestic, req.getParameterMap());
|
|
||||||
Page<LawsAsmsDomestic> page = new Page<>(pageNo, pageSize);
|
|
||||||
return page(page, queryWrapper);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 列表查询
|
|
||||||
*
|
|
||||||
* @param lawsAsmsDomestic
|
|
||||||
* @param req
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<LawsAsmsDomestic> queryList(LawsAsmsDomestic lawsAsmsDomestic, HttpServletRequest req) {
|
|
||||||
return list(QueryGenerator.initQueryWrapper(lawsAsmsDomestic, req.getParameterMap()));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 保存
|
|
||||||
*
|
|
||||||
* @param lawsAsmsDomestic
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void add(LawsAsmsDomestic lawsAsmsDomestic) {
|
|
||||||
save(lawsAsmsDomestic);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新
|
|
||||||
*
|
|
||||||
* @param lawsAsmsDomestic
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void editById(LawsAsmsDomestic lawsAsmsDomestic) {
|
|
||||||
saveOrUpdate(lawsAsmsDomestic);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id删除
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void deleteById(String id) {
|
|
||||||
removeById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除
|
|
||||||
*
|
|
||||||
* @param ids
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void deleteByIds(List<String> ids) {
|
|
||||||
removeByIds(ids);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过id查询
|
|
||||||
*
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public LawsAsmsDomestic queryById(String id) {
|
|
||||||
return getById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 清理导入进来的脏数据
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void cleanData() {
|
|
||||||
// 先清理废止日期垃圾时间数据
|
|
||||||
lawsDomesticStandardMapper.cleanAnnulmentDate();
|
|
||||||
lawsOverseasStandardMapper.cleanAnnulmentDate();
|
|
||||||
List<LawsDomesticStandard> gblist = lawsDomesticStandardMapper.listWithoutDelFlag();
|
|
||||||
List<LawsOverseasStandard> fblist = lawsOverseasStandardMapper.listWithoutDelFlag();
|
|
||||||
// 遍历所有国标数据,清理新车型实施日期 在产车实施日期两个字段中的脏数据
|
|
||||||
for (LawsDomesticStandard standard : gblist) {
|
|
||||||
String newModelImplementationDate = standard.getNewModelImplementationDate();
|
|
||||||
String onTheProductionDate = standard.getOnTheProductionDate();
|
|
||||||
if (StrUtil.isBlank(newModelImplementationDate) && StrUtil.isBlank(onTheProductionDate)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (StrUtil.isNotBlank(newModelImplementationDate)) {
|
|
||||||
if (newModelImplementationDate.equals(",")) {
|
|
||||||
standard.setNewModelImplementationDate("");
|
|
||||||
} else {
|
|
||||||
List<String> dateList = Arrays.asList(newModelImplementationDate.split(","));
|
|
||||||
// 去重
|
|
||||||
standard.setNewModelImplementationDate(dateList.stream()
|
|
||||||
.distinct().collect(Collectors.joining(",")));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (StrUtil.isNotBlank(onTheProductionDate)) {
|
|
||||||
if (onTheProductionDate.equals(",")) {
|
|
||||||
standard.setOnTheProductionDate("");
|
|
||||||
} else {
|
|
||||||
List<String> dateList = Arrays.asList(onTheProductionDate.split(","));
|
|
||||||
// 去重
|
|
||||||
standard.setOnTheProductionDate(dateList.stream()
|
|
||||||
.distinct().collect(Collectors.joining(",")));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
lawsDomesticStandardMapper.updateIgnoreDelFlag(standard);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (LawsOverseasStandard standard : fblist) {
|
|
||||||
String newModelImplementationDate = standard.getNewModelImplementationDate();
|
|
||||||
String onTheProductionDate = standard.getOnTheProductionDate();
|
|
||||||
if (StrUtil.isBlank(newModelImplementationDate) && StrUtil.isBlank(onTheProductionDate)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (StrUtil.isNotBlank(newModelImplementationDate)) {
|
|
||||||
if (newModelImplementationDate.equals(",")) {
|
|
||||||
standard.setNewModelImplementationDate("");
|
|
||||||
} else {
|
|
||||||
List<String> dateList = Arrays.asList(newModelImplementationDate.split(","));
|
|
||||||
// 去重
|
|
||||||
standard.setNewModelImplementationDate(dateList.stream()
|
|
||||||
.distinct().collect(Collectors.joining(",")));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (StrUtil.isNotBlank(onTheProductionDate)) {
|
|
||||||
if (onTheProductionDate.equals(",")) {
|
|
||||||
standard.setOnTheProductionDate("");
|
|
||||||
} else {
|
|
||||||
List<String> dateList = Arrays.asList(onTheProductionDate.split(","));
|
|
||||||
// 去重
|
|
||||||
standard.setOnTheProductionDate(dateList.stream()
|
|
||||||
.distinct().collect(Collectors.joining(",")));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
lawsOverseasStandardMapper.updateIgnoreDelFlag(standard);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-1127
File diff suppressed because it is too large
Load Diff
-933
@@ -1,933 +0,0 @@
|
|||||||
package com.jero.modules.docking.asms.service.impl;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
||||||
import com.jero.common.exception.JeroBootException;
|
|
||||||
import com.jero.common.util.MinioUtil;
|
|
||||||
import com.jero.common.util.SnowflakeUtils;
|
|
||||||
import com.jero.common.util.UUIDUtils;
|
|
||||||
import com.jero.modules.docking.asms.entity.LawsAsmsDomestic;
|
|
||||||
import com.jero.modules.docking.asms.mapper.LawsAsmsOpenApiMapper;
|
|
||||||
import com.jero.modules.docking.asms.service.ILawsAsmsDomesticService;
|
|
||||||
import com.jero.modules.docking.asms.service.ILawsAsmsOpenApiService;
|
|
||||||
import com.jero.modules.docking.asms.util.AlphanumericComparator;
|
|
||||||
import com.jero.modules.docking.asms.util.AsmsPostUtil;
|
|
||||||
import com.jero.modules.laws.common.util.DateUtil;
|
|
||||||
import com.jero.modules.laws.documenttool.entity.LawsDocumentSplit;
|
|
||||||
import com.jero.modules.laws.documenttool.mapper.LawsDocumentSplitMapper;
|
|
||||||
import com.jero.modules.laws.documenttool.service.IDocumentSplitService;
|
|
||||||
import com.jero.modules.laws.home.common.LawsHomeSearchCommon;
|
|
||||||
import com.jero.modules.laws.home.service.ILawsHomeSearchService;
|
|
||||||
import com.jero.modules.laws.standard.entity.LawsDomesticStandard;
|
|
||||||
import com.jero.modules.laws.standard.service.ILawsDomesticStandardService;
|
|
||||||
import com.jero.modules.laws.standard.service.ILawsReplacedStandardService;
|
|
||||||
import com.jero.modules.laws.standardization.entity.LawsStandardization;
|
|
||||||
import com.jero.modules.laws.standardization.service.ILawsStandardizationService;
|
|
||||||
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.SarFileSplitItemsValEO;
|
|
||||||
import com.jero.modules.split.entity.SarFileSplitMenuEO;
|
|
||||||
import com.jero.modules.split.mapper.SarFileSplitMenuEOMapper;
|
|
||||||
import com.jero.modules.split.service.ISarFileSplitInfoService;
|
|
||||||
import com.jero.modules.split.service.ISarFileSplitItemsValEOService;
|
|
||||||
import com.jero.modules.split.service.ISarFileSplitMenuEOService;
|
|
||||||
import com.jero.modules.system.entity.SysDictItem;
|
|
||||||
import com.jero.modules.system.service.ISysDictItemService;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.jsoup.Jsoup;
|
|
||||||
import org.jsoup.nodes.Document;
|
|
||||||
import org.jsoup.nodes.Element;
|
|
||||||
import org.jsoup.select.Elements;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
import org.springframework.web.client.RestTemplate;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import java.util.*;
|
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/11/3 13:46
|
|
||||||
* @Description: 定时同步asms
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
@Slf4j
|
|
||||||
public class SynchronizationAsmsService {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private AsmsPostUtil asmsPostUtil;
|
|
||||||
@Autowired
|
|
||||||
private ISysDictItemService sysDictItemService;
|
|
||||||
@Autowired
|
|
||||||
private ILawsAsmsDomesticService lawsAsmsDomesticService;
|
|
||||||
@Autowired
|
|
||||||
private LawsAsmsOpenApiMapper lawsAsmsOpenApiMapper;
|
|
||||||
@Autowired
|
|
||||||
private ILawsStandardizationService lawsStandardizationService;
|
|
||||||
@Autowired
|
|
||||||
private ILawsDomesticStandardService lawsDomesticStandardService;
|
|
||||||
@Autowired
|
|
||||||
private ISarFileSplitInfoService sarFileSplitInfoService;
|
|
||||||
@Autowired
|
|
||||||
private LawsDocumentSplitMapper lawsDocumentSplitMapper;
|
|
||||||
@Autowired
|
|
||||||
private ISarFileSplitMenuEOService sarFileSplitMenuEOService;
|
|
||||||
@Autowired
|
|
||||||
private SarFileSplitMenuEOMapper sarFileSplitMenuEOMapper;
|
|
||||||
@Autowired
|
|
||||||
private ISarFileSplitItemsValEOService sarFileSplitItemsValEOService;
|
|
||||||
@Autowired
|
|
||||||
private ILawsReplacedStandardService lawsReplacedStandardService;
|
|
||||||
@Resource
|
|
||||||
private ILawsHomeSearchService lawsHomeSearchService;
|
|
||||||
@Autowired
|
|
||||||
private IOSSFileService ossFileService;
|
|
||||||
@Autowired
|
|
||||||
private IDocumentSplitService documentSplitService;
|
|
||||||
@Autowired
|
|
||||||
private RestTemplate restTemplate;
|
|
||||||
@Resource
|
|
||||||
private ILawsAsmsOpenApiService lawsAsmsOpenApiService;
|
|
||||||
|
|
||||||
private final static String filePath = "asms/";
|
|
||||||
private static SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
|
||||||
private static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
||||||
private static SimpleDateFormat oldDateFormat = new SimpleDateFormat("yyyy年MM月dd日");
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/11/3 13:48
|
|
||||||
* @Description: 定时同步国内法规
|
|
||||||
**/
|
|
||||||
@Transactional
|
|
||||||
public void syncDomestic() {
|
|
||||||
log.info("=====================定时同步国内法规=====================");
|
|
||||||
long start = System.currentTimeMillis();
|
|
||||||
|
|
||||||
// 法规列表
|
|
||||||
String url = "xiaobodata/openApi/domesticLaws/list";
|
|
||||||
Map<String, String> paramMap = new HashMap<>();
|
|
||||||
paramMap.put("pageNo", "1");
|
|
||||||
paramMap.put("pageSize", "2");
|
|
||||||
Map<String, Object> totalMap = asmsPostUtil.sendGetReq2(url, paramMap);
|
|
||||||
Integer total = (Integer) totalMap.get("total");
|
|
||||||
paramMap.put("pageSize", total.toString());
|
|
||||||
|
|
||||||
List<Map<String, String>> mapList = asmsPostUtil.sendGetReq(url, paramMap);
|
|
||||||
if (Objects.isNull(mapList)) {
|
|
||||||
log.info("=====================没有获取到ASMS系统数据,同步结束=====================");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
LambdaQueryWrapper<LawsDomesticStandard> queryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
queryWrapper.select(LawsDomesticStandard::getStandardNumber);
|
|
||||||
List<LawsDomesticStandard> lawsDomesticStandards = lawsDomesticStandardService.list(queryWrapper);
|
|
||||||
List<String> dupCodeList;
|
|
||||||
if (CollectionUtils.isNotEmpty(lawsDomesticStandards)) {
|
|
||||||
dupCodeList = lawsDomesticStandards.stream().map(LawsDomesticStandard::getStandardNumber).collect(Collectors.toList());
|
|
||||||
} else {
|
|
||||||
dupCodeList = new ArrayList<>();
|
|
||||||
}
|
|
||||||
List<LawsAsmsDomestic> lawsAsmsDomesticList = new ArrayList();
|
|
||||||
mapList.forEach(eMap -> {
|
|
||||||
String createTimeString = eMap.get("createTime");
|
|
||||||
Date createTime = DateUtil.getDateSecond(createTimeString);
|
|
||||||
Date yesterday = DateUtil.getDateAddDays(new Date(), -1);
|
|
||||||
// 创建时间为昨天的数据
|
|
||||||
if (createTime.after(DateUtil.getDayStart(yesterday)) && createTime.before(DateUtil.getDayEnd(yesterday))) {
|
|
||||||
if (!dupCodeList.contains((String) eMap.get("code"))) {
|
|
||||||
LawsAsmsDomestic lawsAsmsDomestic = JSONObject.parseObject(JSONObject.toJSONString(eMap), LawsAsmsDomestic.class);
|
|
||||||
lawsAsmsDomestic.setCreateTimeString(createTimeString);
|
|
||||||
lawsAsmsDomestic.setUpdateTimeString(eMap.get("updateTime"));
|
|
||||||
lawsAsmsDomestic.setFocalPointName(eMap.get("focalPoint"));
|
|
||||||
lawsAsmsDomesticList.add(lawsAsmsDomestic);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (CollectionUtils.isEmpty(lawsAsmsDomesticList)) {
|
|
||||||
log.info("=====================昨天新增法规0条,同步结束=====================");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 法规详情
|
|
||||||
String detailUrl = "xiaobodata/openApi/domesticLaws/getInfo";
|
|
||||||
List<LawsAsmsDomestic> detailList = new ArrayList();
|
|
||||||
Map<String, String> detailMap = new HashMap<>();
|
|
||||||
lawsAsmsDomesticList.forEach(lawsAsmsDomestic -> {
|
|
||||||
detailMap.put("lawCode", lawsAsmsDomestic.getCode());
|
|
||||||
Map<String, Object> objectMap = asmsPostUtil.sendGetReq2(detailUrl, detailMap);
|
|
||||||
|
|
||||||
LawsAsmsDomestic parseObject = JSONObject.parseObject(JSONObject.toJSONString(objectMap), LawsAsmsDomestic.class);
|
|
||||||
parseObject.setCreateTimeString((String) objectMap.get("createTime"));
|
|
||||||
parseObject.setUpdateTimeString((String) objectMap.get("updateTime"));
|
|
||||||
parseObject.setFocalPointName((String) objectMap.get("focalPoint"));
|
|
||||||
detailList.add(parseObject);
|
|
||||||
});
|
|
||||||
|
|
||||||
// 同步到数据库
|
|
||||||
List<SysDictItem> sysDictItemList = sysDictItemService.list();
|
|
||||||
List<LawsStandardization> lawsStandardizationList = lawsStandardizationService.list();
|
|
||||||
List<LawsDomesticStandard> insertDomesticList = new ArrayList<>();
|
|
||||||
detailList.forEach(lawsAsmsDomestic -> {
|
|
||||||
String[] parts = lawsAsmsDomestic.getCode().split("[-\\s]"); // 使用空格或破折号作为分隔符
|
|
||||||
if (parts.length < 3) {
|
|
||||||
parts = lawsAsmsDomestic.getCode().split("[—\\s]"); // 使用空格或破折号作为分隔符
|
|
||||||
if (parts.length < 3) {
|
|
||||||
parts = lawsAsmsDomestic.getCode().split("[一\\s]"); // 使用一或破折号作为分隔符
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 封装实例
|
|
||||||
LawsDomesticStandard lawsDomesticStandard = new LawsDomesticStandard();
|
|
||||||
// 对接标识
|
|
||||||
lawsDomesticStandard.setIsAsmsImport("1");
|
|
||||||
// 标准编号
|
|
||||||
lawsDomesticStandard.setStandardNumber(lawsAsmsDomestic.getCode());
|
|
||||||
// 标准类别
|
|
||||||
lawsDomesticStandard.setStandardClass(parts[0]);
|
|
||||||
// 标准号
|
|
||||||
lawsDomesticStandard.setStandardNumberTemp(parts[1]);
|
|
||||||
// 年代号
|
|
||||||
lawsDomesticStandard.setYearNumber(parts[2]);
|
|
||||||
// 标准名称
|
|
||||||
lawsDomesticStandard.setStandardName(lawsAsmsDomestic.getName());
|
|
||||||
// 标准英文名称
|
|
||||||
lawsDomesticStandard.setStandardEnglishName(lawsAsmsDomestic.getEnglishName());
|
|
||||||
// 适用认证
|
|
||||||
String itemValues = getItemValues(lawsAsmsDomestic.getApplicableCertificationListString(),
|
|
||||||
"1696008107352854529", sysDictItemList);
|
|
||||||
lawsDomesticStandard.setApplicableCertification(itemValues);
|
|
||||||
// 适用车型
|
|
||||||
itemValues = getItemValues(lawsAsmsDomestic.getApplicableModelsListString(),
|
|
||||||
"1702518672924110850", sysDictItemList);
|
|
||||||
lawsDomesticStandard.setApplicableVehicle(itemValues);
|
|
||||||
// 采标程度
|
|
||||||
itemValues = getItemValues(lawsAsmsDomestic.getDegreeAdoption(),
|
|
||||||
"1696042735686049793", sysDictItemList);
|
|
||||||
lawsDomesticStandard.setDegreeOfBidAcquisition(itemValues);
|
|
||||||
// 实施日期
|
|
||||||
lawsDomesticStandard.setImplementationDate(getSimpleDate(lawsAsmsDomestic.getImplementationDate()));
|
|
||||||
// 采用国际标准号
|
|
||||||
lawsDomesticStandard.setAdoptTheInternationalStandardNumber(lawsAsmsDomestic.getInternationalStandard());
|
|
||||||
// 新车实施日期
|
|
||||||
lawsDomesticStandard.setNewModelImplementationDate(getManyDateString(lawsAsmsDomestic.getNewCarImplementationDate()));
|
|
||||||
// 动力类型
|
|
||||||
itemValues = getItemValues(lawsAsmsDomestic.getPowerTypeListString(),
|
|
||||||
"1702518671166697474", sysDictItemList);
|
|
||||||
lawsDomesticStandard.setDynamicType(itemValues);
|
|
||||||
// 在产车实施日期
|
|
||||||
lawsDomesticStandard.setOnTheProductionDate(getManyDateString(lawsAsmsDomestic.getProductionCarImplementationDate()));
|
|
||||||
// 发布日期
|
|
||||||
lawsDomesticStandard.setReleaseDate(getSimpleDate(lawsAsmsDomestic.getPublishDate()));
|
|
||||||
// 代替标准号
|
|
||||||
lawsReplacedStandardService.addRelation(lawsAsmsDomestic.getReplaceCode(), lawsAsmsDomestic.getCode(), 1);
|
|
||||||
// 标准性质
|
|
||||||
/*itemValues = getItemValues(lawsAsmsDomestic.getStandardNature(),
|
|
||||||
"1695010513489833985", sysDictItemList);*/
|
|
||||||
lawsDomesticStandard.setStandardProperty("SN002");
|
|
||||||
// 标准性质判断
|
|
||||||
if (Objects.equals("强制性", lawsAsmsDomestic.getStandardNature())){
|
|
||||||
lawsDomesticStandard.setStandardProperty(lawsAsmsOpenApiService.judgeStandardProperty(lawsDomesticStandard.getStandardNumber()));
|
|
||||||
}
|
|
||||||
// 标准状态
|
|
||||||
itemValues = getItemValues(lawsAsmsDomestic.getStandardStatus(),
|
|
||||||
"1695991936599715842", sysDictItemList);
|
|
||||||
lawsDomesticStandard.setStandardState(itemValues);
|
|
||||||
// 分标委
|
|
||||||
String subcommittee = lawsAsmsDomestic.getSubcommittee();
|
|
||||||
if (StringUtils.isNotBlank(subcommittee)) {
|
|
||||||
lawsDomesticStandard.setBiddingCommittee(lawsStandardizationList.stream()
|
|
||||||
.filter(e -> subcommittee.equals(e.getName())).collect(Collectors.toList()).get(0).getId());
|
|
||||||
}
|
|
||||||
// 创建时间
|
|
||||||
lawsDomesticStandard.setCreateTime(getSimpleDate2(lawsAsmsDomestic.getCreateTimeString()));
|
|
||||||
// 更新时间
|
|
||||||
lawsDomesticStandard.setUpdateTime(getSimpleDate2(lawsAsmsDomestic.getUpdateTimeString()));
|
|
||||||
|
|
||||||
// 生成id
|
|
||||||
lawsDomesticStandard.setId(UUIDUtils.randomUUID20());
|
|
||||||
|
|
||||||
insertDomesticList.add(lawsDomesticStandard);
|
|
||||||
});
|
|
||||||
// 插入国内法规标准数据库
|
|
||||||
lawsDomesticStandardService.saveBatch(insertDomesticList, insertDomesticList.size());
|
|
||||||
// 同步es数据库
|
|
||||||
insertDomesticList.forEach(e ->
|
|
||||||
lawsHomeSearchService.updateEsData(LawsHomeSearchCommon.LAWS_DOMESTIC_STANDARD, e.getId(), LawsHomeSearchCommon.LAWS_ES_ADD));
|
|
||||||
long time1 = System.currentTimeMillis();
|
|
||||||
log.info("=====================同步国内法规标准数据:{}条,耗时:{}毫秒=====================", insertDomesticList.size(), time1 - start);
|
|
||||||
|
|
||||||
// 同步国内法规相关文档
|
|
||||||
String fileUrl = "xiaobodata/openApi/domesticLaws/getFile";
|
|
||||||
insertDomesticList.forEach(lawsDomesticStandard -> {
|
|
||||||
String id = lawsDomesticStandard.getId();
|
|
||||||
String code = lawsDomesticStandard.getStandardNumber();
|
|
||||||
Map<String, String> fileParamMap = new HashMap<>();
|
|
||||||
fileParamMap.put("lawCode", code);
|
|
||||||
Map<String, Object> objectMap = asmsPostUtil.sendGetReq2(fileUrl, fileParamMap);
|
|
||||||
if (!Objects.isNull(objectMap)) {
|
|
||||||
Map<String, String> standardTextPdf = (Map<String, String>) objectMap.get("standardTextPdf");
|
|
||||||
if (!Objects.isNull(standardTextPdf)){
|
|
||||||
String fileName = standardTextPdf.get("fileName");
|
|
||||||
String fileType = standardTextPdf.get("fileType");
|
|
||||||
String urls = standardTextPdf.get("url");
|
|
||||||
if (StringUtils.isNotBlank(urls)) {
|
|
||||||
upload(urls, fileName, fileType, id, code);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, String> standardTextWord = (Map<String, String>) objectMap.get("standardTextWord");
|
|
||||||
if (!Objects.isNull(standardTextWord)){
|
|
||||||
String fileName = standardTextWord.get("fileName");
|
|
||||||
String fileType = standardTextWord.get("fileType");
|
|
||||||
String urls = standardTextWord.get("url");
|
|
||||||
if (StringUtils.isNotBlank(urls)) {
|
|
||||||
upload(urls, fileName, fileType, id, code);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
long time2 = System.currentTimeMillis();
|
|
||||||
log.info("=====================同步国内法规文件耗时:{}毫秒=====================", time2 - time1);
|
|
||||||
|
|
||||||
long end = System.currentTimeMillis();
|
|
||||||
log.info("=====================全部同步完成,耗时:{} 毫秒=====================", end - start);
|
|
||||||
log.info("=====================定时任务同步结束=====================");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/11/3 13:49
|
|
||||||
* @Description: 同步文档拆分
|
|
||||||
**/
|
|
||||||
@Transactional
|
|
||||||
public void syncSplit() {
|
|
||||||
log.info("=====================定时同步文档拆分=====================");
|
|
||||||
long start = System.currentTimeMillis();
|
|
||||||
|
|
||||||
// 文档拆分
|
|
||||||
String url = "xiaobodata/openApi/article/search";
|
|
||||||
Map<String, String> paramMap = new HashMap<>();
|
|
||||||
paramMap.put("pageNo", "1");
|
|
||||||
paramMap.put("pageSize", "2");
|
|
||||||
Map<String, Object> totalMap = asmsPostUtil.sendGetReq2(url, paramMap);
|
|
||||||
Integer total = (Integer) totalMap.get("total");
|
|
||||||
paramMap.put("pageSize", total.toString());
|
|
||||||
|
|
||||||
List<Map<String, String>> mapList = asmsPostUtil.sendGetReq(url, paramMap);
|
|
||||||
if (Objects.isNull(mapList)) {
|
|
||||||
log.info("=====================没有获取到ASMS系统数据,同步结束=====================");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<SarFileSplitInfoEO> allSplitList = sarFileSplitInfoService.list(
|
|
||||||
new LambdaQueryWrapper<SarFileSplitInfoEO>().isNull(SarFileSplitInfoEO::getPublishBeforeId));
|
|
||||||
List<String> codeList = allSplitList.stream().map(SarFileSplitInfoEO::getSerialNumber).collect(Collectors.toList());
|
|
||||||
|
|
||||||
List<SarFileSplitInfoEO> insertSplitList = new ArrayList<>();
|
|
||||||
mapList.forEach(eMap -> {
|
|
||||||
String code = eMap.get("code");
|
|
||||||
if (CollectionUtils.isEmpty(codeList) || !codeList.contains(code)) {
|
|
||||||
LambdaQueryWrapper<LawsDomesticStandard> queryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
queryWrapper.eq(LawsDomesticStandard::getStandardNumber, code);
|
|
||||||
LawsDomesticStandard lawsDomesticStandard = lawsDomesticStandardService.getOne(queryWrapper, false);
|
|
||||||
if(Objects.isNull(lawsDomesticStandard)){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
LambdaQueryWrapper<OSSFile> queryWrapper1 = new LambdaQueryWrapper<>();
|
|
||||||
queryWrapper1.eq(OSSFile::getStandardId, lawsDomesticStandard.getId());
|
|
||||||
queryWrapper1.eq(OSSFile::getStandardFileType, "publish_of_original");
|
|
||||||
queryWrapper1.like(OSSFile::getFileName, ".docx");
|
|
||||||
OSSFile ossFile = ossFileService.getOne(queryWrapper1, false);
|
|
||||||
|
|
||||||
SarFileSplitInfoEO sarFileSplitInfoEO = new SarFileSplitInfoEO();
|
|
||||||
sarFileSplitInfoEO.setStandardId(lawsDomesticStandard.getId());
|
|
||||||
sarFileSplitInfoEO.setSerialNumber(lawsDomesticStandard.getStandardNumber());
|
|
||||||
sarFileSplitInfoEO.setTitle(lawsDomesticStandard.getStandardName());
|
|
||||||
sarFileSplitInfoEO.setFileType("publish_of_original");
|
|
||||||
sarFileSplitInfoEO.setFileId(ossFile.getId());
|
|
||||||
sarFileSplitInfoEO.setFileName(ossFile.getFileName());
|
|
||||||
sarFileSplitInfoEO.setSplitStatus("1");
|
|
||||||
sarFileSplitInfoEO.setCreateTime(getSimpleDate2(eMap.get("createTime")));
|
|
||||||
sarFileSplitInfoEO.setUpdateTime(getSimpleDate2(eMap.get("updateTime")));
|
|
||||||
sarFileSplitInfoEO.setIsAsmsImport("1");
|
|
||||||
sarFileSplitInfoEO.setAuthor("云平台");
|
|
||||||
sarFileSplitInfoEO.setSplitResult("成功");
|
|
||||||
|
|
||||||
sarFileSplitInfoEO.setId(UUIDUtils.randomUUID20());
|
|
||||||
|
|
||||||
insertSplitList.add(sarFileSplitInfoEO);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (CollectionUtils.isEmpty(insertSplitList)) {
|
|
||||||
log.info("=====================昨天新增拆分0条,同步结束=====================");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
sarFileSplitInfoService.saveBatch(insertSplitList, insertSplitList.size());
|
|
||||||
long time1 = System.currentTimeMillis();
|
|
||||||
log.info("=====================同步标准拆分数据:{}条,耗时:{}毫秒=====================", insertSplitList.size(), time1 - start);
|
|
||||||
|
|
||||||
// 单条拆分的详情
|
|
||||||
String splitUrl = "xiaobodata/openApi/article/details";
|
|
||||||
List<SysDictItem> sysDictItemList = sysDictItemService.list();
|
|
||||||
Map<String, String> paramMap1 = new HashMap<>();
|
|
||||||
Map<String, String> paramMap2 = new HashMap<>();
|
|
||||||
Map<String, String> paramMap3 = new HashMap<>();
|
|
||||||
Map<String, List<LawsDocumentSplit>> infoMap = new HashMap<>();
|
|
||||||
int[] n = {0};
|
|
||||||
insertSplitList.forEach(sarFileSplitInfoEO -> {
|
|
||||||
paramMap.put("standardCode", sarFileSplitInfoEO.getSerialNumber());
|
|
||||||
paramMap1.put("standardCode", sarFileSplitInfoEO.getSerialNumber());
|
|
||||||
List<Map<String, String>> mapListAll = asmsPostUtil.sendGetReq(splitUrl, paramMap1);
|
|
||||||
List<LawsDocumentSplit> insertDocumentList = new ArrayList<>();
|
|
||||||
mapListAll.forEach(eMap -> {
|
|
||||||
// 单个法规的条文解读详情
|
|
||||||
paramMap2.put("standardCode", sarFileSplitInfoEO.getSerialNumber());
|
|
||||||
paramMap2.put("termsCode", eMap.get("termsNum"));
|
|
||||||
Map<String, Object> objectMap = asmsPostUtil.sendGetReq2("xiaobodata/openApi/article/interpretation/details", paramMap2);
|
|
||||||
|
|
||||||
// 单个法规的条文标签详情
|
|
||||||
paramMap3.put("standardCode", sarFileSplitInfoEO.getSerialNumber());
|
|
||||||
paramMap3.put("termsCode", eMap.get("termsNum"));
|
|
||||||
Map<String, Object> objectMap2 = asmsPostUtil.sendGetReq2("xiaobodata/openApi/article/label/details", paramMap3);
|
|
||||||
|
|
||||||
LawsDocumentSplit lawsDocumentSplit = new LawsDocumentSplit();
|
|
||||||
lawsDocumentSplit.setId(String.valueOf(SnowflakeUtils.snowflake()));
|
|
||||||
lawsDocumentSplit.setInfoId(sarFileSplitInfoEO.getId());
|
|
||||||
lawsDocumentSplit.setItemNum(eMap.get("termsNum"));
|
|
||||||
lawsDocumentSplit.setItemTitle(eMap.get("termsName"));
|
|
||||||
// 条文内容
|
|
||||||
String articleContent = eMap.get("articleContent");
|
|
||||||
try {
|
|
||||||
// 处理图片
|
|
||||||
articleContent = lawsAsmsOpenApiService.disposeImg(articleContent);
|
|
||||||
}catch (Exception e){
|
|
||||||
log.error(e.getMessage());
|
|
||||||
log.error("图片处理失败!");
|
|
||||||
}
|
|
||||||
// 处理条文详情
|
|
||||||
lawsAsmsOpenApiService.disposeItemVal(lawsDocumentSplit, articleContent);
|
|
||||||
// 重复性校验
|
|
||||||
// if (duplicateCheck(lawsDocumentSplit, articleContent)) {return;}
|
|
||||||
|
|
||||||
lawsDocumentSplit.setItemContent(articleContent);
|
|
||||||
lawsDocumentSplit.setCreateTime(getSimpleDate2(eMap.get("createTime")));
|
|
||||||
lawsDocumentSplit.setUpdateTime(getSimpleDate2(eMap.get("updateTime")));
|
|
||||||
|
|
||||||
lawsDocumentSplit.setInterpretationArticles((String) objectMap.get("termsInterpretation"));
|
|
||||||
|
|
||||||
lawsDocumentSplit.setFunctionClassification((String) objectMap2.get("functionClassification"));
|
|
||||||
lawsDocumentSplit.setFunctionProfessional((String) objectMap2.get("functionProfession"));
|
|
||||||
lawsDocumentSplit.setFunctionGroupCode((String) objectMap2.get("groupingNum"));
|
|
||||||
lawsDocumentSplit.setFunctionGroupName((String) objectMap2.get("groupingNum"));
|
|
||||||
lawsDocumentSplit.setCerImplementDate((String) objectMap2.get("implementDateCertified"));
|
|
||||||
lawsDocumentSplit.setNewCerImplementDate((String) objectMap2.get("implementDateNewCer"));
|
|
||||||
lawsDocumentSplit.setNewRegisterImplementDate((String) objectMap2.get("implementDateNewRegister"));
|
|
||||||
lawsDocumentSplit.setLawsRequireType((String) objectMap2.get("lawsRequireType"));
|
|
||||||
lawsDocumentSplit.setApplications((String) objectMap2.get("modelsType"));
|
|
||||||
lawsDocumentSplit.setDynamicType((String) objectMap2.get("powerType"));
|
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(lawsDocumentSplit.getLawsRequireType())){
|
|
||||||
lawsDocumentSplit.setLawsRequireType(getItemValues(lawsDocumentSplit.getLawsRequireType().replace(",", ";"),
|
|
||||||
"1702212236079886338", sysDictItemList)); // 法规要求类型
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotBlank(lawsDocumentSplit.getFunctionClassification())){
|
|
||||||
lawsDocumentSplit.setFunctionClassification(getItemValues(lawsDocumentSplit.getFunctionClassification().replace(",", ";"),
|
|
||||||
"1702212237296234497", sysDictItemList)); // 功能分类
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotBlank(lawsDocumentSplit.getFunctionProfessional())){
|
|
||||||
lawsDocumentSplit.setFunctionProfessional(getItemValues(lawsDocumentSplit.getFunctionProfessional().replace(",", ";"),
|
|
||||||
"1702202280677044226", sysDictItemList)); // 功能专业
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotBlank(lawsDocumentSplit.getApplications())){
|
|
||||||
lawsDocumentSplit.setApplications(getItemValues(lawsDocumentSplit.getApplications().replace(",", ";"),
|
|
||||||
"1702518672924110850", sysDictItemList)); // 适用车型
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotBlank(lawsDocumentSplit.getDynamicType())){
|
|
||||||
lawsDocumentSplit.setDynamicType(getItemValues(lawsDocumentSplit.getDynamicType().replace(",", ";"),
|
|
||||||
"1702518671166697474", sysDictItemList)); // 动力类型
|
|
||||||
}
|
|
||||||
|
|
||||||
insertDocumentList.add(lawsDocumentSplit);
|
|
||||||
lawsDocumentSplitMapper.insert(lawsDocumentSplit);
|
|
||||||
n[0]++;
|
|
||||||
});
|
|
||||||
infoMap.put(sarFileSplitInfoEO.getId(), insertDocumentList);
|
|
||||||
});
|
|
||||||
long time2 = System.currentTimeMillis();
|
|
||||||
log.info("=====================同步DocumentSplit条文数据:{}条,耗时:{}毫秒=====================", n[0], time2 - time1);
|
|
||||||
String regex = "[^a-zA-Z0-9.]";
|
|
||||||
insertSplitList.forEach(sarFileSplitInfoEO -> {
|
|
||||||
String infoId = sarFileSplitInfoEO.getId();
|
|
||||||
List<LawsDocumentSplit> lawsDocumentSplitList = infoMap.get(infoId);
|
|
||||||
List<String> itemNumList = new ArrayList<>();
|
|
||||||
for (LawsDocumentSplit lawsDocumentSplit : lawsDocumentSplitList) {
|
|
||||||
String itemNum = lawsDocumentSplit.getItemNum();
|
|
||||||
itemNumList.add(itemNum.replaceAll(regex, ""));
|
|
||||||
}
|
|
||||||
// 对目录排序
|
|
||||||
Collections.sort(itemNumList, new AlphanumericComparator());
|
|
||||||
Map<String, Long> sortMap = new HashMap<>();
|
|
||||||
for (int i = 0; i < itemNumList.size(); i++) {
|
|
||||||
sortMap.put(itemNumList.get(i), i + 2L);
|
|
||||||
}
|
|
||||||
List<SarFileSplitMenuEO> sarFileSplitMenuEOList = new java.util.ArrayList<>();
|
|
||||||
// 根目录
|
|
||||||
SarFileSplitMenuEO rootEO = new SarFileSplitMenuEO();
|
|
||||||
String rootId = UUIDUtils.randomUUID20();
|
|
||||||
rootEO.setId(rootId);
|
|
||||||
rootEO.setInfoId(infoId);
|
|
||||||
rootEO.setName("总目录");
|
|
||||||
rootEO.setDisplaySeq(1L);
|
|
||||||
rootEO.setValidFlag(0);
|
|
||||||
sarFileSplitMenuEOMapper.insertSelective(rootEO);
|
|
||||||
|
|
||||||
Map<String, String> idMap = new HashMap<>();
|
|
||||||
lawsDocumentSplitList.forEach(lawsDocumentSplit -> {
|
|
||||||
SarFileSplitMenuEO sarFileSplitMenuEO = new SarFileSplitMenuEO();
|
|
||||||
String itemNum = lawsDocumentSplit.getItemNum();
|
|
||||||
String id = UUIDUtils.randomUUID20();
|
|
||||||
sarFileSplitMenuEO.setId(id);
|
|
||||||
sarFileSplitMenuEO.setInfoId(infoId);
|
|
||||||
sarFileSplitMenuEO.setName(itemNum);
|
|
||||||
sarFileSplitMenuEO.setDisplaySeq(sortMap.get(itemNum.replaceAll(regex, "")));
|
|
||||||
sarFileSplitMenuEO.setValidFlag(0);
|
|
||||||
String itemTitle = lawsDocumentSplit.getItemTitle();
|
|
||||||
sarFileSplitMenuEO.setItemName(itemTitle.substring(0, Math.min(10, itemTitle.length())));
|
|
||||||
sarFileSplitMenuEOList.add(sarFileSplitMenuEO);
|
|
||||||
idMap.put(itemNum.replaceAll(regex, ""), id);
|
|
||||||
|
|
||||||
lawsDocumentSplit.setMenuId(id);
|
|
||||||
lawsDocumentSplitMapper.updateById(lawsDocumentSplit);
|
|
||||||
});
|
|
||||||
|
|
||||||
// 设置父id
|
|
||||||
sarFileSplitMenuEOList.forEach(sarFileSplitMenuEO -> {
|
|
||||||
String itemNum = sarFileSplitMenuEO.getName().replaceAll(regex, "");
|
|
||||||
String[] split = itemNum.split("\\.");
|
|
||||||
if (split.length == 1) {
|
|
||||||
sarFileSplitMenuEO.setPId(rootId);
|
|
||||||
} else {
|
|
||||||
// 去除数组中的最后一个元素
|
|
||||||
split = Arrays.copyOf(split, split.length - 1);
|
|
||||||
String pid = idMap.get(StringUtils.join(split, "."));
|
|
||||||
if (StringUtils.isBlank(pid)) {
|
|
||||||
pid = rootId;
|
|
||||||
}
|
|
||||||
sarFileSplitMenuEO.setPId(pid);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (!sarFileSplitMenuEOList.isEmpty()) {
|
|
||||||
sarFileSplitMenuEOMapper.insertForeach(sarFileSplitMenuEOList);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
long time3 = System.currentTimeMillis();
|
|
||||||
log.info("=====================生成拆分详情左侧目录耗时:{}毫秒=====================", time3 - time2);
|
|
||||||
|
|
||||||
for (SarFileSplitInfoEO sarFileSplitInfoEO : insertSplitList) {
|
|
||||||
HashMap<String, Object> parameter = new HashMap<>();
|
|
||||||
parameter.put("id", sarFileSplitInfoEO.getId());
|
|
||||||
documentSplitService.publishTwo(parameter);
|
|
||||||
}
|
|
||||||
long end = System.currentTimeMillis();
|
|
||||||
log.info("=====================全部同步完成,耗时:{} 毫秒=====================", end - start);
|
|
||||||
log.info("=====================定时任务同步结束=====================");
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean duplicateCheck(LawsDocumentSplit lawsDocumentSplit, String articleContent) {
|
|
||||||
LawsDocumentSplit lawsDocumentSplits = lawsDocumentSplitMapper.selectOne(
|
|
||||||
new LambdaQueryWrapper<LawsDocumentSplit>()
|
|
||||||
.eq(LawsDocumentSplit::getInfoId, lawsDocumentSplit.getInfoId())
|
|
||||||
.eq(LawsDocumentSplit::getItemNum, lawsDocumentSplit.getItemNum())
|
|
||||||
.eq(LawsDocumentSplit::getItemTitle, lawsDocumentSplit.getItemTitle()));
|
|
||||||
if (!Objects.isNull(lawsDocumentSplits)){
|
|
||||||
// 合并
|
|
||||||
String itemContent = StringUtils.isNotBlank(lawsDocumentSplits.getItemContent()) ? lawsDocumentSplits.getItemContent() : "";
|
|
||||||
lawsDocumentSplitMapper.update(null,
|
|
||||||
new LambdaUpdateWrapper<LawsDocumentSplit>()
|
|
||||||
.set(LawsDocumentSplit::getItemContent, itemContent + articleContent)
|
|
||||||
.eq(LawsDocumentSplit::getId, lawsDocumentSplits.getId()));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void syncSplitByStandardNumber(String standardNumber) {
|
|
||||||
log.info("=====================定时同步文档拆分=====================");
|
|
||||||
long start = System.currentTimeMillis();
|
|
||||||
|
|
||||||
// 文档拆分
|
|
||||||
String url = "xiaobodata/openApi/article/search";
|
|
||||||
Map<String, String> paramMap = new HashMap<>();
|
|
||||||
paramMap.put("pageNo", "1");
|
|
||||||
paramMap.put("pageSize", "2");
|
|
||||||
Map<String, Object> totalMap = asmsPostUtil.sendGetReq2(url, paramMap);
|
|
||||||
Integer total = (Integer) totalMap.get("total");
|
|
||||||
paramMap.put("pageSize", total.toString());
|
|
||||||
|
|
||||||
List<Map<String, String>> mapList = asmsPostUtil.sendGetReq(url, paramMap);
|
|
||||||
if (Objects.isNull(mapList)) {
|
|
||||||
log.info("=====================没有获取到ASMS系统数据,同步结束=====================");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<SarFileSplitInfoEO> insertSplitList = new ArrayList<>();
|
|
||||||
mapList.forEach(eMap -> {
|
|
||||||
String code = eMap.get("code").trim();
|
|
||||||
String name = eMap.get("name");
|
|
||||||
if (!code.contains(standardNumber)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
LambdaQueryWrapper<LawsDomesticStandard> queryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
queryWrapper.eq(LawsDomesticStandard::getStandardNumber, code);
|
|
||||||
LawsDomesticStandard lawsDomesticStandard = lawsDomesticStandardService.getOne(queryWrapper);
|
|
||||||
if (Objects.isNull(lawsDomesticStandard)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
LambdaQueryWrapper<OSSFile> queryWrapper1 = new LambdaQueryWrapper<>();
|
|
||||||
queryWrapper1.eq(OSSFile::getStandardId, lawsDomesticStandard.getId());
|
|
||||||
queryWrapper1.eq(OSSFile::getStandardFileType, "publish_of_original");
|
|
||||||
queryWrapper1.like(OSSFile::getFileName, ".docx");
|
|
||||||
OSSFile ossFile = ossFileService.getOne(queryWrapper1);
|
|
||||||
|
|
||||||
SarFileSplitInfoEO sarFileSplitInfoEO = new SarFileSplitInfoEO();
|
|
||||||
sarFileSplitInfoEO.setStandardId(lawsDomesticStandard.getId());
|
|
||||||
sarFileSplitInfoEO.setSerialNumber(lawsDomesticStandard.getStandardNumber());
|
|
||||||
sarFileSplitInfoEO.setTitle(lawsDomesticStandard.getStandardName());
|
|
||||||
sarFileSplitInfoEO.setFileType("publish_of_original");
|
|
||||||
sarFileSplitInfoEO.setFileId(ossFile.getId());
|
|
||||||
sarFileSplitInfoEO.setFileName(ossFile.getFileName());
|
|
||||||
sarFileSplitInfoEO.setSplitStatus("1");
|
|
||||||
sarFileSplitInfoEO.setCreateTime(getSimpleDate2(eMap.get("createTime")));
|
|
||||||
sarFileSplitInfoEO.setUpdateTime(getSimpleDate2(eMap.get("updateTime")));
|
|
||||||
sarFileSplitInfoEO.setIsAsmsImport("1");
|
|
||||||
sarFileSplitInfoEO.setAuthor("云平台");
|
|
||||||
sarFileSplitInfoEO.setSplitResult("成功");
|
|
||||||
|
|
||||||
sarFileSplitInfoEO.setId(UUIDUtils.randomUUID20());
|
|
||||||
|
|
||||||
insertSplitList.add(sarFileSplitInfoEO);
|
|
||||||
});
|
|
||||||
if (CollectionUtils.isEmpty(insertSplitList)) {
|
|
||||||
log.info("=====================昨天新增拆分0条,同步结束=====================");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
sarFileSplitInfoService.saveBatch(insertSplitList, insertSplitList.size());
|
|
||||||
long time1 = System.currentTimeMillis();
|
|
||||||
log.info("=====================同步标准拆分数据:{}条,耗时:{}毫秒=====================", insertSplitList.size(), time1 - start);
|
|
||||||
|
|
||||||
// 单条拆分的详情
|
|
||||||
String splitUrl = "xiaobodata/openApi/article/details";
|
|
||||||
List<SysDictItem> sysDictItemList = sysDictItemService.list();
|
|
||||||
Map<String, String> paramMap1 = new HashMap<>();
|
|
||||||
Map<String, String> paramMap2 = new HashMap<>();
|
|
||||||
Map<String, String> paramMap3 = new HashMap<>();
|
|
||||||
Map<String, List<LawsDocumentSplit>> infoMap = new HashMap<>();
|
|
||||||
int[] n = {0};
|
|
||||||
|
|
||||||
for (SarFileSplitInfoEO sarFileSplitInfoEO : insertSplitList) {
|
|
||||||
paramMap.put("standardCode", sarFileSplitInfoEO.getSerialNumber());
|
|
||||||
paramMap1.put("standardCode", sarFileSplitInfoEO.getSerialNumber());
|
|
||||||
List<Map<String, String>> mapListAll = asmsPostUtil.sendGetReq(splitUrl, paramMap1);
|
|
||||||
List<LawsDocumentSplit> insertDocumentList = new ArrayList<>();
|
|
||||||
for (Map<String, String> eMap : mapListAll) {
|
|
||||||
// 单个法规的条文解读详情
|
|
||||||
paramMap2.put("standardCode", sarFileSplitInfoEO.getSerialNumber());
|
|
||||||
|
|
||||||
paramMap2.put("termsCode", eMap.get("termsNum"));
|
|
||||||
Map<String, Object> objectMap = asmsPostUtil.sendGetReq2("xiaobodata/openApi/article/interpretation/details", paramMap2);
|
|
||||||
|
|
||||||
// 单个法规的条文标签详情
|
|
||||||
paramMap3.put("standardCode", sarFileSplitInfoEO.getSerialNumber());
|
|
||||||
paramMap3.put("termsCode", eMap.get("termsNum"));
|
|
||||||
Map<String, Object> objectMap2 = asmsPostUtil.sendGetReq2("xiaobodata/openApi/article/label/details", paramMap3);
|
|
||||||
|
|
||||||
LawsDocumentSplit lawsDocumentSplit = new LawsDocumentSplit();
|
|
||||||
lawsDocumentSplit.setInfoId(sarFileSplitInfoEO.getId());
|
|
||||||
lawsDocumentSplit.setItemNum(eMap.get("termsNum"));
|
|
||||||
lawsDocumentSplit.setItemTitle(eMap.get("termsName"));
|
|
||||||
String articleContent = eMap.get("articleContent");
|
|
||||||
String disposeImg = articleContent;
|
|
||||||
try {
|
|
||||||
// 处理图片
|
|
||||||
disposeImg = lawsAsmsOpenApiService.disposeImg(articleContent);
|
|
||||||
}catch (Exception e){
|
|
||||||
log.error(e.getMessage());
|
|
||||||
log.error("图片处理失败!");
|
|
||||||
}
|
|
||||||
lawsDocumentSplit.setItemContent(disposeImg);
|
|
||||||
lawsDocumentSplit.setCreateTime(getSimpleDate2(eMap.get("createTime")));
|
|
||||||
lawsDocumentSplit.setUpdateTime(getSimpleDate2(eMap.get("updateTime")));
|
|
||||||
|
|
||||||
lawsDocumentSplit.setInterpretationArticles((String) objectMap.get("termsInterpretation"));
|
|
||||||
|
|
||||||
lawsDocumentSplit.setFunctionClassification((String) objectMap2.get("functionClassification"));
|
|
||||||
lawsDocumentSplit.setFunctionProfessional((String) objectMap2.get("functionProfession"));
|
|
||||||
lawsDocumentSplit.setFunctionGroupCode((String) objectMap2.get("groupingNum"));
|
|
||||||
lawsDocumentSplit.setFunctionGroupName((String) objectMap2.get("groupingNum"));
|
|
||||||
lawsDocumentSplit.setCerImplementDate((String) objectMap2.get("implementDateCertified"));
|
|
||||||
lawsDocumentSplit.setNewCerImplementDate((String) objectMap2.get("implementDateNewCer"));
|
|
||||||
lawsDocumentSplit.setNewRegisterImplementDate((String) objectMap2.get("implementDateNewRegister"));
|
|
||||||
lawsDocumentSplit.setLawsRequireType((String) objectMap2.get("lawsRequireType"));
|
|
||||||
lawsDocumentSplit.setApplications((String) objectMap2.get("modelsType"));
|
|
||||||
lawsDocumentSplit.setDynamicType((String) objectMap2.get("powerType"));
|
|
||||||
|
|
||||||
lawsDocumentSplit.setId(UUIDUtils.randomUUID20());
|
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(lawsDocumentSplit.getLawsRequireType())) {
|
|
||||||
lawsDocumentSplit.setLawsRequireType(getItemValues(lawsDocumentSplit.getLawsRequireType().replace(",", ";"),
|
|
||||||
"1702212236079886338", sysDictItemList)); // 法规要求类型
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotBlank(lawsDocumentSplit.getFunctionClassification())) {
|
|
||||||
lawsDocumentSplit.setFunctionClassification(getItemValues(lawsDocumentSplit.getFunctionClassification().replace(",", ";"),
|
|
||||||
"1702212237296234497", sysDictItemList)); // 功能分类
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotBlank(lawsDocumentSplit.getFunctionProfessional())) {
|
|
||||||
lawsDocumentSplit.setFunctionProfessional(getItemValues(lawsDocumentSplit.getFunctionProfessional().replace(",", ";"),
|
|
||||||
"1702202280677044226", sysDictItemList)); // 功能专业
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotBlank(lawsDocumentSplit.getApplications())) {
|
|
||||||
lawsDocumentSplit.setApplications(getItemValues(lawsDocumentSplit.getApplications().replace(",", ";"),
|
|
||||||
"1702518672924110850", sysDictItemList)); // 适用车型
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotBlank(lawsDocumentSplit.getDynamicType())) {
|
|
||||||
lawsDocumentSplit.setDynamicType(getItemValues(lawsDocumentSplit.getDynamicType().replace(",", ";"),
|
|
||||||
"1702518671166697474", sysDictItemList)); // 动力类型
|
|
||||||
}
|
|
||||||
|
|
||||||
insertDocumentList.add(lawsDocumentSplit);
|
|
||||||
lawsDocumentSplitMapper.insert(lawsDocumentSplit);
|
|
||||||
n[0]++;
|
|
||||||
}
|
|
||||||
;
|
|
||||||
infoMap.put(sarFileSplitInfoEO.getId(), insertDocumentList);
|
|
||||||
}
|
|
||||||
;
|
|
||||||
long time2 = System.currentTimeMillis();
|
|
||||||
log.info("=====================同步DocumentSplit条文数据:{}条,耗时:{}毫秒=====================", n[0], time2 - time1);
|
|
||||||
String regex = "[^a-zA-Z0-9.]";
|
|
||||||
insertSplitList.forEach(sarFileSplitInfoEO -> {
|
|
||||||
String infoId = sarFileSplitInfoEO.getId();
|
|
||||||
List<LawsDocumentSplit> lawsDocumentSplitList = infoMap.get(infoId);
|
|
||||||
List<String> itemNumList = new ArrayList<>();
|
|
||||||
for (LawsDocumentSplit lawsDocumentSplit : lawsDocumentSplitList) {
|
|
||||||
String itemNum = lawsDocumentSplit.getItemNum();
|
|
||||||
itemNumList.add(itemNum.replaceAll(regex, ""));
|
|
||||||
}
|
|
||||||
// 对目录排序
|
|
||||||
Collections.sort(itemNumList, new AlphanumericComparator());
|
|
||||||
Map<String, Long> sortMap = new HashMap<>();
|
|
||||||
for (int i = 0; i < itemNumList.size(); i++) {
|
|
||||||
sortMap.put(itemNumList.get(i), i + 2L);
|
|
||||||
}
|
|
||||||
List<SarFileSplitMenuEO> sarFileSplitMenuEOList = new java.util.ArrayList<>();
|
|
||||||
// 根目录
|
|
||||||
SarFileSplitMenuEO rootEO = new SarFileSplitMenuEO();
|
|
||||||
String rootId = UUIDUtils.randomUUID20();
|
|
||||||
rootEO.setId(rootId);
|
|
||||||
rootEO.setInfoId(infoId);
|
|
||||||
rootEO.setName("总目录");
|
|
||||||
rootEO.setDisplaySeq(1L);
|
|
||||||
rootEO.setValidFlag(0);
|
|
||||||
sarFileSplitMenuEOMapper.insertSelective(rootEO);
|
|
||||||
|
|
||||||
Map<String, String> idMap = new HashMap<>();
|
|
||||||
lawsDocumentSplitList.forEach(lawsDocumentSplit -> {
|
|
||||||
SarFileSplitMenuEO sarFileSplitMenuEO = new SarFileSplitMenuEO();
|
|
||||||
String itemNum = lawsDocumentSplit.getItemNum();
|
|
||||||
String id = UUIDUtils.randomUUID20();
|
|
||||||
sarFileSplitMenuEO.setId(id);
|
|
||||||
sarFileSplitMenuEO.setInfoId(infoId);
|
|
||||||
sarFileSplitMenuEO.setName(itemNum);
|
|
||||||
sarFileSplitMenuEO.setDisplaySeq(sortMap.get(itemNum.replaceAll(regex, "")));
|
|
||||||
sarFileSplitMenuEO.setValidFlag(0);
|
|
||||||
String itemTitle = lawsDocumentSplit.getItemTitle();
|
|
||||||
sarFileSplitMenuEO.setItemName(itemTitle.substring(0, Math.min(10, itemTitle.length())));
|
|
||||||
sarFileSplitMenuEOList.add(sarFileSplitMenuEO);
|
|
||||||
idMap.put(itemNum.replaceAll(regex, ""), id);
|
|
||||||
|
|
||||||
lawsDocumentSplit.setMenuId(id);
|
|
||||||
lawsDocumentSplitMapper.updateById(lawsDocumentSplit);
|
|
||||||
});
|
|
||||||
|
|
||||||
// 设置父id
|
|
||||||
sarFileSplitMenuEOList.forEach(sarFileSplitMenuEO -> {
|
|
||||||
String itemNum = sarFileSplitMenuEO.getName().replaceAll(regex, "");
|
|
||||||
String[] split = itemNum.split("\\.");
|
|
||||||
if (split.length == 1) {
|
|
||||||
sarFileSplitMenuEO.setPId(rootId);
|
|
||||||
} else {
|
|
||||||
// 去除数组中的最后一个元素
|
|
||||||
split = Arrays.copyOf(split, split.length - 1);
|
|
||||||
String pid = idMap.get(StringUtils.join(split, "."));
|
|
||||||
if (StringUtils.isBlank(pid)) {
|
|
||||||
pid = rootId;
|
|
||||||
}
|
|
||||||
sarFileSplitMenuEO.setPId(pid);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
sarFileSplitMenuEOMapper.insertForeach(sarFileSplitMenuEOList);
|
|
||||||
});
|
|
||||||
long time3 = System.currentTimeMillis();
|
|
||||||
log.info("=====================生成拆分详情左侧目录耗时:{}毫秒=====================", time3 - time2);
|
|
||||||
|
|
||||||
insertSplitList.forEach(sarFileSplitInfoEO -> {
|
|
||||||
String infoId = sarFileSplitInfoEO.getId();
|
|
||||||
List<LawsDocumentSplit> lawsDocumentSplitList = infoMap.get(infoId);
|
|
||||||
lawsDocumentSplitList.forEach(lawsDocumentSplit -> {
|
|
||||||
String itemContent = lawsDocumentSplit.getItemContent();
|
|
||||||
// 使用 jsoup 解析 HTML
|
|
||||||
Document doc = Jsoup.parse(itemContent);
|
|
||||||
|
|
||||||
// 选择所有的 <p> 元素
|
|
||||||
Elements paragraphs = doc.select("p");
|
|
||||||
|
|
||||||
// 存储提取的文本内容
|
|
||||||
List<String> textContents = new java.util.ArrayList<>();
|
|
||||||
|
|
||||||
for (Element paragraph : paragraphs) {
|
|
||||||
// 获取每个 <p> 元素的文本内容并添加到集合中
|
|
||||||
String textContent = paragraph.text();
|
|
||||||
textContents.add(textContent);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < textContents.size(); i++) {
|
|
||||||
SarFileSplitItemsValEO sarFileSplitItemsValEO = new SarFileSplitItemsValEO();
|
|
||||||
sarFileSplitItemsValEO.setId(UUIDUtils.randomUUID20());
|
|
||||||
sarFileSplitItemsValEO.setType("TEXT");
|
|
||||||
sarFileSplitItemsValEO.setItemId(lawsDocumentSplit.getId());
|
|
||||||
sarFileSplitItemsValEO.setItemContent(textContents.get(i));
|
|
||||||
sarFileSplitItemsValEO.setDisplaySeq(i + 1);
|
|
||||||
sarFileSplitItemsValEO.setValidFlag(0);
|
|
||||||
sarFileSplitItemsValEOService.insertSelective(sarFileSplitItemsValEO);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
for (SarFileSplitInfoEO sarFileSplitInfoEO : insertSplitList) {
|
|
||||||
HashMap<String, Object> parameter = new HashMap<>();
|
|
||||||
parameter.put("id", sarFileSplitInfoEO.getId());
|
|
||||||
documentSplitService.publish(parameter);
|
|
||||||
}
|
|
||||||
long time4 = System.currentTimeMillis();
|
|
||||||
log.info("=====================生成条文详情耗时:{}毫秒=====================", time4 - time3);
|
|
||||||
|
|
||||||
long end = System.currentTimeMillis();
|
|
||||||
log.info("=====================全部同步完成,耗时:{} 毫秒=====================", end - start);
|
|
||||||
log.info("=====================定时任务同步结束=====================");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Transactional
|
|
||||||
public void upload(String url, String fileName, String fileType, String id, String code) {
|
|
||||||
InputStream inputStream = asmsPostUtil.getFileByteArray(url);
|
|
||||||
try {
|
|
||||||
MinioUtil.upload(inputStream, filePath + url);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
throw new JeroBootException("文件上传错误");
|
|
||||||
}
|
|
||||||
OSSFile ossFile = new OSSFile();
|
|
||||||
ossFile.setFileName(fileName + "." + fileType);
|
|
||||||
ossFile.setUrl(filePath + url);
|
|
||||||
ossFile.setStandardId(id);
|
|
||||||
ossFile.setStandardNo(code);
|
|
||||||
ossFile.setStandardFileType("publish_of_original");
|
|
||||||
ossFileService.save(ossFile);
|
|
||||||
}
|
|
||||||
|
|
||||||
private Date getSimpleDate(String dateStr) {
|
|
||||||
if (StringUtils.isBlank(dateStr)) return null;
|
|
||||||
try {
|
|
||||||
return simpleDateFormat.parse(dateStr);
|
|
||||||
} catch (ParseException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
throw new JeroBootException("时间格式转换错误");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private Date getSimpleDate2(String dateStr) {
|
|
||||||
if (StringUtils.isBlank(dateStr)) return null;
|
|
||||||
try {
|
|
||||||
return dateFormat.parse(dateStr);
|
|
||||||
} catch (ParseException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
throw new JeroBootException("时间格式转换错误");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/23 15:57
|
|
||||||
* @Description: 获取多日期字符串
|
|
||||||
**/
|
|
||||||
private String getManyDateString(String oldManyDateString) {
|
|
||||||
if (StringUtils.isBlank(oldManyDateString)) return "";
|
|
||||||
List<String> oldValueList = Arrays.asList(oldManyDateString.split("、"));
|
|
||||||
// 使用正则表达式提取日期部分
|
|
||||||
Pattern pattern = Pattern.compile("\\d{4}年\\d{2}月\\d{2}日");
|
|
||||||
|
|
||||||
List<String> valueList = new java.util.ArrayList<>();
|
|
||||||
oldValueList.forEach(value -> {
|
|
||||||
Matcher matcher = pattern.matcher(value);
|
|
||||||
String dateStr;
|
|
||||||
if (matcher.find()) {
|
|
||||||
dateStr = matcher.group(0);
|
|
||||||
} else {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
Date parse = oldDateFormat.parse(dateStr);
|
|
||||||
String format = simpleDateFormat.format(parse);
|
|
||||||
valueList.add(format);
|
|
||||||
} catch (ParseException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
throw new JeroBootException("时间格式转换错误");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (valueList.size() == 1) {
|
|
||||||
// 如果只有一个日期值,则复制成两个,用于查询和排序
|
|
||||||
return valueList.get(0) + "," + valueList.get(0);
|
|
||||||
}
|
|
||||||
List<LocalDate> dateList = valueList.stream()
|
|
||||||
.map(LocalDate::parse) // 解析日期字符串为 LocalDate 对象
|
|
||||||
.sorted() // 按照日期大小进行排序
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
|
|
||||||
// 将排序后的 LocalDate 对象转换为字符串
|
|
||||||
List<String> sortedDateStrList = dateList.stream()
|
|
||||||
.map(LocalDate::toString)
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
|
|
||||||
return String.join(",", sortedDateStrList);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/23 15:09
|
|
||||||
* @Description: 获取字典值
|
|
||||||
**/
|
|
||||||
private String getItemValues(String itemTexts, String dictId, List<SysDictItem> sysDictItemList) {
|
|
||||||
if (StringUtils.isBlank(itemTexts)) return "";
|
|
||||||
List<String> itemTextList = Arrays.asList(itemTexts.split(";"));
|
|
||||||
List<String> itemValues = sysDictItemList.stream()
|
|
||||||
.filter(sysDictItem -> itemTextList.contains(sysDictItem.getItemText()) && dictId.equals(sysDictItem.getDictId()))
|
|
||||||
.map(SysDictItem::getItemValue).collect(Collectors.toList());
|
|
||||||
return StringUtils.join(itemValues, ",");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
-47
@@ -1,47 +0,0 @@
|
|||||||
package com.jero.modules.docking.asms.util;
|
|
||||||
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/25 9:33
|
|
||||||
* @Description: 目录顺序排序
|
|
||||||
*/
|
|
||||||
public class AlphanumericComparator implements Comparator<String> {
|
|
||||||
private Pattern pattern = Pattern.compile("(\\d+|\\D+)");
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int compare(String s1, String s2) {
|
|
||||||
Matcher matcher1 = pattern.matcher(s1);
|
|
||||||
Matcher matcher2 = pattern.matcher(s2);
|
|
||||||
|
|
||||||
while (matcher1.find() && matcher2.find()) {
|
|
||||||
String group1 = matcher1.group();
|
|
||||||
String group2 = matcher2.group();
|
|
||||||
|
|
||||||
int result;
|
|
||||||
if (isInteger(group1) && isInteger(group2)) {
|
|
||||||
result = Integer.compare(Integer.parseInt(group1), Integer.parseInt(group2));
|
|
||||||
} else {
|
|
||||||
result = group1.compareTo(group2);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (result != 0) {
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isInteger(String s) {
|
|
||||||
try {
|
|
||||||
Integer.parseInt(s);
|
|
||||||
return true;
|
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-154
@@ -1,154 +0,0 @@
|
|||||||
package com.jero.modules.docking.asms.util;
|
|
||||||
|
|
||||||
import com.jero.common.api.vo.Result;
|
|
||||||
import com.jero.common.exception.JeroBootException;
|
|
||||||
import com.jero.common.util.RedisUtil;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.http.HttpEntity;
|
|
||||||
import org.springframework.http.HttpHeaders;
|
|
||||||
import org.springframework.http.HttpMethod;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
import org.springframework.web.client.RestTemplate;
|
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/17 15:12
|
|
||||||
* @Description: 远程调用
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
@Slf4j
|
|
||||||
public class AsmsPostUtil {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private RestTemplate restTemplate;
|
|
||||||
@Autowired
|
|
||||||
private RedisUtil redisUtil;
|
|
||||||
@Value("${asms.host}")
|
|
||||||
private String host;
|
|
||||||
@Value("${asms.username}")
|
|
||||||
private String username;
|
|
||||||
|
|
||||||
public String getHost() {
|
|
||||||
return host;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Value("${asms.password}")
|
|
||||||
private String password;
|
|
||||||
@Value("${asms.expire}")
|
|
||||||
private Long expire;
|
|
||||||
// 汽车标准数字化平台ASMS权限验证token
|
|
||||||
private final static String ASMS_SYSTEM_AUTH_TOKEN = "ASMS_SYSTEM_AUTH_TOKEN";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/17 15:43
|
|
||||||
* @Description: 获取token字符串
|
|
||||||
**/
|
|
||||||
private String getToken() {
|
|
||||||
// 从redis中获取token
|
|
||||||
String token = (String) redisUtil.get(ASMS_SYSTEM_AUTH_TOKEN);
|
|
||||||
// 如果token为空则重新获取
|
|
||||||
if (StringUtils.isBlank(token)) {
|
|
||||||
Map<String, String> map = new HashMap<>();
|
|
||||||
map.put("username", username);
|
|
||||||
map.put("password", password);
|
|
||||||
ResponseEntity<Result> responseEntity = restTemplate.postForEntity(host + "xiaobodata/openApi/login", map, Result.class);
|
|
||||||
if (!responseEntity.getBody().isSuccess()) {
|
|
||||||
System.out.println("汽车标准数字化平台:token获取失败" + responseEntity.getBody().toString());
|
|
||||||
throw new JeroBootException("汽车标准数字化平台:token获取失败" + responseEntity.getBody().toString());
|
|
||||||
}
|
|
||||||
Map<String, String> resultMap = (Map<String, String>) responseEntity.getBody().getResult();
|
|
||||||
token = resultMap.get("token");
|
|
||||||
// 将新获取的token存入redis
|
|
||||||
redisUtil.set(ASMS_SYSTEM_AUTH_TOKEN, token, expire * 60 * 60);
|
|
||||||
log.info("new token is creating: {}", token);
|
|
||||||
}
|
|
||||||
return token;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/17 16:33
|
|
||||||
* @Description: 发送get请求
|
|
||||||
* uri:接口地址
|
|
||||||
* map:参数map
|
|
||||||
**/
|
|
||||||
public List<Map<String, String>> sendGetReq(String uri, Map<String, String> map) {
|
|
||||||
ResponseEntity<Result> responseEntity = getSendGetReq(uri, map);
|
|
||||||
Map<String, Object> resultMap = (Map<String, Object>) responseEntity.getBody().getResult();
|
|
||||||
if (Objects.isNull(resultMap)) {
|
|
||||||
throw new JeroBootException("返回数据为空");
|
|
||||||
}
|
|
||||||
List<Map<String, String>> mapList = (List<Map<String, String>>) resultMap.get("records");
|
|
||||||
if (CollectionUtils.isEmpty(mapList)) {
|
|
||||||
mapList = new ArrayList<>();
|
|
||||||
Map<String, String> result = (Map<String, String>) responseEntity.getBody().getResult();
|
|
||||||
if (result.containsKey("records")) {
|
|
||||||
return new ArrayList<>();
|
|
||||||
}
|
|
||||||
mapList.add(result);
|
|
||||||
}
|
|
||||||
log.info("返回{}条数据", mapList.size());
|
|
||||||
return mapList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, Object> sendGetReq2(String uri, Map<String, String> map) {
|
|
||||||
ResponseEntity<Result> responseEntity = getSendGetReq(uri, map);
|
|
||||||
return (Map<String, Object>) responseEntity.getBody().getResult();
|
|
||||||
}
|
|
||||||
|
|
||||||
private ResponseEntity<Result> getSendGetReq(String uri, Map<String, String> map) {
|
|
||||||
// 准备请求头
|
|
||||||
String token = getToken();
|
|
||||||
HttpHeaders headers = new HttpHeaders();
|
|
||||||
headers.set("Content-Type", "application/x-www-form-urlencoded");
|
|
||||||
headers.set("X-Access-Token", token);
|
|
||||||
|
|
||||||
if (StringUtils.isBlank(uri)) {
|
|
||||||
throw new JeroBootException("url不能为空");
|
|
||||||
}
|
|
||||||
// 准备url
|
|
||||||
String url = host + uri;
|
|
||||||
if (!Objects.isNull(map)) {
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
map.forEach((k, v) -> sb.append("&" + k + "=" + v));
|
|
||||||
String s = sb.toString();
|
|
||||||
url += "?" + s.substring(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
ResponseEntity<Result> responseEntity;
|
|
||||||
try {
|
|
||||||
log.info("request url : {}", url);
|
|
||||||
responseEntity = restTemplate.exchange(url.toString(),
|
|
||||||
HttpMethod.GET, new HttpEntity<>(null, headers), Result.class);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.info("old token is deleting: {}", token);
|
|
||||||
redisUtil.del(ASMS_SYSTEM_AUTH_TOKEN);
|
|
||||||
e.printStackTrace();
|
|
||||||
throw new JeroBootException("操作失败,请稍后重试");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!responseEntity.getBody().isSuccess()) {
|
|
||||||
System.out.println("汽车标准数字化平台:请求发送失败" + responseEntity.getBody().toString());
|
|
||||||
throw new JeroBootException("汽车标准数字化平台:请求发送失败" + responseEntity.getBody().toString());
|
|
||||||
}
|
|
||||||
return responseEntity;
|
|
||||||
}
|
|
||||||
|
|
||||||
public InputStream getFileByteArray(String fileUrl) {
|
|
||||||
// 执行GET请求
|
|
||||||
ResponseEntity<byte[]> response = restTemplate.getForEntity(host + fileUrl, byte[].class);
|
|
||||||
byte[] bytes = response.getBody();
|
|
||||||
return new ByteArrayInputStream(bytes);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
-87
@@ -1,87 +0,0 @@
|
|||||||
package com.jero.modules.docking.download.config;
|
|
||||||
import org.apache.commons.io.IOUtils;
|
|
||||||
import org.springframework.core.Ordered;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
import org.springframework.web.filter.OncePerRequestFilter;
|
|
||||||
import org.springframework.web.util.ContentCachingRequestWrapper;
|
|
||||||
import org.springframework.web.util.ContentCachingResponseWrapper;
|
|
||||||
import org.springframework.web.util.WebUtils;
|
|
||||||
|
|
||||||
import javax.servlet.FilterChain;
|
|
||||||
import javax.servlet.ServletException;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author lqt
|
|
||||||
* @version 1.0
|
|
||||||
* @date 2023/11/24 11:36
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
public class ContentCachingWrapperFilter extends OncePerRequestFilter implements Ordered {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getOrder() {
|
|
||||||
return Ordered.LOWEST_PRECEDENCE - 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain)
|
|
||||||
throws ServletException, IOException {
|
|
||||||
// 包装流,可重复读取
|
|
||||||
if (!(request instanceof ContentCachingRequestWrapper)) {
|
|
||||||
request = new ContentCachingRequestWrapper(request);
|
|
||||||
}
|
|
||||||
if (!(response instanceof ContentCachingResponseWrapper)) {
|
|
||||||
response = new ContentCachingResponseWrapper(response);
|
|
||||||
}
|
|
||||||
|
|
||||||
filterChain.doFilter(request, response);
|
|
||||||
updateResponse(response);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新响应(不操作这一步,会导致接口响应空白)
|
|
||||||
*
|
|
||||||
* @param response 响应对象
|
|
||||||
* @throws IOException /
|
|
||||||
*/
|
|
||||||
public static void updateResponse(HttpServletResponse response) throws IOException {
|
|
||||||
ContentCachingResponseWrapper responseWrapper = WebUtils.getNativeResponse(response, ContentCachingResponseWrapper.class);
|
|
||||||
Objects.requireNonNull(responseWrapper).copyBodyToResponse();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取请求体
|
|
||||||
*
|
|
||||||
* @param request 请求对象
|
|
||||||
* @return 请求体
|
|
||||||
*/
|
|
||||||
public static String getRequestBody(HttpServletRequest request) throws IOException {
|
|
||||||
String requestBody = "";
|
|
||||||
ContentCachingRequestWrapper wrapper = WebUtils.getNativeRequest(request, ContentCachingRequestWrapper.class);
|
|
||||||
if (wrapper != null) {
|
|
||||||
requestBody = IOUtils.toString(wrapper.getContentAsByteArray(), StandardCharsets.UTF_8.toString());
|
|
||||||
}
|
|
||||||
return requestBody;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取响应体
|
|
||||||
*
|
|
||||||
* @param response 响应对象
|
|
||||||
* @return 响应体
|
|
||||||
*/
|
|
||||||
public static InputStream getResponseBody(HttpServletResponse response) throws IOException {
|
|
||||||
InputStream responseBody = null;
|
|
||||||
ContentCachingResponseWrapper wrapper = WebUtils.getNativeResponse(response, ContentCachingResponseWrapper.class);
|
|
||||||
if (wrapper != null) {
|
|
||||||
responseBody = wrapper.getContentInputStream();
|
|
||||||
}
|
|
||||||
return responseBody;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-53
@@ -1,53 +0,0 @@
|
|||||||
package com.jero.modules.docking.download.config;
|
|
||||||
|
|
||||||
import com.jero.modules.docking.download.service.DownloadDecryptFileService;
|
|
||||||
import org.springframework.lang.Nullable;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
import org.springframework.web.servlet.HandlerInterceptor;
|
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author lqt
|
|
||||||
* @version 1.0
|
|
||||||
* @date 2023/11/23 18:20
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
public class DownloadInterceptor implements HandlerInterceptor{
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private DownloadDecryptFileService downloadDecryptFileService;
|
|
||||||
|
|
||||||
public DownloadInterceptor(DownloadDecryptFileService downloadDecryptFileService) {
|
|
||||||
this.downloadDecryptFileService = downloadDecryptFileService;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 预处理回调方法,实现处理器的预处理(如检查登陆),第三个参数为响应的处理器
|
|
||||||
* 返回值:true表示继续流程(如调用下一个拦截器或处理器);false表示流程中断(如登录检查失败),不会继续调用其他的拦截器或处理器,此时我们需要通过response来产生响应
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 后处理回调方法,实现处理器的后处理(但在渲染视图之前),此时我们可以通过modelAndView(模型和视图对象)对模型数据进行处理或对视图进行处理,modelAndView也可能为null
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, @Nullable ModelAndView modelAndView) throws Exception {
|
|
||||||
downloadDecryptFileService.downloadDecryptFile(request,response,handler,"1");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*整个请求处理完毕回调方法,即在视图渲染完毕时回调,如性能监控中我们可以在此记录结束时间并输出消耗时间,还可以进行一些资源清理,类似于try-catch-finally中的finally,但仅调用处理器执行链中
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, @Nullable Exception ex) throws Exception {
|
|
||||||
downloadDecryptFileService.downloadDecryptFile(request,response,handler,null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-25
@@ -1,25 +0,0 @@
|
|||||||
package com.jero.modules.docking.download.config;
|
|
||||||
|
|
||||||
import com.jero.modules.docking.download.service.DownloadDecryptFileService;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
|
||||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author lqt
|
|
||||||
* @version 1.0
|
|
||||||
* @date 2023/11/23 18:21
|
|
||||||
*/
|
|
||||||
@Configuration
|
|
||||||
public class InterceptorConfig implements WebMvcConfigurer {
|
|
||||||
@Resource
|
|
||||||
private DownloadDecryptFileService downloadDecryptFileService;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addInterceptors(InterceptorRegistry registry) {
|
|
||||||
registry.addInterceptor(new DownloadInterceptor(downloadDecryptFileService)).addPathPatterns("/**");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
-45
@@ -1,45 +0,0 @@
|
|||||||
package com.jero.modules.docking.download.controller;
|
|
||||||
|
|
||||||
import com.jero.common.util.IntekeyUtils;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.OutputStream;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author lqt
|
|
||||||
* @version 1.0
|
|
||||||
* @date 2023/11/27 17:41
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/home/search")
|
|
||||||
public class SearchController {
|
|
||||||
|
|
||||||
|
|
||||||
@PostMapping(value = "/download")
|
|
||||||
public void downloadAndView(@RequestParam("file") MultipartFile file,
|
|
||||||
@RequestParam("url") String url,
|
|
||||||
@RequestParam("appCode") String appCode,
|
|
||||||
@RequestParam("secretKey") String secretKey,
|
|
||||||
@RequestParam(value = "scope",required = false) Integer scope,
|
|
||||||
HttpServletResponse response) {
|
|
||||||
try (InputStream inputStream = IntekeyUtils.decryptFile(url, appCode, secretKey, scope, file);
|
|
||||||
OutputStream outputStream = response.getOutputStream()
|
|
||||||
) {
|
|
||||||
byte[] buf = new byte[1024];
|
|
||||||
int len;
|
|
||||||
while ((len = inputStream.read(buf)) > 0) {
|
|
||||||
outputStream.write(buf, 0, len);
|
|
||||||
}
|
|
||||||
response.flushBuffer();
|
|
||||||
} catch (Exception e) {
|
|
||||||
response.setStatus(404);
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-24
@@ -1,24 +0,0 @@
|
|||||||
package com.jero.modules.docking.download.service;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author lqt
|
|
||||||
* @version 1.0
|
|
||||||
* @date 2023/11/24 9:04
|
|
||||||
*/
|
|
||||||
public interface DownloadDecryptFileService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author LQT
|
|
||||||
* @date 2023/11/24 9:06
|
|
||||||
* @param request
|
|
||||||
* @param response
|
|
||||||
* @param handler
|
|
||||||
* @param type 1 为直接返回文件流,其他为modelandview
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
void downloadDecryptFile(HttpServletRequest request, HttpServletResponse response, Object handler,String type);
|
|
||||||
}
|
|
||||||
-269
@@ -1,269 +0,0 @@
|
|||||||
package com.jero.modules.docking.download.service.impl;
|
|
||||||
|
|
||||||
import com.jero.modules.docking.download.config.ContentCachingWrapperFilter;
|
|
||||||
import com.jero.modules.docking.download.service.DownloadDecryptFileService;
|
|
||||||
import com.jero.common.util.IntekeyUtils;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.apache.http.entity.ContentType;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.mock.web.MockMultipartFile;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.web.method.HandlerMethod;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.OutputStream;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author lqt
|
|
||||||
* @version 1.0
|
|
||||||
* @date 2023/11/24 9:04
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Service
|
|
||||||
public class DownloadDecryptFileServiceImpl implements DownloadDecryptFileService {
|
|
||||||
|
|
||||||
@Value("#{'${download.download_url}'.split(',')}")
|
|
||||||
private List<String> downloadUrl;
|
|
||||||
|
|
||||||
@Value("#{'${download.view_url}'.split(',')}")
|
|
||||||
private List<String> viewUrl;
|
|
||||||
|
|
||||||
@Value("#{'${download.enable}'}")
|
|
||||||
private boolean enable;
|
|
||||||
|
|
||||||
@Value("#{'${download.white_url}'.split(',')}")
|
|
||||||
private List<String> whiteUrls;
|
|
||||||
|
|
||||||
@Value("#{'${download.dev_encrypt_url}'.split(',')}")
|
|
||||||
private List<String> devEncryptUrls;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 管理员角色
|
|
||||||
*/
|
|
||||||
@Value("#{'${download.admin_role_code}'.split(',')}")
|
|
||||||
private List<String> adminRoleCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 加密
|
|
||||||
*/
|
|
||||||
@Value("#{'${download.encrypt.url}'}")
|
|
||||||
private String encryptUrl;
|
|
||||||
@Value("#{'${download.encrypt.app_code}'}")
|
|
||||||
private String encryptAppCode;
|
|
||||||
@Value("#{'${download.encrypt.secret_key}'}")
|
|
||||||
private String encryptSecretKey;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 解密
|
|
||||||
*/
|
|
||||||
@Value("#{'${download.decrypt.url}'}")
|
|
||||||
private String decryptUrl;
|
|
||||||
@Value("#{'${download.decrypt.app_code}'}")
|
|
||||||
private String decryptAppCode;
|
|
||||||
@Value("#{'${download.decrypt.secret_key}'}")
|
|
||||||
private String decryptSecretKey;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 研发域
|
|
||||||
*/
|
|
||||||
@Value("#{'${download.scope_dev}'}")
|
|
||||||
private int scopeDev;
|
|
||||||
/**
|
|
||||||
* 办公域
|
|
||||||
*/
|
|
||||||
@Value("#{'${download.scope_work}'}")
|
|
||||||
private int scopeWork;
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void downloadDecryptFile(HttpServletRequest request, HttpServletResponse response, Object handler,String type) {
|
|
||||||
if(!enable){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 白名单不执行
|
|
||||||
String requestUrl = request.getRequestURI();
|
|
||||||
for (String whiteUrl : whiteUrls) {
|
|
||||||
if (requestUrl.contains(whiteUrl)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 是否加研发密
|
|
||||||
boolean isDevEncrypt = false;
|
|
||||||
for (String devEncryptUrl : devEncryptUrls) {
|
|
||||||
if (requestUrl.contains(devEncryptUrl)) {
|
|
||||||
isDevEncrypt = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 判断返回值是否为文件流,否则其他接口返回值会变更成字符串,导致前端无法解析
|
|
||||||
HandlerMethod handlerMethod = (HandlerMethod) handler;
|
|
||||||
InputStream responseBody = null;
|
|
||||||
try {
|
|
||||||
String returnType = handlerMethod.getMethod().getReturnType().getName();
|
|
||||||
if(!Objects.equals(returnType,"void") && !Objects.equals(returnType,"org.springframework.web.servlet.ModelAndView")){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(Objects.equals(returnType,"void") && !Objects.equals(type,"1")){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
responseBody = ContentCachingWrapperFilter.getResponseBody(response);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("Exception:",e);
|
|
||||||
response.setStatus(404);
|
|
||||||
}
|
|
||||||
|
|
||||||
String contentType = response.getContentType();
|
|
||||||
String fileName = getFileName(response);
|
|
||||||
if (!fileName.contains(".")) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
MultipartFile file = getMultipartFile(response,responseBody, contentType, fileName);
|
|
||||||
// 访问路径
|
|
||||||
String str = request.getRequestURI();
|
|
||||||
|
|
||||||
boolean b = isBoolean(str, viewUrl);
|
|
||||||
|
|
||||||
boolean b1 = isBoolean(str, downloadUrl);
|
|
||||||
|
|
||||||
int scope = getScope(isDevEncrypt);
|
|
||||||
|
|
||||||
if(b){
|
|
||||||
// 预览,进行解密
|
|
||||||
decryptFile(response, file, null);
|
|
||||||
}else if(b1){
|
|
||||||
// 下载文件 先解密,判断组织域,加密
|
|
||||||
try (InputStream is = IntekeyUtils.decryptFile(decryptUrl, decryptAppCode, decryptSecretKey, null, file)) {
|
|
||||||
MultipartFile fileDecrypt = getMultipartFile(response,is, contentType, fileName);
|
|
||||||
// 判断fileDecrypt是不是zip压缩包,如果是压缩包的话则不加密
|
|
||||||
boolean isZipFile = false;
|
|
||||||
String originalFileName = fileDecrypt.getOriginalFilename();
|
|
||||||
if (originalFileName != null && originalFileName.endsWith(".zip")) {
|
|
||||||
isZipFile = true;
|
|
||||||
}
|
|
||||||
if (isZipFile) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 加密
|
|
||||||
encryptFile(response, fileDecrypt, scope);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("Exception:",e);
|
|
||||||
response.setStatus(404);
|
|
||||||
}
|
|
||||||
|
|
||||||
}else{
|
|
||||||
// 加密
|
|
||||||
encryptFile(response, file, scope);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
|
||||||
private String getFileName(HttpServletResponse response) {
|
|
||||||
String fileName = "";
|
|
||||||
String headerField = response.getHeader("Content-Disposition");
|
|
||||||
|
|
||||||
if (headerField != null &&
|
|
||||||
(!StringUtils.isBlank(headerField) || headerField.contains("fileName=") || headerField.contains("filename="))){
|
|
||||||
String name = "";
|
|
||||||
if(headerField.contains("fileName=")){
|
|
||||||
name = "fileName";
|
|
||||||
}else{
|
|
||||||
name = "filename";
|
|
||||||
}
|
|
||||||
fileName = headerField.substring(headerField.lastIndexOf(name + "=") + 9);
|
|
||||||
if (headerField.contains("filename*=UTF-8")){
|
|
||||||
fileName = headerField.substring(headerField.lastIndexOf("filename*=UTF-8") + 17);
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
fileName = UUID.randomUUID().toString();
|
|
||||||
}
|
|
||||||
return fileName;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void decryptFile(HttpServletResponse response, MultipartFile file, Integer scope) {
|
|
||||||
try (InputStream is = IntekeyUtils.decryptFile(decryptUrl, decryptAppCode, decryptSecretKey, scope, file)) {
|
|
||||||
writeResponse(response, is);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("Exception:",e);
|
|
||||||
response.setStatus(404);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void encryptFile(HttpServletResponse response, MultipartFile file, Integer scope) {
|
|
||||||
try (InputStream is = IntekeyUtils.decryptFile(encryptUrl, encryptAppCode, encryptSecretKey, scope, file)) {
|
|
||||||
writeResponse(response, is);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("Exception:",e);
|
|
||||||
response.setStatus(404);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
|
||||||
private MultipartFile getMultipartFile(HttpServletResponse response,InputStream responseBody,String contentType,String fileName) {
|
|
||||||
MultipartFile file = null;
|
|
||||||
try {
|
|
||||||
file = new MockMultipartFile(ContentType.APPLICATION_OCTET_STREAM.toString(),fileName,contentType, responseBody);
|
|
||||||
} catch (IOException e) {
|
|
||||||
log.error("Exception:",e);
|
|
||||||
response.setStatus(404);
|
|
||||||
}
|
|
||||||
return file;
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isBoolean(String str, List<String> viewUrl) {
|
|
||||||
boolean b = false;
|
|
||||||
for (String s : viewUrl) {
|
|
||||||
if (str.contains(s)) {
|
|
||||||
b = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return b;
|
|
||||||
}
|
|
||||||
|
|
||||||
private int getScope(boolean isDevEncrypt) {
|
|
||||||
// 角色信息中存在 【系统管理员】或者 【标准管理员】即加为研发密,其他情况都是OA密
|
|
||||||
// 研发密比较高级(加密需要传参)
|
|
||||||
// 研发域 scope = 51
|
|
||||||
// 办公密 scope = 52
|
|
||||||
// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
||||||
// List<String> listRoleCode = Arrays.asList(sysUser.getRoleIds().split(","));
|
|
||||||
// if(CollectionUtils.isEmpty(listRoleCode)){
|
|
||||||
// throw new JeroBootException(ResultCommon.ERROR);
|
|
||||||
// }
|
|
||||||
// int scope = scopeWork;
|
|
||||||
// long l = listRoleCode.stream().filter(o->adminRoleCode.contains(o)).count();
|
|
||||||
// if(l > 0){
|
|
||||||
// scope = scopeDev;
|
|
||||||
// }
|
|
||||||
if (isDevEncrypt) {
|
|
||||||
return scopeDev;
|
|
||||||
} else {
|
|
||||||
return scopeWork;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void writeResponse(HttpServletResponse response,InputStream is) {
|
|
||||||
response.resetBuffer();
|
|
||||||
try (OutputStream outputStream = response.getOutputStream()) {
|
|
||||||
byte[] buf = new byte[1024];
|
|
||||||
int len;
|
|
||||||
while ((len = is.read(buf)) > 0) {
|
|
||||||
outputStream.write(buf, 0, len);
|
|
||||||
}
|
|
||||||
response.flushBuffer();
|
|
||||||
}catch (Exception e){
|
|
||||||
log.error("Exception:",e);
|
|
||||||
response.setStatus(404);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-31
@@ -1,31 +0,0 @@
|
|||||||
package com.jero.modules.docking.hiwork.controller;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.jero.common.api.vo.Result;
|
|
||||||
import com.jero.modules.docking.hiwork.service.impl.HiworkService;
|
|
||||||
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;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author liJiaRao
|
|
||||||
* @date 2024-03-01 14:01
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/hiwork")
|
|
||||||
@Slf4j
|
|
||||||
public class HiworkLoginController {
|
|
||||||
@Resource
|
|
||||||
private HiworkService hiworkService;
|
|
||||||
|
|
||||||
@ApiOperation("hiwork单点登录")
|
|
||||||
@PostMapping("/login")
|
|
||||||
public Result<JSONObject> login(@RequestBody JSONObject jsonObject){
|
|
||||||
return hiworkService.login(jsonObject);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-36
@@ -1,36 +0,0 @@
|
|||||||
package com.jero.modules.docking.hiwork.entity;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/13 17:49
|
|
||||||
* @Description: 统一消息集成-钉钉消息
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@ApiModel(value="统一消息集成-钉钉消息", description="统一消息集成-钉钉消息")
|
|
||||||
public class HiworkDingDingMsg {
|
|
||||||
@ApiModelProperty(value = "异构系统标识")
|
|
||||||
private String sysCode;
|
|
||||||
@ApiModelProperty(value = "服务号消息")
|
|
||||||
private String noticeServiceCode;
|
|
||||||
@ApiModelProperty(value = "消息推送类型 ding | message | jpush")
|
|
||||||
private String noticePushType;
|
|
||||||
@ApiModelProperty(value = "发送人员Id")
|
|
||||||
private String useridList;
|
|
||||||
@ApiModelProperty(value = "发送部门id")
|
|
||||||
private String deptIdList;
|
|
||||||
@ApiModelProperty(value = "agentId")
|
|
||||||
private String agentId;
|
|
||||||
@ApiModelProperty(value = "标题")
|
|
||||||
private String title;
|
|
||||||
@ApiModelProperty(value = "消息体")
|
|
||||||
private JSONObject msg;
|
|
||||||
}
|
|
||||||
-27
@@ -1,27 +0,0 @@
|
|||||||
package com.jero.modules.docking.hiwork.entity;
|
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/13 14:39
|
|
||||||
* @Description: 统一待办集成返回
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@ApiModel(value="统一待办集成返回", description="统一待办集成返回")
|
|
||||||
public class HiworkResult {
|
|
||||||
@ApiModelProperty(value = "成功true,失败false")
|
|
||||||
private Boolean success;
|
|
||||||
@ApiModelProperty(value = "成功1,失败0")
|
|
||||||
private Integer code;
|
|
||||||
@ApiModelProperty(value = "消息")
|
|
||||||
private String msg;
|
|
||||||
@ApiModelProperty(value = "成功null,失败null")
|
|
||||||
private Object data;
|
|
||||||
}
|
|
||||||
-37
@@ -1,37 +0,0 @@
|
|||||||
package com.jero.modules.docking.hiwork.entity;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/13 17:49
|
|
||||||
* @Description: 统一消息集成-系统消息
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@ApiModel(value="统一消息集成-系统消息", description="统一消息集成-系统消息")
|
|
||||||
public class HiworkSystemMsg {
|
|
||||||
@ApiModelProperty(value = "异构系统标识")
|
|
||||||
private String sysCode;
|
|
||||||
@ApiModelProperty(value = "消息推送类型 ding | message | jpush")
|
|
||||||
private String noticePushType;
|
|
||||||
@ApiModelProperty(value = "发送人员编号")
|
|
||||||
private String sendCode;
|
|
||||||
@ApiModelProperty(value = "发送人员姓名")
|
|
||||||
private String sendName;
|
|
||||||
@ApiModelProperty(value = "消息类型 字典")
|
|
||||||
private String messageType;
|
|
||||||
@ApiModelProperty(value = "消息标题")
|
|
||||||
private String title;
|
|
||||||
@ApiModelProperty(value = "消息接收人 集合")
|
|
||||||
private JSONArray receiverList;
|
|
||||||
@ApiModelProperty(value = "消息体")
|
|
||||||
private JSONObject msg;
|
|
||||||
}
|
|
||||||
-78
@@ -1,78 +0,0 @@
|
|||||||
package com.jero.modules.docking.hiwork.entity;
|
|
||||||
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
import java.time.Instant;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/13 14:22
|
|
||||||
* @Description: 待办
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@ApiModel(value="统一待办集成", description="统一待办集成")
|
|
||||||
public class HiworkTodo {
|
|
||||||
@ApiModelProperty(value = "异构系统标识")
|
|
||||||
private String sysCode;
|
|
||||||
@ApiModelProperty(value = "标题")
|
|
||||||
private String noticeTitle;
|
|
||||||
@ApiModelProperty(value = "描述")
|
|
||||||
private String noticeDescription;
|
|
||||||
@ApiModelProperty(value = "流程编号")
|
|
||||||
private String busiDefCode;
|
|
||||||
@ApiModelProperty(value = "流程id")
|
|
||||||
private String flowid;
|
|
||||||
@ApiModelProperty(value = "流程实例id")
|
|
||||||
private String processId;
|
|
||||||
@ApiModelProperty(value = "流程实例名称")
|
|
||||||
private String processName;
|
|
||||||
@ApiModelProperty(value = "流程类型,字典")
|
|
||||||
private String processType;
|
|
||||||
@ApiModelProperty(value = "任务id")
|
|
||||||
private String taskId;
|
|
||||||
@ApiModelProperty(value = "节点名称")
|
|
||||||
private String taskName;
|
|
||||||
@ApiModelProperty(value = "是否进入下一节点(0是 1不是)")
|
|
||||||
private Integer multiInstance;
|
|
||||||
@ApiModelProperty(value = "节点编号")
|
|
||||||
private String nodeBusiCode;
|
|
||||||
@ApiModelProperty(value = "跳转链接")
|
|
||||||
private String businessLink;
|
|
||||||
@ApiModelProperty(value = "APP跳转链接")
|
|
||||||
private String appBusinessLink;
|
|
||||||
@ApiModelProperty(value = "创建人code")
|
|
||||||
private String createUserCode;
|
|
||||||
@ApiModelProperty(value = "创建人姓名")
|
|
||||||
private String createUserName;
|
|
||||||
@ApiModelProperty(value = "接收人id")
|
|
||||||
private String userId;
|
|
||||||
@ApiModelProperty(value = "接收人code")
|
|
||||||
private String userCode;
|
|
||||||
@ApiModelProperty(value = "接收人姓名")
|
|
||||||
private String userName;
|
|
||||||
@ApiModelProperty(value = "参与者id")
|
|
||||||
private String participantId;
|
|
||||||
@ApiModelProperty(value = "参与者编号")
|
|
||||||
private String participantCode;
|
|
||||||
@ApiModelProperty(value = "接收时间")
|
|
||||||
private Instant receiveTime;
|
|
||||||
@ApiModelProperty(value = "截止时间")
|
|
||||||
private Long dueTime;
|
|
||||||
@ApiModelProperty(value = "业务主键")
|
|
||||||
private String bid;
|
|
||||||
@ApiModelProperty(value = "待办、已办")
|
|
||||||
private String isTodo;
|
|
||||||
@ApiModelProperty(value = "是否展示在列表中")
|
|
||||||
private String isShow;
|
|
||||||
@ApiModelProperty(value = "优先级")
|
|
||||||
private String priority;
|
|
||||||
@ApiModelProperty(value = "是否通知消息")
|
|
||||||
private String notifyConfig;
|
|
||||||
|
|
||||||
}
|
|
||||||
-72
@@ -1,72 +0,0 @@
|
|||||||
package com.jero.modules.docking.hiwork.entity;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.annotation.JSONField;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author liJiaRao
|
|
||||||
* @date 2024-03-01 14:26
|
|
||||||
*/
|
|
||||||
@NoArgsConstructor
|
|
||||||
@Data
|
|
||||||
public class HiworkUserInfo {
|
|
||||||
/**
|
|
||||||
* errcode
|
|
||||||
*/
|
|
||||||
@JSONField(name = "errcode")
|
|
||||||
private Integer errcode;
|
|
||||||
/**
|
|
||||||
* result
|
|
||||||
*/
|
|
||||||
@JSONField(name = "result")
|
|
||||||
private ResultDTO result;
|
|
||||||
/**
|
|
||||||
* errmsg
|
|
||||||
*/
|
|
||||||
@JSONField(name = "errmsg")
|
|
||||||
private String errmsg;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ResultDTO
|
|
||||||
*/
|
|
||||||
@NoArgsConstructor
|
|
||||||
@Data
|
|
||||||
public static class ResultDTO {
|
|
||||||
/**
|
|
||||||
* associatedUnionid
|
|
||||||
*/
|
|
||||||
@JSONField(name = "associated_unionid")
|
|
||||||
private String associatedUnionid;
|
|
||||||
/**
|
|
||||||
* unionid
|
|
||||||
*/
|
|
||||||
@JSONField(name = "unionid")
|
|
||||||
private String unionid;
|
|
||||||
/**
|
|
||||||
* deviceId
|
|
||||||
*/
|
|
||||||
@JSONField(name = "device_id")
|
|
||||||
private String deviceId;
|
|
||||||
/**
|
|
||||||
* sysLevel
|
|
||||||
*/
|
|
||||||
@JSONField(name = "sys_level")
|
|
||||||
private Integer sysLevel;
|
|
||||||
/**
|
|
||||||
* name
|
|
||||||
*/
|
|
||||||
@JSONField(name = "name")
|
|
||||||
private String name;
|
|
||||||
/**
|
|
||||||
* sys
|
|
||||||
*/
|
|
||||||
@JSONField(name = "sys")
|
|
||||||
private Boolean sys;
|
|
||||||
/**
|
|
||||||
* userid
|
|
||||||
*/
|
|
||||||
@JSONField(name = "userid")
|
|
||||||
private String userid;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-25
@@ -1,25 +0,0 @@
|
|||||||
package com.jero.modules.docking.hiwork.enums;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/13 15:05
|
|
||||||
* @Description: 待办、已办
|
|
||||||
*/
|
|
||||||
public enum IsTodoEnum {
|
|
||||||
TODO( "待办", "1"),
|
|
||||||
DONE("已办", "2"),
|
|
||||||
FINISH("结束", "3"),
|
|
||||||
DEL("删除", "6")
|
|
||||||
;
|
|
||||||
|
|
||||||
String name;
|
|
||||||
String value;
|
|
||||||
|
|
||||||
IsTodoEnum(String name, String value) {
|
|
||||||
this.name = name;
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {return name;}
|
|
||||||
public String getValue() {return value;}
|
|
||||||
}
|
|
||||||
-29
@@ -1,29 +0,0 @@
|
|||||||
package com.jero.modules.docking.hiwork.handle;
|
|
||||||
|
|
||||||
import com.jero.common.util.SpringContextUtils;
|
|
||||||
import com.jero.modules.docking.hiwork.service.IHiworkMsgService;
|
|
||||||
import com.jero.modules.message.handle.ISendMsgHandle;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/17 14:29
|
|
||||||
* @Description: Hiwork钉钉消息
|
|
||||||
**/
|
|
||||||
@Slf4j
|
|
||||||
public class DingDingSendMsgHandle implements ISendMsgHandle {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/17 14:29
|
|
||||||
* @Description: Hiwork钉钉消息
|
|
||||||
**/
|
|
||||||
@Override
|
|
||||||
public void SendMsg(String esReceiver, String esTitle, String esContent, String openType, String messageUrl) {
|
|
||||||
IHiworkMsgService hiworkMsgService = SpringContextUtils.getBean(IHiworkMsgService.class);
|
|
||||||
hiworkMsgService.sendDingDingMsg(Arrays.asList(esReceiver.split(",")), esTitle, esContent, messageUrl);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
-21
@@ -1,21 +0,0 @@
|
|||||||
package com.jero.modules.docking.hiwork.handle;
|
|
||||||
|
|
||||||
import com.jero.common.util.SpringContextUtils;
|
|
||||||
import com.jero.modules.docking.hiwork.service.IHiworkMsgService;
|
|
||||||
import com.jero.modules.message.handle.ISendMsgHandle;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
@Slf4j
|
|
||||||
public class SystemSendMsgHandle implements ISendMsgHandle {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void SendMsg(String esReceiver, String esTitle, String esContent, String openType, String openPage) {
|
|
||||||
IHiworkMsgService hiworkMsgService = SpringContextUtils.getBean(IHiworkMsgService.class);
|
|
||||||
// TODO 先写死 01 消息类型(暂未确定)
|
|
||||||
String messageType = "01";
|
|
||||||
hiworkMsgService.sendSystemMsg(Arrays.asList(esReceiver.split(",")), messageType, esTitle, esContent, openPage);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
-33
@@ -1,33 +0,0 @@
|
|||||||
package com.jero.modules.docking.hiwork.service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/16 15:18
|
|
||||||
* @Description: 统一消息集成
|
|
||||||
*/
|
|
||||||
public interface IHiworkMsgService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/16 15:32
|
|
||||||
* @Description: 发送钉钉消息
|
|
||||||
* senderIdList:发送人员id集合
|
|
||||||
* title:消息标题
|
|
||||||
* content:文本内容
|
|
||||||
**/
|
|
||||||
void sendDingDingMsg(List<String> senderIdList, String title, String content, String messageUrl);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/16 16:11
|
|
||||||
* @Description: 发送系统消息
|
|
||||||
* senderId:发送人员id
|
|
||||||
* receiverIdList:消息接收人id集合
|
|
||||||
* messageType:消息类型 字典
|
|
||||||
* title:消息标题
|
|
||||||
* content:消息内容
|
|
||||||
**/
|
|
||||||
void sendSystemMsg(List<String> receiverIdList, String messageType, String title, String content, String messageUrl);
|
|
||||||
}
|
|
||||||
-22
@@ -1,22 +0,0 @@
|
|||||||
package com.jero.modules.docking.hiwork.service;
|
|
||||||
|
|
||||||
|
|
||||||
import com.jero.common.api.dto.message.HiworkTodoAdd;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/13 14:23
|
|
||||||
* @Description: 待办
|
|
||||||
*/
|
|
||||||
public interface IHiworkTodoService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/13 15:12
|
|
||||||
* @Description: 统一待办集成
|
|
||||||
**/
|
|
||||||
void sendTodoTask(List<HiworkTodoAdd> hiworkTodoAddList);
|
|
||||||
|
|
||||||
}
|
|
||||||
-152
@@ -1,152 +0,0 @@
|
|||||||
package com.jero.modules.docking.hiwork.service.impl;
|
|
||||||
|
|
||||||
import cn.hutool.core.annotation.Link;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.jero.common.exception.JeroBootException;
|
|
||||||
import com.jero.common.system.vo.LoginUser;
|
|
||||||
import com.jero.modules.docking.hiwork.entity.HiworkDingDingMsg;
|
|
||||||
import com.jero.modules.docking.hiwork.entity.HiworkSystemMsg;
|
|
||||||
import com.jero.modules.docking.hiwork.service.IHiworkMsgService;
|
|
||||||
import com.jero.modules.docking.hiwork.util.HiworkPostUtil;
|
|
||||||
import com.jero.common.api.vo.ResultCommon;
|
|
||||||
import com.jero.modules.system.entity.SysUser;
|
|
||||||
import com.jero.modules.system.service.ISysUserService;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.apache.shiro.SecurityUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/16 15:18
|
|
||||||
* @Description: 统一消息集成
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
@Slf4j
|
|
||||||
public class HiworkMsgServiceImpl implements IHiworkMsgService {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private HiworkPostUtil hiworkPostUtil;
|
|
||||||
@Autowired
|
|
||||||
private ISysUserService sysUserService;
|
|
||||||
|
|
||||||
private final static String TEXT = "text"; // 消息类型-文本
|
|
||||||
private final static String LINK = "link"; // 消息类型-文本
|
|
||||||
private final static String MSG_TYPE = "msgtype"; // 消息类型
|
|
||||||
private final static String CONTENT = "content"; // 消息内容
|
|
||||||
private final static String MESSAGE_URL = "messageUrl"; // 消息内容
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/16 15:32
|
|
||||||
* @Description: 发送钉钉消息
|
|
||||||
* senderIdList:发送人员id集合
|
|
||||||
* content:文本内容
|
|
||||||
**/
|
|
||||||
@Override
|
|
||||||
public void sendDingDingMsg(List<String> senderIdList, String title, String content, String messageUrl) {
|
|
||||||
HiworkDingDingMsg hiworkDingDingMsg = new HiworkDingDingMsg();
|
|
||||||
// 异步系统标识
|
|
||||||
hiworkDingDingMsg.setSysCode(HiworkPostUtil.getSysCode());
|
|
||||||
//服务号消息
|
|
||||||
hiworkDingDingMsg.setNoticeServiceCode(HiworkPostUtil.getServiceCode());
|
|
||||||
//消息推送类型
|
|
||||||
hiworkDingDingMsg.setNoticePushType(HiworkPostUtil.Ding);
|
|
||||||
|
|
||||||
if (CollectionUtils.isEmpty(senderIdList)) {
|
|
||||||
throw new JeroBootException(ResultCommon.EMPTY_COMMON, "senderIdList");
|
|
||||||
}
|
|
||||||
List<SysUser> senderUserList = sysUserService.listByIds(senderIdList);
|
|
||||||
List<String> usernameList = senderUserList.stream().map(SysUser::getUsername).collect(Collectors.toList());
|
|
||||||
// 发送人员id(工号以英文逗号分隔)
|
|
||||||
hiworkDingDingMsg.setUseridList(StringUtils.join(usernameList, ","));
|
|
||||||
// 标题
|
|
||||||
hiworkDingDingMsg.setTitle(title);
|
|
||||||
|
|
||||||
// 消息体
|
|
||||||
JSONObject msgJsonObject = new JSONObject();
|
|
||||||
msgJsonObject.put(MSG_TYPE, TEXT);
|
|
||||||
JSONObject textJsonObject = new JSONObject();
|
|
||||||
textJsonObject.put(CONTENT, content);
|
|
||||||
msgJsonObject.put(TEXT, textJsonObject);
|
|
||||||
hiworkDingDingMsg.setMsg(msgJsonObject);
|
|
||||||
|
|
||||||
log.info("发送Hiwork钉钉消息: {}", JSONObject.toJSONString(hiworkDingDingMsg));
|
|
||||||
|
|
||||||
hiworkPostUtil.postDingDingMsg(hiworkDingDingMsg);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/16 16:12
|
|
||||||
* @Description: 发送系统消息
|
|
||||||
* senderId:发送人员id
|
|
||||||
* receiverIdList:消息接收人id集合
|
|
||||||
* messageType:消息类型 字典
|
|
||||||
* title:消息标题
|
|
||||||
* content:消息内容
|
|
||||||
**/
|
|
||||||
@Override
|
|
||||||
public void sendSystemMsg(List<String> receiverIdList, String messageType, String title, String content, String messageUrl) {
|
|
||||||
HiworkSystemMsg hiworkSystemMsg = new HiworkSystemMsg();
|
|
||||||
|
|
||||||
// 异步系统标识
|
|
||||||
hiworkSystemMsg.setSysCode(HiworkPostUtil.getSysCode());
|
|
||||||
//消息推送类型
|
|
||||||
hiworkSystemMsg.setNoticePushType(HiworkPostUtil.Message);
|
|
||||||
|
|
||||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
|
||||||
// 发送人员编号
|
|
||||||
hiworkSystemMsg.setSendCode(loginUser.getUsername());
|
|
||||||
// 发送人员姓名
|
|
||||||
hiworkSystemMsg.setSendName(loginUser.getRealname());
|
|
||||||
// 消息标题
|
|
||||||
hiworkSystemMsg.setTitle(title);
|
|
||||||
// 消息类型
|
|
||||||
hiworkSystemMsg.setMessageType(messageType);
|
|
||||||
|
|
||||||
if (CollectionUtils.isEmpty(receiverIdList)) {
|
|
||||||
throw new JeroBootException(ResultCommon.EMPTY_COMMON, "receiverIdList");
|
|
||||||
}
|
|
||||||
List<SysUser> receiverUserList = sysUserService.listByIds(receiverIdList);
|
|
||||||
JSONArray jsonArray = new JSONArray();
|
|
||||||
receiverUserList.forEach(receiverUser -> {
|
|
||||||
Map<String, String> receiverMap = new HashMap<>();
|
|
||||||
// 人员编号
|
|
||||||
receiverMap.put("employeeNo", receiverUser.getUsername());
|
|
||||||
// 人员名称
|
|
||||||
receiverMap.put("userName", receiverUser.getRealname());
|
|
||||||
jsonArray.add(receiverMap);
|
|
||||||
});
|
|
||||||
// 消息接收人 集合
|
|
||||||
hiworkSystemMsg.setReceiverList(jsonArray);
|
|
||||||
|
|
||||||
// 消息体
|
|
||||||
JSONObject msgJsonObject = new JSONObject();
|
|
||||||
msgJsonObject.put(MSG_TYPE, TEXT);
|
|
||||||
|
|
||||||
JSONObject textJsonObject = new JSONObject();
|
|
||||||
textJsonObject.put(CONTENT, content);
|
|
||||||
|
|
||||||
JSONObject linkJsonObject = new JSONObject();
|
|
||||||
linkJsonObject.put(MESSAGE_URL, messageUrl);
|
|
||||||
|
|
||||||
msgJsonObject.put(TEXT, textJsonObject);
|
|
||||||
msgJsonObject.put(LINK, linkJsonObject);
|
|
||||||
|
|
||||||
hiworkSystemMsg.setMsg(msgJsonObject);
|
|
||||||
|
|
||||||
log.info("发送Hiwork系统消息: {}", JSONObject.toJSONString(hiworkSystemMsg));
|
|
||||||
|
|
||||||
hiworkPostUtil.postSystemMsg(hiworkSystemMsg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-51
@@ -1,51 +0,0 @@
|
|||||||
package com.jero.modules.docking.hiwork.service.impl;
|
|
||||||
|
|
||||||
import cn.hutool.http.HttpRequest;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.jero.common.api.vo.Result;
|
|
||||||
import com.jero.modules.docking.hiwork.entity.HiworkUserInfo;
|
|
||||||
import com.jero.modules.system.service.ILoginService;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author liJiaRao
|
|
||||||
* @date 2024-03-01 14:02
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Service
|
|
||||||
public class HiworkService {
|
|
||||||
@Resource
|
|
||||||
private ILoginService loginService;
|
|
||||||
|
|
||||||
@Value("${hiwork.appkey}")
|
|
||||||
private String appkey;
|
|
||||||
@Value("${hiwork.appsecret}")
|
|
||||||
private String appsecret;
|
|
||||||
|
|
||||||
public Result<JSONObject> login(JSONObject jsonObject) {
|
|
||||||
//根据appkey和appsecret获取accessToken
|
|
||||||
String url1 = "https://oapi.dingtalk.com/gettoken?appkey=" + appkey + "&appsecret=" + appsecret;
|
|
||||||
log.info("url:"+url1);
|
|
||||||
String body = HttpRequest.get(url1)
|
|
||||||
.execute().body();
|
|
||||||
JSONObject responseJson = JSONObject.parseObject(body);
|
|
||||||
log.info("responseJson:"+responseJson.toJSONString());
|
|
||||||
String accessToken = responseJson.getString("access_token");
|
|
||||||
//根据accessToken和前端传过来的jsonObject获得用户信息
|
|
||||||
String url2 = "https://oapi.dingtalk.com/topapi/v2/user/getuserinfo?access_token=" + accessToken;
|
|
||||||
log.info("url:"+url2);
|
|
||||||
String body1 = HttpRequest.post(url2)
|
|
||||||
//jsonObject中有code
|
|
||||||
.body(jsonObject.toJSONString())
|
|
||||||
.execute().body();
|
|
||||||
HiworkUserInfo hiworkUserInfo = JSONObject.parseObject(body1, HiworkUserInfo.class);
|
|
||||||
log.info("response:"+hiworkUserInfo.toString());
|
|
||||||
String userid = hiworkUserInfo.getResult().getUserid();
|
|
||||||
log.info("userid:"+userid);
|
|
||||||
return loginService.loginByUserName(userid);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-275
@@ -1,275 +0,0 @@
|
|||||||
package com.jero.modules.docking.hiwork.service.impl;
|
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.jero.common.api.PushWorkflowIntegrationAPI;
|
|
||||||
import com.jero.common.api.dto.message.HiworkTodoAdd;
|
|
||||||
import com.jero.common.api.vo.ResultCommon;
|
|
||||||
import com.jero.common.constant.enums.YesOrNoEnum;
|
|
||||||
import com.jero.common.exception.JeroBootException;
|
|
||||||
import com.jero.common.system.vo.LoginUser;
|
|
||||||
import com.jero.modules.activiti.entity.ProcessAll;
|
|
||||||
import com.jero.modules.activiti.entity.ProcessApprovalRecord;
|
|
||||||
import com.jero.modules.activiti.entity.ProcessNode;
|
|
||||||
import com.jero.modules.activiti.enums.ProcessTypeEnum;
|
|
||||||
import com.jero.modules.activiti.service.ProcessAllService;
|
|
||||||
import com.jero.modules.activiti.service.ProcessApprovalRecordService;
|
|
||||||
import com.jero.modules.activiti.service.ProcessNodeService;
|
|
||||||
import com.jero.modules.docking.hiwork.entity.HiworkTodo;
|
|
||||||
import com.jero.modules.docking.hiwork.util.HiworkPostUtil;
|
|
||||||
import com.jero.modules.system.entity.SysUser;
|
|
||||||
import com.jero.modules.system.service.ISysUserService;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
|
||||||
import org.apache.shiro.SecurityUtils;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.web.client.RestTemplate;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.time.Instant;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/13 14:23
|
|
||||||
* @Description: 待办
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Service
|
|
||||||
public class HiworkTodoServiceImpl implements PushWorkflowIntegrationAPI {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private ISysUserService sysUserService;
|
|
||||||
@Resource
|
|
||||||
private ProcessApprovalRecordService processApprovalRecordService;
|
|
||||||
@Resource
|
|
||||||
private HiworkPostUtil hiworkPostUtil;
|
|
||||||
@Resource
|
|
||||||
private ProcessNodeService processNodeService;
|
|
||||||
@Resource
|
|
||||||
private ProcessAllService processAllService;
|
|
||||||
@Resource
|
|
||||||
private RestTemplate restTemplate;
|
|
||||||
|
|
||||||
@Value("${hiwork.ip}")
|
|
||||||
private String ip;
|
|
||||||
@Value("${hiwork.todoUrl}")
|
|
||||||
private String todoUrl;
|
|
||||||
@Value("${hiwork.isWorkflow}")
|
|
||||||
private boolean isWorkflow;
|
|
||||||
@Value("${hiwork.sysCode}")
|
|
||||||
private String hiworkSysCode;
|
|
||||||
@Value("${hiwork.url}")
|
|
||||||
private String hiworkUrl;
|
|
||||||
@Value("${hiwork.fontUrl}")
|
|
||||||
private String hiworkFontUrl;
|
|
||||||
@Value("${hiwork.fontAppUrl}")
|
|
||||||
private String hiworkFontAppUrl;
|
|
||||||
|
|
||||||
|
|
||||||
private static final String PROCESS_TYPE = "srms";
|
|
||||||
private static final String TODO_TYPE_2 = "2";
|
|
||||||
private static final String TODO_TYPE_3 = "3";
|
|
||||||
private static final String TODO_TYPE_6 = "6";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/13 15:12
|
|
||||||
* @Description: 统一待办集成
|
|
||||||
**/
|
|
||||||
@Override
|
|
||||||
public void sendTodoTask(List<HiworkTodoAdd> hiworkTodoAddList) {
|
|
||||||
if(!isWorkflow){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CollectionUtils.isEmpty(hiworkTodoAddList)) {
|
|
||||||
throw new JeroBootException(ResultCommon.EMPTY_COMMON, "hiworkTodoAddList");
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
List<HiworkTodo> hiworkTodoList = getHiworkTodos(hiworkTodoAddList);
|
|
||||||
log.info("统一待办推送入参" + JSON.toJSONString(hiworkTodoList));
|
|
||||||
log.info("统一待办推送url" + ip + todoUrl);
|
|
||||||
// 远程调用
|
|
||||||
JSONObject json = restTemplate.postForObject(ip + todoUrl,hiworkTodoList, JSONObject.class);
|
|
||||||
if(!Objects.isNull(json) && json.containsKey("success") && Objects.equals("true",json.getString("success"))){
|
|
||||||
log.info("统一待办推送成功");
|
|
||||||
}else{
|
|
||||||
log.info("统一待办推送失败{}",json);
|
|
||||||
}
|
|
||||||
}catch (Exception e){
|
|
||||||
log.error("统一待办推送异常",e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void sendActivityComplete(List<HiworkTodoAdd> hiworkTodoAddList) {
|
|
||||||
if(!isWorkflow){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
for (HiworkTodoAdd hiworkTodoAdd : hiworkTodoAddList) {
|
|
||||||
hiworkTodoAdd.setType(TODO_TYPE_3);
|
|
||||||
}
|
|
||||||
List<HiworkTodo> hiworkTodoList = getHiworkTodos(hiworkTodoAddList);
|
|
||||||
log.info("统一待办推送入参" + JSON.toJSONString(hiworkTodoList));
|
|
||||||
log.info("统一待办推送url" + ip + todoUrl);
|
|
||||||
// 远程调用
|
|
||||||
JSONObject json = restTemplate.postForObject(ip + todoUrl,hiworkTodoList, JSONObject.class);
|
|
||||||
if(!Objects.isNull(json) && json.containsKey("success") && Objects.equals("true",json.getString("success"))){
|
|
||||||
log.info("统一待办推送成功");
|
|
||||||
}else{
|
|
||||||
log.info("统一待办推送失败{}",json);
|
|
||||||
}
|
|
||||||
}catch (Exception e){
|
|
||||||
log.error("统一待办推送异常",e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void sendDeleteTask(List<HiworkTodoAdd> hiworkTodoAddList) {
|
|
||||||
if(!isWorkflow){
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
for (HiworkTodoAdd hiworkTodoAdd : hiworkTodoAddList) {
|
|
||||||
hiworkTodoAdd.setType(TODO_TYPE_6);
|
|
||||||
}
|
|
||||||
List<HiworkTodo> hiworkTodoList = getHiworkTodos(hiworkTodoAddList);
|
|
||||||
log.info("统一待办删除推送入参" + JSON.toJSONString(hiworkTodoList));
|
|
||||||
log.info("统一待办推送url" + ip + todoUrl);
|
|
||||||
// 远程调用
|
|
||||||
JSONObject json = restTemplate.postForObject(ip + todoUrl,hiworkTodoList, JSONObject.class);
|
|
||||||
if(!Objects.isNull(json) && json.containsKey("success") && Objects.equals("true",json.getString("success"))){
|
|
||||||
log.info("统一待办删除推送成功");
|
|
||||||
}else{
|
|
||||||
log.info("统一待办删除推送失败{}",json);
|
|
||||||
}
|
|
||||||
}catch (Exception e){
|
|
||||||
log.error("统一待办删除推送异常",e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
|
||||||
private List<HiworkTodo> getHiworkTodos(List<HiworkTodoAdd> hiworkTodoAddList) {
|
|
||||||
List<HiworkTodo> hiworkTodoList = new ArrayList<>();
|
|
||||||
for (HiworkTodoAdd hiworkTodoAdd : hiworkTodoAddList) {
|
|
||||||
String recordId = hiworkTodoAdd.getRecordId();
|
|
||||||
String processDefinitionId = hiworkTodoAdd.getProcessDefinitionId();
|
|
||||||
String type = hiworkTodoAdd.getType();
|
|
||||||
ProcessApprovalRecord processApprovalRecord = processApprovalRecordService.getById(recordId);
|
|
||||||
if(Objects.isNull(processApprovalRecord)){
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
HiworkTodo hiworkTodo = new HiworkTodo();
|
|
||||||
hiworkTodo.setSysCode(hiworkSysCode);
|
|
||||||
|
|
||||||
String date = DateUtil.formatDateTime(new Date());
|
|
||||||
|
|
||||||
hiworkTodo.setFlowid(processApprovalRecord.getProcessInstanceId());
|
|
||||||
hiworkTodo.setProcessId(processApprovalRecord.getProcessInstanceId());
|
|
||||||
hiworkTodo.setProcessType(PROCESS_TYPE);
|
|
||||||
hiworkTodo.setTaskId(processApprovalRecord.getTaskId());
|
|
||||||
hiworkTodo.setTaskName(processApprovalRecord.getTaskName());
|
|
||||||
|
|
||||||
LambdaQueryWrapper<ProcessNode> wrapper = new LambdaQueryWrapper<>();
|
|
||||||
wrapper.eq(ProcessNode::getProcessDefinitionId,processDefinitionId);
|
|
||||||
wrapper.eq(ProcessNode::getNodeName,processApprovalRecord.getTaskName());
|
|
||||||
wrapper.eq(ProcessNode::getIsView, YesOrNoEnum.YES.getValue());
|
|
||||||
ProcessNode processNode = processNodeService.getOne(wrapper,false);
|
|
||||||
if(!Objects.isNull(processNode)){
|
|
||||||
if(processNode.getNodeName().contains("会签")){
|
|
||||||
|
|
||||||
}
|
|
||||||
hiworkTodo.setNodeBusiCode(processNode.getXmlNodeId());
|
|
||||||
// 是否显示(0否,1是)
|
|
||||||
hiworkTodo.setIsShow(String.valueOf(processNode.getIsView()));
|
|
||||||
}
|
|
||||||
String userId;
|
|
||||||
if (hiworkTodoAdd.getToUserId() == null){
|
|
||||||
userId = processApprovalRecord.getUserId();
|
|
||||||
}else {
|
|
||||||
userId = hiworkTodoAdd.getToUserId();
|
|
||||||
}
|
|
||||||
SysUser sysUser = sysUserService.getById(userId);
|
|
||||||
|
|
||||||
String noticeTitle = processApprovalRecord.getTaskName() + "(" + sysUser.getRealname() + " " + date + ")";
|
|
||||||
LambdaQueryWrapper<ProcessAll> queryProcessAll = new LambdaQueryWrapper<>();
|
|
||||||
queryProcessAll.eq(ProcessAll::getProcessInstanceId,processApprovalRecord.getProcessInstanceId());
|
|
||||||
ProcessAll processAll = processAllService.getOne(queryProcessAll);
|
|
||||||
if(!Objects.isNull(processAll)){
|
|
||||||
String processName = ProcessTypeEnum.getNameByValue(processAll.getPrcType());
|
|
||||||
noticeTitle = processName + "(" + sysUser.getRealname() + " " + date + ")";
|
|
||||||
hiworkTodo.setProcessName(processName);
|
|
||||||
|
|
||||||
SysUser createUser = sysUserService.getById(processAll.getCreateUserId());
|
|
||||||
if(!Objects.isNull(createUser)){
|
|
||||||
hiworkTodo.setCreateUserCode(createUser.getUsername());
|
|
||||||
hiworkTodo.setCreateUserName(createUser.getRealname());
|
|
||||||
}
|
|
||||||
if(!Objects.isNull(processAll.getDueTime())){
|
|
||||||
hiworkTodo.setDueTime(processAll.getDueTime().getTime());
|
|
||||||
}
|
|
||||||
String projectId = "";
|
|
||||||
if (StrUtil.isNotBlank(processAll.getProjectId())){
|
|
||||||
projectId = processAll.getProjectId();
|
|
||||||
}
|
|
||||||
hiworkTodo.setBid(projectId);
|
|
||||||
String url = hiworkFontUrl
|
|
||||||
//.replaceAll("&","%26")
|
|
||||||
//.replaceAll("\\?","%3F")
|
|
||||||
.replace("{projectId}",projectId)
|
|
||||||
.replace("{taskName}",processApprovalRecord.getTaskName())
|
|
||||||
.replace("{taskId}",processApprovalRecord.getTaskId())
|
|
||||||
.replace("{processInstanceId}",processApprovalRecord.getProcessInstanceId())
|
|
||||||
.replace("{nodeId}",processApprovalRecord.getNodeId());
|
|
||||||
// 跳转链接
|
|
||||||
String businessLink = Objects.requireNonNull(ProcessTypeEnum.getFontReturnUrlPc(processAll.getPrcType())) + url;
|
|
||||||
hiworkTodo.setBusinessLink(businessLink);
|
|
||||||
// APP跳转链接
|
|
||||||
String appUrl = hiworkFontAppUrl
|
|
||||||
//.replaceAll("&","%26")
|
|
||||||
//.replaceAll("\\?","%3F")
|
|
||||||
.replace("{projectId}",projectId)
|
|
||||||
.replace("{taskName}",processApprovalRecord.getTaskName())
|
|
||||||
.replace("{taskId}",processApprovalRecord.getTaskId())
|
|
||||||
.replace("{processInstanceId}",processApprovalRecord.getProcessInstanceId())
|
|
||||||
.replace("{nodeId}",processApprovalRecord.getNodeId());
|
|
||||||
String appBusinessLink = appUrl.replace("{url}", Objects.requireNonNull(ProcessTypeEnum.getFontReturnUrlPc(processAll.getPrcType())));
|
|
||||||
hiworkTodo.setAppBusinessLink(appBusinessLink);
|
|
||||||
}
|
|
||||||
hiworkTodo.setNoticeTitle(noticeTitle);
|
|
||||||
hiworkTodo.setUserId(userId);
|
|
||||||
hiworkTodo.setUserCode(sysUser.getUsername());
|
|
||||||
hiworkTodo.setUserName(sysUser.getRealname());
|
|
||||||
hiworkTodo.setReceiveTime(Instant.now());
|
|
||||||
//2已完成时进入下一节点
|
|
||||||
Integer finishFlag = processApprovalRecord.getFinishFlag();
|
|
||||||
if (finishFlag.equals(2)){
|
|
||||||
hiworkTodo.setMultiInstance(0);
|
|
||||||
}else {
|
|
||||||
hiworkTodo.setMultiInstance(1);
|
|
||||||
}
|
|
||||||
if (TODO_TYPE_3.equals(type)){
|
|
||||||
hiworkTodo.setIsTodo(TODO_TYPE_3);
|
|
||||||
}else if (TODO_TYPE_6.equals(type)){
|
|
||||||
hiworkTodo.setIsTodo(TODO_TYPE_6);
|
|
||||||
}else if (TODO_TYPE_2.equals(type)){
|
|
||||||
hiworkTodo.setIsTodo(TODO_TYPE_2);
|
|
||||||
}else {
|
|
||||||
hiworkTodo.setIsTodo(String.valueOf(finishFlag));
|
|
||||||
}
|
|
||||||
hiworkTodoList.add(hiworkTodo);
|
|
||||||
}
|
|
||||||
return hiworkTodoList;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
-127
@@ -1,127 +0,0 @@
|
|||||||
package com.jero.modules.docking.hiwork.service.impl;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.jero.common.api.dto.message.SendMessageDTO;
|
|
||||||
import com.jero.common.api.vo.SendMessageAPI;
|
|
||||||
import com.jero.common.exception.JeroBootException;
|
|
||||||
import com.jero.modules.docking.hiwork.handle.DingDingSendMsgHandle;
|
|
||||||
import com.jero.modules.docking.hiwork.handle.SystemSendMsgHandle;
|
|
||||||
import com.jero.modules.message.entity.SysMessageTemplate;
|
|
||||||
import com.jero.modules.message.handle.ISendMsgHandle;
|
|
||||||
import com.jero.modules.message.handle.impl.SmsSendMsgHandle;
|
|
||||||
import com.jero.modules.message.service.ISysMessageTemplateService;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.net.URLEncoder;
|
|
||||||
import java.nio.charset.CharsetEncoder;
|
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/17 11:23
|
|
||||||
* @Description: 发送消息
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Service
|
|
||||||
public class SendMessageServiceImpl implements SendMessageAPI {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private ISysMessageTemplateService sysMessageTemplateService;
|
|
||||||
@Value("${hiwork.isSend}")
|
|
||||||
private Boolean isSend;
|
|
||||||
@Value("${hiwork.hiworkUrlPrefix}")
|
|
||||||
private String hiworkUrlPrefix;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/17 11:25
|
|
||||||
* @Description: 根据模板发送消息
|
|
||||||
**/
|
|
||||||
@Override
|
|
||||||
public void sendMessage(SendMessageDTO sendMessageDTO) {
|
|
||||||
if (StringUtils.isEmpty(sendMessageDTO.getToUserId())) {
|
|
||||||
throw new JeroBootException("消息接收人id不能为空");
|
|
||||||
}
|
|
||||||
if (StringUtils.isEmpty(sendMessageDTO.getTemplateCode())) {
|
|
||||||
throw new JeroBootException("消息模板编码不能为空!");
|
|
||||||
}
|
|
||||||
|
|
||||||
LambdaQueryWrapper<SysMessageTemplate> query = new LambdaQueryWrapper<>();
|
|
||||||
query.eq(SysMessageTemplate::getTemplateCode, sendMessageDTO.getTemplateCode());
|
|
||||||
List<SysMessageTemplate> sysSmsTemplates = sysMessageTemplateService.list(query);
|
|
||||||
if (CollectionUtils.isEmpty(sysSmsTemplates)) {
|
|
||||||
throw new JeroBootException("消息模板不存在");
|
|
||||||
}
|
|
||||||
SysMessageTemplate sysMessageTemplate = sysSmsTemplates.get(0);
|
|
||||||
|
|
||||||
String openType = sysMessageTemplate.getOpenType();
|
|
||||||
String openPage = sysMessageTemplate.getOpenPage();
|
|
||||||
|
|
||||||
try {
|
|
||||||
// 替换模板内容
|
|
||||||
if (!Objects.isNull(sendMessageDTO.getMap())) {
|
|
||||||
Map<String, String> map = sendMessageDTO.getMap();
|
|
||||||
map.forEach((k, v) -> sysMessageTemplate.setTemplateContent(
|
|
||||||
sysMessageTemplate.getTemplateContent().replace("${" + k + "}", v)));
|
|
||||||
if (null != map.get("openType")) {
|
|
||||||
openType = map.get("openType");
|
|
||||||
}
|
|
||||||
if (null != map.get("openPage")) {
|
|
||||||
openPage = map.get("openPage");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
List<String> typeList = Arrays.asList(sysMessageTemplate.getTemplateType().split(","));
|
|
||||||
if (StrUtil.isNotBlank(openPage)) {
|
|
||||||
if (openPage.contains("/workCenter/processCenter/processCenter")) {
|
|
||||||
if (openPage.contains("?")) {
|
|
||||||
openPage = openPage + "&activeTab=TodoList";
|
|
||||||
} else {
|
|
||||||
openPage = openPage + "?activeTab=TodoList";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
String finalOpenType = openType;
|
|
||||||
String finalOpenPage = openPage;
|
|
||||||
typeList.forEach(type -> {
|
|
||||||
log.info("消息标题:{},消息内容:{},消息类型:{}", sysMessageTemplate.getTemplateName(), sysMessageTemplate.getTemplateContent(), type);
|
|
||||||
ISendMsgHandle sendMsgHandle;
|
|
||||||
if ("5".equals(type)) {
|
|
||||||
// Hiwork钉钉消息
|
|
||||||
sendMsgHandle = new DingDingSendMsgHandle();
|
|
||||||
if (isSend) {
|
|
||||||
sendMsgHandle.SendMsg(sendMessageDTO.getToUserId(), sysMessageTemplate.getTemplateName(), sysMessageTemplate.getTemplateContent(), null, null);
|
|
||||||
}
|
|
||||||
} else if ("6".equals(type)) {
|
|
||||||
// Hiwork系统消息
|
|
||||||
sendMsgHandle = new SystemSendMsgHandle();
|
|
||||||
if (isSend) {
|
|
||||||
String messageUrl = hiworkUrlPrefix + finalOpenPage;
|
|
||||||
sendMsgHandle.SendMsg(sendMessageDTO.getToUserId(), sysMessageTemplate.getTemplateName(), sysMessageTemplate.getTemplateContent(), finalOpenType, messageUrl);
|
|
||||||
}
|
|
||||||
} else if ("4".equals(type)) {
|
|
||||||
// 普通系统消息
|
|
||||||
sendMsgHandle = new SmsSendMsgHandle();
|
|
||||||
if (isSend) {
|
|
||||||
sendMsgHandle.SendMsg(sendMessageDTO.getToUserId(), sysMessageTemplate.getTemplateName(), sysMessageTemplate.getTemplateContent(), finalOpenType, finalOpenPage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("发送消息异常", e);
|
|
||||||
throw new JeroBootException("发送消息异常");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-147
@@ -1,147 +0,0 @@
|
|||||||
package com.jero.modules.docking.hiwork.util;
|
|
||||||
|
|
||||||
import cn.hutool.http.Header;
|
|
||||||
import cn.hutool.http.HttpResponse;
|
|
||||||
import cn.hutool.http.HttpUtil;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.jero.common.exception.JeroBootException;
|
|
||||||
import com.jero.modules.docking.hiwork.entity.HiworkResult;
|
|
||||||
import com.jero.modules.docking.hiwork.entity.HiworkTodo;
|
|
||||||
import com.jero.modules.docking.hiwork.entity.HiworkDingDingMsg;
|
|
||||||
import com.jero.modules.docking.hiwork.entity.HiworkSystemMsg;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.http.HttpEntity;
|
|
||||||
import org.springframework.http.HttpHeaders;
|
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
import org.springframework.web.client.RestTemplate;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static net.sf.jsqlparser.parser.feature.Feature.execute;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/13 16:55
|
|
||||||
* @Description: Hiwork集成
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
public class HiworkPostUtil {
|
|
||||||
@Autowired
|
|
||||||
private RestTemplate restTemplate;
|
|
||||||
@Value("${hiwork.ip}")
|
|
||||||
private String ip;
|
|
||||||
@Value("${hiwork.todoUrl}")
|
|
||||||
private String todoUrl;
|
|
||||||
@Value("${hiwork.messageUrl}")
|
|
||||||
private String messageUrl;
|
|
||||||
|
|
||||||
// 异构系统标识
|
|
||||||
private static String sysCode;
|
|
||||||
|
|
||||||
@Value("${hiwork.sysCode}")
|
|
||||||
public void setSysCode(String sysCode) {
|
|
||||||
HiworkPostUtil.sysCode = sysCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getSysCode() {
|
|
||||||
return sysCode;
|
|
||||||
}
|
|
||||||
// 异构系统标识
|
|
||||||
private static String serviceCode;
|
|
||||||
|
|
||||||
@Value("${hiwork.serviceCode}")
|
|
||||||
public void setServiceCode(String serviceCode) {
|
|
||||||
HiworkPostUtil.serviceCode = serviceCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getServiceCode() {
|
|
||||||
return serviceCode;
|
|
||||||
}
|
|
||||||
public static String Ding = "ding";
|
|
||||||
public static String Message = "message";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/13 17:45
|
|
||||||
* @Description: 远程调用Hiwork
|
|
||||||
**/
|
|
||||||
private void postHiwork(String jsonString, String url) {
|
|
||||||
log.info("远程调用Hiwork,url: {}, body: {}",url,jsonString);
|
|
||||||
// 设置请求头
|
|
||||||
HttpHeaders headers = new HttpHeaders();
|
|
||||||
headers.setContentType(MediaType.APPLICATION_JSON);
|
|
||||||
|
|
||||||
HttpEntity<String> requestEntity = new HttpEntity<>(jsonString, headers);
|
|
||||||
|
|
||||||
// 发送 POST 请求并获取响应
|
|
||||||
HttpResponse response = HttpUtil.createPost(url)
|
|
||||||
.header(Header.CONTENT_TYPE, "application/json")
|
|
||||||
.body(jsonString)
|
|
||||||
.execute();
|
|
||||||
// 处理响应数据
|
|
||||||
if (response.isOk()) {
|
|
||||||
String body = response.body();
|
|
||||||
HiworkResult hiworkResult = JSONObject.parseObject(body, HiworkResult.class);
|
|
||||||
if (!hiworkResult.getSuccess()) {
|
|
||||||
throw new JeroBootException("Hiwork:" + hiworkResult.getMsg());
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
throw new JeroBootException("Hiwork: request failed with status code: " + response.getStatus());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/13 17:45
|
|
||||||
* @Description: 统一待办集成远程调用
|
|
||||||
**/
|
|
||||||
public void postTodo(List<HiworkTodo> hiworkTodoList) {
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
String jsonString;
|
|
||||||
try {
|
|
||||||
jsonString = objectMapper.writeValueAsString(hiworkTodoList);
|
|
||||||
} catch (JsonProcessingException e) {
|
|
||||||
throw new JeroBootException("JSON string format conversion error");
|
|
||||||
}
|
|
||||||
postHiwork(jsonString, ip + todoUrl);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/13 17:45
|
|
||||||
* @Description: 统一消息集成远程调用-钉钉消息
|
|
||||||
**/
|
|
||||||
public void postDingDingMsg(HiworkDingDingMsg hiworkDingDingMsg) {
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
String jsonString;
|
|
||||||
try {
|
|
||||||
jsonString = objectMapper.writeValueAsString(hiworkDingDingMsg);
|
|
||||||
} catch (JsonProcessingException e) {
|
|
||||||
throw new JeroBootException("JSON string format conversion error");
|
|
||||||
}
|
|
||||||
postHiwork(jsonString, ip + messageUrl);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: liao
|
|
||||||
* @Date: 2023/10/13 17:45
|
|
||||||
* @Description: 统一消息集成远程调用-系统消息
|
|
||||||
**/
|
|
||||||
public void postSystemMsg(HiworkSystemMsg hiworkSystemMsg) {
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
String jsonString;
|
|
||||||
try {
|
|
||||||
jsonString = objectMapper.writeValueAsString(hiworkSystemMsg);
|
|
||||||
} catch (JsonProcessingException e) {
|
|
||||||
throw new JeroBootException("JSON string format conversion error");
|
|
||||||
}
|
|
||||||
postHiwork(jsonString, ip + messageUrl);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-35
@@ -1,35 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.annotation;
|
|
||||||
|
|
||||||
import java.lang.annotation.*;
|
|
||||||
|
|
||||||
@Target({ElementType.FIELD})
|
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
|
||||||
@Documented
|
|
||||||
@Inherited
|
|
||||||
public @interface IamProperty {
|
|
||||||
|
|
||||||
// /**
|
|
||||||
// * 字段属性名
|
|
||||||
// * @return
|
|
||||||
// */
|
|
||||||
// String name() default "";
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// *
|
|
||||||
// * @return
|
|
||||||
// */
|
|
||||||
// String type() default "";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 定义对象的属性字段在创建时是否为必填字段
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
boolean required() default true;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 定义对象的属性字段是否为多值
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
boolean multivalued() default false;
|
|
||||||
|
|
||||||
}
|
|
||||||
-322
@@ -1,322 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.client;
|
|
||||||
|
|
||||||
import cn.hutool.http.HttpUtil;
|
|
||||||
import com.bamboocloud.codec.BamboocloudFacade;
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.jero.common.util.DateUtils;
|
|
||||||
import com.jero.common.util.UUIDGenerator;
|
|
||||||
import com.jero.common.util.UUIDUtils;
|
|
||||||
import com.jero.modules.docking.iam.dto.IamCommonAcceptDto;
|
|
||||||
import com.jero.modules.docking.iam.dto.IamOrgAcceptDto;
|
|
||||||
import com.jero.modules.docking.iam.dto.IamUserAcceptDto;
|
|
||||||
import com.jero.modules.docking.iam.po.encrypt.AcceptEncryptPo;
|
|
||||||
import com.jero.modules.docking.iam.po.MessageHeader;
|
|
||||||
import com.jero.modules.docking.iam.po.encrypt.MessageEncryptTabels;
|
|
||||||
import com.jero.modules.docking.iam.po.encrypt.MessageEncryptTabelsHeader;
|
|
||||||
import com.jero.modules.docking.iam.po.encrypt.SendPoEncryptPo;
|
|
||||||
import com.jero.modules.docking.utils.BamboocloudUtils;
|
|
||||||
import com.jero.modules.docking.utils.DockingConstant;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 测试接口是否正确的客户端,mock IAM发送请求
|
|
||||||
*/
|
|
||||||
public class TestClient {
|
|
||||||
|
|
||||||
public static void main(String[] args) throws JsonProcessingException {
|
|
||||||
TestClient testClient = new TestClient();
|
|
||||||
// testClient.sendSchemaService(); // 字段映射接口测试
|
|
||||||
// for (int i = 0; i < 1; i++) {
|
|
||||||
// System.out.println(i);
|
|
||||||
// testClient.sendUserCreate(i);
|
|
||||||
// }
|
|
||||||
// 创建用户接口测试
|
|
||||||
// testClient.sendUserUpdate(); // 更新用户接口测试
|
|
||||||
// testClient.sendOrgCreate(); // 组织创建接口测试
|
|
||||||
// testClient.sendQueryAllUserIdsService(); // 查询所有用户ID接口测试
|
|
||||||
// testClient.sendQueryAllOrgIdsService(); // 查询所有组织ID接口测试
|
|
||||||
// testClient.sendQueryOrgByIdService(); // 查询指定id的组织数据测试
|
|
||||||
// testClient.sendQueryUserByIdService(); // 查询指定id的用户数据测试
|
|
||||||
testClient.decryptSting("8rAKWPUwkEZ3yYLy/1TuGGkIGCYtc+MD56pShLi97OmMttoFooo5GXZ/lY4NrQ5DiWmVUX23zqDwyQqufXLZNDU+KuJO/9UonpqUlZxM91w=");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void decryptSting(String encryptString) {
|
|
||||||
String decrypt = BamboocloudUtils.getPlaintext(encryptString, DockingConstant.IAM_ENCRYPT_SECRET, DockingConstant.IAM_ENCRYPT_TYPE);
|
|
||||||
System.out.println("解密后数据:" + decrypt);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 对数据解密
|
|
||||||
private void decryptData(String encryptData) throws JsonProcessingException {
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
SendPoEncryptPo sendPoEncryptPo = objectMapper.readValue(encryptData, SendPoEncryptPo.class);
|
|
||||||
String decrypt = BamboocloudUtils.getPlaintext(sendPoEncryptPo.getReturns().getData(), DockingConstant.IAM_ENCRYPT_SECRET, DockingConstant.IAM_ENCRYPT_TYPE);
|
|
||||||
|
|
||||||
System.out.println("解密后数据:" + decrypt);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 封装统一发送的PO层
|
|
||||||
* @param encryptData
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private AcceptEncryptPo handlerPoPackage(String encryptData) {
|
|
||||||
MessageHeader messageHeader = new MessageHeader();
|
|
||||||
messageHeader.setInterfaceID("SRMSUSERCREATE");
|
|
||||||
messageHeader.setUUID(UUIDGenerator.generate());
|
|
||||||
messageHeader.setMessageId(UUIDGenerator.generate());
|
|
||||||
messageHeader.setSender(DockingConstant.IAM_SYSTEM_NAME);
|
|
||||||
messageHeader.setReceiver(DockingConstant.SYSTEM_NAME);
|
|
||||||
|
|
||||||
Date curDate = new Date();
|
|
||||||
messageHeader.setSendDate(DateUtils.formatDate(curDate, "YYYYMMDD"));
|
|
||||||
messageHeader.setSendTime(DateUtils.formatDate(curDate, "HHmmss"));
|
|
||||||
|
|
||||||
MessageEncryptTabelsHeader messageEncryptTabelsHeader = new MessageEncryptTabelsHeader();
|
|
||||||
messageEncryptTabelsHeader.setData(encryptData);
|
|
||||||
|
|
||||||
MessageEncryptTabels messageEncryptTabels = new MessageEncryptTabels();
|
|
||||||
messageEncryptTabels.setHeader(messageEncryptTabelsHeader);
|
|
||||||
|
|
||||||
AcceptEncryptPo acceptEncryptPo = new AcceptEncryptPo();
|
|
||||||
acceptEncryptPo.setMessageHeader(messageHeader);
|
|
||||||
acceptEncryptPo.setMessageEncryptTabels(messageEncryptTabels);
|
|
||||||
|
|
||||||
return acceptEncryptPo;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Schema映射获取
|
|
||||||
*/
|
|
||||||
private void sendSchemaService() throws JsonProcessingException {
|
|
||||||
String url = "http://localhost:8184/laws-sinotruk/sync/iam/UserCreateService";
|
|
||||||
|
|
||||||
IamCommonAcceptDto iamCommonAcceptDto = new IamCommonAcceptDto();
|
|
||||||
iamCommonAcceptDto.setBimRequestId(UUIDUtils.randomUUID20());
|
|
||||||
iamCommonAcceptDto.setBimRemoteUser("srmsIam");
|
|
||||||
iamCommonAcceptDto.setBimRemotePwd("srmsIam2023");
|
|
||||||
|
|
||||||
// 加密数据
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
String sendData = objectMapper.writeValueAsString(iamCommonAcceptDto);
|
|
||||||
String encryptData = BamboocloudFacade.encrypt(sendData, DockingConstant.IAM_ENCRYPT_SECRET, DockingConstant.IAM_ENCRYPT_TYPE);
|
|
||||||
|
|
||||||
AcceptEncryptPo sendPoDataEntity = handlerPoPackage(encryptData);
|
|
||||||
String sendPoDataJson = objectMapper.writeValueAsString(sendPoDataEntity);
|
|
||||||
|
|
||||||
String response = HttpUtil.post(url, sendPoDataJson);
|
|
||||||
System.out.println("映射接口响应:" + response);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户创建测试
|
|
||||||
*/
|
|
||||||
private void sendUserCreate(int i) throws JsonProcessingException {
|
|
||||||
// 封装 IamUserAcceptDto 为用户数据层
|
|
||||||
IamUserAcceptDto iamUserAcceptDto = new IamUserAcceptDto();
|
|
||||||
iamUserAcceptDto.setSrmsCompanyCode("123");
|
|
||||||
iamUserAcceptDto.setSrmsOrgCode("123/321");
|
|
||||||
iamUserAcceptDto.setSrmsTypeId("001");
|
|
||||||
iamUserAcceptDto.setSrmsUsername((108088 + i) +"");
|
|
||||||
iamUserAcceptDto.setSrmsRealname("测试" + i);
|
|
||||||
iamUserAcceptDto.setSrmsPassword("1qaz@WSX");
|
|
||||||
iamUserAcceptDto.setSrmsSex("1"); // 男
|
|
||||||
iamUserAcceptDto.setSrmsPost("主任");
|
|
||||||
iamUserAcceptDto.setSrmsDutyLevelId("4"); // 主管级,srms不解析,直接存
|
|
||||||
iamUserAcceptDto.setSrmsDirectLeadership("1706939999105900545"); // 直接上级,不清楚应该存什么,暂时存为id(fcc-test)
|
|
||||||
iamUserAcceptDto.setSrmsPostStatus("1"); // 在岗,srms不解析,直接存
|
|
||||||
iamUserAcceptDto.setSrmsStatus("1"); // 1在册,0离职
|
|
||||||
iamUserAcceptDto.setSrmsOfficePhone("022-87648762");
|
|
||||||
iamUserAcceptDto.setSrmsPhone("13811112232");
|
|
||||||
iamUserAcceptDto.setSrmsEmail("test@sinotruk.com");
|
|
||||||
iamUserAcceptDto.setSrmsCreateTime("2023-10-15 10:35:20");
|
|
||||||
|
|
||||||
iamUserAcceptDto.setBimRequestId(UUIDUtils.randomUUID20());
|
|
||||||
iamUserAcceptDto.setBimRemoteUser("srmsIam");
|
|
||||||
iamUserAcceptDto.setBimRemotePwd("srmsIam2023");
|
|
||||||
|
|
||||||
// 加密数据
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
String sendData = objectMapper.writeValueAsString(iamUserAcceptDto);
|
|
||||||
String encryptData = BamboocloudFacade.encrypt(sendData, DockingConstant.IAM_ENCRYPT_SECRET, DockingConstant.IAM_ENCRYPT_TYPE);
|
|
||||||
|
|
||||||
// 封装 AcceptPoSystemPo 为PO层套壳
|
|
||||||
AcceptEncryptPo sendPoDataEntity = handlerPoPackage(encryptData);
|
|
||||||
String sendPoDataJson = objectMapper.writeValueAsString(sendPoDataEntity);
|
|
||||||
|
|
||||||
// 发送数据
|
|
||||||
String url = "http://localhost:8184/laws-sinotruk/sync/iam/UserCreateService";
|
|
||||||
// String url = "laws-test.sinotruk.com/laws-sinotruk/sync/iam/UserCreateService";
|
|
||||||
String response = HttpUtil.post(url, sendPoDataJson);
|
|
||||||
System.out.println("用户创建接口响应:" + response);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户更新测试
|
|
||||||
*/
|
|
||||||
private void sendUserUpdate() throws JsonProcessingException {
|
|
||||||
// 封装 IamUserAcceptDto 为用户数据层
|
|
||||||
IamUserAcceptDto iamUserAcceptDto = new IamUserAcceptDto();
|
|
||||||
iamUserAcceptDto.setBimUid("1709786346053017601"); // 数据库中取到的ID
|
|
||||||
iamUserAcceptDto.setSrmsPost("科长");
|
|
||||||
iamUserAcceptDto.setSrmsUpdateTime("2023-10-15 10:35:20"); // 测试不发送UpdateTime的情况
|
|
||||||
|
|
||||||
iamUserAcceptDto.setBimRequestId(UUIDUtils.randomUUID20());
|
|
||||||
iamUserAcceptDto.setBimRemoteUser("srmsIam");
|
|
||||||
iamUserAcceptDto.setBimRemotePwd("srmsIam2023");
|
|
||||||
|
|
||||||
// 加密数据
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
String sendData = objectMapper.writeValueAsString(iamUserAcceptDto);
|
|
||||||
String encryptData = BamboocloudFacade.encrypt(sendData, DockingConstant.IAM_ENCRYPT_SECRET, DockingConstant.IAM_ENCRYPT_TYPE);
|
|
||||||
|
|
||||||
// 封装 AcceptPoSystemPo 为PO层套壳
|
|
||||||
AcceptEncryptPo sendPoDataEntity = handlerPoPackage(encryptData);
|
|
||||||
String sendPoDataJson = objectMapper.writeValueAsString(sendPoDataEntity);
|
|
||||||
|
|
||||||
// 发送数据
|
|
||||||
String url = "http://localhost:8184/laws-sinotruk/sync/iam/UserUpdateService";
|
|
||||||
String response = HttpUtil.post(url, sendPoDataJson);
|
|
||||||
System.out.println("用户更新接口响应:" + response);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户创建测试
|
|
||||||
*/
|
|
||||||
private void sendOrgCreate() throws JsonProcessingException {
|
|
||||||
// 封装 IamUserAcceptDto 为用户数据层
|
|
||||||
IamOrgAcceptDto iamOrgAcceptDto = new IamOrgAcceptDto();
|
|
||||||
|
|
||||||
iamOrgAcceptDto.setSrmsOrgCode("IA00102");
|
|
||||||
iamOrgAcceptDto.setSrmsDepartName("测试IAM部门");
|
|
||||||
iamOrgAcceptDto.setSrmsParentCode("");
|
|
||||||
iamOrgAcceptDto.setSrmsCompany("测试公司");
|
|
||||||
iamOrgAcceptDto.setSrmsStatus("1");
|
|
||||||
iamOrgAcceptDto.setSrmsCreateTime("2023-10-12 10:35:20");
|
|
||||||
iamOrgAcceptDto.setSrmsType("002");
|
|
||||||
iamOrgAcceptDto.setSrmsOrgCategory("2");
|
|
||||||
|
|
||||||
iamOrgAcceptDto.setBimRequestId(UUIDUtils.randomUUID20());
|
|
||||||
iamOrgAcceptDto.setBimRemoteUser("srmsIam");
|
|
||||||
iamOrgAcceptDto.setBimRemotePwd("srmsIam2023");
|
|
||||||
|
|
||||||
// 加密数据
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
String sendData = objectMapper.writeValueAsString(iamOrgAcceptDto);
|
|
||||||
String encryptData = BamboocloudFacade.encrypt(sendData, DockingConstant.IAM_ENCRYPT_SECRET, DockingConstant.IAM_ENCRYPT_TYPE);
|
|
||||||
|
|
||||||
// 封装 AcceptPoSystemPo 为PO层套壳
|
|
||||||
AcceptEncryptPo sendPoDataEntity = handlerPoPackage(encryptData);
|
|
||||||
String sendPoDataJson = objectMapper.writeValueAsString(sendPoDataEntity);
|
|
||||||
|
|
||||||
// 发送数据
|
|
||||||
String url = "http://localhost:8184/laws-sinotruk/sync/iam/OrgCreateService";
|
|
||||||
String response = HttpUtil.post(url, sendPoDataJson);
|
|
||||||
System.out.println("组织创建接口响应:" + response);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取全部用户id
|
|
||||||
*/
|
|
||||||
private void sendQueryAllUserIdsService() throws JsonProcessingException {
|
|
||||||
String url = "http://localhost:8184/laws-sinotruk/sync/iam/QueryAllUserIdsService";
|
|
||||||
|
|
||||||
IamCommonAcceptDto iamCommonAcceptDto = new IamCommonAcceptDto();
|
|
||||||
iamCommonAcceptDto.setBimRequestId(UUIDUtils.randomUUID20());
|
|
||||||
iamCommonAcceptDto.setBimRemoteUser("srmsIam");
|
|
||||||
iamCommonAcceptDto.setBimRemotePwd("srmsIam2023");
|
|
||||||
|
|
||||||
// 加密数据
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
String sendData = objectMapper.writeValueAsString(iamCommonAcceptDto);
|
|
||||||
String encryptData = BamboocloudFacade.encrypt(sendData, DockingConstant.IAM_ENCRYPT_SECRET, DockingConstant.IAM_ENCRYPT_TYPE);
|
|
||||||
|
|
||||||
AcceptEncryptPo sendPoDataEntity = handlerPoPackage(encryptData);
|
|
||||||
String sendPoDataJson = objectMapper.writeValueAsString(sendPoDataEntity);
|
|
||||||
String response = HttpUtil.post(url, sendPoDataJson);
|
|
||||||
System.out.println("查询全部用户id接口响应:" + response);
|
|
||||||
|
|
||||||
this.decryptData(response);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取全部组织id
|
|
||||||
*/
|
|
||||||
private void sendQueryAllOrgIdsService() throws JsonProcessingException {
|
|
||||||
String url = "http://localhost:8184/laws-sinotruk/sync/iam/QueryAllOrgIdsService";
|
|
||||||
|
|
||||||
IamCommonAcceptDto iamCommonAcceptDto = new IamCommonAcceptDto();
|
|
||||||
iamCommonAcceptDto.setBimRequestId(UUIDUtils.randomUUID20());
|
|
||||||
iamCommonAcceptDto.setBimRemoteUser("srmsIam");
|
|
||||||
iamCommonAcceptDto.setBimRemotePwd("srmsIam2023");
|
|
||||||
|
|
||||||
// 加密数据
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
String sendData = objectMapper.writeValueAsString(iamCommonAcceptDto);
|
|
||||||
String encryptData = BamboocloudFacade.encrypt(sendData, DockingConstant.IAM_ENCRYPT_SECRET, DockingConstant.IAM_ENCRYPT_TYPE);
|
|
||||||
|
|
||||||
AcceptEncryptPo sendPoDataEntity = handlerPoPackage(encryptData);
|
|
||||||
String sendPoDataJson = objectMapper.writeValueAsString(sendPoDataEntity);
|
|
||||||
|
|
||||||
String response = HttpUtil.post(url, sendPoDataJson);
|
|
||||||
System.out.println("查询全部组织id接口响应:" + response);
|
|
||||||
|
|
||||||
this.decryptData(response);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户查询接口测试
|
|
||||||
*/
|
|
||||||
private void sendQueryUserByIdService() throws JsonProcessingException {
|
|
||||||
// 封装 IamUserAcceptDto 为用户数据层
|
|
||||||
IamUserAcceptDto iamUserAcceptDto = new IamUserAcceptDto();
|
|
||||||
iamUserAcceptDto.setBimUid("1709786346053017601"); // 数据库中取到的ID
|
|
||||||
iamUserAcceptDto.setBimRemoteUser("srmsIam");
|
|
||||||
iamUserAcceptDto.setBimRemotePwd("srmsIam2023");
|
|
||||||
|
|
||||||
// 加密数据
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
String sendData = objectMapper.writeValueAsString(iamUserAcceptDto);
|
|
||||||
String encryptData = BamboocloudFacade.encrypt(sendData, DockingConstant.IAM_ENCRYPT_SECRET, DockingConstant.IAM_ENCRYPT_TYPE);
|
|
||||||
|
|
||||||
// 封装 AcceptPoSystemPo 为PO层套壳
|
|
||||||
AcceptEncryptPo sendPoDataEntity = handlerPoPackage(encryptData);
|
|
||||||
String sendPoDataJson = objectMapper.writeValueAsString(sendPoDataEntity);
|
|
||||||
|
|
||||||
// 发送数据
|
|
||||||
String url = "http://localhost:8184/laws-sinotruk/sync/iam/QueryUserByIdService";
|
|
||||||
String response = HttpUtil.post(url, sendPoDataJson);
|
|
||||||
System.out.println("用户查询接口响应:" + response);
|
|
||||||
|
|
||||||
this.decryptData(response);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 组织查询接口测试
|
|
||||||
*/
|
|
||||||
private void sendQueryOrgByIdService() throws JsonProcessingException {
|
|
||||||
// 封装 IamUserAcceptDto 为用户数据层
|
|
||||||
IamOrgAcceptDto iamOrgAcceptDto = new IamOrgAcceptDto();
|
|
||||||
iamOrgAcceptDto.setBimOrgId("IA00102"); // 数据库中取到的ID
|
|
||||||
iamOrgAcceptDto.setBimRemoteUser("srmsIam");
|
|
||||||
iamOrgAcceptDto.setBimRemotePwd("srmsIam2023");
|
|
||||||
|
|
||||||
// 加密数据
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
String sendData = objectMapper.writeValueAsString(iamOrgAcceptDto);
|
|
||||||
String encryptData = BamboocloudFacade.encrypt(sendData, DockingConstant.IAM_ENCRYPT_SECRET, DockingConstant.IAM_ENCRYPT_TYPE);
|
|
||||||
|
|
||||||
// 封装 AcceptPoSystemPo 为PO层套壳
|
|
||||||
AcceptEncryptPo sendPoDataEntity = handlerPoPackage(encryptData);
|
|
||||||
String sendPoDataJson = objectMapper.writeValueAsString(sendPoDataEntity);
|
|
||||||
|
|
||||||
// 发送数据
|
|
||||||
String url = "http://localhost:8184/laws-sinotruk/sync/iam/QueryOrgByIdService";
|
|
||||||
String response = HttpUtil.post(url, sendPoDataJson);
|
|
||||||
System.out.println("组织查询接口响应:" + response);
|
|
||||||
|
|
||||||
this.decryptData(response);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
-35
@@ -1,35 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.controller;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.jero.common.api.vo.Result;
|
|
||||||
import com.jero.modules.system.entity.Oauth;
|
|
||||||
import com.jero.modules.system.service.ILoginService;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
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;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Author: yjz
|
|
||||||
* @Date: 2023/10/17/10:09
|
|
||||||
* @Description:
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/iam")
|
|
||||||
@Slf4j
|
|
||||||
public class IamLoginController {
|
|
||||||
private final ILoginService loginService;
|
|
||||||
|
|
||||||
public IamLoginController(ILoginService loginService) {
|
|
||||||
this.loginService = loginService;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("单点登录")
|
|
||||||
@PostMapping("/loginByOauth2")
|
|
||||||
public Result<JSONObject> loginByOauth2(@Validated @RequestBody Oauth oauth){
|
|
||||||
return loginService.loginByOauth2(oauth);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-599
@@ -1,599 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.controller;
|
|
||||||
|
|
||||||
import cn.hutool.core.text.CharSequenceUtil;
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.aliyun.oss.ServiceException;
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
|
||||||
import com.fasterxml.jackson.core.type.TypeReference;
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.jero.common.constant.CacheConstant;
|
|
||||||
import com.jero.modules.base.service.BaseCommonService;
|
|
||||||
import com.jero.modules.docking.iam.dto.IamCommonAcceptDto;
|
|
||||||
import com.jero.modules.docking.iam.dto.IamOrgAcceptDto;
|
|
||||||
import com.jero.modules.docking.iam.dto.IamUserAcceptDto;
|
|
||||||
import com.jero.modules.docking.iam.dto.bpmc.*;
|
|
||||||
import com.jero.modules.docking.iam.dto.response.*;
|
|
||||||
import com.jero.modules.docking.iam.exception.IamGlobalException;
|
|
||||||
import com.jero.modules.docking.iam.po.MessageHeader;
|
|
||||||
import com.jero.modules.docking.iam.po.decrypt.AcceptDecryptPo;
|
|
||||||
import com.jero.modules.docking.iam.po.encrypt.AcceptEncryptPo;
|
|
||||||
import com.jero.modules.docking.iam.po.encrypt.SendPoEncryptPo;
|
|
||||||
import com.jero.modules.docking.iam.service.SyncIamService;
|
|
||||||
import com.jero.modules.docking.utils.BamboocloudUtils;
|
|
||||||
import com.jero.modules.docking.utils.DockingConstant;
|
|
||||||
import com.jero.modules.docking.utils.SHA256Util;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.cache.annotation.CacheEvict;
|
|
||||||
import org.springframework.dao.DuplicateKeyException;
|
|
||||||
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 java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* IAM同步的控制器,提供用户、组织、菜单和权限的同步
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/sync/iam")
|
|
||||||
@Slf4j
|
|
||||||
public class SyncIamController {
|
|
||||||
|
|
||||||
@Value("${iam.bpmcAppkey}")
|
|
||||||
private String bpmcAppkey;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private SyncIamService syncIamService;
|
|
||||||
|
|
||||||
public final String paramNotGetError = "参数传递错误,未收到参数";
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private BaseCommonService baseCommonService;
|
|
||||||
|
|
||||||
@PostMapping({"/SchemaService"})
|
|
||||||
public SendPoEncryptPo schemaService(@RequestBody AcceptEncryptPo iamCommon) throws JsonProcessingException {
|
|
||||||
if (iamCommon == null
|
|
||||||
|| iamCommon.getMessageEncryptTabels() == null
|
|
||||||
|| iamCommon.getMessageEncryptTabels().getHeader() == null
|
|
||||||
|| iamCommon.getMessageEncryptTabels().getHeader().getData() == null){
|
|
||||||
throw new IamGlobalException(null, this.paramNotGetError);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 对核心数据解密
|
|
||||||
String bodyParam = iamCommon.getMessageEncryptTabels().getHeader().getData();
|
|
||||||
String bodyParamDecrypt = BamboocloudUtils.getPlaintext(bodyParam, DockingConstant.IAM_ENCRYPT_SECRET, DockingConstant.IAM_ENCRYPT_TYPE);
|
|
||||||
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
IamCommonAcceptDto commonAcceptDto = objectMapper.readValue(bodyParamDecrypt, IamCommonAcceptDto.class);
|
|
||||||
|
|
||||||
// 校验身份认证,确保接口正确 必须调用!
|
|
||||||
this.syncIamService.validateUserAndPwd(commonAcceptDto);
|
|
||||||
|
|
||||||
// 处理业务逻辑,封装字段
|
|
||||||
IamSchemaResponse iamSchemaResponse = this.syncIamService.getSchemaInfo(commonAcceptDto);
|
|
||||||
|
|
||||||
// 处理统一响应PO层,并加密业务字段
|
|
||||||
MessageHeader acceptMessageHeader = iamCommon.getMessageHeader();
|
|
||||||
SendPoEncryptPo sendPoEncryptPo = this.syncIamService.handlerGloablEncryptResponse(acceptMessageHeader, iamSchemaResponse);
|
|
||||||
|
|
||||||
return sendPoEncryptPo;
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping({"/UserCreateService"})
|
|
||||||
public SendPoEncryptPo userCreateService(@RequestBody AcceptEncryptPo iamUserInfo) throws JsonProcessingException {
|
|
||||||
log.info("进入账号创建");
|
|
||||||
IamUserAcceptDto userAcceptDto = null;
|
|
||||||
IamUserCreateResponse iamUserCreateResponse = new IamUserCreateResponse();
|
|
||||||
SendPoEncryptPo sendPoEncryptPo = new SendPoEncryptPo();
|
|
||||||
try {
|
|
||||||
if (iamUserInfo == null
|
|
||||||
|| iamUserInfo.getMessageEncryptTabels() == null
|
|
||||||
|| iamUserInfo.getMessageEncryptTabels().getHeader() == null
|
|
||||||
|| iamUserInfo.getMessageEncryptTabels().getHeader().getData() == null){
|
|
||||||
throw new IamGlobalException(null, "参数传递错误,未收到参数");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 对核心数据解密
|
|
||||||
String bodyParam = iamUserInfo.getMessageEncryptTabels().getHeader().getData();
|
|
||||||
String bodyParamDecrypt = BamboocloudUtils.getPlaintext(bodyParam, DockingConstant.IAM_ENCRYPT_SECRET, DockingConstant.IAM_ENCRYPT_TYPE);
|
|
||||||
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
userAcceptDto = objectMapper.readValue(bodyParamDecrypt, IamUserAcceptDto.class);
|
|
||||||
|
|
||||||
// 校验身份认证,确保接口正确 必须调用!
|
|
||||||
this.syncIamService.validateUserAndPwd(userAcceptDto);
|
|
||||||
iamUserCreateResponse.setBimRequestId(userAcceptDto.getBimRequestId());
|
|
||||||
// 处理业务逻辑,存储用户,返回用户id
|
|
||||||
iamUserCreateResponse = this.syncIamService.userCreateService(userAcceptDto);
|
|
||||||
} catch (ServiceException e) {
|
|
||||||
iamUserCreateResponse.setResultCode(DockingConstant.IAM_ERROR_RESULT_CODE);
|
|
||||||
String message = e.getErrorMessage();
|
|
||||||
iamUserCreateResponse.setMessage(message);
|
|
||||||
log.error(iamUserCreateResponse.getMessage());
|
|
||||||
}catch (Exception e){
|
|
||||||
iamUserCreateResponse.setResultCode(DockingConstant.IAM_ERROR_RESULT_CODE);
|
|
||||||
iamUserCreateResponse.setMessage("操作失败" + e.getMessage());
|
|
||||||
log.error(iamUserCreateResponse.getMessage());
|
|
||||||
}
|
|
||||||
// 处理统一响应PO层,并加密业务字段
|
|
||||||
MessageHeader acceptMessageHeader = iamUserInfo.getMessageHeader();
|
|
||||||
sendPoEncryptPo = this.syncIamService.handlerGloablEncryptResponse(acceptMessageHeader, iamUserCreateResponse);
|
|
||||||
return sendPoEncryptPo;
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping({"/UserUpdateService"})
|
|
||||||
public SendPoEncryptPo userUpdateService(@RequestBody AcceptEncryptPo iamUserInfo) throws JsonProcessingException {
|
|
||||||
IamCommonResponseDto iamCommonResponseDto = new IamCommonResponseDto();
|
|
||||||
try {
|
|
||||||
if (iamUserInfo == null
|
|
||||||
|| iamUserInfo.getMessageEncryptTabels() == null
|
|
||||||
|| iamUserInfo.getMessageEncryptTabels().getHeader() == null
|
|
||||||
|| iamUserInfo.getMessageEncryptTabels().getHeader().getData() == null){
|
|
||||||
throw new IamGlobalException(null, "参数传递错误,未收到参数");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 对核心数据解密
|
|
||||||
String bodyParam = iamUserInfo.getMessageEncryptTabels().getHeader().getData();
|
|
||||||
String bodyParamDecrypt = BamboocloudUtils.getPlaintext(bodyParam, DockingConstant.IAM_ENCRYPT_SECRET, DockingConstant.IAM_ENCRYPT_TYPE);
|
|
||||||
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
IamUserAcceptDto userAcceptDto = objectMapper.readValue(bodyParamDecrypt, IamUserAcceptDto.class);
|
|
||||||
|
|
||||||
// 校验身份认证,确保接口正确 必须调用!
|
|
||||||
this.syncIamService.validateUserAndPwd(userAcceptDto);
|
|
||||||
|
|
||||||
// 处理业务逻辑,存储用户,返回用户id
|
|
||||||
iamCommonResponseDto = this.syncIamService.userUpdateService(userAcceptDto);
|
|
||||||
iamCommonResponseDto.setBimRequestId(userAcceptDto.getBimRequestId());
|
|
||||||
}catch (IamGlobalException e){
|
|
||||||
iamCommonResponseDto.setResultCode(DockingConstant.IAM_ERROR_RESULT_CODE);
|
|
||||||
String message = e.getMessage();
|
|
||||||
iamCommonResponseDto.setMessage(message);
|
|
||||||
log.error(iamCommonResponseDto.getMessage());
|
|
||||||
}catch (Exception e){
|
|
||||||
iamCommonResponseDto.setResultCode(DockingConstant.IAM_ERROR_RESULT_CODE);
|
|
||||||
iamCommonResponseDto.setMessage("操作失败" + e.getMessage());
|
|
||||||
log.error(iamCommonResponseDto.getMessage());
|
|
||||||
}
|
|
||||||
// 处理统一响应PO层,并加密业务字段
|
|
||||||
MessageHeader acceptMessageHeader = iamUserInfo.getMessageHeader();
|
|
||||||
SendPoEncryptPo sendPoEncryptPo = this.syncIamService.handlerGloablEncryptResponse(acceptMessageHeader, iamCommonResponseDto);
|
|
||||||
return sendPoEncryptPo;
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping({"/UserDeleteService"})
|
|
||||||
public SendPoEncryptPo userDeleteService(@RequestBody AcceptEncryptPo iamUserInfo) throws JsonProcessingException {
|
|
||||||
IamCommonResponseDto iamCommonResponseDto = new IamCommonResponseDto();
|
|
||||||
try {
|
|
||||||
if (iamUserInfo == null
|
|
||||||
|| iamUserInfo.getMessageEncryptTabels() == null
|
|
||||||
|| iamUserInfo.getMessageEncryptTabels().getHeader() == null
|
|
||||||
|| iamUserInfo.getMessageEncryptTabels().getHeader().getData() == null){
|
|
||||||
throw new IamGlobalException(null, "参数传递错误,未收到参数");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 对核心数据解密
|
|
||||||
String bodyParam = iamUserInfo.getMessageEncryptTabels().getHeader().getData();
|
|
||||||
String bodyParamDecrypt = BamboocloudUtils.getPlaintext(bodyParam, DockingConstant.IAM_ENCRYPT_SECRET, DockingConstant.IAM_ENCRYPT_TYPE);
|
|
||||||
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
IamUserAcceptDto userAcceptDto = objectMapper.readValue(bodyParamDecrypt, IamUserAcceptDto.class);
|
|
||||||
|
|
||||||
// 校验身份认证,确保接口正确 必须调用!
|
|
||||||
this.syncIamService.validateUserAndPwd(userAcceptDto);
|
|
||||||
|
|
||||||
// 处理业务逻辑,存储用户,返回用户id
|
|
||||||
iamCommonResponseDto = this.syncIamService.userDeleteService(userAcceptDto);
|
|
||||||
iamCommonResponseDto.setBimRequestId(userAcceptDto.getBimRequestId());
|
|
||||||
}catch (IamGlobalException e){
|
|
||||||
iamCommonResponseDto.setResultCode(DockingConstant.IAM_ERROR_RESULT_CODE);
|
|
||||||
String message = e.getMessage();
|
|
||||||
iamCommonResponseDto.setMessage(message);
|
|
||||||
log.error(iamCommonResponseDto.getMessage());
|
|
||||||
}catch (Exception e){
|
|
||||||
iamCommonResponseDto.setResultCode(DockingConstant.IAM_ERROR_RESULT_CODE);
|
|
||||||
iamCommonResponseDto.setMessage("操作失败" + e.getMessage());
|
|
||||||
log.error(iamCommonResponseDto.getMessage());
|
|
||||||
}
|
|
||||||
// 处理统一响应PO层,并加密业务字段
|
|
||||||
MessageHeader acceptMessageHeader = iamUserInfo.getMessageHeader();
|
|
||||||
SendPoEncryptPo sendPoEncryptPo = this.syncIamService.handlerGloablEncryptResponse(acceptMessageHeader, iamCommonResponseDto);
|
|
||||||
return sendPoEncryptPo;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 组织创建和更新移除缓存
|
|
||||||
* @param iamOrgInfo
|
|
||||||
* @return
|
|
||||||
* @throws JsonProcessingException
|
|
||||||
*/
|
|
||||||
@PostMapping({"/OrgCreateService"})
|
|
||||||
@CacheEvict(value= {CacheConstant.SYS_DEPARTS_CACHE,CacheConstant.SYS_DEPART_IDS_CACHE}, allEntries=true)
|
|
||||||
public SendPoEncryptPo orgCreateService(@RequestBody AcceptEncryptPo iamOrgInfo) throws JsonProcessingException {
|
|
||||||
IamOrgAcceptDto orgAcceptDto = null;
|
|
||||||
try {
|
|
||||||
if (iamOrgInfo == null
|
|
||||||
|| iamOrgInfo.getMessageEncryptTabels() == null
|
|
||||||
|| iamOrgInfo.getMessageEncryptTabels().getHeader() == null
|
|
||||||
|| iamOrgInfo.getMessageEncryptTabels().getHeader().getData() == null){
|
|
||||||
throw new IamGlobalException(null, "参数传递错误,未收到参数");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 对核心数据解密
|
|
||||||
String bodyParam = iamOrgInfo.getMessageEncryptTabels().getHeader().getData();
|
|
||||||
String bodyParamDecrypt = BamboocloudUtils.getPlaintext(bodyParam, DockingConstant.IAM_ENCRYPT_SECRET, DockingConstant.IAM_ENCRYPT_TYPE);
|
|
||||||
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
orgAcceptDto = objectMapper.readValue(bodyParamDecrypt, IamOrgAcceptDto.class);
|
|
||||||
|
|
||||||
// 校验身份认证,确保接口正确 必须调用!
|
|
||||||
this.syncIamService.validateUserAndPwd(orgAcceptDto);
|
|
||||||
|
|
||||||
// 处理业务逻辑,存储组织,返回组织id
|
|
||||||
IamOrgCreateResponse iamOrgCreateResponse = this.syncIamService.orgCreateService(orgAcceptDto);
|
|
||||||
|
|
||||||
// 处理统一响应PO层,并加密业务字段
|
|
||||||
MessageHeader acceptMessageHeader = iamOrgInfo.getMessageHeader();
|
|
||||||
SendPoEncryptPo sendPoEncryptPo = this.syncIamService.handlerGloablEncryptResponse(acceptMessageHeader, iamOrgCreateResponse);
|
|
||||||
return sendPoEncryptPo;
|
|
||||||
} catch (DuplicateKeyException duplicateKeyException) {
|
|
||||||
log.error("数据库值重复:{}", duplicateKeyException.getMessage());
|
|
||||||
if (orgAcceptDto != null) {
|
|
||||||
throw new IamGlobalException(orgAcceptDto.getBimRequestId(), "数据库值重复,请检查组织编号【" + orgAcceptDto.getSrmsOrgCode() + "】是否异常");
|
|
||||||
} else {
|
|
||||||
throw new IamGlobalException(null, "未知异常,请联系管理员");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 组织创建和更新移除缓存
|
|
||||||
* @param iamOrgInfo
|
|
||||||
* @return
|
|
||||||
* @throws JsonProcessingException
|
|
||||||
*/
|
|
||||||
@PostMapping({"/OrgUpdateService"})
|
|
||||||
@CacheEvict(value= {CacheConstant.SYS_DEPARTS_CACHE,CacheConstant.SYS_DEPART_IDS_CACHE}, allEntries=true)
|
|
||||||
public SendPoEncryptPo orgUpdateService(@RequestBody AcceptEncryptPo iamOrgInfo) throws JsonProcessingException {
|
|
||||||
if (iamOrgInfo == null
|
|
||||||
|| iamOrgInfo.getMessageEncryptTabels() == null
|
|
||||||
|| iamOrgInfo.getMessageEncryptTabels().getHeader() == null
|
|
||||||
|| iamOrgInfo.getMessageEncryptTabels().getHeader().getData() == null){
|
|
||||||
throw new IamGlobalException(null, "参数传递错误,未收到参数");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 对核心数据解密
|
|
||||||
String bodyParam = iamOrgInfo.getMessageEncryptTabels().getHeader().getData();
|
|
||||||
String bodyParamDecrypt = BamboocloudUtils.getPlaintext(bodyParam, DockingConstant.IAM_ENCRYPT_SECRET, DockingConstant.IAM_ENCRYPT_TYPE);
|
|
||||||
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
IamOrgAcceptDto orgAcceptDto = objectMapper.readValue(bodyParamDecrypt, IamOrgAcceptDto.class);
|
|
||||||
|
|
||||||
// 校验身份认证,确保接口正确 必须调用!
|
|
||||||
this.syncIamService.validateUserAndPwd(orgAcceptDto);
|
|
||||||
|
|
||||||
// 处理业务逻辑,更新组织
|
|
||||||
IamCommonResponseDto iamCommonResponseDto = this.syncIamService.orgUpdateService(orgAcceptDto);
|
|
||||||
|
|
||||||
// 处理统一响应PO层,并加密业务字段
|
|
||||||
MessageHeader acceptMessageHeader = iamOrgInfo.getMessageHeader();
|
|
||||||
SendPoEncryptPo sendPoEncryptPo = this.syncIamService.handlerGloablEncryptResponse(acceptMessageHeader, iamCommonResponseDto);
|
|
||||||
|
|
||||||
return sendPoEncryptPo;
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping({"/OrgDeleteService"})
|
|
||||||
public SendPoEncryptPo orgDeleteService(@RequestBody AcceptEncryptPo iamOrgInfo) throws JsonProcessingException {
|
|
||||||
if (iamOrgInfo == null
|
|
||||||
|| iamOrgInfo.getMessageEncryptTabels() == null
|
|
||||||
|| iamOrgInfo.getMessageEncryptTabels().getHeader() == null
|
|
||||||
|| iamOrgInfo.getMessageEncryptTabels().getHeader().getData() == null){
|
|
||||||
throw new IamGlobalException(null, "参数传递错误,未收到参数");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 对核心数据解密
|
|
||||||
String bodyParam = iamOrgInfo.getMessageEncryptTabels().getHeader().getData();
|
|
||||||
String bodyParamDecrypt = BamboocloudUtils.getPlaintext(bodyParam, DockingConstant.IAM_ENCRYPT_SECRET, DockingConstant.IAM_ENCRYPT_TYPE);
|
|
||||||
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
IamOrgAcceptDto orgAcceptDto = objectMapper.readValue(bodyParamDecrypt, IamOrgAcceptDto.class);
|
|
||||||
|
|
||||||
// 校验身份认证,确保接口正确 必须调用!
|
|
||||||
this.syncIamService.validateUserAndPwd(orgAcceptDto);
|
|
||||||
|
|
||||||
// 处理业务逻辑,更新组织
|
|
||||||
IamCommonResponseDto iamCommonResponseDto = this.syncIamService.orgDeleteService(orgAcceptDto);
|
|
||||||
|
|
||||||
// 处理统一响应PO层,并加密业务字段
|
|
||||||
MessageHeader acceptMessageHeader = iamOrgInfo.getMessageHeader();
|
|
||||||
SendPoEncryptPo sendPoEncryptPo = this.syncIamService.handlerGloablEncryptResponse(acceptMessageHeader, iamCommonResponseDto);
|
|
||||||
|
|
||||||
return sendPoEncryptPo;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 对接统一权限服务平台。
|
|
||||||
* 该接口包含角色创建、菜单创建、角色菜单关联、用户角色关联等4个接口
|
|
||||||
* 通过type字段来区分
|
|
||||||
*/
|
|
||||||
@PostMapping({"/bpmcCreate"})
|
|
||||||
public SendPoEncryptPo bpmcCreate(@RequestBody AcceptDecryptPo acceptDecryptPo) throws JsonProcessingException {
|
|
||||||
if (acceptDecryptPo == null
|
|
||||||
|| acceptDecryptPo.getMessageDecryptTabels() == null
|
|
||||||
|| acceptDecryptPo.getMessageDecryptTabels().getHeader() == null){
|
|
||||||
throw new IamGlobalException(null, "参数传递错误,未收到参数");
|
|
||||||
}
|
|
||||||
|
|
||||||
log.info("统一权限服务平台请求数据:{}", acceptDecryptPo.toString());
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
BpmcAcceptDto bpmcAcceptDto = objectMapper.readValue(acceptDecryptPo.getMessageDecryptTabels().getHeader().getData(), BpmcAcceptDto.class);
|
|
||||||
|
|
||||||
MessageHeader messageHeader = acceptDecryptPo.getMessageHeader();
|
|
||||||
BpmcResponseDto bpmcResponseDto = BpmcResponseDto.success();
|
|
||||||
SendPoEncryptPo sendPoEncryptPo = new SendPoEncryptPo();
|
|
||||||
|
|
||||||
if (CharSequenceUtil.isEmpty(bpmcAcceptDto.getType())){
|
|
||||||
bpmcResponseDto.setResultCode(DockingConstant.IAM_ERROR_RESULT_CODE);
|
|
||||||
bpmcResponseDto.setMessage("接口类型(type)未传参,请检查");
|
|
||||||
log.error(bpmcResponseDto.getMessage());
|
|
||||||
sendPoEncryptPo = this.syncIamService.handlerGloablEncryptResponse(messageHeader, bpmcResponseDto);
|
|
||||||
sendPoEncryptPo.getReturns().setData(JSON.toJSONString(bpmcResponseDto));
|
|
||||||
return sendPoEncryptPo;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CharSequenceUtil.isEmpty(bpmcAcceptDto.getEntity())){
|
|
||||||
bpmcResponseDto.setResultCode(DockingConstant.IAM_ERROR_RESULT_CODE);
|
|
||||||
bpmcResponseDto.setMessage("数据实体(entity)未传参,请检查");
|
|
||||||
log.error(bpmcResponseDto.getMessage());
|
|
||||||
sendPoEncryptPo = this.syncIamService.handlerGloablEncryptResponse(messageHeader, bpmcResponseDto);
|
|
||||||
sendPoEncryptPo.getReturns().setData(JSON.toJSONString(bpmcResponseDto));
|
|
||||||
return sendPoEncryptPo;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CharSequenceUtil.isEmpty(bpmcAcceptDto.getAction())){
|
|
||||||
bpmcResponseDto.setResultCode(DockingConstant.IAM_ERROR_RESULT_CODE);
|
|
||||||
bpmcResponseDto.setMessage("操作方式(action)未传参,请检查");
|
|
||||||
log.error(bpmcResponseDto.getMessage());
|
|
||||||
sendPoEncryptPo = this.syncIamService.handlerGloablEncryptResponse(messageHeader, bpmcResponseDto);
|
|
||||||
sendPoEncryptPo.getReturns().setData(JSON.toJSONString(bpmcResponseDto));
|
|
||||||
return sendPoEncryptPo;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (CharSequenceUtil.isEmpty(bpmcAcceptDto.getSignature())){
|
|
||||||
bpmcResponseDto.setResultCode(DockingConstant.IAM_ERROR_RESULT_CODE);
|
|
||||||
bpmcResponseDto.setMessage("签名(signature)未传参,请检查");
|
|
||||||
log.error(bpmcResponseDto.getMessage());
|
|
||||||
sendPoEncryptPo = this.syncIamService.handlerGloablEncryptResponse(messageHeader, bpmcResponseDto);
|
|
||||||
sendPoEncryptPo.getReturns().setData(JSON.toJSONString(bpmcResponseDto));
|
|
||||||
return sendPoEncryptPo;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 验证签名
|
|
||||||
String validateSign = SHA256Util.getSHA256StrJava(bpmcAcceptDto.getEntity() + bpmcAppkey + bpmcAcceptDto.getTimestamp());
|
|
||||||
if (!bpmcAcceptDto.getSignature().equals(validateSign)){
|
|
||||||
bpmcResponseDto.setResultCode(DockingConstant.IAM_ERROR_RESULT_CODE);
|
|
||||||
bpmcResponseDto.setMessage("签名校验不通过,请检查");
|
|
||||||
log.error(bpmcResponseDto.getMessage());
|
|
||||||
sendPoEncryptPo = this.syncIamService.handlerGloablEncryptResponse(messageHeader, bpmcResponseDto);
|
|
||||||
sendPoEncryptPo.getReturns().setData(JSON.toJSONString(bpmcResponseDto));
|
|
||||||
return sendPoEncryptPo;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
switch (bpmcAcceptDto.getType()){
|
|
||||||
// 角色
|
|
||||||
case DockingConstant.BPMC_TYPE_ROLE:
|
|
||||||
bpmcResponseDto = bpmcTypeRole(objectMapper, bpmcAcceptDto, bpmcResponseDto);
|
|
||||||
break;
|
|
||||||
|
|
||||||
// 菜单
|
|
||||||
case DockingConstant.BPMC_TYPE_RESOURCE:
|
|
||||||
bpmcResponseDto = bpmcTypeResource(objectMapper, bpmcAcceptDto, bpmcResponseDto);
|
|
||||||
break;
|
|
||||||
|
|
||||||
// 用户角色关联
|
|
||||||
case DockingConstant.BPMC_TYPE_USER_ROLE:
|
|
||||||
bpmcResponseDto = bpmcTypeUserRole(objectMapper, bpmcAcceptDto, bpmcResponseDto);
|
|
||||||
break;
|
|
||||||
|
|
||||||
// 角色菜单关联
|
|
||||||
case DockingConstant.BPMC_TYPE_ROLE_RESOURCE:
|
|
||||||
bpmcResponseDto = bpmcTypeRoleResource(objectMapper, bpmcAcceptDto, bpmcResponseDto);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
bpmcResponseDto = BpmcResponseDto.error("接口类型(type)未找到,请检查");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}catch (Exception e){
|
|
||||||
e.printStackTrace();
|
|
||||||
log.error(e.getMessage());
|
|
||||||
bpmcResponseDto = BpmcResponseDto.error(e.getMessage());
|
|
||||||
}
|
|
||||||
log.info(bpmcResponseDto.getMessage());
|
|
||||||
sendPoEncryptPo = this.syncIamService.handlerGloablEncryptResponse(messageHeader, bpmcResponseDto);
|
|
||||||
sendPoEncryptPo.getReturns().setData(JSON.toJSONString(bpmcResponseDto));
|
|
||||||
return sendPoEncryptPo;
|
|
||||||
}
|
|
||||||
|
|
||||||
private BpmcResponseDto bpmcTypeRoleResource(ObjectMapper objectMapper, BpmcAcceptDto bpmcAcceptDto, BpmcResponseDto bpmcResponseDto) throws JsonProcessingException {
|
|
||||||
List<RoleResourceDto> roleResourceDtoList = objectMapper.readValue(bpmcAcceptDto.getEntity(), new TypeReference<List<RoleResourceDto>>() {});
|
|
||||||
// 根据新增/删除调用不同的业务处理代码
|
|
||||||
if (bpmcAcceptDto.getAction().equals(DockingConstant.BPMC_ACTION_ADD)){
|
|
||||||
bpmcResponseDto = this.syncIamService.roleResourceCreateService(roleResourceDtoList);
|
|
||||||
} else if (bpmcAcceptDto.getAction().equals(DockingConstant.BPMC_ACTION_DELETE)) {
|
|
||||||
bpmcResponseDto = this.syncIamService.roleResourceDeleteService(roleResourceDtoList);
|
|
||||||
}
|
|
||||||
return bpmcResponseDto;
|
|
||||||
}
|
|
||||||
|
|
||||||
private BpmcResponseDto bpmcTypeUserRole(ObjectMapper objectMapper, BpmcAcceptDto bpmcAcceptDto, BpmcResponseDto bpmcResponseDto) throws JsonProcessingException {
|
|
||||||
List<UserRoleDto> userRoleDtoList = objectMapper.readValue(bpmcAcceptDto.getEntity(), new TypeReference<List<UserRoleDto>>() {});
|
|
||||||
// 根据新增/删除调用不同的业务处理代码
|
|
||||||
if (bpmcAcceptDto.getAction().equals(DockingConstant.BPMC_ACTION_ADD)){
|
|
||||||
bpmcResponseDto = this.syncIamService.userRoleCreateService(userRoleDtoList);
|
|
||||||
} else if (bpmcAcceptDto.getAction().equals(DockingConstant.BPMC_ACTION_DELETE)) {
|
|
||||||
bpmcResponseDto = this.syncIamService.userRoleDeleteService(userRoleDtoList);
|
|
||||||
}
|
|
||||||
return bpmcResponseDto;
|
|
||||||
}
|
|
||||||
|
|
||||||
private BpmcResponseDto bpmcTypeResource(ObjectMapper objectMapper, BpmcAcceptDto bpmcAcceptDto, BpmcResponseDto bpmcResponseDto) throws JsonProcessingException {
|
|
||||||
ResourceDto resourceDto = objectMapper.readValue(bpmcAcceptDto.getEntity(), ResourceDto.class);
|
|
||||||
// 根据新增/编辑/删除调用不同的业务处理代码
|
|
||||||
if (bpmcAcceptDto.getAction().equals(DockingConstant.BPMC_ACTION_ADD)){
|
|
||||||
bpmcResponseDto = this.syncIamService.resourceCreateService(resourceDto);
|
|
||||||
} else if (bpmcAcceptDto.getAction().equals(DockingConstant.BPMC_ACTION_UPDATE)) {
|
|
||||||
bpmcResponseDto = this.syncIamService.resourceUpdateService(resourceDto);
|
|
||||||
} else if (bpmcAcceptDto.getAction().equals(DockingConstant.BPMC_ACTION_DELETE)) {
|
|
||||||
bpmcResponseDto = this.syncIamService.resourceDeleteService(resourceDto);
|
|
||||||
}
|
|
||||||
return bpmcResponseDto;
|
|
||||||
}
|
|
||||||
|
|
||||||
private BpmcResponseDto bpmcTypeRole(ObjectMapper objectMapper, BpmcAcceptDto bpmcAcceptDto, BpmcResponseDto bpmcResponseDto) throws JsonProcessingException {
|
|
||||||
RoleDto roleDto = objectMapper.readValue(bpmcAcceptDto.getEntity(), RoleDto.class);
|
|
||||||
// 根据新增/编辑/删除调用不同的业务处理代码
|
|
||||||
if (bpmcAcceptDto.getAction().equals(DockingConstant.BPMC_ACTION_ADD)){
|
|
||||||
bpmcResponseDto = this.syncIamService.roleCreateService(roleDto);
|
|
||||||
} else if (bpmcAcceptDto.getAction().equals(DockingConstant.BPMC_ACTION_UPDATE)) {
|
|
||||||
bpmcResponseDto = this.syncIamService.roleUpdateService(roleDto);
|
|
||||||
} else if (bpmcAcceptDto.getAction().equals(DockingConstant.BPMC_ACTION_DELETE)) {
|
|
||||||
bpmcResponseDto = this.syncIamService.roleDeleteService(roleDto);
|
|
||||||
}
|
|
||||||
return bpmcResponseDto;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部用户id
|
|
||||||
* @param iamCommon
|
|
||||||
* @return
|
|
||||||
* @throws JsonProcessingException
|
|
||||||
*/
|
|
||||||
@PostMapping({"/QueryAllUserIdsService"})
|
|
||||||
public SendPoEncryptPo QueryAllUserIdsService(@RequestBody AcceptEncryptPo iamCommon) throws JsonProcessingException {
|
|
||||||
if (iamCommon == null
|
|
||||||
|| iamCommon.getMessageEncryptTabels() == null
|
|
||||||
|| iamCommon.getMessageEncryptTabels().getHeader() == null
|
|
||||||
|| iamCommon.getMessageEncryptTabels().getHeader().getData() == null){
|
|
||||||
throw new IamGlobalException(null, this.paramNotGetError);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 对核心数据解密
|
|
||||||
String bodyParam = iamCommon.getMessageEncryptTabels().getHeader().getData();
|
|
||||||
String bodyParamDecrypt = BamboocloudUtils.getPlaintext(bodyParam, DockingConstant.IAM_ENCRYPT_SECRET, DockingConstant.IAM_ENCRYPT_TYPE);
|
|
||||||
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
IamCommonAcceptDto commonAcceptDto = objectMapper.readValue(bodyParamDecrypt, IamCommonAcceptDto.class);
|
|
||||||
|
|
||||||
// 校验身份认证,确保接口正确 必须调用!
|
|
||||||
this.syncIamService.validateUserAndPwd(commonAcceptDto);
|
|
||||||
|
|
||||||
// 处理业务逻辑,封装字段
|
|
||||||
IamUserIdListResponse userIdListResponse = this.syncIamService.getAllUserIds(commonAcceptDto);
|
|
||||||
|
|
||||||
// 处理统一响应PO层,并加密业务字段
|
|
||||||
MessageHeader acceptMessageHeader = iamCommon.getMessageHeader();
|
|
||||||
SendPoEncryptPo sendPoEncryptPo = this.syncIamService.handlerGloablEncryptResponse(acceptMessageHeader, userIdListResponse);
|
|
||||||
|
|
||||||
return sendPoEncryptPo;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部组织id
|
|
||||||
* @param iamCommon
|
|
||||||
* @return
|
|
||||||
* @throws JsonProcessingException
|
|
||||||
*/
|
|
||||||
@PostMapping({"/QueryAllOrgIdsService"})
|
|
||||||
public SendPoEncryptPo QueryAllOrgIdsService(@RequestBody AcceptEncryptPo iamCommon) throws JsonProcessingException {
|
|
||||||
if (iamCommon == null
|
|
||||||
|| iamCommon.getMessageEncryptTabels() == null
|
|
||||||
|| iamCommon.getMessageEncryptTabels().getHeader() == null
|
|
||||||
|| iamCommon.getMessageEncryptTabels().getHeader().getData() == null){
|
|
||||||
throw new IamGlobalException(null, this.paramNotGetError);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 对核心数据解密
|
|
||||||
String bodyParam = iamCommon.getMessageEncryptTabels().getHeader().getData();
|
|
||||||
String bodyParamDecrypt = BamboocloudUtils.getPlaintext(bodyParam, DockingConstant.IAM_ENCRYPT_SECRET, DockingConstant.IAM_ENCRYPT_TYPE);
|
|
||||||
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
IamCommonAcceptDto commonAcceptDto = objectMapper.readValue(bodyParamDecrypt, IamCommonAcceptDto.class);
|
|
||||||
|
|
||||||
// 校验身份认证,确保接口正确 必须调用!
|
|
||||||
this.syncIamService.validateUserAndPwd(commonAcceptDto);
|
|
||||||
|
|
||||||
// 处理业务逻辑,封装字段
|
|
||||||
IamOrgIdListResponse orgIdListResponse = this.syncIamService.getAllOrgIds(commonAcceptDto);
|
|
||||||
|
|
||||||
// 处理统一响应PO层,并加密业务字段
|
|
||||||
MessageHeader acceptMessageHeader = iamCommon.getMessageHeader();
|
|
||||||
SendPoEncryptPo sendPoEncryptPo = this.syncIamService.handlerGloablEncryptResponse(acceptMessageHeader, orgIdListResponse);
|
|
||||||
|
|
||||||
return sendPoEncryptPo;
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping({"/QueryUserByIdService"})
|
|
||||||
public SendPoEncryptPo QueryUserByIdService(@RequestBody AcceptEncryptPo iamUserInfo) throws JsonProcessingException {
|
|
||||||
if (iamUserInfo == null
|
|
||||||
|| iamUserInfo.getMessageEncryptTabels() == null
|
|
||||||
|| iamUserInfo.getMessageEncryptTabels().getHeader() == null
|
|
||||||
|| iamUserInfo.getMessageEncryptTabels().getHeader().getData() == null){
|
|
||||||
throw new IamGlobalException(null, "参数传递错误,未收到参数");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 对核心数据解密
|
|
||||||
String bodyParam = iamUserInfo.getMessageEncryptTabels().getHeader().getData();
|
|
||||||
String bodyParamDecrypt = BamboocloudUtils.getPlaintext(bodyParam, DockingConstant.IAM_ENCRYPT_SECRET, DockingConstant.IAM_ENCRYPT_TYPE);
|
|
||||||
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
IamUserAcceptDto userAcceptDto = objectMapper.readValue(bodyParamDecrypt, IamUserAcceptDto.class);
|
|
||||||
|
|
||||||
// 校验身份认证,确保接口正确 必须调用!
|
|
||||||
this.syncIamService.validateUserAndPwd(userAcceptDto);
|
|
||||||
|
|
||||||
// 处理业务逻辑,存储用户,返回用户id
|
|
||||||
IamUserInfoResponse iamUserInfoResponse = this.syncIamService.getUserInfoById(userAcceptDto);
|
|
||||||
|
|
||||||
// 处理统一响应PO层,并加密业务字段
|
|
||||||
MessageHeader acceptMessageHeader = iamUserInfo.getMessageHeader();
|
|
||||||
SendPoEncryptPo sendPoEncryptPo = this.syncIamService.handlerGloablEncryptResponse(acceptMessageHeader, iamUserInfoResponse);
|
|
||||||
|
|
||||||
return sendPoEncryptPo;
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping({"/QueryOrgByIdService"})
|
|
||||||
public SendPoEncryptPo QueryOrgByIdService(@RequestBody AcceptEncryptPo iamUserInfo) throws JsonProcessingException {
|
|
||||||
if (iamUserInfo == null
|
|
||||||
|| iamUserInfo.getMessageEncryptTabels() == null
|
|
||||||
|| iamUserInfo.getMessageEncryptTabels().getHeader() == null
|
|
||||||
|| iamUserInfo.getMessageEncryptTabels().getHeader().getData() == null){
|
|
||||||
throw new IamGlobalException(null, "参数传递错误,未收到参数");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 对核心数据解密
|
|
||||||
String bodyParam = iamUserInfo.getMessageEncryptTabels().getHeader().getData();
|
|
||||||
String bodyParamDecrypt = BamboocloudUtils.getPlaintext(bodyParam, DockingConstant.IAM_ENCRYPT_SECRET, DockingConstant.IAM_ENCRYPT_TYPE);
|
|
||||||
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
IamOrgAcceptDto orgAcceptDto = objectMapper.readValue(bodyParamDecrypt, IamOrgAcceptDto.class);
|
|
||||||
|
|
||||||
// 校验身份认证,确保接口正确 必须调用!
|
|
||||||
this.syncIamService.validateUserAndPwd(orgAcceptDto);
|
|
||||||
|
|
||||||
// 处理业务逻辑,存储用户,返回用户id
|
|
||||||
IamOrgInfoResponse iamOrgInfoResponse = this.syncIamService.getOrgInfoById(orgAcceptDto);
|
|
||||||
|
|
||||||
// 处理统一响应PO层,并加密业务字段
|
|
||||||
MessageHeader acceptMessageHeader = iamUserInfo.getMessageHeader();
|
|
||||||
SendPoEncryptPo sendPoEncryptPo = this.syncIamService.handlerGloablEncryptResponse(acceptMessageHeader, iamOrgInfoResponse);
|
|
||||||
|
|
||||||
return sendPoEncryptPo;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
-31
@@ -1,31 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.dto;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.ToString;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* IAM的通用Dto,存放IAM接口的非业务通用属性。接口呗请求时会带着该参数
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@ToString
|
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
|
||||||
public class IamCommonAcceptDto {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* BIM每次调用生成的随机ID,应用系统每次响应返回此ID
|
|
||||||
*/
|
|
||||||
private String bimRequestId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*BIM调用三方应用接口的授权账号,由应用分配给BIM系统
|
|
||||||
*/
|
|
||||||
private String bimRemoteUser ;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* BIM调用三方应用接口的密码,由应用分配给BIM系统
|
|
||||||
*/
|
|
||||||
private String bimRemotePwd;
|
|
||||||
|
|
||||||
}
|
|
||||||
-91
@@ -1,91 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.dto;
|
|
||||||
|
|
||||||
import com.jero.modules.docking.iam.annotation.IamProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.ToString;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* IAM的组织实体,接收IAM传递的组织数据
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@ToString
|
|
||||||
public class IamOrgAcceptDto extends IamCommonAcceptDto {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 组织的id,在删除或编辑的接口会传递
|
|
||||||
*/
|
|
||||||
private String bimOrgId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 机构编码.全集团唯一,不可重复,撤销后不可重新启用
|
|
||||||
*/
|
|
||||||
@IamProperty(required = true, multivalued = false)
|
|
||||||
private String srmsOrgCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 组织名称
|
|
||||||
*/
|
|
||||||
@IamProperty(required = true, multivalued = false)
|
|
||||||
private String srmsDepartName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 父级机构编码.当前组织所属的父节点code
|
|
||||||
*/
|
|
||||||
@IamProperty(required = true, multivalued = false)
|
|
||||||
private String srmsParentCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 所属单位,10位HR机构编号
|
|
||||||
*/
|
|
||||||
@IamProperty(required = true, multivalued = false)
|
|
||||||
private String srmsCompany;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 机构状态
|
|
||||||
*/
|
|
||||||
@IamProperty(required = true, multivalued = false)
|
|
||||||
private String srmsStatus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 机构类型。001内部机构 002 外部机构 003 虚拟机构
|
|
||||||
*/
|
|
||||||
@IamProperty(required = true, multivalued = false)
|
|
||||||
private String srmsType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 组织类型。1.单位 2.部门。单位下可以有单位,但是部门下不能有单位
|
|
||||||
*/
|
|
||||||
@IamProperty(required = true, multivalued = false)
|
|
||||||
private String srmsOrgCategory;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
@IamProperty(required = true, multivalued = false)
|
|
||||||
private String srmsCreateTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新时间
|
|
||||||
*/
|
|
||||||
@IamProperty(required = true, multivalued = false)
|
|
||||||
private String srmsUpdateTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 部门负责人
|
|
||||||
*/
|
|
||||||
@IamProperty(required = false, multivalued = false)
|
|
||||||
private String srmsHeadOfDepartment;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分管领导
|
|
||||||
*/
|
|
||||||
@IamProperty(required = false, multivalued = false)
|
|
||||||
private String srmsLeadersInCharge;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 副职领导
|
|
||||||
*/
|
|
||||||
@IamProperty(required = false, multivalued = false)
|
|
||||||
private String srmsDeputyLeader;
|
|
||||||
|
|
||||||
}
|
|
||||||
-121
@@ -1,121 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.dto;
|
|
||||||
|
|
||||||
import com.jero.modules.docking.iam.annotation.IamProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.ToString;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* IAM的用户实体,接收IAM传递的用户数据
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@ToString
|
|
||||||
public class IamUserAcceptDto extends IamCommonAcceptDto {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户的id,在删除或编辑的接口会传递
|
|
||||||
*/
|
|
||||||
private String bimUid;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 单位编码
|
|
||||||
*/
|
|
||||||
@IamProperty(required = true, multivalued = false)
|
|
||||||
private String srmsCompanyCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 部门编码,用于做人员和组织的关联
|
|
||||||
*/
|
|
||||||
@IamProperty(required = true, multivalued = false)
|
|
||||||
private String srmsOrgCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 人员类型
|
|
||||||
*/
|
|
||||||
@IamProperty(required = true, multivalued = false)
|
|
||||||
private String srmsTypeId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 工号
|
|
||||||
*/
|
|
||||||
@IamProperty(required = true, multivalued = false)
|
|
||||||
private String srmsUsername;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 姓名
|
|
||||||
*/
|
|
||||||
@IamProperty(required = true, multivalued = false)
|
|
||||||
private String srmsRealname;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 密码
|
|
||||||
*/
|
|
||||||
@IamProperty(required = false, multivalued = false)
|
|
||||||
private String srmsPassword;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 性别
|
|
||||||
*/
|
|
||||||
@IamProperty(required = true, multivalued = false)
|
|
||||||
private String srmsSex;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 岗位
|
|
||||||
*/
|
|
||||||
@IamProperty(required = true, multivalued = false)
|
|
||||||
private String srmsPost;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 职务级别
|
|
||||||
*/
|
|
||||||
@IamProperty(required = true, multivalued = false)
|
|
||||||
private String srmsDutyLevelId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 直接上级
|
|
||||||
*/
|
|
||||||
@IamProperty(required = true, multivalued = false)
|
|
||||||
private String srmsDirectLeadership;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 岗位状态
|
|
||||||
*/
|
|
||||||
@IamProperty(required = true, multivalued = false)
|
|
||||||
private String srmsPostStatus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否在册
|
|
||||||
*/
|
|
||||||
@IamProperty(required = true, multivalued = false)
|
|
||||||
private String srmsStatus;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 办公电话
|
|
||||||
*/
|
|
||||||
@IamProperty(required = true, multivalued = false)
|
|
||||||
private String srmsOfficePhone;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 移动电话
|
|
||||||
*/
|
|
||||||
@IamProperty(required = true, multivalued = false)
|
|
||||||
private String srmsPhone;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 电子邮件
|
|
||||||
*/
|
|
||||||
@IamProperty(required = true, multivalued = false)
|
|
||||||
private String srmsEmail;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
@IamProperty(required = true, multivalued = false)
|
|
||||||
private String srmsCreateTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新时间
|
|
||||||
*/
|
|
||||||
@IamProperty(required = true, multivalued = false)
|
|
||||||
private String srmsUpdateTime;
|
|
||||||
|
|
||||||
}
|
|
||||||
-50
@@ -1,50 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.dto.bpmc;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.ToString;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 和竹云统一权限服务平台对接的实体
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@ToString
|
|
||||||
public class BpmcAcceptDto {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 角色:D_AR (本系统对接)
|
|
||||||
* 功能权限:D_AM (本系统对接)
|
|
||||||
* 账号与应用角色关系: R_USER_AR (本系统对接)
|
|
||||||
* 应用角色与应用功能权限关系:R_AR_AM (本系统对接)
|
|
||||||
* 账号与功能权限关系:R_USER_AM
|
|
||||||
* 群组与应用角色关系:R_ACCSET_AR
|
|
||||||
* 群组与功能权限关系:R_ACCSET_AM
|
|
||||||
* 机构/岗位与应用角色关系:R_USERSET_AR
|
|
||||||
* 机构/岗位与功能权限关系:R_USERSET_AM
|
|
||||||
*/
|
|
||||||
private String type;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 后续基础数据接口、权限关系接口章节中对应操作的entity JSON格式数据字符串
|
|
||||||
*/
|
|
||||||
private String entity;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 操作方式
|
|
||||||
* 基础数据接口:(add:新增;delete:删除;update:更新)
|
|
||||||
* 关系数据接口:
|
|
||||||
* (add:新增;delete:删除;)
|
|
||||||
*/
|
|
||||||
private String action;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求签名,计算方式
|
|
||||||
* SHA256 (entity+appKey+timestamp)
|
|
||||||
*/
|
|
||||||
private String signature;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 时间戳
|
|
||||||
*/
|
|
||||||
private long timestamp;
|
|
||||||
|
|
||||||
}
|
|
||||||
-112
@@ -1,112 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.dto.bpmc;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 统一权限服务平台的菜单实体
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
|
||||||
public class ResourceDto {
|
|
||||||
|
|
||||||
private String id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 功能编码
|
|
||||||
*/
|
|
||||||
private String code;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 父级id
|
|
||||||
*/
|
|
||||||
private String parentId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 功能名称
|
|
||||||
*/
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 对应前端组件
|
|
||||||
*/
|
|
||||||
private String component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 描述
|
|
||||||
*/
|
|
||||||
private String description;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 一级菜单跳转地址
|
|
||||||
*/
|
|
||||||
private String redirect;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 路径
|
|
||||||
*/
|
|
||||||
private String url;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 类型(0:一级菜单; 1:子菜单:2:按钮权限)
|
|
||||||
*/
|
|
||||||
private int menu_type;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 排序号
|
|
||||||
*/
|
|
||||||
private Integer sort;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 菜单英文
|
|
||||||
*/
|
|
||||||
private String menu_en;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 菜单是否为路径菜单(默认值为1)
|
|
||||||
*/
|
|
||||||
private Integer is_route;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 打开外部链接菜单的方式(默认值为0)
|
|
||||||
*/
|
|
||||||
private Integer internal_or_external;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 菜单是否隐藏(默认值为0)
|
|
||||||
*/
|
|
||||||
private Integer hidden;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 菜单是否需要缓存(默认值为0)
|
|
||||||
*/
|
|
||||||
private Integer keep_alive;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建人
|
|
||||||
*/
|
|
||||||
private String createBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改时间
|
|
||||||
*/
|
|
||||||
private Date modifyTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 最近修改人
|
|
||||||
*/
|
|
||||||
private String modifyBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 应用id
|
|
||||||
*/
|
|
||||||
private String appId;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.dto.bpmc;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 统一权限服务平台的角色实体
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
|
||||||
public class RoleDto {
|
|
||||||
|
|
||||||
private String id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 角色编码
|
|
||||||
*/
|
|
||||||
private String code;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 角色名称
|
|
||||||
*/
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 描述
|
|
||||||
*/
|
|
||||||
private String description;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 排序号
|
|
||||||
*/
|
|
||||||
private int sort;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建人
|
|
||||||
*/
|
|
||||||
private String createBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改时间
|
|
||||||
*/
|
|
||||||
private Date modifyTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 最近修改人
|
|
||||||
*/
|
|
||||||
private String modifyBy;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 应用id
|
|
||||||
*/
|
|
||||||
private String appId;
|
|
||||||
|
|
||||||
}
|
|
||||||
-53
@@ -1,53 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.dto.bpmc;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 统一权限服务平台的 角色-菜单关联 实体
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
|
||||||
public class RoleResourceDto {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 角色id
|
|
||||||
*/
|
|
||||||
private String arId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 角色名称
|
|
||||||
*/
|
|
||||||
private String arName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 角色编码
|
|
||||||
*/
|
|
||||||
private String arCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 菜单id
|
|
||||||
*/
|
|
||||||
private String amId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 菜单名称
|
|
||||||
*/
|
|
||||||
private String amName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 菜单编码
|
|
||||||
*/
|
|
||||||
private String amCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 菜单类型(0 菜单 、1行为)
|
|
||||||
*/
|
|
||||||
private int amType;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 菜单code绝对路径
|
|
||||||
*/
|
|
||||||
private String codePath;
|
|
||||||
|
|
||||||
}
|
|
||||||
-48
@@ -1,48 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.dto.bpmc;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 统一权限服务平台的 用户-角色关联 实体
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
|
||||||
public class UserRoleDto {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户ID
|
|
||||||
*/
|
|
||||||
private String userId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 账号名
|
|
||||||
*/
|
|
||||||
private String accountCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 账号id
|
|
||||||
*/
|
|
||||||
private String accountId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 姓名
|
|
||||||
*/
|
|
||||||
private String fullName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 角色id
|
|
||||||
*/
|
|
||||||
private String arId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 角色编码
|
|
||||||
*/
|
|
||||||
private String arCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 角色名称
|
|
||||||
*/
|
|
||||||
private String arName;
|
|
||||||
|
|
||||||
}
|
|
||||||
-35
@@ -1,35 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.dto.response;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class BpmcResponseDto {
|
|
||||||
|
|
||||||
private String resultCode;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "{" +
|
|
||||||
"resultCode:'" + resultCode + '\'' +
|
|
||||||
", message:'" + message + '\'' +
|
|
||||||
'}';
|
|
||||||
}
|
|
||||||
|
|
||||||
private String message;
|
|
||||||
public static BpmcResponseDto success(){
|
|
||||||
BpmcResponseDto bpmcResponseDto = new BpmcResponseDto();
|
|
||||||
bpmcResponseDto.resultCode = "200"; // 成功时固定为200
|
|
||||||
bpmcResponseDto.message = "操作成功";
|
|
||||||
|
|
||||||
return bpmcResponseDto;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static BpmcResponseDto error(String message){
|
|
||||||
BpmcResponseDto bpmcResponseDto = new BpmcResponseDto();
|
|
||||||
bpmcResponseDto.resultCode = "500"; // 失败时固定为500
|
|
||||||
bpmcResponseDto.message = message;
|
|
||||||
|
|
||||||
return bpmcResponseDto;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
-26
@@ -1,26 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.dto.response;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* IAM出SchemaService外的成功响应 或 失败响应 通用报文
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class IamCommonResponseDto {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求id,收到什么就返回什么
|
|
||||||
*/
|
|
||||||
private String bimRequestId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 相应码,0位正常
|
|
||||||
*/
|
|
||||||
private String resultCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 消息
|
|
||||||
*/
|
|
||||||
private String message;
|
|
||||||
|
|
||||||
}
|
|
||||||
-16
@@ -1,16 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.dto.response;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 组织机构创建的响应体
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class IamOrgCreateResponse extends IamCommonResponseDto{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户创建后生成的id
|
|
||||||
*/
|
|
||||||
private String orgId;
|
|
||||||
|
|
||||||
}
|
|
||||||
-18
@@ -1,18 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.dto.response;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 组织机构创建的响应体
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class IamOrgIdListResponse extends IamCommonResponseDto{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户创建后生成的id
|
|
||||||
*/
|
|
||||||
private List<String> orgIdList;
|
|
||||||
|
|
||||||
}
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.dto.response;
|
|
||||||
|
|
||||||
import com.jero.modules.docking.iam.dto.IamOrgAcceptDto;
|
|
||||||
import com.jero.modules.docking.iam.dto.IamUserAcceptDto;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 组织机构创建的响应体
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class IamOrgInfoResponse extends IamCommonResponseDto{
|
|
||||||
|
|
||||||
private IamOrgAcceptDto organization;
|
|
||||||
|
|
||||||
}
|
|
||||||
-28
@@ -1,28 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.dto.response;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Schema映射的响应体
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class IamSchemaResponse {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求id,收到什么就返回什么
|
|
||||||
*/
|
|
||||||
private String bimRequestId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户账号的具体内容响应实体
|
|
||||||
*/
|
|
||||||
private List<SchemaResponseInner> account;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 组织机构的具体内容响应实体
|
|
||||||
*/
|
|
||||||
private List<SchemaResponseInner> organization;
|
|
||||||
|
|
||||||
}
|
|
||||||
-16
@@ -1,16 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.dto.response;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户创建的响应体
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class IamUserCreateResponse extends IamCommonResponseDto{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户创建后生成的id
|
|
||||||
*/
|
|
||||||
private String uid;
|
|
||||||
|
|
||||||
}
|
|
||||||
-18
@@ -1,18 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.dto.response;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 组织机构创建的响应体
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class IamUserIdListResponse extends IamCommonResponseDto{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户创建后生成的id
|
|
||||||
*/
|
|
||||||
private List<String> userIdList;
|
|
||||||
|
|
||||||
}
|
|
||||||
-16
@@ -1,16 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.dto.response;
|
|
||||||
|
|
||||||
import com.jero.modules.docking.iam.dto.IamUserAcceptDto;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 组织机构创建的响应体
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class IamUserInfoResponse extends IamCommonResponseDto{
|
|
||||||
|
|
||||||
private IamUserAcceptDto account;
|
|
||||||
|
|
||||||
}
|
|
||||||
-31
@@ -1,31 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.dto.response;
|
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Schema的核心内容
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class SchemaResponseInner {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 定义对象的属性字段名称
|
|
||||||
*/
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 定义对象的属性字段类型,可选值为String、int、double、float、long、byte、boolean
|
|
||||||
*/
|
|
||||||
private String type;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 定义对象的属性字段在创建时是否为必填字段。可选值true或者false
|
|
||||||
*/
|
|
||||||
private boolean required;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 定义对象的属性字段是否为多值。可选值true或者false。字段为boolean类型
|
|
||||||
*/
|
|
||||||
private boolean multivalued;
|
|
||||||
|
|
||||||
}
|
|
||||||
-27
@@ -1,27 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.exception;
|
|
||||||
|
|
||||||
import com.jero.common.util.MessageUtils;
|
|
||||||
|
|
||||||
public class IamGlobalException extends RuntimeException {
|
|
||||||
|
|
||||||
private String bimRequestId;
|
|
||||||
private String message;
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 3634632351214L;
|
|
||||||
|
|
||||||
public IamGlobalException(String bimRequestId, String message){
|
|
||||||
super(message);
|
|
||||||
this.bimRequestId = bimRequestId;
|
|
||||||
this.message = message;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getBimRequestId() {
|
|
||||||
return bimRequestId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String getMessage() {
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
-39
@@ -1,39 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.exception;
|
|
||||||
|
|
||||||
import com.jero.common.api.vo.Result;
|
|
||||||
import com.jero.common.exception.JeroBootException;
|
|
||||||
import com.jero.modules.docking.iam.dto.response.IamCommonResponseDto;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.apache.poi.ss.formula.functions.T;
|
|
||||||
import org.apache.shiro.authz.AuthorizationException;
|
|
||||||
import org.apache.shiro.authz.UnauthorizedException;
|
|
||||||
import org.springframework.dao.DataIntegrityViolationException;
|
|
||||||
import org.springframework.dao.DuplicateKeyException;
|
|
||||||
import org.springframework.data.redis.connection.PoolException;
|
|
||||||
import org.springframework.web.HttpRequestMethodNotSupportedException;
|
|
||||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
|
||||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
|
||||||
import org.springframework.web.multipart.MaxUploadSizeExceededException;
|
|
||||||
import org.springframework.web.servlet.NoHandlerFoundException;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* IAM对接全局异常处理器
|
|
||||||
*/
|
|
||||||
@RestControllerAdvice
|
|
||||||
@Slf4j
|
|
||||||
public class IamGlobalExceptionHandler {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理自定义异常
|
|
||||||
*/
|
|
||||||
@ExceptionHandler(IamGlobalException.class)
|
|
||||||
public IamCommonResponseDto handleJeroBootException(IamGlobalException e){
|
|
||||||
IamCommonResponseDto iamCommonResponseDto = new IamCommonResponseDto();
|
|
||||||
iamCommonResponseDto.setBimRequestId(e.getBimRequestId());
|
|
||||||
iamCommonResponseDto.setResultCode("-1"); // 错误码统一为-1
|
|
||||||
iamCommonResponseDto.setMessage(e.getMessage());
|
|
||||||
|
|
||||||
return iamCommonResponseDto;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.po;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* PO系统交互必须的实体,包含接口传递的基本信息头
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class MessageHeader {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 接口ID
|
|
||||||
*/
|
|
||||||
@JsonProperty("Interface_ID")
|
|
||||||
private String interfaceID;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* UUID
|
|
||||||
*/
|
|
||||||
@JsonProperty("UUID")
|
|
||||||
private String UUID;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 消息Id
|
|
||||||
*/
|
|
||||||
@JsonProperty("MessageId")
|
|
||||||
private String messageId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发送系统
|
|
||||||
*/
|
|
||||||
@JsonProperty("Sender")
|
|
||||||
private String sender;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 接收系统
|
|
||||||
*/
|
|
||||||
@JsonProperty("Receiver")
|
|
||||||
private String receiver;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发送日期
|
|
||||||
*/
|
|
||||||
@JsonProperty("SendDate")
|
|
||||||
private String sendDate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发送时间
|
|
||||||
*/
|
|
||||||
@JsonProperty("SendTime")
|
|
||||||
private String sendTime;
|
|
||||||
|
|
||||||
}
|
|
||||||
-19
@@ -1,19 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.po.decrypt;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
||||||
import com.jero.modules.docking.iam.po.MessageHeader;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 和PO系统做数据交互的最外层壳,做数据接收用
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class AcceptDecryptPo {
|
|
||||||
|
|
||||||
@JsonProperty("MessageHeader")
|
|
||||||
private MessageHeader messageHeader;
|
|
||||||
|
|
||||||
@JsonProperty("Tables")
|
|
||||||
private MessageDecryptTabels messageDecryptTabels;
|
|
||||||
|
|
||||||
}
|
|
||||||
-14
@@ -1,14 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.po.decrypt;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* PO系统交互必须的实体,包含接口传递的正式数据(仅为套的一层壳)
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class MessageDecryptTabels {
|
|
||||||
|
|
||||||
@JsonProperty("Header")
|
|
||||||
private MessageTablesData header;
|
|
||||||
}
|
|
||||||
-17
@@ -1,17 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.po.decrypt;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: MessageTablesData
|
|
||||||
* @Description:
|
|
||||||
* @Author: yjz
|
|
||||||
* @Date: 2023-11-07 14:21
|
|
||||||
* @Version: 1.0
|
|
||||||
**/
|
|
||||||
@Data
|
|
||||||
public class MessageTablesData {
|
|
||||||
@JsonProperty("data")
|
|
||||||
private String data;
|
|
||||||
}
|
|
||||||
-27
@@ -1,27 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.po.decrypt;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
||||||
import com.jero.modules.docking.iam.po.MessageHeader;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 和PO系统做数据交互的最外层壳,做数据发送用
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class SendPoDecryptPo<T> {
|
|
||||||
|
|
||||||
@JsonProperty("MessageHeader")
|
|
||||||
private MessageHeader messageHeader;
|
|
||||||
|
|
||||||
@JsonProperty("Returns")
|
|
||||||
private T returns;
|
|
||||||
|
|
||||||
public SendPoDecryptPo<T> response(MessageHeader messageHeader, T t){
|
|
||||||
SendPoDecryptPo<T> sendPoDecryptPo = new SendPoDecryptPo<>();
|
|
||||||
sendPoDecryptPo.setMessageHeader(messageHeader);
|
|
||||||
sendPoDecryptPo.setReturns(t);
|
|
||||||
|
|
||||||
return sendPoDecryptPo;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
-19
@@ -1,19 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.po.encrypt;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
||||||
import com.jero.modules.docking.iam.po.MessageHeader;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 和PO系统做数据交互的最外层壳,做数据接收用
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class AcceptEncryptPo {
|
|
||||||
|
|
||||||
@JsonProperty("MessageHeader")
|
|
||||||
private MessageHeader messageHeader;
|
|
||||||
|
|
||||||
@JsonProperty("Tables")
|
|
||||||
private MessageEncryptTabels messageEncryptTabels;
|
|
||||||
|
|
||||||
}
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.po.encrypt;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* PO系统交互必须的实体,包含接口传递的正式数据(仅为套的一层壳)
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class MessageEncryptTabels {
|
|
||||||
|
|
||||||
@JsonProperty("Header")
|
|
||||||
private MessageEncryptTabelsHeader header;
|
|
||||||
|
|
||||||
}
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.po.encrypt;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 接受数据的tables中的header层
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class MessageEncryptTabelsHeader {
|
|
||||||
|
|
||||||
@JsonProperty("data")
|
|
||||||
private String data;
|
|
||||||
|
|
||||||
}
|
|
||||||
-21
@@ -1,21 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.po.encrypt;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 返回数据的Return层
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class SendEncryptReturnsPo {
|
|
||||||
|
|
||||||
@JsonProperty("data")
|
|
||||||
private String data;
|
|
||||||
|
|
||||||
public SendEncryptReturnsPo(String data){
|
|
||||||
this.data = data;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
-19
@@ -1,19 +0,0 @@
|
|||||||
package com.jero.modules.docking.iam.po.encrypt;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
||||||
import com.jero.modules.docking.iam.po.MessageHeader;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 和PO系统做数据交互的最外层壳,做数据发送用
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class SendPoEncryptPo {
|
|
||||||
|
|
||||||
@JsonProperty("MessageHeader")
|
|
||||||
private MessageHeader messageHeader;
|
|
||||||
|
|
||||||
@JsonProperty("Returns")
|
|
||||||
private SendEncryptReturnsPo returns;
|
|
||||||
|
|
||||||
}
|
|
||||||
-1037
File diff suppressed because it is too large
Load Diff
-31
@@ -1,31 +0,0 @@
|
|||||||
package com.jero.modules.docking.oa.controller;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.jero.common.api.vo.Result;
|
|
||||||
import com.jero.modules.docking.oa.service.OAService;
|
|
||||||
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;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author lijiarao
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/oa")
|
|
||||||
@Slf4j
|
|
||||||
public class OALoginController {
|
|
||||||
@Resource
|
|
||||||
private OAService oaService;
|
|
||||||
|
|
||||||
@ApiOperation("OA单点登录")
|
|
||||||
@PostMapping("/login")
|
|
||||||
public Result<JSONObject> login(@RequestBody JSONObject jsonObject){
|
|
||||||
return oaService.login(jsonObject);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
package com.jero.modules.docking.oa.service;
|
|
||||||
|
|
||||||
import cn.hutool.http.Header;
|
|
||||||
import cn.hutool.http.HttpRequest;
|
|
||||||
import cn.hutool.http.HttpUtil;
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.jero.common.api.vo.Result;
|
|
||||||
import com.jero.modules.system.service.ILoginService;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author liJiaRao
|
|
||||||
* @date 2024-02-26 17:20
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class OAService {
|
|
||||||
@Resource
|
|
||||||
private ILoginService loginService;
|
|
||||||
|
|
||||||
public static final String TICKET = "ticket";
|
|
||||||
public static final String APP_ID = "appId";
|
|
||||||
public static final String APP_SECRET = "appSecret";
|
|
||||||
public static final String ACCESS_TOKEN = "accessToken";
|
|
||||||
public static final String USER_NAME = "userName";
|
|
||||||
|
|
||||||
@Value("${oa.getAccessTokenUrl}")
|
|
||||||
private String getAccessTokenUrl;
|
|
||||||
@Value("${oa.getTicketInfoUrl}")
|
|
||||||
private String getTicketInfoUrl;
|
|
||||||
@Value("${oa.appId}")
|
|
||||||
private String appId;
|
|
||||||
@Value("${oa.appSecret}")
|
|
||||||
private String appSecret;
|
|
||||||
|
|
||||||
|
|
||||||
public Result<JSONObject> login(JSONObject jsonObject) {
|
|
||||||
String ticket = jsonObject.getString(TICKET);
|
|
||||||
JSONObject body = new JSONObject();
|
|
||||||
body.put(APP_ID, appId);
|
|
||||||
body.put(APP_SECRET, appSecret);
|
|
||||||
|
|
||||||
String post = HttpRequest.post(getAccessTokenUrl)
|
|
||||||
.header(Header.CONTENT_TYPE, "application/json")
|
|
||||||
.body(body.toJSONString())
|
|
||||||
.execute().body();
|
|
||||||
JSONObject responseJson = JSONObject.parseObject(post);
|
|
||||||
|
|
||||||
String accessToken = responseJson.getString(ACCESS_TOKEN);
|
|
||||||
JSONObject body1 = new JSONObject();
|
|
||||||
body1.put(ACCESS_TOKEN, accessToken);
|
|
||||||
body1.put(TICKET, ticket);
|
|
||||||
String post1 = HttpRequest.post(getTicketInfoUrl)
|
|
||||||
.header(Header.CONTENT_TYPE, "application/json")
|
|
||||||
.body(body1.toJSONString())
|
|
||||||
.execute().body();
|
|
||||||
JSONObject responseJson1 = JSONObject.parseObject(post1);
|
|
||||||
String userName = responseJson1.getString(USER_NAME);
|
|
||||||
|
|
||||||
return loginService.loginByUserName(userName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-219
@@ -1,219 +0,0 @@
|
|||||||
package com.jero.modules.docking.srms.controller;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
|
||||||
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 com.jero.modules.laws.standard.service.PartNameService;
|
|
||||||
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;
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @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";
|
|
||||||
private static final String RESULT = "Result";
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private PartNameService partNameService;
|
|
||||||
|
|
||||||
@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(re.getMessage());
|
|
||||||
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(re.getMessage());
|
|
||||||
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(re.getMessage());
|
|
||||||
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(re.getMessage());
|
|
||||||
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(re.getMessage());
|
|
||||||
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);
|
|
||||||
partNameService.fixFirstNodeCode();
|
|
||||||
if(!re.isSuccess()){
|
|
||||||
log.error("零部件分类树同步接口同步失败",re.getMessage());
|
|
||||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),null);
|
|
||||||
}
|
|
||||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),null);
|
|
||||||
}catch (Exception e){
|
|
||||||
log.error("零部件分类树同步接口异常:",e);
|
|
||||||
return ResponsesUtil.getJsonResult(json.get(MESSAGE_HEADER),null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@PostMapping("/syncPartStandard")
|
|
||||||
public Result<String> syncPartStandard(){
|
|
||||||
return srmsApiService.syncPartStandard();
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation("E采通获取标准信息")
|
|
||||||
@AutoLog(value = "E采通获取标准信息")
|
|
||||||
@PostMapping("/getEStandardInfo")
|
|
||||||
public JSONObject getEStandardInfo(@RequestBody JSONObject json, HttpServletRequest req) {
|
|
||||||
JSONObject messageHandler = JSON.parseObject(JSON.toJSONString(json.get(MESSAGE_HEADER)));
|
|
||||||
String uuid = messageHandler.get("UUID").toString();
|
|
||||||
try {
|
|
||||||
Result<JSONArray> re = srmsApiService.getEStandardInfo(json, req);
|
|
||||||
JSONArray rows = re.getResult();
|
|
||||||
JSONObject resultJson = new JSONObject();
|
|
||||||
resultJson.put("MessageHeader", srmsApiService.getMessageHandler("CNHTC_PO1000402", uuid, "SCM"));
|
|
||||||
JSONObject jsonResponses = ResponsesUtil.getJsonOkUpper();
|
|
||||||
if (!Objects.isNull(rows)) {
|
|
||||||
jsonResponses.put("Rows", rows);
|
|
||||||
}
|
|
||||||
resultJson.put("Responses", jsonResponses);
|
|
||||||
return resultJson;
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("E采通获取标准信息异常:", e);
|
|
||||||
return ResponsesUtil.getJsonResult(
|
|
||||||
srmsApiService.getMessageHandler("interface_id", uuid, "SCM"),
|
|
||||||
ResponsesUtil.getJsonErrUpper("操作失败", CommonConstant.SC_INTERNAL_SERVER_ERROR_500));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@AutoLog(value = "PDM获取零部件号绑定的法规数据信息")
|
|
||||||
@PostMapping("/bindPartStandardInfo")
|
|
||||||
public JSONObject getBindPartStandardInfo(@RequestBody JSONObject json) {
|
|
||||||
JSONObject messageHandler = JSON.parseObject(JSON.toJSONString(json.get(MESSAGE_HEADER)));
|
|
||||||
String uuid = messageHandler.get("UUID").toString();
|
|
||||||
try {
|
|
||||||
List<JSONObject> rows = srmsApiService.getBindPartStandardInfo(json);
|
|
||||||
JSONObject resultJson = new JSONObject();
|
|
||||||
resultJson.put("MessageHeader", srmsApiService.getMessageHandler("CNHTC_PO1000496", uuid, "PDM"));
|
|
||||||
JSONObject jsonResponses = ResponsesUtil.getJsonOkUpper();
|
|
||||||
if (!Objects.isNull(rows)) {
|
|
||||||
jsonResponses.put("Rows", rows);
|
|
||||||
}
|
|
||||||
resultJson.put("Responses", jsonResponses);
|
|
||||||
return resultJson;
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("PDM获取零部件号绑定的法规数据信息异常:", e);
|
|
||||||
return ResponsesUtil.getJsonResult(
|
|
||||||
srmsApiService.getMessageHandler("interface_id", uuid, "PDM"),
|
|
||||||
ResponsesUtil.getJsonErrUpper("操作失败", CommonConstant.SC_INTERNAL_SERVER_ERROR_500));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-27
@@ -1,27 +0,0 @@
|
|||||||
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
@@ -1,27 +0,0 @@
|
|||||||
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
@@ -1,30 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
||||||
-68
@@ -1,68 +0,0 @@
|
|||||||
package com.jero.modules.docking.srms.entity;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author lqt
|
|
||||||
* @version 1.0
|
|
||||||
* @date 2024/1/30 14:05
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class LawsPartStandard implements Serializable {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/**主键ID*/
|
|
||||||
@TableId(type = IdType.ASSIGN_ID)
|
|
||||||
@ApiModelProperty(value = "主键ID")
|
|
||||||
private String id;
|
|
||||||
/**标准id*/
|
|
||||||
@ApiModelProperty(value = "标准id")
|
|
||||||
private String standardId;
|
|
||||||
/**分类内部码*/
|
|
||||||
@ApiModelProperty(value = "分类内部码")
|
|
||||||
private String partCategoryNum;
|
|
||||||
/**标准分类:设计规范:1释放规范:2*/
|
|
||||||
@ApiModelProperty(value = "标准分类:设计规范:1释放规范:2")
|
|
||||||
private String standardPdmType;
|
|
||||||
/**标准编号*/
|
|
||||||
@ApiModelProperty(value = "标准编号")
|
|
||||||
private String standardNumber;
|
|
||||||
/**备用字段1*/
|
|
||||||
@ApiModelProperty(value = "备用字段1")
|
|
||||||
private String remark1;
|
|
||||||
/**备用字段2*/
|
|
||||||
@ApiModelProperty(value = "备用字段2")
|
|
||||||
private String remark2;
|
|
||||||
/**备用字段3*/
|
|
||||||
@ApiModelProperty(value = "备用字段3")
|
|
||||||
private String remark3;
|
|
||||||
/**创建人*/
|
|
||||||
@ApiModelProperty(value = "创建人")
|
|
||||||
private String createBy;
|
|
||||||
/**创建日期*/
|
|
||||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy年MM月dd日 EEEE")
|
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
|
||||||
@ApiModelProperty(value = "创建日期")
|
|
||||||
private Date createTime;
|
|
||||||
/**更新人*/
|
|
||||||
@ApiModelProperty(value = "更新人")
|
|
||||||
private String updateBy;
|
|
||||||
/**更新日期*/
|
|
||||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
|
||||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
|
||||||
@ApiModelProperty(value = "更新日期")
|
|
||||||
private Date updateTime;
|
|
||||||
/**删除状态(0-正常,1-删除)*/
|
|
||||||
@ApiModelProperty(value = "删除状态(0-正常,1-删除)")
|
|
||||||
@TableLogic
|
|
||||||
private Integer delFlag;
|
|
||||||
}
|
|
||||||
-50
@@ -1,50 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
||||||
-30
@@ -1,30 +0,0 @@
|
|||||||
package com.jero.modules.docking.srms.job;
|
|
||||||
|
|
||||||
import com.jero.modules.docking.srms.service.SrmsApiService;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.quartz.Job;
|
|
||||||
import org.quartz.JobExecutionContext;
|
|
||||||
import org.quartz.JobExecutionException;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分类树标准法规回写
|
|
||||||
* @author LQT
|
|
||||||
* @date 2024/2/21 16:01
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
public class SyncPartStandardJob implements Job {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private SrmsApiService srmsApiService;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
|
|
||||||
log.info("每日分类树标准法规回写开始");
|
|
||||||
// 同步数据
|
|
||||||
srmsApiService.syncPartStandard();
|
|
||||||
// 发送请求
|
|
||||||
srmsApiService.sendPartStandard();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-16
@@ -1,16 +0,0 @@
|
|||||||
package com.jero.modules.docking.srms.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.jero.modules.docking.srms.entity.LawsPartStandard;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description:
|
|
||||||
* @Author: jero-boot
|
|
||||||
* @Date: 2023-10-18
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
@Mapper
|
|
||||||
public interface LawsPartStandardMapper extends BaseMapper<LawsPartStandard> {
|
|
||||||
|
|
||||||
}
|
|
||||||
-69
@@ -1,69 +0,0 @@
|
|||||||
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.entity.LawsPartStandard;
|
|
||||||
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);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 更新父级id
|
|
||||||
* @author LQT
|
|
||||||
* @date 2024/1/30 15:07
|
|
||||||
* @param
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
void updatePartParentId();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取所有 标准分类:
|
|
||||||
* 设计规范:1
|
|
||||||
* 释放规范:2 (系统中编码为4)
|
|
||||||
* @author LQT
|
|
||||||
* @date 2024/1/30 16:51
|
|
||||||
* @param
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
List<LawsPartStandard> getSyncPartStandard();
|
|
||||||
|
|
||||||
}
|
|
||||||
-16
@@ -1,16 +0,0 @@
|
|||||||
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> {
|
|
||||||
|
|
||||||
}
|
|
||||||
-5
@@ -1,5 +0,0 @@
|
|||||||
<?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.LawsPartStandardMapper">
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
-170
@@ -1,170 +0,0 @@
|
|||||||
<?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 = 8
|
|
||||||
<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 1=1
|
|
||||||
<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>
|
|
||||||
<select id="getSyncPartStandard" resultType="com.jero.modules.docking.srms.entity.LawsPartStandard">
|
|
||||||
SELECT
|
|
||||||
a.id as standard_id,
|
|
||||||
a.standard_number as standard_number,
|
|
||||||
a.standard_class as standard_pdm_type,
|
|
||||||
substring_index(substring_index(a.part_name, ',', b.help_topic_id + 1), ',', - 1) as part_category_num
|
|
||||||
FROM (
|
|
||||||
select
|
|
||||||
id,
|
|
||||||
standard_number,
|
|
||||||
case when standard_class = 4 then 2 else standard_class end as standard_class,
|
|
||||||
part_name
|
|
||||||
from laws_enterprise_standard where standard_class in (1,4) and del_flag = 0 and part_name is not null
|
|
||||||
) a
|
|
||||||
INNER JOIN mysql.help_topic b
|
|
||||||
ON b.help_topic_id < (length(a.part_name) - length(REPLACE(a.part_name, ',', '')) + 1)
|
|
||||||
union all
|
|
||||||
(select
|
|
||||||
id as standard_id,
|
|
||||||
standard_number,
|
|
||||||
case when standard_class = 4 then 2 else standard_class end as standard_class,
|
|
||||||
part_name
|
|
||||||
from laws_enterprise_standard where standard_class in (1,4) and del_flag = 0 and ISNULL(part_name))
|
|
||||||
</select>
|
|
||||||
<update id="updatePartParentId">
|
|
||||||
update laws_part_name l1 set parent_id = (select id from (select id from laws_part_name l2 where l2.code = l1.parent_code) aa)
|
|
||||||
</update>
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
-5
@@ -1,5 +0,0 @@
|
|||||||
<?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
@@ -1,14 +0,0 @@
|
|||||||
package com.jero.modules.docking.srms.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.jero.modules.docking.srms.entity.LawsPartStandard;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 系统对接信息
|
|
||||||
* @Author: jero-boot
|
|
||||||
* @Date: 2023-10-18
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
public interface ILawsPartStandardService extends IService<LawsPartStandard> {
|
|
||||||
|
|
||||||
}
|
|
||||||
-14
@@ -1,14 +0,0 @@
|
|||||||
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> {
|
|
||||||
|
|
||||||
}
|
|
||||||
-122
@@ -1,122 +0,0 @@
|
|||||||
package com.jero.modules.docking.srms.service;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
|
||||||
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);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分类树标准法规回写
|
|
||||||
* @author LQT
|
|
||||||
* @date 2024/1/26 16:05
|
|
||||||
* @return com.jero.common.api.vo.Result<java.lang.String>
|
|
||||||
*/
|
|
||||||
Result<String> syncPartStandard();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发送分类树标准法规
|
|
||||||
* @author LQT
|
|
||||||
* @date 2024/1/30 17:15
|
|
||||||
* @param
|
|
||||||
* @return com.jero.common.api.vo.Result<java.lang.String>
|
|
||||||
*/
|
|
||||||
void sendPartStandard();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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<JSONArray> getEStandardInfo(JSONObject json, HttpServletRequest req);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取固定的MessageHandler
|
|
||||||
* @param interfaceId
|
|
||||||
* @return com.jero.common.api.vo.Result<java.util.List<com.alibaba.fastjson.JSONObject>>
|
|
||||||
*/
|
|
||||||
JSONObject getMessageHandler(String interfaceId, String uuid, String receiver);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取零部件号绑定的法规数据
|
|
||||||
* @author CHH
|
|
||||||
* @date 2024/4/28 15:08
|
|
||||||
* @param json
|
|
||||||
* @return com.jero.common.api.vo.Result<java.util.List<com.alibaba.fastjson.JSONObject>>
|
|
||||||
*/
|
|
||||||
List<JSONObject> getBindPartStandardInfo(JSONObject json);
|
|
||||||
}
|
|
||||||
-18
@@ -1,18 +0,0 @@
|
|||||||
package com.jero.modules.docking.srms.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.jero.modules.docking.srms.entity.LawsPartStandard;
|
|
||||||
import com.jero.modules.docking.srms.mapper.LawsPartStandardMapper;
|
|
||||||
import com.jero.modules.docking.srms.service.ILawsPartStandardService;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description:
|
|
||||||
* @Author: jero-boot
|
|
||||||
* @Date: 2023-10-18
|
|
||||||
* @Version: V1.0
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class ILawsPartStandardServiceImpl extends ServiceImpl<LawsPartStandardMapper, LawsPartStandard> implements ILawsPartStandardService {
|
|
||||||
|
|
||||||
}
|
|
||||||
-18
@@ -1,18 +0,0 @@
|
|||||||
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 {
|
|
||||||
|
|
||||||
}
|
|
||||||
-1024
File diff suppressed because it is too large
Load Diff
@@ -1,63 +0,0 @@
|
|||||||
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
@@ -1,35 +0,0 @@
|
|||||||
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
@@ -1,37 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
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
@@ -1,64 +0,0 @@
|
|||||||
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;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user