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 0d710aaa..be2a19b7 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 @@ -1,5 +1,6 @@ package io.renren.modules.activiti.controller; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import io.renren.common.annotation.LogOperation; import io.renren.common.constant.Constant; @@ -30,6 +31,7 @@ import springfox.documentation.annotations.ApiIgnore; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 任务管理 @@ -98,6 +100,35 @@ public class ActTaskController { taskDTO.setAssigneeName(userDTO.getRealName()); } } + if (!(params.containsKey("processDefinitionKey") && org.apache.commons.lang3.StringUtils.isNotEmpty(params.get("processDefinitionKey").toString()))) { + int meetingroom_book = jdbcTemplate.queryForObject("SELECT COUNT(id) FROM t_meetingroom_book WHERE state = 1;", Integer.class); + page.setTotal(page.getTotal() + meetingroom_book); + Integer limit = 10; + if (params.get(Constant.LIMIT) != null) { + limit = Integer.parseInt((String) params.get(Constant.LIMIT)); + } + if (page.getList().size() < limit) { + List> meetingroom_bookTask = jdbcTemplate.queryForList("SELECT " + + " t_meetingroom_book.id AS `taskId`, " + + " t_meetingroom_book.dept AS `userDeptName`, " + + " t_meetingroom.`name` AS `userName`, " + + " '会议室审核' AS `taskName `, " + + " t_meetingroom.create_date AS `createTime` " + + "FROM " + + " t_meetingroom_book " + + " LEFT JOIN t_meetingroom ON t_meetingroom_book.room_id = t_meetingroom.id " + + "WHERE " + + " state = 1;"); + List meetingroom_bookTaskDto = meetingroom_bookTask + .stream().map(index -> { + TaskDTO taskDTO = JSON.parseObject(JSON.toJSONString(index), TaskDTO.class); + return taskDTO; + }).collect(Collectors.toList()); + List temp = page.getList(); + temp.addAll(meetingroom_bookTaskDto); + page.setList(temp); + } + } return new Result>().ok(page); } diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/controller/HistoryController.java b/renren-admin/src/main/java/io/renren/modules/activiti/controller/HistoryController.java index df5076df..b806fcb7 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/controller/HistoryController.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/controller/HistoryController.java @@ -200,7 +200,7 @@ public class HistoryController { if (StringUtils.isNotEmpty(activityDTO.getStartUserId())) { SysUserDTO userDTO = sysUserService.get(Long.valueOf(activityDTO.getStartUserId())); activityDTO.setStartUserName(userDTO != null ? userDTO.getRealName() : ""); - activityDTO.setStartUserDeptName(sysUserDao.getDeptNameByUserId(userDTO.getId().toString())); + activityDTO.setStartUserDeptName(userDTO != null ? sysUserDao.getDeptNameByUserId(userDTO.getId().toString()) : ""); } if (StringUtils.isNotEmpty(activityDTO.getAssignee())) { SysUserDTO userDTO = sysUserService.get(Long.valueOf(activityDTO.getAssignee())); diff --git a/renren-admin/src/main/java/io/renren/modules/activiti/service/ActTaskService.java b/renren-admin/src/main/java/io/renren/modules/activiti/service/ActTaskService.java index 0912f227..d16f2f63 100644 --- a/renren-admin/src/main/java/io/renren/modules/activiti/service/ActTaskService.java +++ b/renren-admin/src/main/java/io/renren/modules/activiti/service/ActTaskService.java @@ -59,6 +59,7 @@ import org.codehaus.jackson.map.ObjectMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -122,6 +123,8 @@ public class ActTaskService extends BaseServiceImpl { private ResourceDao resourceDao; @Autowired private SysNoticeService sysNoticeService; + @Autowired + private JdbcTemplate jdbcTemplate; /** * 根据参数获取当前运行的任务信息 @@ -685,6 +688,7 @@ public class ActTaskService extends BaseServiceImpl { pvmTransitionListC.clear(); pvmTransitionListC.addAll(oriPvmTransitionList); } + jdbcTemplate.update(String.format("UPDATE t_ability_application SET del_flag = 1 WHERE instance_id = %s ;", task.getProcessInstanceId())); sysNoticeService.updateApplyStateById(task.getProcessInstanceId(), 1); } @@ -743,6 +747,7 @@ public class ActTaskService extends BaseServiceImpl { pvmTransitionListC.clear(); pvmTransitionListC.addAll(oriPvmTransitionList); } + jdbcTemplate.update(String.format("UPDATE t_ability_application SET del_flag = 1 WHERE instance_id = %s ;", instanceId)); sysNoticeService.updateApplyStateById(instanceId, 1); } diff --git a/renren-admin/src/main/java/io/renren/modules/enke/service/EnkeService.java b/renren-admin/src/main/java/io/renren/modules/enke/service/EnkeService.java index 4e6d967e..858cf6e1 100644 --- a/renren-admin/src/main/java/io/renren/modules/enke/service/EnkeService.java +++ b/renren-admin/src/main/java/io/renren/modules/enke/service/EnkeService.java @@ -3,8 +3,6 @@ package io.renren.modules.enke.service; import io.renren.common.service.CrudService; import io.renren.modules.enke.dto.HostInfoDTO; import io.renren.modules.enke.entity.HostInfoEntity; -import io.renren.modules.fuse.dto.TbFuseDTO; -import io.renren.modules.fuse.entity.TbFuseEntity; /** * @Auther:lizhicheng2@hisense.com diff --git a/renren-admin/src/main/java/io/renren/modules/enke/service/impl/EnkeServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/enke/service/impl/EnkeServiceImpl.java index ba7d3443..ebc5e632 100644 --- a/renren-admin/src/main/java/io/renren/modules/enke/service/impl/EnkeServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/enke/service/impl/EnkeServiceImpl.java @@ -8,7 +8,6 @@ import io.renren.modules.enke.dao.HostInfoDao; import io.renren.modules.enke.dto.HostInfoDTO; import io.renren.modules.enke.entity.HostInfoEntity; import io.renren.modules.enke.service.EnkeService; -import io.renren.modules.fuse.dto.TbFuseDTO; import org.springframework.stereotype.Service; import java.util.List; diff --git a/renren-admin/src/main/java/io/renren/modules/gateway/controller/MonitorControllerV2.java b/renren-admin/src/main/java/io/renren/modules/gateway/controller/MonitorControllerV2.java index 2ca2ad0e..1a36f261 100644 --- a/renren-admin/src/main/java/io/renren/modules/gateway/controller/MonitorControllerV2.java +++ b/renren-admin/src/main/java/io/renren/modules/gateway/controller/MonitorControllerV2.java @@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.google.common.collect.Lists; -import io.renren.common.constant.Constant; import io.renren.common.utils.ExcelUtils; import io.renren.common.utils.JhlDAPTool; import io.renren.modules.gateway.dao.ApiCountHistoryDao; @@ -33,7 +32,6 @@ import io.swagger.annotations.ApiOperation; import lombok.Data; import lombok.extern.log4j.Log4j2; import org.apache.commons.lang3.StringUtils; -import org.bytedeco.opencv.presets.opencv_core; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.ResponseEntity; @@ -409,7 +407,7 @@ public class MonitorControllerV2 { LambdaQueryWrapper queryWrapper = new QueryWrapper() .lambda() - .select(SysNoticeEntity::getId,SysNoticeEntity::getJumpUrl,SysNoticeEntity::getApplyState,SysNoticeEntity::getType) + .select(SysNoticeEntity::getId, SysNoticeEntity::getJumpUrl, SysNoticeEntity::getApplyState, SysNoticeEntity::getType) .isNull(SysNoticeEntity::getJumpUrl); long current = 1L; @@ -425,7 +423,7 @@ public class MonitorControllerV2 { sysNoticeDao.update(null, updateWrapper); } } - }while (entityPage.hasNext()); + } while (entityPage.hasNext()); } diff --git a/renren-admin/src/main/java/io/renren/modules/notice/dao/SysNoticeDao.java b/renren-admin/src/main/java/io/renren/modules/notice/dao/SysNoticeDao.java index 1438a4b9..216577fe 100644 --- a/renren-admin/src/main/java/io/renren/modules/notice/dao/SysNoticeDao.java +++ b/renren-admin/src/main/java/io/renren/modules/notice/dao/SysNoticeDao.java @@ -23,4 +23,9 @@ public interface SysNoticeDao extends BaseDao { * 获取我的通知列表 */ List getMyNoticeList(Map params); + + /** + * 更新 apply state + */ + int updateApplyState(Long userId, Integer applyState, String applyId); } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/notice/entity/SysNoticeEntity.java b/renren-admin/src/main/java/io/renren/modules/notice/entity/SysNoticeEntity.java index c683b828..674e9520 100644 --- a/renren-admin/src/main/java/io/renren/modules/notice/entity/SysNoticeEntity.java +++ b/renren-admin/src/main/java/io/renren/modules/notice/entity/SysNoticeEntity.java @@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.annotation.FieldFill; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; diff --git a/renren-admin/src/main/java/io/renren/modules/notice/service/impl/SysNoticeServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/notice/service/impl/SysNoticeServiceImpl.java index b2d4049d..17ba31e3 100644 --- a/renren-admin/src/main/java/io/renren/modules/notice/service/impl/SysNoticeServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/notice/service/impl/SysNoticeServiceImpl.java @@ -110,13 +110,7 @@ public class SysNoticeServiceImpl extends CrudServiceImpl list = this.list(params); - list.stream().filter(it -> it.getReceiverTypeIds().contains(SecurityUser.getUserId().toString())).forEach(it -> { - it.setApplyState(state); - this.update(it); - }); + baseDao.updateApplyState(SecurityUser.getUserId(), state, id); } @Override @@ -139,7 +133,6 @@ public class SysNoticeServiceImpl extends CrudServiceImplBE604908-D7A3-4947-9CAD-A70FF2E48AB1\n" + //没有发送人定义,先写死 " 其他\n" + " 1\n" + - (StringUtils.isNotBlank(notice.getJumpUrl()) ? "" + notice.getJumpUrl() +"\n" : "http://15.72.183.90:7008\n") + + (StringUtils.isNotBlank(notice.getJumpUrl()) ? "" + notice.getJumpUrl() + "\n" : "http://15.72.183.90:7008\n") + " 1\n" + " 0\n" + " 0\n" + 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 cf61ec6d..31155c0d 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 @@ -10,7 +10,7 @@ import java.util.Map; @Component public class NoticeUntil { - static Map> routeMap; + static Map> routeMap; static Map typeMap; static Map tabMap; @@ -60,7 +60,7 @@ public class NoticeUntil { " 12: \"其他\"" + "}"; typeMap = JSONObject.parseObject(typeString, HashMap.class); - + String tabString = "{" + " \"申请前台\": \"能力申请\"," + " \"上架前台\": \"能力上架\"," + @@ -81,11 +81,12 @@ public class NoticeUntil { /** * 先根据type取通知类型,前台根据tab区分不同param,后台根据待办已办状态区分不同路由 * 这个逻辑好费劲哈哈 + * * @param type * @param applyState * @return */ - public String convertJumpUrl(Integer type, Integer applyState){ + public String convertJumpUrl(Integer type, Integer applyState) { String typeName = typeMap.get(type); if (typeName == null) return null; @@ -93,10 +94,10 @@ public class NoticeUntil { if (typeName.indexOf("后台") > -1) {//后台根据待办已办状态区分不同路由 Map todoMap = routeMap.get(typeName); String route = todoMap.get(applyState); - if (route != null){ + 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/resource/dao/ResourceDao.java b/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java index 47a3b5b6..22682303 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 @@ -53,7 +53,7 @@ public interface ResourceDao extends BaseDao { */ List selectDTOPageSpecilTotal(@Param("dto") ResourceDTO resourceDTO); - Long selectDTOPageCount(@Param("dto") ResourceDTO resourceDTO); + Long selectDTOPageCount(@Param("dto") ResourceDTO resourceDTO, @Param("nonChinese") Boolean nonChinese); List selectApplyArea(Long userId); diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index cee417f9..bf72ffd4 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -56,6 +56,7 @@ import okhttp3.*; import org.activiti.engine.HistoryService; import org.activiti.engine.history.HistoricProcessInstance; import org.activiti.engine.history.HistoricProcessInstanceQuery; +import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.ObjectUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -553,7 +554,7 @@ public class ResourceServiceImpl extends CrudServiceImpl resourceDTOS = resourceDao.selectWithAttrs(resourceDTO, orderField, orderType, nonChinese); @@ -1898,6 +1899,7 @@ public class ResourceServiceImpl extends CrudServiceImpl hkt = CompletableFuture.runAsync(() -> { QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("del_flag", 0); resultMap.put("会客厅", tMeetingroomMapper.selectCount(wrapper)); }, executor); @@ -2002,8 +2004,8 @@ public class ResourceServiceImpl extends CrudServiceImpl resultList = new ArrayList<>(); - Boolean nonChinese_ = Boolean.getBoolean(nonChinese);// 不传默认为中文走全文索引 + List resultList = new CopyOnWriteArrayList<>(); + Boolean nonChinese_ = BooleanUtils.toBoolean(nonChinese.toLowerCase());// 不传默认为中文走全文索引 CompletableFuture DBresourceCount = CompletableFuture.runAsync(() -> resultList.addAll(resourceDao.selectTypeCountByName(keyWorld, nonChinese_))); final Integer[] meetCountNew = new Integer[1]; switch (Constant.ProjectPlace.getByFlag(projectPlace)) { @@ -2132,6 +2134,7 @@ public class ResourceServiceImpl extends CrudServiceImpl> typeCountListByApplyDept = resourceDao.selectApplyDeptDetailTypeCountList(params); List> resultList = getDeptTemp1(); resultList.addAll(getDeptTemp2()); + resultList.addAll(getDeptTemp4()); Map countMap = new HashMap<>(); Map>> typeCountListMap = // 市级部门 @@ -2151,7 +2154,8 @@ public class ResourceServiceImpl extends CrudServiceImpl>> typeCountListMap1 = // 区级部门 - typeCountListByApplyDept.stream().filter(index -> index.get("deptType").toString().equals("3")).collect(Collectors.groupingBy(m -> m.get("district").toString())); + typeCountListByApplyDept.stream().filter(index -> index.get("deptType").toString().equals("3")) + .collect(Collectors.groupingBy(m -> m.get("district").toString())); resultList = resultList.stream().map(index -> { if (typeCountListMap1.keySet().contains(index.get("dept_id").toString())) { // 该部门存在上架信息 index.put("count", typeCountListMap1.get(index.get("dept_id").toString()).stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum()); @@ -2167,12 +2171,13 @@ public class ResourceServiceImpl extends CrudServiceImpl>> typeCountListMap2 = // 会议室 - typeCountListByApplyDept.stream().filter(index -> index.get("deptType").toString().equals("99")).collect(Collectors.groupingBy(m -> m.get("deptName").toString())); + Map>> typeCountListMap2 = // 企业部门 + typeCountListByApplyDept.stream().filter(index -> index.get("deptType").toString().equals("4")) + .collect(Collectors.groupingBy(m -> m.get("dept_id").toString())); resultList = resultList.stream().map(index -> { - if (typeCountListMap2.keySet().contains(index.get("name").toString())) { // 该部门存在上架信息 - index.put("count", Integer.parseInt(index.get("count").toString()) + typeCountListMap2.get(index.get("name").toString()).stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum()); - typeCountListMap2.get(index.get("name").toString()).stream().forEach(count -> { + if (typeCountListMap2.keySet().contains(index.get("dept_id").toString())) { // 该部门存在上架信息 + index.put("count", typeCountListMap2.get(index.get("dept_id").toString()).stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum()); + typeCountListMap2.get(index.get("dept_id").toString()).stream().forEach(count -> { index.put(count.get("type").toString(), Integer.parseInt(count.get("count").toString()) + Integer.parseInt(index.getOrDefault(count.get("type").toString(), "0").toString())); if (countMap.containsKey(count.get("type"))) { countMap.replace(count.get("type").toString(), Integer.parseInt(count.get("count").toString()) + countMap.get(count.get("type"))); @@ -2180,15 +2185,32 @@ public class ResourceServiceImpl extends CrudServiceImpl> temp = typeCountListMap2.keySet().stream().map(index_ -> { + 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())) { // 该部门存在上架信息 + index.put("count", Integer.parseInt(index.get("count").toString()) + typeCountListMap3.get(index.get("name").toString()).stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum()); + typeCountListMap3.get(index.get("name").toString()).stream().forEach(count -> { + index.put(count.get("type").toString(), Integer.parseInt(count.get("count").toString()) + Integer.parseInt(index.getOrDefault(count.get("type").toString(), "0").toString())); + if (countMap.containsKey(count.get("type"))) { + countMap.replace(count.get("type").toString(), Integer.parseInt(count.get("count").toString()) + countMap.get(count.get("type"))); + } else { + countMap.put(count.get("type").toString(), Integer.parseInt(count.get("count").toString())); + } + }); + typeCountListMap3.remove(index.get("name").toString());// 去除 + } + return index; + }).collect(Collectors.toList()); + + if (!typeCountListMap3.isEmpty()) { // 仍然有会议室信息 + List> temp = typeCountListMap3.keySet().stream().map(index_ -> { HashMap map = new HashMap<>(); - typeCountListMap2.get(index_).stream().forEach(count -> { + typeCountListMap3.get(index_).stream().forEach(count -> { map.put(count.get("type").toString(), Integer.parseInt(count.get("count").toString())); if (countMap.containsKey(count.get("type"))) { countMap.replace(count.get("type").toString(), Integer.parseInt(count.get("count").toString()) + countMap.get(count.get("type"))); @@ -2290,6 +2312,7 @@ public class ResourceServiceImpl extends CrudServiceImpl index.get("deptType").toString().equals("2")).collect(Collectors.groupingBy(m -> m.get("dept_id").toString())); List> resultList = getDeptTemp1(); resultList.addAll(getDeptTemp2()); + resultList.addAll(getDeptTemp4()); Map countMap = new HashMap<>(); resultList = resultList.stream().map(index -> { if (typeCountListMap.keySet().contains(index.get("dept_id").toString())) { // 该部门存在上架信息 @@ -2306,7 +2329,8 @@ public class ResourceServiceImpl extends CrudServiceImpl>> typeCountListMap1 = // 区级部门 - typeCountListByDept.stream().filter(index -> index.get("deptType").toString().equals("3")).collect(Collectors.groupingBy(m -> m.get("district").toString())); + typeCountListByDept.stream().filter(index -> index.get("deptType").toString().equals("3")) + .collect(Collectors.groupingBy(m -> m.get("district").toString())); resultList = resultList.stream().map(index -> { if (typeCountListMap1.keySet().contains(index.get("dept_id").toString())) { // 该部门存在上架信息 index.put("count", typeCountListMap1.get(index.get("dept_id").toString()).stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum()); @@ -2321,6 +2345,23 @@ public class ResourceServiceImpl extends CrudServiceImpl>> typeCountListMap2 = // 企业部门 + typeCountListByDept.stream().filter(index -> index.get("deptType").toString().equals("4")) + .collect(Collectors.groupingBy(m -> m.get("dept_id").toString())); + resultList = resultList.stream().map(index -> { + if (typeCountListMap2.keySet().contains(index.get("dept_id").toString())) { // 该部门存在上架信息 + index.put("count", typeCountListMap2.get(index.get("dept_id").toString()).stream().mapToInt(it -> Integer.parseInt(it.get("count").toString())).sum()); + typeCountListMap2.get(index.get("dept_id").toString()).stream().forEach(count -> { + index.put(count.get("type").toString(), Integer.parseInt(count.get("count").toString()) + Integer.parseInt(index.getOrDefault(count.get("type").toString(), "0").toString())); + if (countMap.containsKey(count.get("type"))) { + countMap.replace(count.get("type").toString(), Integer.parseInt(count.get("count").toString()) + countMap.get(count.get("type"))); + } else { + countMap.put(count.get("type").toString(), Integer.parseInt(count.get("count").toString())); + } + }); + } + return index; + }).collect(Collectors.toList()); Integer total = 0; for (Integer count : countMap.values()) { total += count; @@ -2385,6 +2426,30 @@ public class ResourceServiceImpl extends CrudServiceImpl> getDeptTemp4() { + List> resultList; + List> maps = jdbcTemplate.queryForList("SELECT id,`name`,type,pid,district FROM sys_dept WHERE type = 4 AND `name` != '访客部门' ORDER BY sys_dept.sort;"); + resultList = maps.stream().map(index -> { + HashMap map = new HashMap<>(); + map.put("count", 0); // + map.put("name", index.get("name").toString()); + map.put("dept_id", index.get("id").toString()); + map.put("yyzy", "0"); + map.put("znsf", "0"); + map.put("tcfw", "0"); + map.put("kfzj", "0"); + map.put("ywzj", "0"); + map.put("jcss", "0"); + map.put("zsk", "0"); + map.put("sjzy", "0"); + return map; + }).collect(Collectors.toList()); + return resultList; + } + @Override public Object selectCensusResourceTable(Map params) { int curPage = 1; diff --git a/renren-admin/src/main/java/io/renren/modules/resourceMountApply/controller/TResourceMountApplyController.java b/renren-admin/src/main/java/io/renren/modules/resourceMountApply/controller/TResourceMountApplyController.java index 1464eed4..30b216f2 100644 --- a/renren-admin/src/main/java/io/renren/modules/resourceMountApply/controller/TResourceMountApplyController.java +++ b/renren-admin/src/main/java/io/renren/modules/resourceMountApply/controller/TResourceMountApplyController.java @@ -68,7 +68,7 @@ public class TResourceMountApplyController { // @RequiresPermissions("resourceMountApply:tresourcemountapply:info") public Result get(@PathVariable("id") Long id) { TResourceMountApplyDTO data = tResourceMountApplyService.get(id); - if (data.getDeptId() != null) { + if (data != null && data.getDeptId() != null) { SysDeptDTO sysDeptDTO = sysDeptService.get(Long.valueOf(data.getDeptId())); if (sysDeptDTO != null) { ResourceDTO resourceDTO = data.getResourceDTO(); diff --git a/renren-admin/src/main/java/io/renren/modules/sys/controller/SysDictTypeController.java b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysDictTypeController.java index 87ce47e5..f29104f0 100644 --- a/renren-admin/src/main/java/io/renren/modules/sys/controller/SysDictTypeController.java +++ b/renren-admin/src/main/java/io/renren/modules/sys/controller/SysDictTypeController.java @@ -10,6 +10,7 @@ import io.renren.common.validator.group.DefaultGroup; import io.renren.common.validator.group.UpdateGroup; import io.renren.modules.sys.dto.SysDictTypeDTO; import io.renren.modules.sys.entity.DictType; +import io.renren.modules.sys.service.SysDictDataService; import io.renren.modules.sys.service.SysDictTypeService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; @@ -21,6 +22,7 @@ import springfox.documentation.annotations.ApiIgnore; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 字典类型 @@ -31,6 +33,8 @@ import java.util.Map; public class SysDictTypeController { @Autowired private SysDictTypeService sysDictTypeService; + @Autowired + private SysDictDataService sysDictDataService; @GetMapping("page") @ApiOperation("字典类型分页查询") @@ -41,13 +45,18 @@ public class SysDictTypeController { @ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType = "String"), @ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "dictType", value = "字典类型", paramType = "query", dataType = "String"), - @ApiImplicitParam(name = "dictName", value = "字典名称", paramType = "query", dataType = "String") + @ApiImplicitParam(name = "dictName", value = "字典名称", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "dictLabel", value = "字典标签", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "dictValue", value = "字典值", paramType = "query", dataType = "String") }) // @RequiresPermissions("sys:dict:page") public Result> page(@ApiIgnore @RequestParam Map params) { //字典类型 PageData page = sysDictTypeService.page(params); - + page.setList(page.getList().stream().map(index -> { + index.setSysDictDataDTOList(sysDictDataService.selectByDictTypeId(index.getId().toString())); + return index; + }).collect(Collectors.toList())); // return new Result>().ok(page); } @@ -57,7 +66,7 @@ public class SysDictTypeController { // @RequiresPermissions("sys:dict:info") public Result get(@PathVariable("id") Long id) { SysDictTypeDTO data = sysDictTypeService.get(id); - + data.setSysDictDataDTOList(sysDictDataService.selectByDictTypeId(data.getId().toString())); return new Result().ok(data); } diff --git a/renren-admin/src/main/java/io/renren/modules/sys/dto/SysDictTypeDTO.java b/renren-admin/src/main/java/io/renren/modules/sys/dto/SysDictTypeDTO.java index eb7fd086..06cfbdba 100644 --- a/renren-admin/src/main/java/io/renren/modules/sys/dto/SysDictTypeDTO.java +++ b/renren-admin/src/main/java/io/renren/modules/sys/dto/SysDictTypeDTO.java @@ -14,6 +14,7 @@ import javax.validation.constraints.NotNull; import javax.validation.constraints.Null; import java.io.Serializable; import java.util.Date; +import java.util.List; /** * 字典类型 @@ -50,4 +51,9 @@ public class SysDictTypeDTO implements Serializable { @ApiModelProperty(value = "更新时间") @JsonProperty(access = JsonProperty.Access.READ_ONLY) private Date updateDate; + + + @ApiModelProperty(value = "对应字典数据") + @JsonProperty(access = JsonProperty.Access.READ_ONLY) + List sysDictDataDTOList; } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/service/SysDictDataService.java b/renren-admin/src/main/java/io/renren/modules/sys/service/SysDictDataService.java index d33b984b..cd835d9c 100644 --- a/renren-admin/src/main/java/io/renren/modules/sys/service/SysDictDataService.java +++ b/renren-admin/src/main/java/io/renren/modules/sys/service/SysDictDataService.java @@ -5,6 +5,7 @@ import io.renren.common.service.BaseService; import io.renren.modules.sys.dto.SysDictDataDTO; import io.renren.modules.sys.entity.SysDictDataEntity; +import java.util.List; import java.util.Map; /** @@ -22,4 +23,6 @@ public interface SysDictDataService extends BaseService { void delete(Long[] ids); + List selectByDictTypeId(String dictTypeId); + } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysDictDataServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysDictDataServiceImpl.java index d2a30383..e67c906e 100644 --- a/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysDictDataServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysDictDataServiceImpl.java @@ -14,7 +14,9 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Arrays; +import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 字典类型 @@ -75,4 +77,11 @@ public class SysDictDataServiceImpl extends BaseServiceImpl selectByDictTypeId(String dictTypeId) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("dict_type_id", dictTypeId); + return baseDao.selectList(wrapper).stream().map(index -> ConvertUtils.sourceToTarget(index, SysDictDataDTO.class)).collect(Collectors.toList()); + } + } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysDictTypeServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysDictTypeServiceImpl.java index 4a949c3c..da309c9a 100644 --- a/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysDictTypeServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysDictTypeServiceImpl.java @@ -31,10 +31,7 @@ public class SysDictTypeServiceImpl extends BaseServiceImpl page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, "sort", true), - getWrapper(params) - ); + IPage page = baseDao.selectPage(getPage(params, "sort", true), getWrapper(params)); return getPageData(page, SysDictTypeDTO.class); } @@ -42,11 +39,14 @@ public class SysDictTypeServiceImpl extends BaseServiceImpl getWrapper(Map params) { String dictType = (String) params.get("dictType"); String dictName = (String) params.get("dictName"); + String dictLabel = params.containsKey("dictLabel") ? (String) params.get("dictLabel") : ""; + String dictValue = params.containsKey("dictValue") ? (String) params.get("dictValue") : ""; QueryWrapper wrapper = new QueryWrapper<>(); wrapper.like(StringUtils.isNotBlank(dictType), "dict_type", dictType); wrapper.like(StringUtils.isNotBlank(dictName), "dict_name", dictName); - + wrapper.exists(StringUtils.isNotEmpty(dictLabel), String.format("SELECT 1 FROM sys_dict_data sdd WHERE sdd.dict_type_id = sys_dict_type.id AND sdd.dict_label LIKE CONCAT( '%%', '%s', '%%' ) ", dictLabel)); + wrapper.exists(StringUtils.isNotEmpty(dictValue), String.format("SELECT 1 FROM sys_dict_data sdd WHERE sdd.dict_type_id = sys_dict_type.id AND sdd.dict_value =1", dictValue)); return wrapper; } diff --git a/renren-admin/src/main/resources/application-dev.yml b/renren-admin/src/main/resources/application-dev.yml index f4e58d73..a21e26f4 100644 --- a/renren-admin/src/main/resources/application-dev.yml +++ b/renren-admin/src/main/resources/application-dev.yml @@ -6,9 +6,9 @@ spring: #MySQL driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://192.168.124.236:3306/share_platform?useUnicode=true&characterEncoding=UTF-8&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&useSSL=false + url: jdbc:mysql://192.168.124.46:3306/share_platform?useUnicode=true&characterEncoding=UTF-8&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&useSSL=false username: root - password: Hisense2019 + password: Liwen073898! #Hisense2019 # #Oracle # driver-class-name: oracle.jdbc.OracleDriver diff --git a/renren-admin/src/main/resources/mapper/notice/SysNoticeDao.xml b/renren-admin/src/main/resources/mapper/notice/SysNoticeDao.xml index c2182de8..a8fedc1c 100644 --- a/renren-admin/src/main/resources/mapper/notice/SysNoticeDao.xml +++ b/renren-admin/src/main/resources/mapper/notice/SysNoticeDao.xml @@ -23,4 +23,8 @@ order by t2.create_date desc + + + update sys_notice set apply_state = #{applyState} where receiver_type_ids like concat('%', #{userId}, '%') and apply_id=#{applyId} + \ 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 a2d39ac4..a2ff7228 100644 --- a/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml +++ b/renren-admin/src/main/resources/mapper/processForm/TAbilityApplicationDao.xml @@ -274,6 +274,7 @@ AND t_ability_application.user_id = #{userId} AND t_ability_application.resource_id = #{resourceId} AND tb_data_resource.type != '基础设施' + AND t_ability_application.del_flag = 0