* 'dev' of http://192.168.124.50/wangliwen/share-platform:
  全局resttemp配置项
  调整亚微的详情接口
  1.对接政务云资源和云视频列表查询接口 2.全局搜索会客厅统计错误bug修复
  运行日志文件按时间逆序,下载运行日志无需认证
  ...
  屮
  。。。
  调整上传限制大小
  1.我的收藏列表查询增加融合服务查询 2.增加超级管理员删除能力和流程实例接口 3.删除区划标识修改
  yawei待办详情
  ...
  导出失败的处理
  ...
  jira上的bug
This commit is contained in:
huangweixiong 2022-11-11 09:50:45 +08:00
commit 4ed920651a
28 changed files with 478 additions and 111 deletions

View File

@ -327,7 +327,7 @@
<excludes> <excludes>
<!-- 排除生产环境配置 --> <!-- 排除生产环境配置 -->
<exclude>application-bt.yml</exclude> <exclude>application-bt.yml</exclude>
<exclude>application-dev.yml</exclude> <!-- <exclude>application-dev.yml</exclude> -->
<exclude>application-hwx.yml</exclude> <exclude>application-hwx.yml</exclude>
<exclude>application-my.yml</exclude> <exclude>application-my.yml</exclude>
<exclude>application-prod.yml</exclude> <exclude>application-prod.yml</exclude>

View File

@ -1,5 +1,6 @@
package io.renren.common.config; package io.renren.common.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.ClientHttpRequestFactory; import org.springframework.http.client.ClientHttpRequestFactory;
@ -12,6 +13,11 @@ import java.nio.charset.Charset;
@Configuration @Configuration
public class RestTemplateConfig { public class RestTemplateConfig {
@Value("${rest_template.read_timeout}")
private Integer read_timeout;
@Value("${rest_template.connect_timeout}")
private Integer connect_timeout;
@Bean @Bean
public RestTemplate restTemplate(ClientHttpRequestFactory factory) { public RestTemplate restTemplate(ClientHttpRequestFactory factory) {
RestTemplate restTemplate = new RestTemplate(factory); RestTemplate restTemplate = new RestTemplate(factory);
@ -22,8 +28,8 @@ public class RestTemplateConfig {
@Bean @Bean
public ClientHttpRequestFactory simpleClientHttpRequestFactory() { public ClientHttpRequestFactory simpleClientHttpRequestFactory() {
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory(); SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
factory.setReadTimeout(30 * 000);//单位为ms factory.setReadTimeout(read_timeout);//单位为ms
factory.setConnectTimeout(5 * 1000);//单位为ms factory.setConnectTimeout(connect_timeout);//单位为ms
factory.setOutputStreaming(false); factory.setOutputStreaming(false);
// InetSocketAddress socketAddress = new InetSocketAddress("192.168.124.31", 8888); // InetSocketAddress socketAddress = new InetSocketAddress("192.168.124.31", 8888);

View File

@ -13,16 +13,10 @@ import org.springframework.core.io.FileSystemResource;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Api(tags = "管理员后台") @Api(tags = "管理员后台")
@ -36,17 +30,20 @@ public class AdminController {
@Value("${spring.profiles.active}") @Value("${spring.profiles.active}")
private String active; // 现有生效 private String active; // 现有生效
/** /**
* @param updateFile 更新包下载地址 * @param params updateFile 更新包下载地址 active 重启完成后的配置环境
* @param active 重启完成后的配置环境
* @return * @return
*/ */
@PostMapping(value = "/update") @PostMapping(value = "/update")
public Result<String> update(String updateFile, String active) { public Result<String> update(@RequestBody Map<String, String> params) {
String updateFile = params.containsKey("updateFile") ? params.get("updateFile") : null;
String active = params.containsKey("active") ? params.get("active") : null;
if (StringUtils.isEmpty(active)) { if (StringUtils.isEmpty(active)) {
active = this.active; active = this.active;
} }
if (StringUtils.isEmpty(updateFile)) {
return new Result<String>().ok(String.valueOf(false));
}
boolean success = updateUtil.update(updateFile, active); boolean success = updateUtil.update(updateFile, active);
return new Result<String>().ok(String.valueOf(success)); return new Result<String>().ok(String.valueOf(success));
} }
@ -61,7 +58,15 @@ public class AdminController {
List<String> result = new ArrayList<>(); List<String> result = new ArrayList<>();
File file = new File(pwd + File.separator + "logs"); File file = new File(pwd + File.separator + "logs");
File[] tempFile = file.listFiles(); File[] tempFile = file.listFiles();
result = Arrays.asList(tempFile).stream().filter(index -> index.isFile()).map(index -> index.getName()).collect(Collectors.toList()); result = Arrays.asList(tempFile)
.stream()
.filter(index -> index.isFile() && index.getName().endsWith(".log"))
.sorted(Comparator.comparing(x -> {
File index = (File) x;
return index.lastModified();
}).reversed())
.map(index -> index.getName())
.collect(Collectors.toList());
return new Result<List<String>>().ok(result); return new Result<List<String>>().ok(result);
} }
@ -84,8 +89,12 @@ public class AdminController {
headers.add("Expires", "0"); headers.add("Expires", "0");
headers.add("Last-Modified", new Date().toString()); headers.add("Last-Modified", new Date().toString());
headers.add("ETag", String.valueOf(System.currentTimeMillis())); headers.add("ETag", String.valueOf(System.currentTimeMillis()));
return ResponseEntity.ok().headers(headers).contentLength(file_.length()).contentType(MediaType.parseMediaType("application/octet-stream")).body(new FileSystemResource(file_)); return ResponseEntity
.ok()
.headers(headers)
.contentLength(file_.length())
.contentType(MediaType.parseMediaType("application/octet-stream"))
.body(new FileSystemResource(file_));
} }
} }

View File

@ -1,11 +1,9 @@
package io.renren.common.controller; package io.renren.common.controller;
import io.renren.common.annotation.LogOperation;
import io.renren.common.utils.Result; import io.renren.common.utils.Result;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@ -36,8 +34,8 @@ public class FileUploadController {
private static final SimpleDateFormat SIMPLE_DATE_FORMAT = new SimpleDateFormat("yyyy/MM/dd/"); private static final SimpleDateFormat SIMPLE_DATE_FORMAT = new SimpleDateFormat("yyyy/MM/dd/");
@PostMapping("/upload") @PostMapping("/upload")
@ApiOperation("文件上传") // @ApiOperation("文件上传")
@LogOperation("文件上传") // @LogOperation("文件上传")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "file", value = "文件", paramType = "file", dataType = "file", required = true) @ApiImplicitParam(name = "file", value = "文件", paramType = "file", dataType = "file", required = true)
}) })

View File

@ -112,7 +112,7 @@ public class ActTaskController {
" t_meetingroom_book.id AS `taskId`, " + " t_meetingroom_book.id AS `taskId`, " +
" t_meetingroom_book.dept AS `userDeptName`, " + " t_meetingroom_book.dept AS `userDeptName`, " +
" t_meetingroom.`name` AS `userName`, " + " t_meetingroom.`name` AS `userName`, " +
" '会议室审核' AS `taskName `, " + " '会客厅审核' AS `taskName `, " +
" t_meetingroom.create_date AS `createTime` " + " t_meetingroom.create_date AS `createTime` " +
"FROM " + "FROM " +
" t_meetingroom_book " + " t_meetingroom_book " +

View File

@ -31,7 +31,7 @@ import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@Api(tags = "预约会议室") @Api(tags = "预约会客厅")
@RestController @RestController
@RequestMapping("bookMeeting") @RequestMapping("bookMeeting")
public class BookMeetingRoomController { public class BookMeetingRoomController {
@ -39,7 +39,7 @@ public class BookMeetingRoomController {
@Value("${big_date.name}") @Value("${big_date.name}")
private String bigDateDeptName; // 大数据局名称 private String bigDateDeptName; // 大数据局名称
@Value("${big_date.assignee_meet_role_id}") @Value("${big_date.assignee_meet_role_id}")
private String defaultAssigneeRoleId; // 改成配置的会议室审核人 private String defaultAssigneeRoleId; // 改成配置的会客厅审核人
@Resource @Resource
private TMeetingroomBookService tMeetingroomBookService; private TMeetingroomBookService tMeetingroomBookService;
@ -51,11 +51,11 @@ public class BookMeetingRoomController {
private SysRoleUserService sysRoleUserService; private SysRoleUserService sysRoleUserService;
@GetMapping("list") @GetMapping("list")
@ApiOperation("搜索可以预约的会议室") @ApiOperation("搜索可以预约的会客厅")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType = "int"), @ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType = "int"),
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"), @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"),
@ApiImplicitParam(name = "name", value = "议室名称", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "name", value = "客厅名称", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "bookDate", value = "预约开始时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "bookDate", value = "预约开始时间", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "startTime", value = "预约开始时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "startTime", value = "预约开始时间", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "endTime", value = "预约结束时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "endTime", value = "预约结束时间", paramType = "query", dataType = "String"),
@ -70,7 +70,7 @@ public class BookMeetingRoomController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType = "int"), @ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType = "int"),
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"), @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"),
@ApiImplicitParam(name = "roomName", value = "议室名称", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "roomName", value = "客厅名称", paramType = "query", dataType = "String"),
}) })
public Result<PageData<TMeetingroomBookDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params) { public Result<PageData<TMeetingroomBookDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params) {
PageData<TMeetingroomBookDTO> page = tMeetingroomBookService.queryList(params); PageData<TMeetingroomBookDTO> page = tMeetingroomBookService.queryList(params);
@ -78,9 +78,9 @@ public class BookMeetingRoomController {
} }
@GetMapping("availableDate") @GetMapping("availableDate")
@ApiOperation("根据日期获取会议室当天的可用时段") @ApiOperation("根据日期获取会客厅当天的可用时段")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "roomId", value = "议室主键", paramType = "query", required = true, dataType = "int"), @ApiImplicitParam(name = "roomId", value = "客厅主键", paramType = "query", required = true, dataType = "int"),
@ApiImplicitParam(name = "date", value = "查询的天数", paramType = "query", required = true, dataType = "String"), @ApiImplicitParam(name = "date", value = "查询的天数", paramType = "query", required = true, dataType = "String"),
}) })
public Result<List<String>> availableDate(@ApiIgnore @RequestParam Map<String, Object> params) throws ParseException { public Result<List<String>> availableDate(@ApiIgnore @RequestParam Map<String, Object> params) throws ParseException {
@ -101,9 +101,9 @@ public class BookMeetingRoomController {
tMeetingroomBookService.save(dto); tMeetingroomBookService.save(dto);
// 发起预约后推送消息 // 发起预约后推送消息
String content = "【通知】请审核" + dto.getName() + "发起的" + dto.getRoomName() + String content = "【通知】请审核" + dto.getName() + "发起的" + dto.getRoomName() +
"议室申请"; "客厅申请";
SysNoticeDTO sysNoticeDTO = new SysNoticeDTO(); SysNoticeDTO sysNoticeDTO = new SysNoticeDTO();
sysNoticeDTO.setTitle("议室申请审核通知"); sysNoticeDTO.setTitle("客厅申请审核通知");
sysNoticeDTO.setContent(content); // 通知内容 sysNoticeDTO.setContent(content); // 通知内容
sysNoticeDTO.setReceiverType(1); sysNoticeDTO.setReceiverType(1);
sysNoticeDTO.setType(11); sysNoticeDTO.setType(11);
@ -127,12 +127,12 @@ public class BookMeetingRoomController {
sysNoticeService.save(sysNoticeDTO); sysNoticeService.save(sysNoticeDTO);
// 还要发送自己能看到的的谁给我审核的消息 // 还要发送自己能看到的的谁给我审核的消息
String ownedContent = "【通知】您发起的" + dto.getRoomName() + String ownedContent = "【通知】您发起的" + dto.getRoomName() +
"议室申请,当前审核部门为:" + bigDateDeptName + ",审核负责人:会议室管理员"; "客厅申请,当前审核部门为:" + bigDateDeptName + ",审核负责人:会客厅管理员";
SysNoticeDTO ownedSysNoticeDTO = new SysNoticeDTO(); SysNoticeDTO ownedSysNoticeDTO = new SysNoticeDTO();
ownedSysNoticeDTO.setType(10); ownedSysNoticeDTO.setType(10);
ownedSysNoticeDTO.setApplyState(0); ownedSysNoticeDTO.setApplyState(0);
ownedSysNoticeDTO.setApplyId(dto.getId().toString()); ownedSysNoticeDTO.setApplyId(dto.getId().toString());
ownedSysNoticeDTO.setTitle("议室申请发起通知"); ownedSysNoticeDTO.setTitle("客厅申请发起通知");
ownedSysNoticeDTO.setContent(ownedContent); // 通知内容 ownedSysNoticeDTO.setContent(ownedContent); // 通知内容
ownedSysNoticeDTO.setReceiverType(1); ownedSysNoticeDTO.setReceiverType(1);
ownedSysNoticeDTO.setReceiverTypeIds(dto.getCreator().toString()); ownedSysNoticeDTO.setReceiverTypeIds(dto.getCreator().toString());
@ -160,7 +160,7 @@ public class BookMeetingRoomController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType = "int"), @ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType = "int"),
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"), @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"),
@ApiImplicitParam(name = "roomName", value = "议室名称", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "roomName", value = "客厅名称", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "state", value = "预约状态", paramType = "query", dataType = "int"), @ApiImplicitParam(name = "state", value = "预约状态", paramType = "query", dataType = "int"),
}) })
public Result<PageData<TMeetingroomBookDTO>> auditPage(@ApiIgnore @RequestParam Map<String, Object> params) { public Result<PageData<TMeetingroomBookDTO>> auditPage(@ApiIgnore @RequestParam Map<String, Object> params) {
@ -180,12 +180,12 @@ public class BookMeetingRoomController {
// 修改之后推送存通知sysNotice // 修改之后推送存通知sysNotice
String state = dto.getState() == 2 ? "通过" : "不通过"; String state = dto.getState() == 2 ? "通过" : "不通过";
String content = "【通知】" + dto.getName() + ",您发起的" + dto.getRoomName() + String content = "【通知】" + dto.getName() + ",您发起的" + dto.getRoomName() +
"议室申请,审核结果为:" + state; "客厅申请,审核结果为:" + state;
SysNoticeDTO sysNoticeDTO = new SysNoticeDTO(); SysNoticeDTO sysNoticeDTO = new SysNoticeDTO();
sysNoticeDTO.setType(10); sysNoticeDTO.setType(10);
sysNoticeDTO.setApplyState(1); sysNoticeDTO.setApplyState(1);
sysNoticeDTO.setApplyId(dto.getId().toString()); sysNoticeDTO.setApplyId(dto.getId().toString());
sysNoticeDTO.setTitle("议室申请审核结果通知"); sysNoticeDTO.setTitle("客厅申请审核结果通知");
sysNoticeDTO.setContent(content); // 通知内容 sysNoticeDTO.setContent(content); // 通知内容
sysNoticeDTO.setReceiverType(1); sysNoticeDTO.setReceiverType(1);
sysNoticeDTO.setReceiverTypeIds(dto.getCreator().toString()); sysNoticeDTO.setReceiverTypeIds(dto.getCreator().toString());

View File

@ -22,7 +22,7 @@ import javax.annotation.Resource;
import java.util.Date; import java.util.Date;
import java.util.Map; import java.util.Map;
@Api(tags = "议室") @Api(tags = "客厅")
@RestController @RestController
@RequestMapping("meeting") @RequestMapping("meeting")
public class MeetingroomController { public class MeetingroomController {
@ -36,7 +36,7 @@ public class MeetingroomController {
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType = "int"), @ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType = "int"),
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"), @ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query", required = true, dataType = "int"),
@ApiImplicitParam(name = "name", value = "议室名称", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "name", value = "客厅名称", paramType = "query", dataType = "String"),
}) })
public Result<PageData<TMeetingroomDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params) { public Result<PageData<TMeetingroomDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params) {
PageData<TMeetingroomDTO> page = meetingroomService.queryList(params); PageData<TMeetingroomDTO> page = meetingroomService.queryList(params);
@ -58,7 +58,7 @@ public class MeetingroomController {
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
if (meetingroomService.checkMeetingRepeat(dto.getName())) { if (meetingroomService.checkMeetingRepeat(dto.getName())) {
return new Result().error("已经存在相同名称的会议室,请勿重复新增"); return new Result().error("已经存在相同名称的会客厅,请勿重复新增");
} }
meetingroomService.save(dto); meetingroomService.save(dto);
return new Result(); return new Result();

View File

@ -34,4 +34,6 @@ public interface TMeetingroomBookMapper extends BaseDao<TMeetingroomBook> {
@Param("state") Integer state); @Param("state") Integer state);
List<TMeetingroomBook> selectInvalid(Date date); List<TMeetingroomBook> selectInvalid(Date date);
List<Long> selectBookIdByRoomId(Long id);
} }

View File

@ -10,13 +10,13 @@ import java.util.Date;
@Data @Data
@ApiModel(value = "议室预约") @ApiModel(value = "客厅预约")
public class TMeetingroomBookDTO implements Serializable { public class TMeetingroomBookDTO implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键,新增时不传") @ApiModelProperty(value = "主键,新增时不传")
private Long id; private Long id;
@ApiModelProperty(value = "议室id") @ApiModelProperty(value = "客厅id")
private Long roomId; private Long roomId;
@ApiModelProperty(value = "预约时间请传时间格式为2000-01-01") @ApiModelProperty(value = "预约时间请传时间格式为2000-01-01")
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd")

View File

@ -8,10 +8,10 @@ import java.io.Serializable;
import java.util.Date; import java.util.Date;
/** /**
* 议室 * 客厅
*/ */
@Data @Data
@ApiModel(value = "议室") @ApiModel(value = "客厅")
public class TMeetingroomDTO implements Serializable { public class TMeetingroomDTO implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -25,7 +25,7 @@ public class TMeetingroomDTO implements Serializable {
private String area; private String area;
@ApiModelProperty(value = "可容纳人数") @ApiModelProperty(value = "可容纳人数")
private Integer capacity; private Integer capacity;
@ApiModelProperty(value = "议室图片") @ApiModelProperty(value = "客厅图片")
private String pic; private String pic;
@ApiModelProperty(value = "描述") @ApiModelProperty(value = "描述")
private String description; private String description;

View File

@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode;
import java.util.Date; import java.util.Date;
/** /**
* 议室 * 客厅
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@ -33,7 +33,7 @@ public class TMeetingroom extends BaseEntity {
*/ */
private Integer capacity; private Integer capacity;
/** /**
* 议室图片 * 客厅图片
*/ */
private String pic; private String pic;
/** /**

View File

@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode;
import java.util.Date; import java.util.Date;
/** /**
* 议室预约 * 客厅预约
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@ -17,7 +17,7 @@ public class TMeetingroomBook extends BaseEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 议室id * 客厅id
*/ */
private Long roomId; private Long roomId;
private Date bookDate; private Date bookDate;

View File

@ -20,7 +20,7 @@ public class SysNoticeDTO implements Serializable {
@ApiModelProperty(value = "id") @ApiModelProperty(value = "id")
private Long id; private Long id;
@ApiModelProperty(value = "通知类型 0申请前台 1申请后台 2上架前台 3上架后台 4下架前台 5下架后台 6需求前台 7需求后台 8评论前台 9评论后台 10议室前台 11会议室后台 12其他") @ApiModelProperty(value = "通知类型 0申请前台 1申请后台 2上架前台 3上架后台 4下架前台 5下架后台 6需求前台 7需求后台 8评论前台 9评论后台 10客厅前台 11会客厅后台 12其他")
private Integer type; private Integer type;
@ApiModelProperty(value = "标题") @ApiModelProperty(value = "标题")
private String title; private String title;

View File

@ -36,7 +36,7 @@ public class NoticeUntil {
" 0: \"myAgent-CommentModeration\"," + " 0: \"myAgent-CommentModeration\"," +
" 1: \"hasToDoTasks-CommentModeration\"," + " 1: \"hasToDoTasks-CommentModeration\"," +
" }," + " }," +
" \"议室后台\": {" + " \"客厅后台\": {" +
" 0: \"activiti-RoomExamineAdmin\"," + " 0: \"activiti-RoomExamineAdmin\"," +
" 1: \"activiti-RoomExamineAdmin\"," + " 1: \"activiti-RoomExamineAdmin\"," +
" }," + " }," +
@ -55,8 +55,8 @@ public class NoticeUntil {
" 7: \"需求后台\"," + " 7: \"需求后台\"," +
" 8: \"评论前台\"," + " 8: \"评论前台\"," +
" 9: \"评论后台\"," + " 9: \"评论后台\"," +
" 10: \"议室前台\"," + " 10: \"客厅前台\"," +
" 11: \"议室后台\"," + " 11: \"客厅后台\"," +
" 12: \"其他\"" + " 12: \"其他\"" +
"}"; "}";
typeMap = JSONObject.parseObject(typeString, HashMap.class); typeMap = JSONObject.parseObject(typeString, HashMap.class);
@ -67,7 +67,7 @@ public class NoticeUntil {
" \"下架前台\": \"能力下架\"," + " \"下架前台\": \"能力下架\"," +
" \"需求前台\": \"能力需求\"," + " \"需求前台\": \"能力需求\"," +
" \"评论前台\": \"需求评论\"," + " \"评论前台\": \"需求评论\"," +
" \"议室前台\": \"会议室前台\"" + " \"客厅前台\": \"会客厅前台\"" +
"}"; "}";
tabMap = JSONObject.parseObject(tabString, HashMap.class); tabMap = JSONObject.parseObject(tabString, HashMap.class);
} }
@ -97,7 +97,7 @@ public class NoticeUntil {
if (route != null) { if (route != null) {
return manageUrl + "/#/" + route; return manageUrl + "/#/" + route;
} }
} else if (typeName.equals("议室前台")) {//会议室单独处理 } else if (typeName.equals("客厅前台")) {//会客厅单独处理
return portalUrl + "/#/DetailsPageconetent?select=基础设施&formPage=noticePage"; return portalUrl + "/#/DetailsPageconetent?select=基础设施&formPage=noticePage";
} else {//前台根据tab区分不同param } else {//前台根据tab区分不同param
String tabName = tabMap.get(typeName); String tabName = tabMap.get(typeName);

View File

@ -45,4 +45,6 @@ public interface TAbilityApplicationDao extends BaseDao<TAbilityApplicationEntit
Long countUserResourceApply(Long userId, Long resourceId); Long countUserResourceApply(Long userId, Long resourceId);
Integer getDeptInfrastructureApply(Long deptId); Integer getDeptInfrastructureApply(Long deptId);
List<Long> getInstanceIdByResId(Long id);
} }

View File

@ -22,10 +22,12 @@ import io.renren.modules.resource.service.ResourceService;
import io.renren.modules.resource.videoPreview.AbstractVideoPreviewService; import io.renren.modules.resource.videoPreview.AbstractVideoPreviewService;
import io.renren.modules.resource.videoPreview.VideoPreviewFactory; import io.renren.modules.resource.videoPreview.VideoPreviewFactory;
import io.renren.modules.security.user.SecurityUser; import io.renren.modules.security.user.SecurityUser;
import io.renren.modules.security.user.UserDetail;
import io.renren.modules.sys.dao.SysUserDao; import io.renren.modules.sys.dao.SysUserDao;
import io.renren.modules.sys.dto.SysDeptDTO; import io.renren.modules.sys.dto.SysDeptDTO;
import io.renren.modules.sys.dto.SysUserDTO; import io.renren.modules.sys.dto.SysUserDTO;
import io.renren.modules.sys.entity.SysUserEntity; import io.renren.modules.sys.entity.SysUserEntity;
import io.renren.modules.sys.enums.SuperAdminEnum;
import io.renren.modules.sys.service.SysDeptService; import io.renren.modules.sys.service.SysDeptService;
import io.renren.modules.sys.service.SysUserService; import io.renren.modules.sys.service.SysUserService;
import io.swagger.annotations.*; import io.swagger.annotations.*;
@ -171,15 +173,11 @@ public class ResourceController {
@ApiImplicitParam(name = "deptId", value = "所属部门", paramType = "query", dataType = "long"), @ApiImplicitParam(name = "deptId", value = "所属部门", paramType = "query", dataType = "long"),
@ApiImplicitParam(name = "approveStatus", value = "审核状态,可选值(通过、审核中)", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "approveStatus", value = "审核状态,可选值(通过、审核中)", paramType = "query", dataType = "String"),
}) })
public void exportSelectCensusResourceTable(@RequestParam Map<String, Object> params, HttpServletResponse response) throws IOException { public void exportSelect(@RequestParam Map<String, Object> params, HttpServletResponse response) throws IOException {
// UserDetail user = SecurityUser.getUser();
// if (user.getDeptId() != null) {
// SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId());
// params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域
// }
List<ResourceDTO> result = resourceService.list(params); List<ResourceDTO> result = resourceService.list(params);
List<List<Object>> date = result.stream().map(index -> { List<List<Object>> date = result.stream().map(index -> {
List<Object> data = new ArrayList<>(); List<Object> data = new ArrayList<>();
try {
data.add(index.getName()); data.add(index.getName());
data.add(index.getDescription()); data.add(index.getDescription());
Optional<SysDeptDTO> sysDeptDTOOptional = Optional.ofNullable(sysDeptService.get(index.getDeptId() == null ? 0l : index.getDeptId())); Optional<SysDeptDTO> sysDeptDTOOptional = Optional.ofNullable(sysDeptService.get(index.getDeptId() == null ? 0l : index.getDeptId()));
@ -188,7 +186,8 @@ public class ResourceController {
} else { } else {
data.add("--"); data.add("--");
} }
Optional<String> yyly = index.getInfoList().stream().filter(index_ -> index_.getAttrType().equals("应用领域") && index_.getDelFlag().intValue() == 0).map(index_ -> index_.getAttrValue()).findFirst(); String sql = String.format("SELECT attr_value FROM tb_data_attr WHERE data_resource_id = %d AND attr_type = '应用领域' AND del_flag = 0 LIMIT 1;", index.getId());
Optional<String> yyly = Optional.ofNullable(jdbcTemplate.queryForObject(sql, String.class));
if (yyly.isPresent()) { if (yyly.isPresent()) {
data.add(yyly.get()); data.add(yyly.get());
} else { } else {
@ -203,18 +202,22 @@ public class ResourceController {
data.add("--"); data.add("--");
} }
return data; return data;
}).collect(Collectors.toList()); } catch (Exception exception) {
logger.error("导出数据异常", exception);
return null;
}
}).filter(index -> index != null).collect(Collectors.toList());
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8");
String fileName = URLEncoder.encode("资源导出_" + System.currentTimeMillis(), "UTF-8").replaceAll("\\+", "%20"); String fileName = URLEncoder.encode("资源导出_" + System.currentTimeMillis(), "UTF-8").replaceAll("\\+", "%20");
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
EasyExcel.write(response.getOutputStream()).head(exportSelectCensusResourceTableHead()) EasyExcel.write(response.getOutputStream()).head(exportSelectHead())
.registerWriteHandler(new CustomCellWriteWeightConfig()) .registerWriteHandler(new CustomCellWriteWeightConfig())
.registerWriteHandler(new CustomCellWriteHeightConfig()) .registerWriteHandler(new CustomCellWriteHeightConfig())
.sheet("上架情况").doWrite(date); .sheet("资源导出").doWrite(date);
} }
private List<List<String>> exportSelectCensusResourceTableHead() { private List<List<String>> exportSelectHead() {
List<List<String>> list = new ArrayList<>(); List<List<String>> list = new ArrayList<>();
List<String> head0 = new ArrayList<>(); List<String> head0 = new ArrayList<>();
head0.add("名称"); head0.add("名称");
@ -227,7 +230,7 @@ public class ResourceController {
List<String> head4 = new ArrayList<>(); List<String> head4 = new ArrayList<>();
head4.add("上架时间"); head4.add("上架时间");
List<String> head5 = new ArrayList<>(); List<String> head5 = new ArrayList<>();
head4.add("上架账号"); head5.add("上架账号");
list.add(head0); list.add(head0);
list.add(head1); list.add(head1);
list.add(head2); list.add(head2);
@ -335,7 +338,7 @@ public class ResourceController {
@ApiOperation("查询部门企业列表及汇聚能力数量") @ApiOperation("查询部门企业列表及汇聚能力数量")
@LogOperation("查询部门企业列表及汇聚能力数量") @LogOperation("查询部门企业列表及汇聚能力数量")
public Result selectDeptList(@RequestBody JSONObject jsonObject) { public Result selectDeptList(@RequestBody JSONObject jsonObject) {
return new Result().ok(resourceService.selectDeptList(jsonObject, jsonObject.getString("type"))); return new Result().ok(resourceService.selectDeptList(jsonObject, jsonObject.containsKey("type") ? (jsonObject.getString("type") == null ? "" : jsonObject.getString("type")) : ""));
} }
@GetMapping("/updateVisits") @GetMapping("/updateVisits")
@ -542,7 +545,7 @@ public class ResourceController {
if (size == null) size = 10; if (size == null) size = 10;
Long userId = SecurityUser.getUserId(); Long userId = SecurityUser.getUserId();
if (userId == null){ if (userId == null) {
return new Result<>().error("请登录"); return new Result<>().error("请登录");
} }
@ -557,21 +560,65 @@ public class ResourceController {
" <soap:Body>\n" + " <soap:Body>\n" +
" <ZySPPort xmlns=\"http://tempuri.org/\">\n" + " <ZySPPort xmlns=\"http://tempuri.org/\">\n" +
// " <userguid>e8d2fb43-f512-4918-ab47-1141b925af10</userguid>\n" + // " <userguid>e8d2fb43-f512-4918-ab47-1141b925af10</userguid>\n" +
String.format("<userguid>%s</userguid>", sysUser.getGuid()) + String.format(" <userguid>%s</userguid>", sysUser.getGuid()) +
String.format("<pagenum>%d</pagenum>", page) + String.format(" <pagenum>%d</pagenum>\n", page) +
String.format("<pagesize>%d</pagesize>", size) + String.format(" <pagesize>%d</pagesize>\n", size) +
title != null ? String.format("<title>%s</title>", title) : "" + String.format(" <title>%s</title>\n", title == null ? "" : title) +
" </ZySPPort>\n" + " </ZySPPort>\n" +
" </soap:Body>\n" + " </soap:Body>\n" +
"</soap:Envelope>"; "</soap:Envelope>";
HttpHeaders requestHeaders = new HttpHeaders(); HttpHeaders requestHeaders = new HttpHeaders();
requestHeaders.set("SOAPAction", "http://tempuri.org/ZWCJ_mainPort"); requestHeaders.set("SOAPAction", "http://tempuri.org/ZySPPort");
requestHeaders.setContentType(new MediaType("text", "xml", Charset.forName("utf-8"))); requestHeaders.setContentType(new MediaType("text", "xml", Charset.forName("utf-8")));
HttpEntity<String> requestEntity = new HttpEntity<>(parame, requestHeaders); HttpEntity<String> requestEntity = new HttpEntity<>(parame, requestHeaders);
try { try {
String body = restTemplate.postForEntity(url, requestEntity, String.class).getBody(); String body = restTemplate.postForEntity(url, requestEntity, String.class).getBody();
String startTag = "<ZWCJ_mainPortResult>"; String startTag = "<ZySPPortResult>";
String endTag = "</ZWCJ_mainPortResult>"; String endTag = "</ZySPPortResult>";
String json = body.substring(body.indexOf(startTag) + startTag.length(), body.indexOf(endTag));
HashMap result = JSON.parseObject(json, HashMap.class);
return new Result().ok(result);
} catch (Exception e) {
e.printStackTrace();
return new Result().ok(new ArrayList(0));
}
}
@GetMapping("ZywMessage/yaweiApproveDetails")
@ApiOperation("数据资源审批详情转发")
@LogOperation("数据资源审批详情转发")
public Result yaweiApproveDetails(@ApiParam("申请guid") String applyGuid
// , @ApiParam("部门guid") String deptGuid
) {
Long userId = SecurityUser.getUserId();
if (userId == null) {
return new Result<>().error("请登录");
}
SysUserEntity sysUser = sysUserDao.getById(userId);
if (sysUser == null || sysUser.getGuid() == null) {
return new Result<>().error("该账号没有权限");
}
String url = "http://15.72.158.81/zyjk/ZywMessage.asmx?op=ZyShowrecord";
String parame = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" +
"<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n" +
" <soap:Body>\n" +
" <ZyShowrecord xmlns=\"http://tempuri.org/\">\n" +
String.format(" <guid>%s</guid>\n", applyGuid) +
String.format(" <userguid>%s</userguid>", sysUser.getGuid()) +
// String.format(" <bmguid>%s</bmguid>\n", deptGuid) +
" </ZyShowrecord>\n" +
" </soap:Body>\n" +
"</soap:Envelope>";
HttpHeaders requestHeaders = new HttpHeaders();
requestHeaders.set("SOAPAction", "http://tempuri.org/ZyShowrecord");
requestHeaders.setContentType(new MediaType("text", "xml", Charset.forName("utf-8")));
HttpEntity<String> requestEntity = new HttpEntity<>(parame, requestHeaders);
try {
String body = restTemplate.postForEntity(url, requestEntity, String.class).getBody();
String startTag = "<ZyShowrecordResult>";
String endTag = "</ZyShowrecordResult>";
String json = body.substring(body.indexOf(startTag) + startTag.length(), body.indexOf(endTag)); String json = body.substring(body.indexOf(startTag) + startTag.length(), body.indexOf(endTag));
HashMap result = JSON.parseObject(json, HashMap.class); HashMap result = JSON.parseObject(json, HashMap.class);
@ -829,4 +876,64 @@ public class ResourceController {
} }
@PostMapping("/delResBySuAd")
@ApiOperation("/超级管理员删除能力数据")
@LogOperation("/超级管理员删除能力数据")
public Result delResBySuAd(Long id) {
UserDetail user = SecurityUser.getUser();
//不是超级管理员不能执行删除操作
if (SuperAdminEnum.NO.value() == user.getSuperAdmin()) {
return new Result().error("请使用超级管理员账号进行此操作!");
} else {
try {
resourceService.delResBySuAd(id);
} catch (Exception e) {
return new Result().error("清除能力及相关数据失败!");
}
return new Result().ok("能力及相关数据已清除。");
}
}
@PostMapping("/delProcinstBySuAd")
@ApiOperation("/超级管理员删除流程数据")
@LogOperation("/超级管理员删除流程数据")
public Result delProcinstBySuAd(Long id, String type, Long resourceId) {
UserDetail user = SecurityUser.getUser();
//不是超级管理员不能执行删除操作
if (SuperAdminEnum.NO.value() == user.getSuperAdmin()) {
return new Result().error("请使用超级管理员账号进行此操作!");
} else {
try {
resourceService.delProcinstBySuAd(id, type, resourceId);
} catch (Exception e) {
return new Result().error("清除流程及相关数据失败!");
}
return new Result().ok("流程及相关数据已清除。");
}
}
@PostMapping("/getResourceBusinessList")
@ApiOperation("/获取申请云资源业务列表")
@LogOperation("/获取申请云资源业务列表")
public Object getResourceBusinessList(String userAccount, String status) {
try {
return resourceService.getResourceBusinessList(userAccount, status);
} catch (Exception e) {
e.printStackTrace();
return new Result<>().error("云资源查询接口调用失败!");
}
}
@PostMapping("/getVideoBusinessList")
@ApiOperation("/获取云视频业务列表")
@LogOperation("/获取云视频业务列表")
public Object getVideoBusinessList(String userAccount, String status) {
try {
return resourceService.getVideoBusinessList(userAccount, status);
} catch (Exception e) {
e.printStackTrace();
return new Result<>().error("云视频查询接口调用失败!");
}
}
} }

View File

@ -221,4 +221,6 @@ public interface ResourceDao extends BaseDao<ResourceEntity> {
Integer getSquareListCount(@Param("type") String type, @Param("deptType") Integer deptType, @Param("area") String area); Integer getSquareListCount(@Param("type") String type, @Param("deptType") Integer deptType, @Param("area") String area);
List<Map> getAppListByDept(@Param("deptId") Long deptId, @Param("key") String key); List<Map> getAppListByDept(@Param("deptId") Long deptId, @Param("key") String key);
Integer updateByDelProcinst(@Param("resourceId") Long resourceId);
} }

View File

@ -17,7 +17,7 @@ public class SelectApplyDeptDetailTypeCountListExcel {
private Integer ywzj; private Integer ywzj;
@ExcelProperty({"应用资源"}) @ExcelProperty({"应用资源"})
private Integer yyzy; private Integer yyzy;
@ExcelProperty({"议室"}) @ExcelProperty({"客厅"})
private Integer hys; private Integer hys;
@ExcelProperty({"总计"}) @ExcelProperty({"总计"})
private Integer count; private Integer count;

View File

@ -162,4 +162,11 @@ public interface ResourceService extends CrudService<ResourceEntity, ResourceDTO
Object getAppListByDept(String key); Object getAppListByDept(String key);
void delResBySuAd(Long id);
void delProcinstBySuAd(Long id, String type, Long resourceId);
Object getResourceBusinessList(String userAccount, String status);
Object getVideoBusinessList(String userAccount, String status);
} }

View File

@ -16,12 +16,16 @@ import io.renren.common.domain.Tsingtao_xhaProperties;
import io.renren.common.page.PageData; import io.renren.common.page.PageData;
import io.renren.common.service.impl.CrudServiceImpl; import io.renren.common.service.impl.CrudServiceImpl;
import io.renren.common.utils.DateUtils; import io.renren.common.utils.DateUtils;
import io.renren.modules.demanData.dao.TDemandDataDao;
import io.renren.modules.demandComment.dao.TDemandCommentDao;
import io.renren.modules.enke.service.EnkeService; import io.renren.modules.enke.service.EnkeService;
import io.renren.modules.meeting.dao.TMeetingroomBookMapper;
import io.renren.modules.meeting.dao.TMeetingroomMapper; import io.renren.modules.meeting.dao.TMeetingroomMapper;
import io.renren.modules.meeting.entity.TMeetingroom; import io.renren.modules.meeting.entity.TMeetingroom;
import io.renren.modules.monitor.dto.CameraChannelDto1; import io.renren.modules.monitor.dto.CameraChannelDto1;
import io.renren.modules.monitor.entity.CameraChannel; import io.renren.modules.monitor.entity.CameraChannel;
import io.renren.modules.monitor.mapper.CameraChannelMapper; import io.renren.modules.monitor.mapper.CameraChannelMapper;
import io.renren.modules.notice.dao.SysNoticeDao;
import io.renren.modules.processForm.dao.TAbilityApplicationDao; import io.renren.modules.processForm.dao.TAbilityApplicationDao;
import io.renren.modules.processForm.dto.TAbilityApplicationDTO; import io.renren.modules.processForm.dto.TAbilityApplicationDTO;
import io.renren.modules.processForm.entity.TAbilityApplicationEntity; import io.renren.modules.processForm.entity.TAbilityApplicationEntity;
@ -39,8 +43,10 @@ import io.renren.modules.resource.entity.ResourceEntity;
import io.renren.modules.resource.entity.ResourceEntityDelFlag; import io.renren.modules.resource.entity.ResourceEntityDelFlag;
import io.renren.modules.resource.entity.TbDataResourceRelEntity; import io.renren.modules.resource.entity.TbDataResourceRelEntity;
import io.renren.modules.resource.service.ResourceService; import io.renren.modules.resource.service.ResourceService;
import io.renren.modules.resourceBrowse.dao.ResourceBrowseDao;
import io.renren.modules.resourceCar.dao.ResourceCarDao; import io.renren.modules.resourceCar.dao.ResourceCarDao;
import io.renren.modules.resourceCollection.dao.ResourceCollectionDao; import io.renren.modules.resourceCollection.dao.ResourceCollectionDao;
import io.renren.modules.resourceMountApply.dao.TResourceMountApplyDao;
import io.renren.modules.resourceMountApply.dto.TResourceMountApplyDTO; import io.renren.modules.resourceMountApply.dto.TResourceMountApplyDTO;
import io.renren.modules.resourceMountApply.service.TResourceMountApplyService; import io.renren.modules.resourceMountApply.service.TResourceMountApplyService;
import io.renren.modules.resourceScore.dao.ResourceScoreDao; import io.renren.modules.resourceScore.dao.ResourceScoreDao;
@ -57,6 +63,7 @@ import io.renren.modules.sys.service.SysUserService;
import lombok.SneakyThrows; import lombok.SneakyThrows;
import okhttp3.*; import okhttp3.*;
import org.activiti.engine.HistoryService; import org.activiti.engine.HistoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.history.HistoricProcessInstance; import org.activiti.engine.history.HistoricProcessInstance;
import org.activiti.engine.history.HistoricProcessInstanceQuery; import org.activiti.engine.history.HistoricProcessInstanceQuery;
import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.BooleanUtils;
@ -69,9 +76,14 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable; import org.springframework.cache.annotation.Cacheable;
import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Lazy;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.text.ParseException; import java.text.ParseException;
@ -95,6 +107,9 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
private static final Integer CPU_NUM = Runtime.getRuntime().availableProcessors(); private static final Integer CPU_NUM = Runtime.getRuntime().availableProcessors();
private static final ExecutorService executor = Executors.newWorkStealingPool(CPU_NUM * 3); private static final ExecutorService executor = Executors.newWorkStealingPool(CPU_NUM * 3);
@Autowired
private RestTemplate restTemplate;
/** /**
* 公共http客户端 * 公共http客户端
*/ */
@ -204,6 +219,33 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
@Autowired @Autowired
private EnkeService enkeService; private EnkeService enkeService;
@Autowired
private ResourceBrowseDao resourceBrowseDao;
@Autowired
private TResourceMountApplyDao resourceMountApplyDao;
@Autowired
private TAbilityApplicationDao abilityApplicationDao;
@Autowired
private RuntimeService runtimeService;
@Autowired
private SysNoticeDao sysNoticeDao;
@Autowired
private TMeetingroomMapper meetingroomMapper;
@Autowired
private TMeetingroomBookMapper meetingroomBookMapper;
@Autowired
private TDemandCommentDao demandCommentDao;
@Autowired
private TDemandDataDao tDemandDataDao;
@Override @Override
public QueryWrapper<ResourceEntity> getWrapper(Map<String, Object> params) { public QueryWrapper<ResourceEntity> getWrapper(Map<String, Object> params) {
@ -2048,7 +2090,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
// //
//}, executor); //}, executor);
//统计增加会议室搜索结果 //统计增加会客厅搜索结果
CompletableFuture<Void> meetingRoomCount = CompletableFuture.runAsync(() -> meetCountNew[0] = tMeetingroomMapper.selectByName(keyWorld).size(), executor); CompletableFuture<Void> meetingRoomCount = CompletableFuture.runAsync(() -> meetCountNew[0] = tMeetingroomMapper.selectByName(keyWorld).size(), executor);
CompletableFuture<Void> all = CompletableFuture.allOf(DBresourceCount, dataResourceCount, meetingRoomCount); CompletableFuture<Void> all = CompletableFuture.allOf(DBresourceCount, dataResourceCount, meetingRoomCount);
@ -2064,10 +2106,6 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
List<String> temp = new ArrayList<>(); List<String> temp = new ArrayList<>();
resultList.forEach(map -> { resultList.forEach(map -> {
temp.add(map.get("type").toString()); temp.add(map.get("type").toString());
if ("基础设施".equals(map.get("type").toString())) {
int num = meetCountNew[0] + Integer.parseInt(map.get("count").toString());
map.replace("count", num);
}
}); });
Arrays.stream(censusTypes).filter(index -> !temp.contains(index)).forEach(index -> { Arrays.stream(censusTypes).filter(index -> !temp.contains(index)).forEach(index -> {
Map<String, Object> nullMap = new HashMap<String, Object>() { Map<String, Object> nullMap = new HashMap<String, Object>() {
@ -2078,6 +2116,12 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
}; };
resultList.add(nullMap); resultList.add(nullMap);
}); });
resultList.forEach(map -> {
if ("基础设施".equals(map.get("type").toString())) {
int num = meetCountNew[0] + Integer.parseInt(map.get("count").toString());
map.replace("count", num);
}
});
return resultList; return resultList;
} }
@ -2208,7 +2252,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
return index; return index;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
Map<String, List<Map<String, Object>>> typeCountListMap3 = // 议室 Map<String, List<Map<String, Object>>> typeCountListMap3 = // 客厅
typeCountListByApplyDept.stream().filter(index -> index.get("deptType").toString().equals("99")).collect(Collectors.groupingBy(m -> m.get("deptName").toString())); typeCountListByApplyDept.stream().filter(index -> index.get("deptType").toString().equals("99")).collect(Collectors.groupingBy(m -> m.get("deptName").toString()));
resultList = resultList.stream().map(index -> { resultList = resultList.stream().map(index -> {
if (typeCountListMap3.keySet().contains(index.get("name").toString())) { // 该部门存在上架信息 if (typeCountListMap3.keySet().contains(index.get("name").toString())) { // 该部门存在上架信息
@ -2226,7 +2270,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
return index; return index;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
if (!typeCountListMap3.isEmpty()) { // 仍然有会议室信息 if (!typeCountListMap3.isEmpty()) { // 仍然有会客厅信息
List<HashMap<String, Object>> temp = typeCountListMap3.keySet().stream().map(index_ -> { List<HashMap<String, Object>> temp = typeCountListMap3.keySet().stream().map(index_ -> {
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
typeCountListMap3.get(index_).stream().forEach(count -> { typeCountListMap3.get(index_).stream().forEach(count -> {
@ -2248,7 +2292,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
map.put("zsk", "0"); map.put("zsk", "0");
map.put("sjzy", "0"); map.put("sjzy", "0");
return map; return map;
}).collect(Collectors.toList()); // 议室 }).collect(Collectors.toList()); // 客厅
resultList.addAll(temp); resultList.addAll(temp);
} }
@ -2554,4 +2598,159 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
return resourceDao.getAppListByDept(deptId, key); return resourceDao.getAppListByDept(deptId, key);
} }
@Override
@Transactional
public void delResBySuAd(Long id) {
//resource,attr表
CompletableFuture<Void> delRes = CompletableFuture.runAsync(() -> {
resourceDao.deleteById(id);
Map<String, Object> map = new HashMap<>();
map.put("data_resource_id", id);
attrDao.deleteByMap(map);
}, executor);
//browse,collection,score,car表
CompletableFuture<Void> delResOthers = CompletableFuture.runAsync(() -> {
Map<String, Object> map = new HashMap<>();
map.put("resource_id", id);
resourceBrowseDao.deleteByMap(map);
resourceCarDao.deleteByMap(map);
resourceCollectionDao.deleteByMap(map);
resourceScoreDao.deleteByMap(map);
}, executor);
//删除上架流程实例及通知消息数据
CompletableFuture<Void> delMountData = CompletableFuture.runAsync(() -> {
List<Long> instanceIdList = resourceMountApplyDao.getInstanceIdByResId(id);
if (!instanceIdList.isEmpty()) {
instanceIdList.forEach(index -> this.delProcinstBySuAd(index, "能力上架", null));
}
}, executor);
//删除使用流程表单相关数据及通知消息数据
CompletableFuture<Void> delAbilityData = CompletableFuture.runAsync(() -> {
List<Long> instanceIdList = abilityApplicationDao.getInstanceIdByResId(id);
if (!instanceIdList.isEmpty()) {
instanceIdList.forEach(index -> this.delProcinstBySuAd(index, "能力使用", null));
}
}, executor);
//会客厅
CompletableFuture<Void> delRoom = CompletableFuture.runAsync(() -> {
meetingroomMapper.deleteById(id);
//获取当前会客厅预约记录用于删除消息数据
List<Long> idList = meetingroomBookMapper.selectBookIdByRoomId(id);
if (!idList.isEmpty()) {
//清除消息数据
idList.forEach(x -> this.delProcinstBySuAd(x, "会客厅申请", null));
}
}, executor);
//删除申请表单数据
CompletableFuture<Void> delFormData = CompletableFuture.runAsync(() -> {
Map<String, Object> map = new HashMap<>();
map.put("resource_id", id);
resourceMountApplyDao.deleteByMap(map);
abilityApplicationDao.deleteByMap(map);
}, executor);
CompletableFuture<Void> all = CompletableFuture.allOf(delRes, delResOthers, delMountData, delAbilityData, delRoom, delFormData);
all.join();
}
@Override
public void delProcinstBySuAd(Long id, String type, Long resourceId) {
//删除会客厅申请单独处理
if ("会客厅申请".equals(type)) {
meetingroomBookMapper.deleteById(id);
Map<String, Object> deleteMap = new HashMap() {{
put("apply_id", id.toString());
}};
sysNoticeDao.deleteByMap(deleteMap);
} else {
//清除流程实例数据
CompletableFuture<Void> delProcinstHis = CompletableFuture.runAsync(() -> {
try {
historyService.deleteHistoricProcessInstance(id.toString());
} catch (Exception e) {
logger.info("该流程实例为运行中实例,已调用运行中实例相关方法删除!");
}
}, executor);
//清除流程实例数据
CompletableFuture<Void> delProcinstRun = CompletableFuture.runAsync(() -> {
try {
runtimeService.deleteProcessInstance(id.toString(), "");
} catch (Exception e) {
logger.info("该流程实例为已完成实例,已调用历史流程实例相关方法删除!");
}
}, executor);
//清除消息数据
CompletableFuture<Void> delMessage = CompletableFuture.runAsync(() -> {
Map<String, Object> deleteMap = new HashMap() {{
put("apply_id", id.toString());
}};
sysNoticeDao.deleteByMap(deleteMap);
}, executor);
//删除申请表单数据
CompletableFuture<Void> delFrom = CompletableFuture.runAsync(() -> {
Map<String, Object> deleteMap = new HashMap() {{
put("instance_id", id.toString());
}};
switch (type) {
case "能力上架": {
resourceMountApplyDao.deleteByMap(deleteMap);
}
break;
case "能力使用": {
abilityApplicationDao.deleteByMap(deleteMap);
}
break;
case "能力下架": {
resourceDao.updateByDelProcinst(resourceId);
}
break;
case "需求评论": {
demandCommentDao.deleteByMap(deleteMap);
}
break;
case "能力需求": {
tDemandDataDao.deleteByMap(deleteMap);
}
break;
default:
break;
}
}, executor);
CompletableFuture<Void> all = CompletableFuture.allOf(delProcinstHis, delProcinstRun, delMessage, delFrom);
all.join();
}
}
@Override
public Object getResourceBusinessList(String userAccount, String status) {
MultiValueMap<String, Object> param = new LinkedMultiValueMap<>();
param.add("userAccount", userAccount);
param.add("status", status);
HttpEntity<String> requestEntity = new HttpEntity(param, new HttpHeaders());
return restTemplate.postForEntity("http://15.72.183.88:8760/yzy/main/cloudresource/getResourceBusinessList", requestEntity, String.class).getBody();
}
@Override
public Object getVideoBusinessList(String userAccount, String status) {
MultiValueMap<String, Object> param = new LinkedMultiValueMap<>();
param.add("userAccount", userAccount);
param.add("status", status);
HttpEntity<String> requestEntity = new HttpEntity(param, new HttpHeaders());
return restTemplate.postForEntity("http://15.72.183.88:8760/yzy/main/cloudresource/getVideoBusinessList", requestEntity, String.class).getBody();
}
} }

View File

@ -55,7 +55,7 @@ public class ResourceCollectionServiceImpl extends CrudServiceImpl<ResourceColle
List<ResourceCollectionDTO> resourceCollectionDTOS = resourceCollectionDao.selectWithResource(params); List<ResourceCollectionDTO> resourceCollectionDTOS = resourceCollectionDao.selectWithResource(params);
resourceCollectionDTOS.forEach(item -> item.setResourceDTO(resourceService.selectWithAttrs(item.getResourceId()))); resourceCollectionDTOS.forEach(item -> item.setResourceDTO(resourceService.selectWithAttrs(item.getResourceId())));
result.addAll(resourceCollectionDTOS); result.addAll(resourceCollectionDTOS);
if (params.get("type") == null || "".equals(params.get("type"))) { if (params.get("type") == null || "".equals(params.get("type")) || "融合服务".equals(params.get("type"))) {
List<ResourceCollectionDTO> fuseCollectionDTOS = resourceCollectionDao.selectWithFuse(params); List<ResourceCollectionDTO> fuseCollectionDTOS = resourceCollectionDao.selectWithFuse(params);
fuseCollectionDTOS.forEach(item -> item.setFuseDTO(fuseService.getFuseById(item.getResourceId()))); fuseCollectionDTOS.forEach(item -> item.setFuseDTO(fuseService.getFuseById(item.getResourceId())));
result.addAll(fuseCollectionDTOS); result.addAll(fuseCollectionDTOS);

View File

@ -4,6 +4,10 @@ import io.renren.common.dao.BaseDao;
import io.renren.modules.resourceMountApply.entity.TResourceMountApplyEntity; import io.renren.modules.resourceMountApply.entity.TResourceMountApplyEntity;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.Collection;
import java.util.List;
import java.util.Map;
/** /**
* 资源挂载申请表单 * 资源挂载申请表单
* *
@ -13,4 +17,6 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper @Mapper
public interface TResourceMountApplyDao extends BaseDao<TResourceMountApplyEntity> { public interface TResourceMountApplyDao extends BaseDao<TResourceMountApplyEntity> {
void updateInstanceId(String instanceId, Long id); void updateInstanceId(String instanceId, Long id);
List<Long> getInstanceIdByResId(Long id);
} }

View File

@ -76,6 +76,8 @@ public class ShiroConfig {
filterMap.put("/resource/getApplyCameraList/**", "anon"); filterMap.put("/resource/getApplyCameraList/**", "anon");
filterMap.put("/resource/hls/getHls", "anon"); filterMap.put("/resource/hls/getHls", "anon");
filterMap.put("/admin/downloadLog", "anon"); // 下载运行日志文件
/** /**
* 资源上传 * 资源上传
*/ */

View File

@ -14,12 +14,16 @@ big_date:
assignee_city_role_name: 市审批人 assignee_city_role_name: 市审批人
# 当某部门未设置部门审批人时,将使用该用户审批 # 当某部门未设置部门审批人时,将使用该用户审批
default_assignee_role_id: 1516728698224427010 default_assignee_role_id: 1516728698224427010
# 会议室审核员 # 会客厅审核员
assignee_meet_role_id: 1576849766277849089 assignee_meet_role_id: 1576849766277849089
# 需要进行统计数目的资源 type/需要进行统计申请的资源类型 applyType # 需要进行统计数目的资源 type/需要进行统计申请的资源类型 applyType
census: census:
type: 应用资源,组件服务,基础设施,数据资源,知识库 type: 应用资源,组件服务,基础设施,数据资源,知识库
applyType: 应用资源,业务组件,图层服务,开发组件,智能算法 applyType: 应用资源,业务组件,图层服务,开发组件,智能算法
# 全局RestTemplate配置
rest_template:
read_timeout: 30000
connect_timeout: 5000
# 海信网关 # 海信网关
hisense: hisense:
gateway: gateway:
@ -52,8 +56,8 @@ spring:
basename: i18n/messages basename: i18n/messages
servlet: servlet:
multipart: multipart:
max-file-size: 100MB max-file-size: 1024MB
max-request-size: 100MB max-request-size: 1024MB
enabled: true enabled: true
redis: redis:
database: 0 database: 0

View File

@ -142,5 +142,8 @@
where t.state = 1 where t.state = 1
and #{date} > t.book_date and #{date} > t.book_date
</select> </select>
<select id="selectBookIdByRoomId" resultType="java.lang.Long">
SELECT id FROM t_meetingroom_book WHERE room_id = #{id}
</select>
</mapper> </mapper>

View File

@ -124,7 +124,7 @@
SELECT SELECT
COUNT( id ) AS 'amount', COUNT( id ) AS 'amount',
'会议室' AS 'type' '会客厅' AS 'type'
FROM FROM
t_meetingroom_book tmb t_meetingroom_book tmb
) temp2 ) temp2
@ -288,4 +288,8 @@
AND taa.expire_date > now() AND taa.expire_date > now()
AND sd.id = #{deptId} AND sd.id = #{deptId}
</select> </select>
<select id="getInstanceIdByResId" resultType="java.lang.Long">
SELECT instance_id FROM t_ability_application WHERE resource_id = #{id}
</select>
</mapper> </mapper>

View File

@ -104,6 +104,19 @@
</foreach> </foreach>
</update> </update>
<update id="updateByDelProcinst">
UPDATE tb_data_resource
SET del_flag = 0,
undercarriage_reason = NULL,
undercarriage_user_name = NULL,
apply_number = NULL,
undercarriage_enclosure = NULL,
undercarriage_title = NULL,
undercarriage_phone = NULL,
undercarriage_enclosure_name = NULL
WHERE id = #{resourceId}
</update>
<select id="selectWithAttrs" resultMap="resourceDTO"> <select id="selectWithAttrs" resultMap="resourceDTO">
SELECT SELECT
DISTINCT tdr.id, DISTINCT tdr.id,

View File

@ -16,12 +16,15 @@
<result property="resourceId" column="resource_id"/> <result property="resourceId" column="resource_id"/>
<result property="resourceDTO" column="resource_dto" <result property="resourceDTO" column="resource_dto"
typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/> typeHandler="com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler"/>
<result property="createtime" column="createtime"/> <result property="createDate" column="create_date"/>
<result property="applyNumber" column="apply_number"/> <result property="applyNumber" column="apply_number"/>
</resultMap> </resultMap>
<update id="updateInstanceId"> <update id="updateInstanceId">
update t_resource_mount_apply set instance_id = #{instanceId} where id = #{id}; update t_resource_mount_apply set instance_id = #{instanceId} where id = #{id};
</update> </update>
<select id="getInstanceIdByResId" resultType="java.lang.Long">
SELECT CAST(instance_id AS DECIMAL(20)) FROM t_resource_mount_apply WHERE resource_id = #{id}
</select>
</mapper> </mapper>