Merge branch 'dev'
This commit is contained in:
commit
dca052dd59
|
@ -1,14 +1,12 @@
|
|||
package io.renren.common.aspect;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.google.common.collect.ImmutableMultimap;
|
||||
import io.renren.common.annotation.ActivitiNoticeOperation;
|
||||
import io.renren.modules.notice.dto.SysNoticeDTO;
|
||||
import io.renren.modules.notice.enums.NoticeStatusEnum;
|
||||
import io.renren.modules.notice.service.SysNoticeService;
|
||||
import io.renren.modules.processForm.dto.TAbilityApplicationDTO;
|
||||
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.sys.dto.SysDeptDTO;
|
||||
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.ExecutionListener;
|
||||
import org.activiti.engine.delegate.TaskListener;
|
||||
import org.apache.commons.collections.MultiMap;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.annotation.After;
|
||||
|
@ -142,7 +139,7 @@ public class ActivitiNoticeAspect {
|
|||
} else if (kv.containsKey("_id")) {
|
||||
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();
|
||||
if (kv.containsKey("resourceDTO")) {
|
||||
resourceName.append("'");
|
||||
|
@ -193,17 +190,17 @@ public class ActivitiNoticeAspect {
|
|||
CompletableFuture.runAsync(() -> { // 发起人
|
||||
SysUserDTO userDTO = sysUserService.get(Long.valueOf(finalCreator));
|
||||
String content = "【通知】" + userDTO.getRealName() + ",您发起的" + resourceName + activitiNoticeOperation.process() + " " + activitiNoticeOperation.value() + "节点" + finalResult;
|
||||
Integer type=10;
|
||||
if("能力申请流程".equals(activitiNoticeOperation.process())){
|
||||
type=0;
|
||||
}else if("能力资源上架".equals(activitiNoticeOperation.process())){
|
||||
type=2;
|
||||
}else if("能力资源下架".equals(activitiNoticeOperation.process())){
|
||||
type=4;
|
||||
}else if("能力需求申请".equals(activitiNoticeOperation.process())){
|
||||
type=6;
|
||||
}else if("需求评论审核流程".equals(activitiNoticeOperation.process())){
|
||||
type=8;
|
||||
Integer type = 10;
|
||||
if ("能力申请流程".equals(activitiNoticeOperation.process())) {
|
||||
type = 0;
|
||||
} else if ("能力资源上架".equals(activitiNoticeOperation.process())) {
|
||||
type = 2;
|
||||
} else if ("能力资源下架".equals(activitiNoticeOperation.process())) {
|
||||
type = 4;
|
||||
} else if ("能力需求申请".equals(activitiNoticeOperation.process())) {
|
||||
type = 6;
|
||||
} else if ("需求评论审核流程".equals(activitiNoticeOperation.process())) {
|
||||
type = 8;
|
||||
}
|
||||
SysNoticeDTO dto = new SysNoticeDTO();
|
||||
dto.setType(type);
|
||||
|
@ -217,7 +214,7 @@ public class ActivitiNoticeAspect {
|
|||
dto.setCreator(sysUserService.getByUsername("admin").getId());
|
||||
dto.setCreateDate(new Date());
|
||||
dto.setFrom("通知");
|
||||
if(tAbilityApplicationDTOList != null){
|
||||
if (tAbilityApplicationDTOList != null) {
|
||||
dto.setApplyId(tAbilityApplicationDTOList.get(0).getApplyFlag());
|
||||
}
|
||||
dto.setApplyState(0);
|
||||
|
@ -254,7 +251,7 @@ public class ActivitiNoticeAspect {
|
|||
} else if (kv.containsKey("_id")) {
|
||||
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();
|
||||
if (kv.containsKey("resourceDTO")) {
|
||||
resourceName.append("'");
|
||||
|
@ -305,17 +302,17 @@ public class ActivitiNoticeAspect {
|
|||
CompletableFuture.runAsync(() -> { // 发起人
|
||||
SysUserDTO userDTO = sysUserService.get(Long.valueOf(finalCreator));
|
||||
String content = "【通知】" + userDTO.getRealName() + ",您发起的" + resourceName + activitiNoticeOperation.process() + "已完成,审核结果为:" + finalResult;
|
||||
Integer type=10;
|
||||
if("能力申请流程".equals(activitiNoticeOperation.process())){
|
||||
type=0;
|
||||
}else if("能力资源上架".equals(activitiNoticeOperation.process())){
|
||||
type=2;
|
||||
}else if("能力资源下架".equals(activitiNoticeOperation.process())){
|
||||
type=4;
|
||||
}else if("能力需求申请".equals(activitiNoticeOperation.process())){
|
||||
type=6;
|
||||
}else if("需求评论审核流程".equals(activitiNoticeOperation.process())){
|
||||
type=8;
|
||||
Integer type = 10;
|
||||
if ("能力申请流程".equals(activitiNoticeOperation.process())) {
|
||||
type = 0;
|
||||
} else if ("能力资源上架".equals(activitiNoticeOperation.process())) {
|
||||
type = 2;
|
||||
} else if ("能力资源下架".equals(activitiNoticeOperation.process())) {
|
||||
type = 4;
|
||||
} else if ("能力需求申请".equals(activitiNoticeOperation.process())) {
|
||||
type = 6;
|
||||
} else if ("需求评论审核流程".equals(activitiNoticeOperation.process())) {
|
||||
type = 8;
|
||||
}
|
||||
SysNoticeDTO dto = new SysNoticeDTO();
|
||||
dto.setType(type);
|
||||
|
@ -329,7 +326,7 @@ public class ActivitiNoticeAspect {
|
|||
dto.setCreator(sysUserService.getByUsername("admin").getId());
|
||||
dto.setCreateDate(new Date());
|
||||
dto.setFrom("通知");
|
||||
if(tAbilityApplicationDTOList != null){
|
||||
if (tAbilityApplicationDTOList != null) {
|
||||
dto.setApplyId(tAbilityApplicationDTOList.get(0).getApplyFlag());
|
||||
}
|
||||
dto.setApplyState(0);
|
||||
|
@ -347,17 +344,17 @@ public class ActivitiNoticeAspect {
|
|||
dto.setType(2);
|
||||
dto.setTitle("流程结束系统通知");
|
||||
String content = "【通知】" + user.getRealName() + "," + creatorDTO.getRealName() + "发起的" + activitiNoticeOperation.process() + "已完成,审核结果为:" + finalResult;
|
||||
Integer type=10;
|
||||
if("能力申请流程".equals(activitiNoticeOperation.process())){
|
||||
type=1;
|
||||
}else if("能力资源上架".equals(activitiNoticeOperation.process())){
|
||||
type=3;
|
||||
}else if("能力资源下架".equals(activitiNoticeOperation.process())){
|
||||
type=5;
|
||||
}else if("能力需求申请".equals(activitiNoticeOperation.process())){
|
||||
type=7;
|
||||
}else if("需求评论审核流程".equals(activitiNoticeOperation.process())){
|
||||
type=9;
|
||||
Integer type = 10;
|
||||
if ("能力申请流程".equals(activitiNoticeOperation.process())) {
|
||||
type = 1;
|
||||
} else if ("能力资源上架".equals(activitiNoticeOperation.process())) {
|
||||
type = 3;
|
||||
} else if ("能力资源下架".equals(activitiNoticeOperation.process())) {
|
||||
type = 5;
|
||||
} else if ("能力需求申请".equals(activitiNoticeOperation.process())) {
|
||||
type = 7;
|
||||
} else if ("需求评论审核流程".equals(activitiNoticeOperation.process())) {
|
||||
type = 9;
|
||||
}
|
||||
dto.setType(type);
|
||||
dto.setContent(content); // 通知内容
|
||||
|
@ -410,7 +407,7 @@ public class ActivitiNoticeAspect {
|
|||
} else if (kv.containsKey("_id")) {
|
||||
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();
|
||||
if (kv.containsKey("resourceDTO")) {
|
||||
resourceName.append("'");
|
||||
|
@ -446,17 +443,17 @@ public class ActivitiNoticeAspect {
|
|||
LOGGER.error("审核人:{}", assignee.getId());
|
||||
String content = "【通知】您发起的流程 " + resourceName + activitiNoticeOperation.process() + " 当前审核节点为:" + activitiNoticeOperation.value() + ";当前审核部门为:\"" + assignee.getDeptName() + "\";审核负责人\"" + assignee.getRealName() + "\"";
|
||||
LOGGER.info("通知内容:{}", content);
|
||||
Integer type=10;
|
||||
if("能力申请流程".equals(activitiNoticeOperation.process())){
|
||||
type=0;
|
||||
}else if("能力资源上架".equals(activitiNoticeOperation.process())){
|
||||
type=2;
|
||||
}else if("能力资源下架".equals(activitiNoticeOperation.process())){
|
||||
type=4;
|
||||
}else if("能力需求申请".equals(activitiNoticeOperation.process())){
|
||||
type=6;
|
||||
}else if("需求评论审核流程".equals(activitiNoticeOperation.process())){
|
||||
type=8;
|
||||
Integer type = 10;
|
||||
if ("能力申请流程".equals(activitiNoticeOperation.process())) {
|
||||
type = 0;
|
||||
} else if ("能力资源上架".equals(activitiNoticeOperation.process())) {
|
||||
type = 2;
|
||||
} else if ("能力资源下架".equals(activitiNoticeOperation.process())) {
|
||||
type = 4;
|
||||
} else if ("能力需求申请".equals(activitiNoticeOperation.process())) {
|
||||
type = 6;
|
||||
} else if ("需求评论审核流程".equals(activitiNoticeOperation.process())) {
|
||||
type = 8;
|
||||
}
|
||||
SysNoticeDTO dto = new SysNoticeDTO();
|
||||
dto.setType(type);
|
||||
|
@ -470,7 +467,7 @@ public class ActivitiNoticeAspect {
|
|||
dto.setCreator(sysUserService.getByUsername("admin").getId());
|
||||
dto.setCreateDate(new Date());
|
||||
dto.setFrom("通知");
|
||||
if(tAbilityApplicationDTOList != null){
|
||||
if (tAbilityApplicationDTOList != null) {
|
||||
dto.setApplyId(tAbilityApplicationDTOList.get(0).getApplyFlag());
|
||||
}
|
||||
dto.setApplyState(0);
|
||||
|
@ -482,17 +479,17 @@ public class ActivitiNoticeAspect {
|
|||
try {
|
||||
SysUserDTO owner = sysUserService.get(Long.valueOf(finalCreator));
|
||||
String content = "【通知】" + owner.getRealName() + "发起的流程" + resourceName + activitiNoticeOperation.process() + " 已进入审核节点:" + activitiNoticeOperation.value() + ";当前审核人指派为您";
|
||||
Integer type=10;
|
||||
if("能力申请流程".equals(activitiNoticeOperation.process())){
|
||||
type=1;
|
||||
}else if("能力资源上架".equals(activitiNoticeOperation.process())){
|
||||
type=3;
|
||||
}else if("能力资源下架".equals(activitiNoticeOperation.process())){
|
||||
type=5;
|
||||
}else if("能力需求申请".equals(activitiNoticeOperation.process())){
|
||||
type=7;
|
||||
}else if("需求评论审核流程".equals(activitiNoticeOperation.process())){
|
||||
type=9;
|
||||
Integer type = 10;
|
||||
if ("能力申请流程".equals(activitiNoticeOperation.process())) {
|
||||
type = 1;
|
||||
} else if ("能力资源上架".equals(activitiNoticeOperation.process())) {
|
||||
type = 3;
|
||||
} else if ("能力资源下架".equals(activitiNoticeOperation.process())) {
|
||||
type = 5;
|
||||
} else if ("能力需求申请".equals(activitiNoticeOperation.process())) {
|
||||
type = 7;
|
||||
} else if ("需求评论审核流程".equals(activitiNoticeOperation.process())) {
|
||||
type = 9;
|
||||
}
|
||||
SysNoticeDTO dto = new SysNoticeDTO();
|
||||
dto.setType(type);
|
||||
|
|
|
@ -107,10 +107,10 @@ public class SysNoticeServiceImpl extends CrudServiceImpl<SysNoticeDao, SysNotic
|
|||
|
||||
@Override
|
||||
public void updateApplyStateById(String id, Integer state) {
|
||||
Map params=new HashMap();
|
||||
params.put("apply_id",id);
|
||||
List<SysNoticeDTO> list=this.list(params);
|
||||
list.stream().filter(it->it.getReceiverTypeIds().contains(SecurityUser.getUserId().toString())).forEach(it->{
|
||||
Map params = new HashMap();
|
||||
params.put("apply_id", id);
|
||||
List<SysNoticeDTO> list = this.list(params);
|
||||
list.stream().filter(it -> it.getReceiverTypeIds().contains(SecurityUser.getUserId().toString())).forEach(it -> {
|
||||
it.setApplyState(state);
|
||||
this.update(it);
|
||||
});
|
||||
|
|
|
@ -415,12 +415,12 @@ public class TAbilityApplicationController {
|
|||
@GetMapping("canApply/{number}")
|
||||
@ApiOperation("判断资源是否可以申请")
|
||||
@LogOperation("判断资源是否可以申请,当前限制为:一个部门最多申请10个基础设施")
|
||||
public Result canApply(@PathVariable("number") Integer number){
|
||||
Integer count=tAbilityApplicationService.getDeptInfrastructureApply(SecurityUser.getDeptId());
|
||||
if(count>=infrastructureMax){
|
||||
public Result canApply(@PathVariable("number") Integer number) {
|
||||
Integer count = tAbilityApplicationService.getDeptInfrastructureApply(SecurityUser.getDeptId());
|
||||
if (count >= infrastructureMax) {
|
||||
return new Result().error("当前部门申请基础设施数量已达上限!");
|
||||
}else if (count+number>infrastructureMax){
|
||||
return new Result().error("部门已申请基础设施数量"+count+",当前最多可申请"+(infrastructureMax-count)+"个!");
|
||||
} else if (count + number > infrastructureMax) {
|
||||
return new Result().error("部门已申请基础设施数量" + count + ",当前最多可申请" + (infrastructureMax - count) + "个!");
|
||||
}
|
||||
return new Result();
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@ public interface TAbilityApplicationService extends CrudService<TAbilityApplicat
|
|||
|
||||
/**
|
||||
* 查询部门申请的基础设施个数(审核中、通过)
|
||||
*
|
||||
* @param deptId
|
||||
* @return
|
||||
*/
|
||||
|
|
|
@ -1883,18 +1883,18 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object selectCollectComponentList(){
|
||||
List<Map> resourceCountList=baseDao.selectCollectList("组件服务","组件类型");
|
||||
Map result=new HashMap();
|
||||
resourceCountList.stream().forEach(it->result.put(it.get("type"), it.get("count")));
|
||||
public Object selectCollectComponentList() {
|
||||
List<Map> resourceCountList = baseDao.selectCollectList("组件服务", "组件类型");
|
||||
Map result = new HashMap();
|
||||
resourceCountList.stream().forEach(it -> result.put(it.get("type"), it.get("count")));
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object selectCollectResourceList(){
|
||||
List<Map> resourceCountList=baseDao.selectCollectResourceList();
|
||||
Map result=new HashMap();
|
||||
resourceCountList.stream().filter(it->!it.get("type").equals("")).forEach(it->result.put(it.get("type"), it.get("count")));
|
||||
public Object selectCollectResourceList() {
|
||||
List<Map> resourceCountList = baseDao.selectCollectResourceList();
|
||||
Map result = new HashMap();
|
||||
resourceCountList.stream().filter(it -> !it.get("type").equals("")).forEach(it -> result.put(it.get("type"), it.get("count")));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ spring:
|
|||
stat-view-servlet:
|
||||
enabled: true
|
||||
url-pattern: /druid/*
|
||||
#login-username: admin
|
||||
#login-username: admin
|
||||
#login-password: admin
|
||||
filter:
|
||||
stat:
|
||||
|
|
|
@ -11,7 +11,8 @@
|
|||
|
||||
<!-- 获取我的通知列表 -->
|
||||
<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
|
||||
where t1.notice_id = t2.id and t1.receiver_id = #{receiverId}
|
||||
<if test="readStatus != null">
|
||||
|
|
|
@ -1863,8 +1863,10 @@
|
|||
|
||||
<select id="selectCollectResourceList" resultType="java.util.Map">
|
||||
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
|
||||
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
|
||||
(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
|
||||
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
|
||||
WHERE 1=1 AND tdr.del_flag=0 AND tdr.type='应用资源'
|
||||
GROUP BY tda.attr_value
|
||||
|
|
|
@ -127,6 +127,7 @@ $(document).ready(function(){
|
|||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -56,6 +56,7 @@
|
|||
|
||||
})();
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
|
|
@ -55,6 +55,7 @@
|
|||
|
||||
})();
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
|
|
@ -87,6 +87,7 @@ function getIds() {
|
|||
return ids;
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -88,6 +88,7 @@ function getIds() {
|
|||
return ids;
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue