diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java b/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java index be2a19b7..a509d030 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/controller/ActTaskController.java @@ -112,7 +112,7 @@ public class ActTaskController { " t_meetingroom_book.id AS `taskId`, " + " t_meetingroom_book.dept AS `userDeptName`, " + " t_meetingroom.`name` AS `userName`, " + - " '会议室审核' AS `taskName `, " + + " '会客厅审核' AS `taskName `, " + " t_meetingroom.create_date AS `createTime` " + "FROM " + " t_meetingroom_book " + diff --git a/renren-admin/src/main/java/io/renren/modules/meeting/controller/BookMeetingRoomController.java b/renren-admin/src/main/java/io/renren/modules/meeting/controller/BookMeetingRoomController.java index ed447a80..e19c1b32 100644 --- a/renren-admin/src/main/java/io/renren/modules/meeting/controller/BookMeetingRoomController.java +++ b/renren-admin/src/main/java/io/renren/modules/meeting/controller/BookMeetingRoomController.java @@ -31,7 +31,7 @@ import java.util.Date; import java.util.List; import java.util.Map; -@Api(tags = "预约会议室") +@Api(tags = "预约会客厅") @RestController @RequestMapping("bookMeeting") public class BookMeetingRoomController { @@ -39,7 +39,7 @@ public class BookMeetingRoomController { @Value("${big_date.name}") private String bigDateDeptName; // 大数据局名称 @Value("${big_date.assignee_meet_role_id}") - private String defaultAssigneeRoleId; // 改成配置的会议室审核人 + private String defaultAssigneeRoleId; // 改成配置的会客厅审核人 @Resource private TMeetingroomBookService tMeetingroomBookService; @@ -51,11 +51,11 @@ public class BookMeetingRoomController { private SysRoleUserService sysRoleUserService; @GetMapping("list") - @ApiOperation("搜索可以预约的会议室") + @ApiOperation("搜索可以预约的会客厅") @ApiImplicitParams({ @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 = "name", value = "会议室名称", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "name", value = "会客厅名称", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "bookDate", value = "预约开始时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "startTime", value = "预约开始时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "endTime", value = "预约结束时间", paramType = "query", dataType = "String"), @@ -70,7 +70,7 @@ public class BookMeetingRoomController { @ApiImplicitParams({ @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 = "roomName", value = "会议室名称", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "roomName", value = "会客厅名称", paramType = "query", dataType = "String"), }) public Result> page(@ApiIgnore @RequestParam Map params) { PageData page = tMeetingroomBookService.queryList(params); @@ -78,9 +78,9 @@ public class BookMeetingRoomController { } @GetMapping("availableDate") - @ApiOperation("根据日期获取会议室当天的可用时段") + @ApiOperation("根据日期获取会客厅当天的可用时段") @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"), }) public Result> availableDate(@ApiIgnore @RequestParam Map params) throws ParseException { @@ -101,9 +101,9 @@ public class BookMeetingRoomController { tMeetingroomBookService.save(dto); // 发起预约后推送消息 String content = "【通知】请审核" + dto.getName() + "发起的" + dto.getRoomName() + - "会议室申请"; + "会客厅申请"; SysNoticeDTO sysNoticeDTO = new SysNoticeDTO(); - sysNoticeDTO.setTitle("会议室申请审核通知"); + sysNoticeDTO.setTitle("会客厅申请审核通知"); sysNoticeDTO.setContent(content); // 通知内容 sysNoticeDTO.setReceiverType(1); sysNoticeDTO.setType(11); @@ -127,12 +127,12 @@ public class BookMeetingRoomController { sysNoticeService.save(sysNoticeDTO); // 还要发送自己能看到的的谁给我审核的消息 String ownedContent = "【通知】您发起的" + dto.getRoomName() + - "会议室申请,当前审核部门为:" + bigDateDeptName + ",审核负责人:会议室管理员"; + "会客厅申请,当前审核部门为:" + bigDateDeptName + ",审核负责人:会客厅管理员"; SysNoticeDTO ownedSysNoticeDTO = new SysNoticeDTO(); ownedSysNoticeDTO.setType(10); ownedSysNoticeDTO.setApplyState(0); ownedSysNoticeDTO.setApplyId(dto.getId().toString()); - ownedSysNoticeDTO.setTitle("会议室申请发起通知"); + ownedSysNoticeDTO.setTitle("会客厅申请发起通知"); ownedSysNoticeDTO.setContent(ownedContent); // 通知内容 ownedSysNoticeDTO.setReceiverType(1); ownedSysNoticeDTO.setReceiverTypeIds(dto.getCreator().toString()); @@ -160,7 +160,7 @@ public class BookMeetingRoomController { @ApiImplicitParams({ @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 = "roomName", value = "会议室名称", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "roomName", value = "会客厅名称", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "state", value = "预约状态", paramType = "query", dataType = "int"), }) public Result> auditPage(@ApiIgnore @RequestParam Map params) { @@ -180,12 +180,12 @@ public class BookMeetingRoomController { // 修改之后推送存通知sysNotice String state = dto.getState() == 2 ? "通过" : "不通过"; String content = "【通知】" + dto.getName() + ",您发起的" + dto.getRoomName() + - "会议室申请,审核结果为:" + state; + "会客厅申请,审核结果为:" + state; SysNoticeDTO sysNoticeDTO = new SysNoticeDTO(); sysNoticeDTO.setType(10); sysNoticeDTO.setApplyState(1); sysNoticeDTO.setApplyId(dto.getId().toString()); - sysNoticeDTO.setTitle("会议室申请审核结果通知"); + sysNoticeDTO.setTitle("会客厅申请审核结果通知"); sysNoticeDTO.setContent(content); // 通知内容 sysNoticeDTO.setReceiverType(1); sysNoticeDTO.setReceiverTypeIds(dto.getCreator().toString()); diff --git a/renren-admin/src/main/java/io/renren/modules/meeting/controller/MeetingroomController.java b/renren-admin/src/main/java/io/renren/modules/meeting/controller/MeetingroomController.java index 48e688a6..8b3043a6 100644 --- a/renren-admin/src/main/java/io/renren/modules/meeting/controller/MeetingroomController.java +++ b/renren-admin/src/main/java/io/renren/modules/meeting/controller/MeetingroomController.java @@ -22,7 +22,7 @@ import javax.annotation.Resource; import java.util.Date; import java.util.Map; -@Api(tags = "会议室") +@Api(tags = "会客厅") @RestController @RequestMapping("meeting") public class MeetingroomController { @@ -36,7 +36,7 @@ public class MeetingroomController { @ApiImplicitParams({ @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 = "name", value = "会议室名称", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "name", value = "会客厅名称", paramType = "query", dataType = "String"), }) public Result> page(@ApiIgnore @RequestParam Map params) { PageData page = meetingroomService.queryList(params); @@ -58,7 +58,7 @@ public class MeetingroomController { ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); if (meetingroomService.checkMeetingRepeat(dto.getName())) { - return new Result().error("已经存在相同名称的会议室,请勿重复新增"); + return new Result().error("已经存在相同名称的会客厅,请勿重复新增"); } meetingroomService.save(dto); return new Result(); diff --git a/renren-admin/src/main/java/io/renren/modules/meeting/dao/TMeetingroomBookMapper.java b/renren-admin/src/main/java/io/renren/modules/meeting/dao/TMeetingroomBookMapper.java index 37d2f9ef..783916c0 100644 --- a/renren-admin/src/main/java/io/renren/modules/meeting/dao/TMeetingroomBookMapper.java +++ b/renren-admin/src/main/java/io/renren/modules/meeting/dao/TMeetingroomBookMapper.java @@ -34,4 +34,6 @@ public interface TMeetingroomBookMapper extends BaseDao { @Param("state") Integer state); List selectInvalid(Date date); + + List selectBookIdByRoomId(Long id); } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/meeting/dto/TMeetingroomBookDTO.java b/renren-admin/src/main/java/io/renren/modules/meeting/dto/TMeetingroomBookDTO.java index 1cddd128..4f22e87f 100644 --- a/renren-admin/src/main/java/io/renren/modules/meeting/dto/TMeetingroomBookDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/meeting/dto/TMeetingroomBookDTO.java @@ -10,13 +10,13 @@ import java.util.Date; @Data -@ApiModel(value = "会议室预约") +@ApiModel(value = "会客厅预约") public class TMeetingroomBookDTO implements Serializable { private static final long serialVersionUID = 1L; @ApiModelProperty(value = "主键,新增时不传") private Long id; - @ApiModelProperty(value = "会议室id") + @ApiModelProperty(value = "会客厅id") private Long roomId; @ApiModelProperty(value = "预约时间,请传时间格式为2000-01-01") @JsonFormat(pattern = "yyyy-MM-dd") diff --git a/renren-admin/src/main/java/io/renren/modules/meeting/dto/TMeetingroomDTO.java b/renren-admin/src/main/java/io/renren/modules/meeting/dto/TMeetingroomDTO.java index dcbfb57f..e3dcf8fd 100644 --- a/renren-admin/src/main/java/io/renren/modules/meeting/dto/TMeetingroomDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/meeting/dto/TMeetingroomDTO.java @@ -8,10 +8,10 @@ import java.io.Serializable; import java.util.Date; /** - * 会议室 + * 会客厅 */ @Data -@ApiModel(value = "会议室表") +@ApiModel(value = "会客厅表") public class TMeetingroomDTO implements Serializable { private static final long serialVersionUID = 1L; @@ -25,7 +25,7 @@ public class TMeetingroomDTO implements Serializable { private String area; @ApiModelProperty(value = "可容纳人数") private Integer capacity; - @ApiModelProperty(value = "会议室图片") + @ApiModelProperty(value = "会客厅图片") private String pic; @ApiModelProperty(value = "描述") private String description; diff --git a/renren-admin/src/main/java/io/renren/modules/meeting/entity/TMeetingroom.java b/renren-admin/src/main/java/io/renren/modules/meeting/entity/TMeetingroom.java index 3e02f314..74b52e8b 100644 --- a/renren-admin/src/main/java/io/renren/modules/meeting/entity/TMeetingroom.java +++ b/renren-admin/src/main/java/io/renren/modules/meeting/entity/TMeetingroom.java @@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode; import java.util.Date; /** - * 会议室 + * 会客厅 */ @Data @EqualsAndHashCode(callSuper = false) @@ -33,7 +33,7 @@ public class TMeetingroom extends BaseEntity { */ private Integer capacity; /** - * 会议室图片 + * 会客厅图片 */ private String pic; /** diff --git a/renren-admin/src/main/java/io/renren/modules/meeting/entity/TMeetingroomBook.java b/renren-admin/src/main/java/io/renren/modules/meeting/entity/TMeetingroomBook.java index 3e347c27..af09e629 100644 --- a/renren-admin/src/main/java/io/renren/modules/meeting/entity/TMeetingroomBook.java +++ b/renren-admin/src/main/java/io/renren/modules/meeting/entity/TMeetingroomBook.java @@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode; import java.util.Date; /** - * 会议室预约 + * 会客厅预约 */ @Data @EqualsAndHashCode(callSuper = false) @@ -17,7 +17,7 @@ public class TMeetingroomBook extends BaseEntity { private static final long serialVersionUID = 1L; /** - * 会议室id + * 会客厅id */ private Long roomId; private Date bookDate; diff --git a/renren-admin/src/main/java/io/renren/modules/notice/dto/SysNoticeDTO.java b/renren-admin/src/main/java/io/renren/modules/notice/dto/SysNoticeDTO.java index 6a150f35..5c699e85 100644 --- a/renren-admin/src/main/java/io/renren/modules/notice/dto/SysNoticeDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/notice/dto/SysNoticeDTO.java @@ -20,7 +20,7 @@ public class SysNoticeDTO implements Serializable { @ApiModelProperty(value = "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; @ApiModelProperty(value = "标题") private String title; diff --git a/renren-admin/src/main/java/io/renren/modules/notice/until/NoticeUntil.java b/renren-admin/src/main/java/io/renren/modules/notice/until/NoticeUntil.java index 31155c0d..3967d745 100644 --- a/renren-admin/src/main/java/io/renren/modules/notice/until/NoticeUntil.java +++ b/renren-admin/src/main/java/io/renren/modules/notice/until/NoticeUntil.java @@ -36,7 +36,7 @@ public class NoticeUntil { " 0: \"myAgent-CommentModeration\"," + " 1: \"hasToDoTasks-CommentModeration\"," + " }," + - " \"会议室后台\": {" + + " \"会客厅后台\": {" + " 0: \"activiti-RoomExamineAdmin\"," + " 1: \"activiti-RoomExamineAdmin\"," + " }," + @@ -55,8 +55,8 @@ public class NoticeUntil { " 7: \"需求后台\"," + " 8: \"评论前台\"," + " 9: \"评论后台\"," + - " 10: \"会议室前台\"," + - " 11: \"会议室后台\"," + + " 10: \"会客厅前台\"," + + " 11: \"会客厅后台\"," + " 12: \"其他\"" + "}"; typeMap = JSONObject.parseObject(typeString, HashMap.class); @@ -67,7 +67,7 @@ public class NoticeUntil { " \"下架前台\": \"能力下架\"," + " \"需求前台\": \"能力需求\"," + " \"评论前台\": \"需求评论\"," + - " \"会议室前台\": \"会议室前台\"" + + " \"会客厅前台\": \"会客厅前台\"" + "}"; tabMap = JSONObject.parseObject(tabString, HashMap.class); } @@ -97,7 +97,7 @@ public class NoticeUntil { if (route != null) { return manageUrl + "/#/" + route; } - } else if (typeName.equals("会议室前台")) {//会议室单独处理 + } else if (typeName.equals("会客厅前台")) {//会客厅单独处理 return portalUrl + "/#/DetailsPageconetent?select=基础设施&formPage=noticePage"; } else {//前台根据tab区分不同param String tabName = tabMap.get(typeName); diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/dao/TAbilityApplicationDao.java b/renren-admin/src/main/java/io/renren/modules/processForm/dao/TAbilityApplicationDao.java index 5a2cec1f..37f4e35d 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/dao/TAbilityApplicationDao.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/dao/TAbilityApplicationDao.java @@ -45,4 +45,6 @@ public interface TAbilityApplicationDao extends BaseDao getInstanceIdByResId(Long id); } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java index c569d0d9..3f9087a5 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/controller/ResourceController.java @@ -22,8 +22,11 @@ import io.renren.modules.resource.service.ResourceService; import io.renren.modules.resource.videoPreview.AbstractVideoPreviewService; import io.renren.modules.resource.videoPreview.VideoPreviewFactory; import io.renren.modules.security.user.SecurityUser; +import io.renren.modules.security.user.UserDetail; +import io.renren.modules.security.user.SecurityUser; import io.renren.modules.sys.dao.SysUserDao; import io.renren.modules.sys.dto.SysDeptDTO; +import io.renren.modules.sys.enums.SuperAdminEnum; import io.renren.modules.sys.dto.SysUserDTO; import io.renren.modules.sys.entity.SysUserEntity; import io.renren.modules.sys.service.SysDeptService; @@ -558,21 +561,53 @@ public class ResourceController { " \n" + " \n" + // " e8d2fb43-f512-4918-ab47-1141b925af10\n" + - String.format("%s", sysUser.getGuid()) + - String.format("%d", page) + - String.format("%d", size) + - title != null ? String.format("%s", title) : "" + + String.format(" %s", sysUser.getGuid()) + + String.format(" %d\n", page) + + String.format(" %d\n", size) + + String.format(" %s\n", title==null ? "" : title) + " \n" + " \n" + ""; 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"))); HttpEntity requestEntity = new HttpEntity<>(parame, requestHeaders); try { String body = restTemplate.postForEntity(url, requestEntity, String.class).getBody(); - String startTag = ""; - String endTag = ""; + String startTag = ""; + String endTag = ""; + 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) { + String url = "http://15.72.158.81/zyjk/ZywMessage.asmx?op=ZyShowrecord"; + String parame = "\n" + + "\n" + + " \n" + + " \n" + + String.format(" %s\n", applyGuid) + + String.format(" %s\n", deptGuid) + + " \n" + + " \n" + + ""; + HttpHeaders requestHeaders = new HttpHeaders(); + requestHeaders.set("SOAPAction", "http://tempuri.org/ZyShowrecord"); + requestHeaders.setContentType(new MediaType("text", "xml", Charset.forName("utf-8"))); + HttpEntity requestEntity = new HttpEntity<>(parame, requestHeaders); + try { + String body = restTemplate.postForEntity(url, requestEntity, String.class).getBody(); + String startTag = ""; + String endTag = ""; String json = body.substring(body.indexOf(startTag) + startTag.length(), body.indexOf(endTag)); HashMap result = JSON.parseObject(json, HashMap.class); @@ -830,4 +865,40 @@ 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("流程及相关数据已清除。"); + } + } + } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java b/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java index 9104e9f2..c0703618 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java @@ -221,4 +221,6 @@ public interface ResourceDao extends BaseDao { Integer getSquareListCount(@Param("type") String type, @Param("deptType") Integer deptType, @Param("area") String area); List getAppListByDept(@Param("deptId") Long deptId, @Param("key") String key); + + Integer updateByDelProcinst(@Param("resourceId") Long resourceId); } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/resource/excel/census/SelectApplyDeptDetailTypeCountListExcel.java b/renren-admin/src/main/java/io/renren/modules/resource/excel/census/SelectApplyDeptDetailTypeCountListExcel.java index 5c6e1208..e07b3287 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/excel/census/SelectApplyDeptDetailTypeCountListExcel.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/excel/census/SelectApplyDeptDetailTypeCountListExcel.java @@ -17,7 +17,7 @@ public class SelectApplyDeptDetailTypeCountListExcel { private Integer ywzj; @ExcelProperty({"应用资源"}) private Integer yyzy; - @ExcelProperty({"会议室"}) + @ExcelProperty({"会客厅"}) private Integer hys; @ExcelProperty({"总计"}) private Integer count; diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/ResourceService.java b/renren-admin/src/main/java/io/renren/modules/resource/service/ResourceService.java index 91a83caf..912e1805 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/ResourceService.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/ResourceService.java @@ -162,4 +162,7 @@ public interface ResourceService extends CrudService getWrapper(Map params) { @@ -2048,7 +2082,7 @@ public class ResourceServiceImpl extends CrudServiceImpl meetingRoomCount = CompletableFuture.runAsync(() -> meetCountNew[0] = tMeetingroomMapper.selectByName(keyWorld).size(), executor); CompletableFuture all = CompletableFuture.allOf(DBresourceCount, dataResourceCount, meetingRoomCount); @@ -2208,7 +2242,7 @@ public class ResourceServiceImpl extends CrudServiceImpl>> typeCountListMap3 = // 会议室 + Map>> typeCountListMap3 = // 会客厅 typeCountListByApplyDept.stream().filter(index -> index.get("deptType").toString().equals("99")).collect(Collectors.groupingBy(m -> m.get("deptName").toString())); resultList = resultList.stream().map(index -> { if (typeCountListMap3.keySet().contains(index.get("name").toString())) { // 该部门存在上架信息 @@ -2226,7 +2260,7 @@ public class ResourceServiceImpl extends CrudServiceImpl> temp = typeCountListMap3.keySet().stream().map(index_ -> { HashMap map = new HashMap<>(); typeCountListMap3.get(index_).stream().forEach(count -> { @@ -2248,7 +2282,7 @@ public class ResourceServiceImpl extends CrudServiceImpl delRes = CompletableFuture.runAsync(() -> { + resourceDao.deleteById(id); + Map map = new HashMap<>(); + map.put("data_resource_id", id); + attrDao.deleteByMap(map); + }, executor); + + //browse,collection,score,car表 + CompletableFuture delResOthers = CompletableFuture.runAsync(() -> { + Map map = new HashMap<>(); + map.put("resource_id", id); + resourceBrowseDao.deleteByMap(map); + resourceCarDao.deleteByMap(map); + resourceCollectionDao.deleteByMap(map); + resourceScoreDao.deleteByMap(map); + }, executor); + + //删除上架流程实例及通知消息数据 + CompletableFuture delMountData = CompletableFuture.runAsync(() -> { + List instanceIdList = resourceMountApplyDao.getInstanceIdByResId(id); + if (!instanceIdList.isEmpty()) { + instanceIdList.forEach(index -> this.delProcinstBySuAd(index, "能力上架", null)); + } + }, executor); + + //删除使用流程表单相关数据及通知消息数据 + CompletableFuture delAbilityData = CompletableFuture.runAsync(() -> { + List instanceIdList = abilityApplicationDao.getInstanceIdByResId(id); + if (!instanceIdList.isEmpty()) { + instanceIdList.forEach(index -> this.delProcinstBySuAd(index, "能力使用", null)); + } + }, executor); + + //会客厅 + CompletableFuture delRoom = CompletableFuture.runAsync(() -> { + Map map = new HashMap<>(); + map.put("room_id", id); + meetingroomMapper.deleteById(id); + //获取当前会客厅预约记录用于删除消息数据 + List idList = meetingroomBookMapper.selectBookIdByRoomId(id); + if (!idList.isEmpty()) { + //清除消息数据 + idList.forEach(x -> { + Map deleteMap = new HashMap() {{ + put("apply_id", x.toString()); + }}; + sysNoticeDao.deleteByMap(deleteMap); + }); + } + meetingroomBookMapper.deleteByMap(map); + }, executor); + + //删除申请表单数据 + CompletableFuture delFormData = CompletableFuture.runAsync(() -> { + Map map = new HashMap<>(); + map.put("resource_id", id); + resourceMountApplyDao.deleteByMap(map); + abilityApplicationDao.deleteByMap(map); + + }, executor); + CompletableFuture 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); + } else { + + //清除流程实例数据 + CompletableFuture delProcinstHis = CompletableFuture.runAsync(() -> { + try { + historyService.deleteHistoricProcessInstance(id.toString()); + } catch (Exception e) { + logger.info("该流程实例为运行中实例,已调用运行中实例相关方法删除!"); + } + }, executor); + + //清除流程实例数据 + CompletableFuture delProcinstRun = CompletableFuture.runAsync(() -> { + try { + runtimeService.deleteProcessInstance(id.toString(), ""); + } catch (Exception e) { + logger.info("该流程实例为已完成实例,已调用历史流程实例相关方法删除!"); + } + }, executor); + + //清除消息数据 + CompletableFuture delMessage = CompletableFuture.runAsync(() -> { + Map deleteMap = new HashMap() {{ + put("apply_id", id.toString()); + }}; + sysNoticeDao.deleteByMap(deleteMap); + }, executor); + + //删除申请表单数据 + CompletableFuture delFrom = CompletableFuture.runAsync(() -> { + Map 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 all = CompletableFuture.allOf(delProcinstHis, delProcinstRun, delMessage, delFrom); + all.join(); + } + } + + } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/resourceCollection/service/impl/ResourceCollectionServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resourceCollection/service/impl/ResourceCollectionServiceImpl.java index 4bf2545d..4c657468 100644 --- a/renren-admin/src/main/java/io/renren/modules/resourceCollection/service/impl/ResourceCollectionServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resourceCollection/service/impl/ResourceCollectionServiceImpl.java @@ -55,7 +55,7 @@ public class ResourceCollectionServiceImpl extends CrudServiceImpl resourceCollectionDTOS = resourceCollectionDao.selectWithResource(params); resourceCollectionDTOS.forEach(item -> item.setResourceDTO(resourceService.selectWithAttrs(item.getResourceId()))); 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 fuseCollectionDTOS = resourceCollectionDao.selectWithFuse(params); fuseCollectionDTOS.forEach(item -> item.setFuseDTO(fuseService.getFuseById(item.getResourceId()))); result.addAll(fuseCollectionDTOS); diff --git a/renren-admin/src/main/java/io/renren/modules/resourceMountApply/dao/TResourceMountApplyDao.java b/renren-admin/src/main/java/io/renren/modules/resourceMountApply/dao/TResourceMountApplyDao.java index 5ecd5492..5252f709 100644 --- a/renren-admin/src/main/java/io/renren/modules/resourceMountApply/dao/TResourceMountApplyDao.java +++ b/renren-admin/src/main/java/io/renren/modules/resourceMountApply/dao/TResourceMountApplyDao.java @@ -4,6 +4,10 @@ import io.renren.common.dao.BaseDao; import io.renren.modules.resourceMountApply.entity.TResourceMountApplyEntity; 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 public interface TResourceMountApplyDao extends BaseDao { void updateInstanceId(String instanceId, Long id); + + List getInstanceIdByResId(Long id); } \ No newline at end of file diff --git a/renren-admin/src/main/resources/application.yml b/renren-admin/src/main/resources/application.yml index 50b59d0e..33aa0426 100644 --- a/renren-admin/src/main/resources/application.yml +++ b/renren-admin/src/main/resources/application.yml @@ -14,7 +14,7 @@ big_date: assignee_city_role_name: 市审批人 # 当某部门未设置部门审批人时,将使用该用户审批 default_assignee_role_id: 1516728698224427010 - # 会议室审核员 + # 会客厅审核员 assignee_meet_role_id: 1576849766277849089 # 需要进行统计数目的资源 type/需要进行统计申请的资源类型 applyType census: diff --git a/renren-admin/src/main/resources/mapper/meeting/TMeetingroomBookMapper.xml b/renren-admin/src/main/resources/mapper/meeting/TMeetingroomBookMapper.xml index 19b88802..4548698d 100644 --- a/renren-admin/src/main/resources/mapper/meeting/TMeetingroomBookMapper.xml +++ b/renren-admin/src/main/resources/mapper/meeting/TMeetingroomBookMapper.xml @@ -142,5 +142,8 @@ where t.state = 1 and #{date} > t.book_date + \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml b/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml index a2ff7228..69a2a35a 100644 --- a/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml +++ b/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml @@ -124,7 +124,7 @@ SELECT COUNT( id ) AS 'amount', - '会议室' AS 'type' + '会客厅' AS 'type' FROM t_meetingroom_book tmb ) temp2 @@ -288,4 +288,8 @@ AND taa.expire_date > now() AND sd.id = #{deptId} + + \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml index 693acfb8..fe8b2de6 100644 --- a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml +++ b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml @@ -104,6 +104,19 @@ + + 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} + + + SELECT CAST(instance_id AS DECIMAL(20)) FROM t_resource_mount_apply WHERE resource_id = #{id} + \ No newline at end of file