Merge branch 'dev'

This commit is contained in:
wangliwen 2022-10-08 09:28:35 +08:00
commit dca052dd59
13 changed files with 91 additions and 85 deletions

View File

@ -1,14 +1,12 @@
package io.renren.common.aspect; package io.renren.common.aspect;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.google.common.collect.ImmutableMultimap;
import io.renren.common.annotation.ActivitiNoticeOperation; import io.renren.common.annotation.ActivitiNoticeOperation;
import io.renren.modules.notice.dto.SysNoticeDTO; import io.renren.modules.notice.dto.SysNoticeDTO;
import io.renren.modules.notice.enums.NoticeStatusEnum; import io.renren.modules.notice.enums.NoticeStatusEnum;
import io.renren.modules.notice.service.SysNoticeService; import io.renren.modules.notice.service.SysNoticeService;
import io.renren.modules.processForm.dto.TAbilityApplicationDTO; import io.renren.modules.processForm.dto.TAbilityApplicationDTO;
import io.renren.modules.processForm.service.TAbilityApplicationService; import io.renren.modules.processForm.service.TAbilityApplicationService;
import io.renren.modules.processForm.service.impl.TAbilityApplicationServiceImpl;
import io.renren.modules.resource.service.ResourceService; import io.renren.modules.resource.service.ResourceService;
import io.renren.modules.sys.dto.SysDeptDTO; import io.renren.modules.sys.dto.SysDeptDTO;
import io.renren.modules.sys.dto.SysRoleDTO; import io.renren.modules.sys.dto.SysRoleDTO;
@ -20,7 +18,6 @@ import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.DelegateTask; import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.ExecutionListener; import org.activiti.engine.delegate.ExecutionListener;
import org.activiti.engine.delegate.TaskListener; import org.activiti.engine.delegate.TaskListener;
import org.apache.commons.collections.MultiMap;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.aspectj.lang.JoinPoint; import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.After; import org.aspectj.lang.annotation.After;
@ -142,7 +139,7 @@ public class ActivitiNoticeAspect {
} else if (kv.containsKey("_id")) { } else if (kv.containsKey("_id")) {
key = kv.getOrDefault("_id", "").toString(); key = kv.getOrDefault("_id", "").toString();
} }
final List<TAbilityApplicationDTO> tAbilityApplicationDTOList=kv.containsKey("tAbilityApplicationDTOList") ? (List<TAbilityApplicationDTO>) kv.get("tAbilityApplicationDTOList") : null; final List<TAbilityApplicationDTO> tAbilityApplicationDTOList = kv.containsKey("tAbilityApplicationDTOList") ? (List<TAbilityApplicationDTO>) kv.get("tAbilityApplicationDTOList") : null;
final StringBuilder resourceName = new StringBuilder(); final StringBuilder resourceName = new StringBuilder();
if (kv.containsKey("resourceDTO")) { if (kv.containsKey("resourceDTO")) {
resourceName.append("'"); resourceName.append("'");
@ -193,17 +190,17 @@ public class ActivitiNoticeAspect {
CompletableFuture.runAsync(() -> { // 发起人 CompletableFuture.runAsync(() -> { // 发起人
SysUserDTO userDTO = sysUserService.get(Long.valueOf(finalCreator)); SysUserDTO userDTO = sysUserService.get(Long.valueOf(finalCreator));
String content = "【通知】" + userDTO.getRealName() + ",您发起的" + resourceName + activitiNoticeOperation.process() + " " + activitiNoticeOperation.value() + "节点" + finalResult; String content = "【通知】" + userDTO.getRealName() + ",您发起的" + resourceName + activitiNoticeOperation.process() + " " + activitiNoticeOperation.value() + "节点" + finalResult;
Integer type=10; Integer type = 10;
if("能力申请流程".equals(activitiNoticeOperation.process())){ if ("能力申请流程".equals(activitiNoticeOperation.process())) {
type=0; type = 0;
}else if("能力资源上架".equals(activitiNoticeOperation.process())){ } else if ("能力资源上架".equals(activitiNoticeOperation.process())) {
type=2; type = 2;
}else if("能力资源下架".equals(activitiNoticeOperation.process())){ } else if ("能力资源下架".equals(activitiNoticeOperation.process())) {
type=4; type = 4;
}else if("能力需求申请".equals(activitiNoticeOperation.process())){ } else if ("能力需求申请".equals(activitiNoticeOperation.process())) {
type=6; type = 6;
}else if("需求评论审核流程".equals(activitiNoticeOperation.process())){ } else if ("需求评论审核流程".equals(activitiNoticeOperation.process())) {
type=8; type = 8;
} }
SysNoticeDTO dto = new SysNoticeDTO(); SysNoticeDTO dto = new SysNoticeDTO();
dto.setType(type); dto.setType(type);
@ -217,7 +214,7 @@ public class ActivitiNoticeAspect {
dto.setCreator(sysUserService.getByUsername("admin").getId()); dto.setCreator(sysUserService.getByUsername("admin").getId());
dto.setCreateDate(new Date()); dto.setCreateDate(new Date());
dto.setFrom("通知"); dto.setFrom("通知");
if(tAbilityApplicationDTOList != null){ if (tAbilityApplicationDTOList != null) {
dto.setApplyId(tAbilityApplicationDTOList.get(0).getApplyFlag()); dto.setApplyId(tAbilityApplicationDTOList.get(0).getApplyFlag());
} }
dto.setApplyState(0); dto.setApplyState(0);
@ -254,7 +251,7 @@ public class ActivitiNoticeAspect {
} else if (kv.containsKey("_id")) { } else if (kv.containsKey("_id")) {
key = kv.getOrDefault("_id", "").toString(); key = kv.getOrDefault("_id", "").toString();
} }
final List<TAbilityApplicationDTO> tAbilityApplicationDTOList=kv.containsKey("tAbilityApplicationDTOList") ? (List<TAbilityApplicationDTO>) kv.get("tAbilityApplicationDTOList") : null; final List<TAbilityApplicationDTO> tAbilityApplicationDTOList = kv.containsKey("tAbilityApplicationDTOList") ? (List<TAbilityApplicationDTO>) kv.get("tAbilityApplicationDTOList") : null;
final StringBuilder resourceName = new StringBuilder(); final StringBuilder resourceName = new StringBuilder();
if (kv.containsKey("resourceDTO")) { if (kv.containsKey("resourceDTO")) {
resourceName.append("'"); resourceName.append("'");
@ -305,17 +302,17 @@ public class ActivitiNoticeAspect {
CompletableFuture.runAsync(() -> { // 发起人 CompletableFuture.runAsync(() -> { // 发起人
SysUserDTO userDTO = sysUserService.get(Long.valueOf(finalCreator)); SysUserDTO userDTO = sysUserService.get(Long.valueOf(finalCreator));
String content = "【通知】" + userDTO.getRealName() + ",您发起的" + resourceName + activitiNoticeOperation.process() + "已完成,审核结果为:" + finalResult; String content = "【通知】" + userDTO.getRealName() + ",您发起的" + resourceName + activitiNoticeOperation.process() + "已完成,审核结果为:" + finalResult;
Integer type=10; Integer type = 10;
if("能力申请流程".equals(activitiNoticeOperation.process())){ if ("能力申请流程".equals(activitiNoticeOperation.process())) {
type=0; type = 0;
}else if("能力资源上架".equals(activitiNoticeOperation.process())){ } else if ("能力资源上架".equals(activitiNoticeOperation.process())) {
type=2; type = 2;
}else if("能力资源下架".equals(activitiNoticeOperation.process())){ } else if ("能力资源下架".equals(activitiNoticeOperation.process())) {
type=4; type = 4;
}else if("能力需求申请".equals(activitiNoticeOperation.process())){ } else if ("能力需求申请".equals(activitiNoticeOperation.process())) {
type=6; type = 6;
}else if("需求评论审核流程".equals(activitiNoticeOperation.process())){ } else if ("需求评论审核流程".equals(activitiNoticeOperation.process())) {
type=8; type = 8;
} }
SysNoticeDTO dto = new SysNoticeDTO(); SysNoticeDTO dto = new SysNoticeDTO();
dto.setType(type); dto.setType(type);
@ -329,7 +326,7 @@ public class ActivitiNoticeAspect {
dto.setCreator(sysUserService.getByUsername("admin").getId()); dto.setCreator(sysUserService.getByUsername("admin").getId());
dto.setCreateDate(new Date()); dto.setCreateDate(new Date());
dto.setFrom("通知"); dto.setFrom("通知");
if(tAbilityApplicationDTOList != null){ if (tAbilityApplicationDTOList != null) {
dto.setApplyId(tAbilityApplicationDTOList.get(0).getApplyFlag()); dto.setApplyId(tAbilityApplicationDTOList.get(0).getApplyFlag());
} }
dto.setApplyState(0); dto.setApplyState(0);
@ -347,17 +344,17 @@ public class ActivitiNoticeAspect {
dto.setType(2); dto.setType(2);
dto.setTitle("流程结束系统通知"); dto.setTitle("流程结束系统通知");
String content = "【通知】" + user.getRealName() + "," + creatorDTO.getRealName() + "发起的" + activitiNoticeOperation.process() + "已完成,审核结果为:" + finalResult; String content = "【通知】" + user.getRealName() + "," + creatorDTO.getRealName() + "发起的" + activitiNoticeOperation.process() + "已完成,审核结果为:" + finalResult;
Integer type=10; Integer type = 10;
if("能力申请流程".equals(activitiNoticeOperation.process())){ if ("能力申请流程".equals(activitiNoticeOperation.process())) {
type=1; type = 1;
}else if("能力资源上架".equals(activitiNoticeOperation.process())){ } else if ("能力资源上架".equals(activitiNoticeOperation.process())) {
type=3; type = 3;
}else if("能力资源下架".equals(activitiNoticeOperation.process())){ } else if ("能力资源下架".equals(activitiNoticeOperation.process())) {
type=5; type = 5;
}else if("能力需求申请".equals(activitiNoticeOperation.process())){ } else if ("能力需求申请".equals(activitiNoticeOperation.process())) {
type=7; type = 7;
}else if("需求评论审核流程".equals(activitiNoticeOperation.process())){ } else if ("需求评论审核流程".equals(activitiNoticeOperation.process())) {
type=9; type = 9;
} }
dto.setType(type); dto.setType(type);
dto.setContent(content); // 通知内容 dto.setContent(content); // 通知内容
@ -410,7 +407,7 @@ public class ActivitiNoticeAspect {
} else if (kv.containsKey("_id")) { } else if (kv.containsKey("_id")) {
key = kv.getOrDefault("_id", "").toString(); key = kv.getOrDefault("_id", "").toString();
} }
final List<TAbilityApplicationDTO> tAbilityApplicationDTOList=kv.containsKey("tAbilityApplicationDTOList") ? (List<TAbilityApplicationDTO>) kv.get("tAbilityApplicationDTOList") : null; final List<TAbilityApplicationDTO> tAbilityApplicationDTOList = kv.containsKey("tAbilityApplicationDTOList") ? (List<TAbilityApplicationDTO>) kv.get("tAbilityApplicationDTOList") : null;
final StringBuilder resourceName = new StringBuilder(); final StringBuilder resourceName = new StringBuilder();
if (kv.containsKey("resourceDTO")) { if (kv.containsKey("resourceDTO")) {
resourceName.append("'"); resourceName.append("'");
@ -446,17 +443,17 @@ public class ActivitiNoticeAspect {
LOGGER.error("审核人:{}", assignee.getId()); LOGGER.error("审核人:{}", assignee.getId());
String content = "【通知】您发起的流程 " + resourceName + activitiNoticeOperation.process() + " 当前审核节点为:" + activitiNoticeOperation.value() + ";当前审核部门为:\"" + assignee.getDeptName() + "\";审核负责人\"" + assignee.getRealName() + "\""; String content = "【通知】您发起的流程 " + resourceName + activitiNoticeOperation.process() + " 当前审核节点为:" + activitiNoticeOperation.value() + ";当前审核部门为:\"" + assignee.getDeptName() + "\";审核负责人\"" + assignee.getRealName() + "\"";
LOGGER.info("通知内容:{}", content); LOGGER.info("通知内容:{}", content);
Integer type=10; Integer type = 10;
if("能力申请流程".equals(activitiNoticeOperation.process())){ if ("能力申请流程".equals(activitiNoticeOperation.process())) {
type=0; type = 0;
}else if("能力资源上架".equals(activitiNoticeOperation.process())){ } else if ("能力资源上架".equals(activitiNoticeOperation.process())) {
type=2; type = 2;
}else if("能力资源下架".equals(activitiNoticeOperation.process())){ } else if ("能力资源下架".equals(activitiNoticeOperation.process())) {
type=4; type = 4;
}else if("能力需求申请".equals(activitiNoticeOperation.process())){ } else if ("能力需求申请".equals(activitiNoticeOperation.process())) {
type=6; type = 6;
}else if("需求评论审核流程".equals(activitiNoticeOperation.process())){ } else if ("需求评论审核流程".equals(activitiNoticeOperation.process())) {
type=8; type = 8;
} }
SysNoticeDTO dto = new SysNoticeDTO(); SysNoticeDTO dto = new SysNoticeDTO();
dto.setType(type); dto.setType(type);
@ -470,7 +467,7 @@ public class ActivitiNoticeAspect {
dto.setCreator(sysUserService.getByUsername("admin").getId()); dto.setCreator(sysUserService.getByUsername("admin").getId());
dto.setCreateDate(new Date()); dto.setCreateDate(new Date());
dto.setFrom("通知"); dto.setFrom("通知");
if(tAbilityApplicationDTOList != null){ if (tAbilityApplicationDTOList != null) {
dto.setApplyId(tAbilityApplicationDTOList.get(0).getApplyFlag()); dto.setApplyId(tAbilityApplicationDTOList.get(0).getApplyFlag());
} }
dto.setApplyState(0); dto.setApplyState(0);
@ -482,17 +479,17 @@ public class ActivitiNoticeAspect {
try { try {
SysUserDTO owner = sysUserService.get(Long.valueOf(finalCreator)); SysUserDTO owner = sysUserService.get(Long.valueOf(finalCreator));
String content = "【通知】" + owner.getRealName() + "发起的流程" + resourceName + activitiNoticeOperation.process() + " 已进入审核节点:" + activitiNoticeOperation.value() + ";当前审核人指派为您"; String content = "【通知】" + owner.getRealName() + "发起的流程" + resourceName + activitiNoticeOperation.process() + " 已进入审核节点:" + activitiNoticeOperation.value() + ";当前审核人指派为您";
Integer type=10; Integer type = 10;
if("能力申请流程".equals(activitiNoticeOperation.process())){ if ("能力申请流程".equals(activitiNoticeOperation.process())) {
type=1; type = 1;
}else if("能力资源上架".equals(activitiNoticeOperation.process())){ } else if ("能力资源上架".equals(activitiNoticeOperation.process())) {
type=3; type = 3;
}else if("能力资源下架".equals(activitiNoticeOperation.process())){ } else if ("能力资源下架".equals(activitiNoticeOperation.process())) {
type=5; type = 5;
}else if("能力需求申请".equals(activitiNoticeOperation.process())){ } else if ("能力需求申请".equals(activitiNoticeOperation.process())) {
type=7; type = 7;
}else if("需求评论审核流程".equals(activitiNoticeOperation.process())){ } else if ("需求评论审核流程".equals(activitiNoticeOperation.process())) {
type=9; type = 9;
} }
SysNoticeDTO dto = new SysNoticeDTO(); SysNoticeDTO dto = new SysNoticeDTO();
dto.setType(type); dto.setType(type);

View File

@ -107,10 +107,10 @@ public class SysNoticeServiceImpl extends CrudServiceImpl<SysNoticeDao, SysNotic
@Override @Override
public void updateApplyStateById(String id, Integer state) { public void updateApplyStateById(String id, Integer state) {
Map params=new HashMap(); Map params = new HashMap();
params.put("apply_id",id); params.put("apply_id", id);
List<SysNoticeDTO> list=this.list(params); List<SysNoticeDTO> list = this.list(params);
list.stream().filter(it->it.getReceiverTypeIds().contains(SecurityUser.getUserId().toString())).forEach(it->{ list.stream().filter(it -> it.getReceiverTypeIds().contains(SecurityUser.getUserId().toString())).forEach(it -> {
it.setApplyState(state); it.setApplyState(state);
this.update(it); this.update(it);
}); });

View File

@ -415,12 +415,12 @@ public class TAbilityApplicationController {
@GetMapping("canApply/{number}") @GetMapping("canApply/{number}")
@ApiOperation("判断资源是否可以申请") @ApiOperation("判断资源是否可以申请")
@LogOperation("判断资源是否可以申请当前限制为一个部门最多申请10个基础设施") @LogOperation("判断资源是否可以申请当前限制为一个部门最多申请10个基础设施")
public Result canApply(@PathVariable("number") Integer number){ public Result canApply(@PathVariable("number") Integer number) {
Integer count=tAbilityApplicationService.getDeptInfrastructureApply(SecurityUser.getDeptId()); Integer count = tAbilityApplicationService.getDeptInfrastructureApply(SecurityUser.getDeptId());
if(count>=infrastructureMax){ if (count >= infrastructureMax) {
return new Result().error("当前部门申请基础设施数量已达上限!"); return new Result().error("当前部门申请基础设施数量已达上限!");
}else if (count+number>infrastructureMax){ } else if (count + number > infrastructureMax) {
return new Result().error("部门已申请基础设施数量"+count+",当前最多可申请"+(infrastructureMax-count)+"个!"); return new Result().error("部门已申请基础设施数量" + count + ",当前最多可申请" + (infrastructureMax - count) + "个!");
} }
return new Result(); return new Result();
} }

View File

@ -46,6 +46,7 @@ public interface TAbilityApplicationService extends CrudService<TAbilityApplicat
/** /**
* 查询部门申请的基础设施个数审核中通过 * 查询部门申请的基础设施个数审核中通过
*
* @param deptId * @param deptId
* @return * @return
*/ */

View File

@ -1883,18 +1883,18 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
} }
@Override @Override
public Object selectCollectComponentList(){ public Object selectCollectComponentList() {
List<Map> resourceCountList=baseDao.selectCollectList("组件服务","组件类型"); List<Map> resourceCountList = baseDao.selectCollectList("组件服务", "组件类型");
Map result=new HashMap(); Map result = new HashMap();
resourceCountList.stream().forEach(it->result.put(it.get("type"), it.get("count"))); resourceCountList.stream().forEach(it -> result.put(it.get("type"), it.get("count")));
return result; return result;
} }
@Override @Override
public Object selectCollectResourceList(){ public Object selectCollectResourceList() {
List<Map> resourceCountList=baseDao.selectCollectResourceList(); List<Map> resourceCountList = baseDao.selectCollectResourceList();
Map result=new HashMap(); Map result = new HashMap();
resourceCountList.stream().filter(it->!it.get("type").equals("")).forEach(it->result.put(it.get("type"), it.get("count"))); resourceCountList.stream().filter(it -> !it.get("type").equals("")).forEach(it -> result.put(it.get("type"), it.get("count")));
return result; return result;
} }

View File

@ -30,7 +30,7 @@ spring:
stat-view-servlet: stat-view-servlet:
enabled: true enabled: true
url-pattern: /druid/* url-pattern: /druid/*
#login-username: admin #login-username: admin
#login-password: admin #login-password: admin
filter: filter:
stat: stat:

View File

@ -11,7 +11,8 @@
<!-- 获取我的通知列表 --> <!-- 获取我的通知列表 -->
<select id="getMyNoticeList" resultType="io.renren.modules.notice.entity.SysNoticeEntity"> <select id="getMyNoticeList" resultType="io.renren.modules.notice.entity.SysNoticeEntity">
select t2.id, t2.title, t2.type, t2.sender_name, t2.sender_date, t1.read_status, t2.content ,t2.`from`, t2.apply_id, t2.apply_state from select t2.id, t2.title, t2.type, t2.sender_name, t2.sender_date, t1.read_status, t2.content ,t2.`from`,
t2.apply_id, t2.apply_state from
sys_notice_user t1, sys_notice t2 sys_notice_user t1, sys_notice t2
where t1.notice_id = t2.id and t1.receiver_id = #{receiverId} where t1.notice_id = t2.id and t1.receiver_id = #{receiverId}
<if test="readStatus != null"> <if test="readStatus != null">

View File

@ -1863,8 +1863,10 @@
<select id="selectCollectResourceList" resultType="java.util.Map"> <select id="selectCollectResourceList" resultType="java.util.Map">
SELECT tda.attr_value as type, count(*) as count FROM tb_data_resource tdr LEFT JOIN SELECT tda.attr_value as type, count(*) as count FROM tb_data_resource tdr LEFT JOIN
(SELECT a.data_resource_id, a.id, a.attr_type, substring_index(substring_index(a.attr_value, ';', b.help_topic_id + 1), ';', - 1) AS attr_value (SELECT a.data_resource_id, a.id, a.attr_type, substring_index(substring_index(a.attr_value, ';',
FROM tb_data_attr a INNER JOIN mysql.help_topic b ON a.attr_type='应用领域' AND a.del_flag=0 AND b.help_topic_id <![CDATA[ < ]]> (length(a.attr_value) - length(REPLACE(a.attr_value, ';', '')) + 1)) tda b.help_topic_id + 1), ';', - 1) AS attr_value
FROM tb_data_attr a INNER JOIN mysql.help_topic b ON a.attr_type='应用领域' AND a.del_flag=0 AND b.help_topic_id
<![CDATA[ < ]]> (length(a.attr_value) - length(REPLACE(a.attr_value, ';', '')) + 1)) tda
ON tdr.id=tda.data_resource_id ON tdr.id=tda.data_resource_id
WHERE 1=1 AND tdr.del_flag=0 AND tdr.type='应用资源' WHERE 1=1 AND tdr.del_flag=0 AND tdr.type='应用资源'
GROUP BY tda.attr_value GROUP BY tda.attr_value

View File

@ -127,6 +127,7 @@ $(document).ready(function(){
</script> </script>
</body> </body>
</html> </html>

View File

@ -56,6 +56,7 @@
})(); })();
</script> </script>
</head> </head>

View File

@ -55,6 +55,7 @@
})(); })();
</script> </script>
</head> </head>

View File

@ -87,6 +87,7 @@ function getIds() {
return ids; return ids;
} }
</script> </script>
</body> </body>
</html> </html>

View File

@ -88,6 +88,7 @@ function getIds() {
return ids; return ids;
} }
</script> </script>
</body> </body>
</html> </html>