* 'dev' of http://221.0.232.152:9393/ability-center/share-platform: (32 commits)
  编目更新
  ...
  ...
  能力申请v3 未查到审批人时,使用配置文件预设默认审核人
  ...
  区、市审批流程监听器完善
  能力申请模型更新
  ...
  能力申请v3 新增监听器
  ...
  npe
  java.lang.NumberFormatException
  修改getImgServices的子查询sql语句为兼容mysql5.7
  修改sql
  。。
  增加能力申请V3 模型
  整理代码
  ...
  cim 根据应用领域查询图层服务 和 查询智能算法组件
  1.cim模块统计查询及列表查询 2.编目及字典更新
  ...
This commit is contained in:
huangweixiong 2022-08-24 15:01:16 +08:00
commit 16c0d2ad69
35 changed files with 1700 additions and 132 deletions

View File

@ -1,7 +1,7 @@
-- 涉及到的表sys_dict_datasys_dict_type
-- 注意更新时间
/*
Date: 18/07/2022 17:06:10
202281911:53:59
*/
REPLACE INTO `sys_dict_data` VALUES (1160061112075464705, 1160061077912858625, '', '0', '', 0, 1067246875800000001, '2022-02-25 10:37:18', 1067246875800000001, '2022-02-25 10:37:18', 0);
@ -68,6 +68,7 @@ REPLACE INTO `sys_dict_data` VALUES (1513713864000708610, 1513713662657339394, '
REPLACE INTO `sys_dict_data` VALUES (1513714259091562497, 1513714027213660162, '调用接口', '1', '', 1, 1513435534798127105, '2022-04-12 11:02:57', 1524924140178481154, '2022-07-01 14:26:55', NULL);
REPLACE INTO `sys_dict_data` VALUES (1513714288619462658, 1513714027213660162, '平台对接', '2', '', 2, 1513435534798127105, '2022-04-12 11:03:05', 1524924140178481154, '2022-07-01 14:27:15', NULL);
REPLACE INTO `sys_dict_data` VALUES (1513714321163067394, 1513714027213660162, 'SDK', '3', '', 3, 1513435534798127105, '2022-04-12 11:03:12', 1524924140178481154, '2022-07-01 14:27:56', NULL);
REPLACE INTO `sys_dict_data` VALUES (1513714443263451137, 1513714403530809346, '接口', '1', '', 1, 1513435534798127105, '2022-04-12 11:03:41', 1513435534798127105, '2022-04-12 11:03:41', NULL);
REPLACE INTO `sys_dict_data` VALUES (1513714474334855170, 1513714403530809346, 'SDK', '2', '', 2, 1513435534798127105, '2022-04-12 11:03:49', 1513435534798127105, '2022-04-12 11:03:49', NULL);
REPLACE INTO `sys_dict_data` VALUES (1513714504261214210, 1513714403530809346, 'Web页面', '3', '', 3, 1513435534798127105, '2022-04-12 11:03:56', 1513435534798127105, '2022-04-12 11:03:56', NULL);
REPLACE INTO `sys_dict_data` VALUES (1513714541603102722, 1513714403530809346, '其他', '99', '', 99, 1513435534798127105, '2022-04-12 11:04:05', 1513435534798127105, '2022-04-12 11:04:05', NULL);
@ -172,6 +173,16 @@ REPLACE INTO `sys_dict_data` VALUES (1543899506717712386, 1531163741457014785, '
REPLACE INTO `sys_dict_data` VALUES (1545342103516487682, 1531163741457014785, '富文本编辑', 'richText', '', 20, 1513433709613187073, '2022-07-08 17:40:43', 1513433709613187073, '2022-07-08 17:40:43', NULL);
REPLACE INTO `sys_dict_data` VALUES (1545610536514695170, 1531163741457014785, '多条添加', ' multipleAdditions', '', 20, 1513433709613187073, '2022-07-09 11:27:23', 1513433709613187073, '2022-07-09 11:27:23', NULL);
REPLACE INTO `sys_dict_data` VALUES (1547520739196383234, 1531163741457014785, '压缩包', 'package', '', 21, 1524924140178481154, '2022-07-14 17:57:50', 1524924140178481154, '2022-07-14 17:58:03', NULL);
REPLACE INTO `sys_dict_data` VALUES (1560463928171958273, 1560456227954102274, '行政区划', '行政区划', '', 0, 1067246875800000001, '2022-08-19 11:09:27', 1067246875800000001, '2022-08-19 11:09:27', NULL);
REPLACE INTO `sys_dict_data` VALUES (1560463980319739905, 1560456227954102274, '房屋普查', '房屋普查', '', 0, 1067246875800000001, '2022-08-19 11:09:40', 1067246875800000001, '2022-08-19 11:09:40', NULL);
REPLACE INTO `sys_dict_data` VALUES (1560464050129735681, 1560456227954102274, '市政设施', '市政设施', '', 0, 1067246875800000001, '2022-08-19 11:09:56', 1067246875800000001, '2022-08-19 11:09:56', NULL);
REPLACE INTO `sys_dict_data` VALUES (1560464121869111298, 1560456227954102274, '人口数据', '人口数据', '', 0, 1067246875800000001, '2022-08-19 11:10:13', 1067246875800000001, '2022-08-19 11:10:13', NULL);
REPLACE INTO `sys_dict_data` VALUES (1560464163044593666, 1560456227954102274, '地名地址', '地名地址', '', 0, 1067246875800000001, '2022-08-19 11:10:23', 1067246875800000001, '2022-08-19 11:10:23', NULL);
REPLACE INTO `sys_dict_data` VALUES (1560464221148286977, 1560456227954102274, '城市绿区', '城市绿区', '', 0, 1067246875800000001, '2022-08-19 11:10:37', 1067246875800000001, '2022-08-19 11:10:37', NULL);
REPLACE INTO `sys_dict_data` VALUES (1560464295676874754, 1560456227954102274, '海洋河岸', '海洋河岸', '', 0, 1067246875800000001, '2022-08-19 11:10:55', 1067246875800000001, '2022-08-19 11:10:55', NULL);
REPLACE INTO `sys_dict_data` VALUES (1560464354506182658, 1560456227954102274, '规划管控', '规划管控', '', 0, 1067246875800000001, '2022-08-19 11:11:09', 1067246875800000001, '2022-08-19 11:11:09', NULL);
REPLACE INTO `sys_dict_data` VALUES (1560464452883582978, 1560456227954102274, '工程建设', '工程建设', '', 0, 1067246875800000001, '2022-08-19 11:11:32', 1067246875800000001, '2022-08-19 11:11:32', NULL);
REPLACE INTO `sys_dict_data` VALUES (1560464526996934657, 1560456227954102274, '其他', '其他', '', 0, 1067246875800000001, '2022-08-19 11:11:50', 1067246875800000001, '2022-08-19 11:11:50', NULL);
REPLACE INTO `sys_dict_type` VALUES (1160061077912858625, 'gender', '性别', '', 0, 1067246875800000001, '2022-02-25 10:37:18', 1067246875800000001, '2022-02-25 10:37:18', NULL);
REPLACE INTO `sys_dict_type` VALUES (1225813644059140097, 'notice_type', '站内通知-类型', '', 1, 1067246875800000001, '2022-02-25 10:37:18', 1067246875800000001, '2022-02-25 10:37:18', NULL);
REPLACE INTO `sys_dict_type` VALUES (1341593474355838978, 'post_status', '岗位管理状态', '', 0, 1067246875800000001, '2022-02-25 10:37:18', 1067246875800000001, '2022-02-25 10:37:18', NULL);
@ -198,3 +209,4 @@ REPLACE INTO `sys_dict_type` VALUES (1539527547234017282, 'layer_style ', '图
REPLACE INTO `sys_dict_type` VALUES (1539528437391155202, 'Service_type', '服务类型', '', 21, 1515973081575276545, '2022-06-22 16:39:17', 1515973081575276545, '2022-06-22 16:39:17', NULL);
REPLACE INTO `sys_dict_type` VALUES (1541336217898848257, 'videoLabel', '视频标签', '', 31, 1513433270406643713, '2022-06-27 16:22:46', 1513433270406643713, '2022-06-27 16:22:46', NULL);
REPLACE INTO `sys_dict_type` VALUES (1542788081786019842, 'publishingTerminal', '发布端', '', 0, 1524924140178481154, '2022-07-01 16:31:57', 1524924140178481154, '2022-07-01 16:31:57', NULL);
REPLACE INTO `sys_dict_type` VALUES (1560456227954102274, 'layer_class', '图层分类', '', 0, 1067246875800000001, '2022-08-19 10:38:51', 1067246875800000001, '2022-08-19 10:38:51', NULL);

View File

@ -1,7 +1,7 @@
-- 涉及到的表tb_data_category
-- 注意更新时间
/*
20228910:00:46
202282410:27:24
*/
REPLACE INTO `tb_data_category` VALUES (1514138753379680257, '组件服务', NULL, NULL, 'false', NULL, 'false', 'false', '', 10, 0, 1067246875800000001, '2022-04-13 15:09:45', 1513437369940344833, '2022-07-12 16:16:11', NULL, NULL, NULL, NULL, NULL);
@ -70,7 +70,7 @@ REPLACE INTO `tb_data_category` VALUES (1514428953217581058, '共享方式', '
REPLACE INTO `tb_data_category` VALUES (1514428979914326018, '共享条件', '应用资源', '1514418051789471745', 'true', NULL, 'false', 'false', '', 1, 1, 1513437369940344833, '2022-04-14 10:23:00', 1513437369940344833, '2022-05-31 17:39:26', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1514429049392971777, '应用名称', '应用资源', '1514417974589112321', 'true', NULL, 'false', 'false', '', 1, 1, 1513437369940344833, '2022-04-14 10:23:17', 1513437369940344833, '2022-05-31 17:34:26', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1514429081416482818, '应用状态', '应用资源', '1514417974589112321', 'true', 'select', 'false', 'true', '1513711991655014402', 7, 0, 1513437369940344833, '2022-04-14 10:23:24', 1513437369940344833, '2022-04-14 10:23:24', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1514429108071284738, '应用类型', '应用资源', '1514417974589112321', 'true', 'select', 'true', 'true', '1513690812521160705', 2, 0, 1513437369940344833, '2022-04-14 10:23:31', 1513437369940344833, '2022-04-14 10:23:31', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1514429108071284738, '应用类型', '应用资源', '1514417974589112321', 'true', 'select', 'false', 'true', '1513690812521160705', 2, 0, 1513437369940344833, '2022-04-14 10:23:31', 1513437369940344833, '2022-04-14 10:23:31', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1514429134558314497, '应用领域', '应用资源', '1514417974589112321', 'true', 'select', 'true', 'true', '1513712507692818433', 1, 0, 1513437369940344833, '2022-04-14 10:23:37', 1513437369940344833, '2022-04-14 10:23:37', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1514429164702777346, '应用描述', '应用资源', '1514417974589112321', 'true', NULL, 'false', 'false', '', 1, 1, 1513437369940344833, '2022-04-14 10:23:44', 1513437369940344833, '2022-05-31 17:34:30', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1514429196948586498, '部署位置', '应用资源', '1514417974589112321', 'true', 'input', 'false', 'false', '', 3, 0, 1513437369940344833, '2022-04-14 10:23:52', 1513437369940344833, '2022-04-14 10:23:52', NULL, NULL, NULL, NULL, NULL);
@ -485,7 +485,7 @@ REPLACE INTO `tb_data_category` VALUES (1539538615381483522, '切片策略', '
REPLACE INTO `tb_data_category` VALUES (1539538660365393922, '最小级别', '组件服务一', '1539537928253825026', 'true', 'input', 'false', 'false', '', 10, 0, 1515973081575276545, '2022-06-22 17:19:55', 1515973081575276545, '2022-06-22 17:19:55', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1539538689041850370, '最大级别', '组件服务一', '1539537928253825026', 'true', 'input', 'false', 'false', '', 11, 0, 1515973081575276545, '2022-06-22 17:20:01', 1515973081575276545, '2022-06-22 17:20:01', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1539538721136664578, '是否可预览', '组件服务一', '1539537928253825026', 'true', 'radio', 'false', 'true', '1529028127496343554', 13, 0, 1515973081575276545, '2022-06-22 17:20:09', 1515973081575276545, '2022-06-22 17:20:09', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1539538762714800130, '预览服务地址', '组件服务一', '1539537928253825026', 'true', 'input', 'false', 'false', '', 14, 0, 1515973081575276545, '2022-06-22 17:20:19', 1515973081575276545, '2022-06-22 17:20:19', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1539538762714800130, '图层服务地址', '组件服务一', '1539537928253825026', 'true', 'input', 'false', 'false', '', 14, 0, 1515973081575276545, '2022-06-22 17:20:19', 1515973081575276545, '2022-06-22 17:20:19', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1541958011009875969, '数据范围', '组件服务一', '1539537928253825026', 'true', 'input', 'false', 'false', '', 12, 0, 1524924140178481154, '2022-06-29 09:33:33', 1524924140178481154, '2022-06-29 09:33:33', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1541958848058736642, '样式服务地址', '组件服务一', '1539529687759314945', 'true', 'input', 'false', 'false', '', 4, 0, 1524924140178481154, '2022-06-29 09:36:52', 1524924140178481154, '2022-06-29 09:36:52', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1542755260526624769, '能力类型', '组件服务一', '1534718048405012481', 'true', 'AbilityType', 'false', 'false', '', 1, 0, 1524924140178481154, '2022-07-01 14:21:32', 1524924140178481154, '2022-07-01 14:21:32', NULL, NULL, NULL, NULL, NULL);
@ -540,3 +540,4 @@ REPLACE INTO `tb_data_category` VALUES (1548960050394947586, '共享条件', '
REPLACE INTO `tb_data_category` VALUES (1548962537742970881, '部门联系人', '组件服务一', '1534718048405012481', 'true', 'input', 'false', 'false', '', 17, 0, 1513437369940344833, '2022-07-18 17:27:02', 1513437369940344833, '2022-07-18 17:27:02', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1548962613546627073, '部门联系人电话', '组件服务一', '1534718048405012481', 'true', 'input', 'false', 'false', '', 18, 0, 1513437369940344833, '2022-07-18 17:27:20', 1513437369940344833, '2022-07-18 17:27:20', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1548980404643405825, '使用方式', '组件服务', '1531208527270404097', 'true', 'input', 'true', 'true', '1513714027213660162', 8, 1, 1524924140178481154, '2022-07-18 18:38:02', 1524924140178481154, '2022-07-18 18:43:36', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1560464775119376386, '分类', '组件服务一', '1539536463208636417', 'true', 'radio', 'false', 'true', '1560456227954102274', 13, 0, 1067246875800000001, '2022-08-19 11:12:49', 1067246875800000001, '2022-08-19 11:12:49', NULL, NULL, NULL, NULL, NULL);

View File

@ -128,7 +128,13 @@ public class ActivitiNoticeAspect {
private void task_complete_notice(final DelegateTask delegateTask, final ActivitiNoticeOperation activitiNoticeOperation) {
Map<String, Object> kv = delegateTask.getVariables();
LOGGER.error("表单:{}", JSON.toJSONString(kv));
final String workKey = TaskListener.EVENTNAME_COMPLETE + kv.get("id").toString();
String key = null;
if (kv.containsKey("id")) {
key = kv.getOrDefault("id", "").toString();
} else if (kv.containsKey("_id")) {
key = kv.getOrDefault("_id", "").toString();
}
final String workKey = TaskListener.EVENTNAME_COMPLETE + key;
if (work.contains(workKey)) {
LOGGER.error("------------出现重放------------");
return;
@ -167,8 +173,6 @@ public class ActivitiNoticeAspect {
String finalResult = result;
CompletableFuture.runAsync(() -> { // 发起人
SysUserDTO userDTO = sysUserService.get(Long.valueOf(finalCreator));
kv.get("resourceId");
kv.get("id");
String content = "【通知】" + userDTO.getRealName() + ",您发起的" + activitiNoticeOperation.process() + " " + activitiNoticeOperation.value() + "节点" + finalResult;
SysNoticeDTO dto = new SysNoticeDTO();
dto.setType(2);
@ -209,7 +213,13 @@ public class ActivitiNoticeAspect {
private void end_notice(final DelegateExecution execution, final ActivitiNoticeOperation activitiNoticeOperation) {
Map<String, Object> kv = execution.getVariables();
LOGGER.error("表单:{}", JSON.toJSONString(kv));
final String workKey = ExecutionListener.EVENTNAME_END + kv.get("id").toString();
String key = null;
if (kv.containsKey("id")) {
key = kv.getOrDefault("id", "").toString();
} else if (kv.containsKey("_id")) {
key = kv.getOrDefault("_id", "").toString();
}
final String workKey = ExecutionListener.EVENTNAME_END + key;
if (work.contains(workKey)) {
LOGGER.error("------------出现重放------------");
return;
@ -248,8 +258,6 @@ public class ActivitiNoticeAspect {
String finalResult = result;
CompletableFuture.runAsync(() -> { // 发起人
SysUserDTO userDTO = sysUserService.get(Long.valueOf(finalCreator));
kv.get("resourceId");
kv.get("id");
String content = "【通知】" + userDTO.getRealName() + ",您发起的" + activitiNoticeOperation.process() + "已完成,审核结果为:" + finalResult;
SysNoticeDTO dto = new SysNoticeDTO();
dto.setType(2);
@ -315,7 +323,13 @@ public class ActivitiNoticeAspect {
private void assignment_notice(final DelegateTask delegateTask, final ActivitiNoticeOperation activitiNoticeOperation) {
Map<String, Object> kv = delegateTask.getVariables();
LOGGER.error("表单:{}", JSON.toJSONString(kv));
final String workKey = TaskListener.EVENTNAME_ASSIGNMENT + kv.get("id").toString();
String key = null;
if (kv.containsKey("id")) {
key = kv.getOrDefault("id", "").toString();
} else if (kv.containsKey("_id")) {
key = kv.getOrDefault("_id", "").toString();
}
final String workKey = TaskListener.EVENTNAME_ASSIGNMENT + key;
if (work.contains(workKey)) {
LOGGER.error("------------出现重放------------");
return;

View File

@ -54,7 +54,8 @@ import java.util.stream.Collectors;
@RestController
@RequestMapping("/ability/center/v2")
public class AbilityCenterControllerV2 {
private static final ExecutorService executor = Executors.newCachedThreadPool();
private static final Integer CPUNUM = Runtime.getRuntime().availableProcessors();
private static final ExecutorService executor = Executors.newWorkStealingPool(CPUNUM * 2);
private static final Logger logger = LoggerFactory.getLogger(AbilityCenterControllerV2.class);
private static final ObjectMapper oMapper = new ObjectMapper();
@Autowired
@ -118,9 +119,7 @@ public class AbilityCenterControllerV2 {
}
break;
default: {
executor.execute(() -> {
deal(abilityBatchApplicationDTO, deptDTO, applyFlag, user);
});
executor.execute(() -> deal(abilityBatchApplicationDTO, deptDTO, applyFlag, user));
}
}
return new Result().ok(LocalDateTime.now().toString());
@ -149,9 +148,7 @@ public class AbilityCenterControllerV2 {
}
break;
default: {
executor.execute(() -> {
deal(abilityBatchApplicationDTO, deptDTO, applyFlag, user);
});
executor.execute(() -> deal(abilityBatchApplicationDTO, deptDTO, applyFlag, user));
}
}
return new Result().ok(LocalDateTime.now().toString());
@ -266,6 +263,7 @@ public class AbilityCenterControllerV2 {
put("key", processStartDTO.getBusinessKey()); // 归属该部门申请的表单id
put("deptId", deptId); // 归属部门
put("id", applyFlag); //申请id
put("_id", applyFlag); //申请id
put("creator", user == null ? null : user.getId().toString()); // 创建人
put("userId", user == null ? null : user.getId().toString()); // 创建人
put("basic_facilities", basicFacilities); // 是否为基础设施

View File

@ -0,0 +1,327 @@
package io.renren.common.controller;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import io.renren.common.annotation.LogOperation;
import io.renren.common.constant.Constant;
import io.renren.common.dto.AuditingBaseDTO;
import io.renren.common.page.PageData;
import io.renren.common.utils.CodeGenerationUtils;
import io.renren.common.utils.Result;
import io.renren.common.validator.ValidatorUtils;
import io.renren.common.validator.group.AddGroup;
import io.renren.common.validator.group.DefaultGroup;
import io.renren.modules.activiti.dto.ProcessInstanceDTO;
import io.renren.modules.activiti.dto.ProcessStartDTO;
import io.renren.modules.activiti.service.ActProcessService;
import io.renren.modules.activiti.service.ActRunningService;
import io.renren.modules.processForm.dto.TAbilityApplicationDTO;
import io.renren.modules.processForm.dto.TAbilityBatchApplicationDTO;
import io.renren.modules.processForm.service.TAbilityApplicationService;
import io.renren.modules.resource.dto.ResourceDTO;
import io.renren.modules.resource.service.ResourceService;
import io.renren.modules.security.user.SecurityUser;
import io.renren.modules.security.user.UserDetail;
import io.renren.modules.sys.dto.SysDeptDTO;
import io.renren.modules.sys.service.SysDeptService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.codehaus.jackson.map.ObjectMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.time.LocalDateTime;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.stream.Collectors;
@Api(tags = "能力集中")
@RestController
@RequestMapping("/ability/center/v3")
public class AbilityCenterControllerV3 {
private static final Logger logger = LoggerFactory.getLogger(AbilityCenterControllerV3.class);
private final CodeGenerationUtils codeGenerationUtils = CodeGenerationUtils.getInstance();
private static final Integer CPUNUM = Runtime.getRuntime().availableProcessors();
private static final ExecutorService executor = Executors.newWorkStealingPool(CPUNUM * 2);
private static final ObjectMapper oMapper = new ObjectMapper();
@Value("${project.place}")
private Integer projectPlace;
@Value("${big_date.name}")
private String bigDateDeptName; // 大数据局名称
@Lazy
@Autowired
private JdbcTemplate jdbcTemplate;
@Autowired
private ActProcessService actProcessService;
@Autowired
private TAbilityApplicationService tAbilityApplicationService;
@Autowired
private ActRunningService actRunningService;
@Autowired
private ResourceService resourceService;
@Autowired
private SysDeptService sysDeptService;
private static final String KEY = "abilityprocess_v3";
private static final Map<String, Object> params = new HashMap<String, Object>() {
{
put("isLatestVersion", true); // 取最新版本
put("key", KEY); // 限定
}
};
@PostMapping(value = "/applyAllApplication")
@ApiOperation("批量进行能力申请")
@LogOperation("批量进行能力申请")
public Result<List<ProcessInstanceDTO>> applyV3AllApplication(@RequestBody TAbilityBatchApplicationDTO abilityBatchApplicationDTO) {
// 仿照请求接口 /act/process/lastestPage
PageData<Map<String, Object>> page = actProcessService.page(params);
if (page.getTotal() <= 0) { //
return new Result().error("联系管理员添加流程");
}
List<Map<String, Object>> system_ = jdbcTemplate.queryForList("SELECT `name` AS resourceName,id AS resourceId FROM tb_data_resource WHERE type = '应用资源' AND del_flag = 0;");
if (system_.isEmpty()) {
return new Result().error("无应用资源");
}
List<Map<String, String>> system = system_.stream().map(index ->
index.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().toString()))
).collect(Collectors.toList());
abilityBatchApplicationDTO.setSystem(system); // 申请所有的正常的应用资源
logger.info("申请入参{}", JSON.toJSONString(abilityBatchApplicationDTO));
final String applyFlag = UUID.randomUUID().toString();
abilityBatchApplicationDTO.setApplyFlag(applyFlag); // 同一次的申请标识
final Optional<SysDeptDTO> deptDTO = Optional.ofNullable(sysDeptService.getByName(bigDateDeptName));
final UserDetail user = SecurityUser.getUser();
switch (Constant.ProjectPlace.getByFlag(projectPlace)) {
case TSINGTAO: { // 青岛市局 异步会死锁
deal(abilityBatchApplicationDTO, deptDTO, applyFlag, user);
}
break;
default: {
executor.execute(() -> {
deal(abilityBatchApplicationDTO, deptDTO, applyFlag, user);
});
}
}
return new Result().ok(LocalDateTime.now().toString());
}
/**
* 批量进行批量能力申请(按资源所属部门分配审核人)
*/
@PostMapping(value = "/apply")
@ApiOperation("批量进行能力申请")
@LogOperation("批量进行能力申请")
public Result<List<ProcessInstanceDTO>> applyV3(@RequestBody TAbilityBatchApplicationDTO abilityBatchApplicationDTO) {
// 仿照请求接口 /act/process/lastestPage
PageData<Map<String, Object>> page = actProcessService.page(params);
if (page.getTotal() <= 0) { //
return new Result().error("联系管理员添加流程");
}
final String applyFlag = UUID.randomUUID().toString();
abilityBatchApplicationDTO.setApplyFlag(applyFlag); // 同一次的申请标识
logger.info("申请入参{}", JSON.toJSONString(abilityBatchApplicationDTO));
final Optional<SysDeptDTO> deptDTO = Optional.ofNullable(sysDeptService.getByName(bigDateDeptName));
final UserDetail user = SecurityUser.getUser();
switch (Constant.ProjectPlace.getByFlag(projectPlace)) {
case TSINGTAO: { // 青岛市局 异步会死锁
deal(abilityBatchApplicationDTO, deptDTO, applyFlag, user);
}
break;
default: {
executor.execute(() -> deal(abilityBatchApplicationDTO, deptDTO, applyFlag, user));
}
}
return new Result().ok(LocalDateTime.now().toString());
}
/**
* 拆单进行审核
*
* @param abilityBatchApplicationDTO
* @param deptDTO
* @param applyFlag
* @param user
*/
// TODO 拆单进行审核 abilityprocess_v3
private void deal(TAbilityBatchApplicationDTO abilityBatchApplicationDTO, Optional<SysDeptDTO> deptDTO, String applyFlag, UserDetail user) {
List<TAbilityApplicationDTO> tAbilityApplicationDTOList = abilityBatchApplicationDTO.getSystem().stream().map(index -> {
if (tAbilityApplicationService.countUserResourceApply(SecurityUser.getUserId(), Long.valueOf(index.get("resourceId"))) > 0) { // 防止重复发起申请
logger.error("重复发起申请");
return null;
}
TAbilityApplicationDTO tAbilityApplicationDTO = new TAbilityApplicationDTO();
tAbilityApplicationDTO.setArea(abilityBatchApplicationDTO.getArea());
tAbilityApplicationDTO.setAttachment(abilityBatchApplicationDTO.getAttachment());
tAbilityApplicationDTO.setBasis(abilityBatchApplicationDTO.getBasis());
tAbilityApplicationDTO.setPhone(abilityBatchApplicationDTO.getPhone());
tAbilityApplicationDTO.setScene(abilityBatchApplicationDTO.getScene());
tAbilityApplicationDTO.setInstanceId(abilityBatchApplicationDTO.getInstanceId());
tAbilityApplicationDTO.setUnit(abilityBatchApplicationDTO.getUnit());
tAbilityApplicationDTO.setUser(abilityBatchApplicationDTO.getUser());
tAbilityApplicationDTO.setResourceId(index.get("resourceId"));
tAbilityApplicationDTO.setUser(abilityBatchApplicationDTO.getUser());
tAbilityApplicationDTO.setSystem(index.get("resourceName"));
tAbilityApplicationDTO.setEnclosure(abilityBatchApplicationDTO.getEnclosure()); // 附件
tAbilityApplicationDTO.setUserId(abilityBatchApplicationDTO.getUserId());
tAbilityApplicationDTO.setApproveStatus("审核中");
tAbilityApplicationDTO.setDelFlag(0);
// v2 新增字段
tAbilityApplicationDTO.setCameraList(index.get("channelId") == null ? null : JSON.toJSONString(index));
tAbilityApplicationDTO.setTitle(abilityBatchApplicationDTO.getTitle());
tAbilityApplicationDTO.setApplicationBackground(abilityBatchApplicationDTO.getApplicationBackground());
tAbilityApplicationDTO.setApplicationScene(abilityBatchApplicationDTO.getApplicationScene());
tAbilityApplicationDTO.setApplicationSystem(abilityBatchApplicationDTO.getApplicationSystem());
tAbilityApplicationDTO.setEffectWish(abilityBatchApplicationDTO.getEffectWish());
tAbilityApplicationDTO.setEnclosureName(abilityBatchApplicationDTO.getEnclosureName());
tAbilityApplicationDTO.setCreateDate(new Date());
// 归为同一次申请
tAbilityApplicationDTO.setApplyFlag(abilityBatchApplicationDTO.getApplyFlag());
tAbilityApplicationDTO.setFlowType("能力申请");
// 仿照请求接口 /processForm/tabilityapplication
ValidatorUtils.validateEntity(tAbilityApplicationDTO, AddGroup.class, DefaultGroup.class);
tAbilityApplicationService.save(tAbilityApplicationDTO); // 写能力申请数据
if (tAbilityApplicationDTO.getId() == null) {
logger.error("插入申请单失败!");
return null;
}
tAbilityApplicationDTO.setCompleteEntry(Boolean.TRUE);
return tAbilityApplicationDTO;
}).filter(ObjectUtil::isNotNull).collect(Collectors.toList()); // 申请入库
if (!tAbilityApplicationDTOList.isEmpty()) {
codeGenerationUtils.setApplyNumber("NLSY", tAbilityApplicationDTOList.stream().map(TAbilityApplicationDTO::getId).collect(Collectors.toList()), jdbcTemplate);
Map<Long, List<TAbilityApplicationDTO>> temp = tAbilityApplicationDTOList.stream()
.filter(Objects::nonNull)
.filter(index -> StringUtils.isNotEmpty(index.getResourceId()))
.collect(Collectors.groupingBy(t -> {
ResourceDTO resourceDTO = resourceService.get(Long.valueOf(t.getResourceId()));
if (resourceDTO == null && deptDTO.isPresent()) { // 资源不存在时
return deptDTO.get().getId();
}
if (resourceDTO.getDeptId() == null && deptDTO.isPresent()) {
return deptDTO.get().getId();
}
return resourceDTO.getDeptId();
})); // 按部门分组
temp.keySet().stream().distinct().forEach(deptId -> {
if (deptId == 0L) { // 部门id不存在时
return;
}
final SysDeptDTO sysDeptDTO = sysDeptService.get(deptId);
if (sysDeptDTO == null) { // 部门不存在
return;
}
List<TAbilityApplicationDTO> dtoList = temp.get(deptId);
CompletableFuture.runAsync(() -> {
String[] sqls = dtoList.stream().map(index -> String.format("UPDATE t_ability_application SET resource_owner_dept = '%s' WHERE id = %s", JSON.toJSONString(sysDeptDTO), index.getId())).collect(Collectors.toList()).toArray(new String[dtoList.size()]);
jdbcTemplate.batchUpdate(sqls); // 批量更新资源所属部门信息
logger.info("批量更新申请的资源的部门信息完成");
}, executor);
Boolean basicFacilities = dtoList.stream().map(index -> {
Optional<ResourceDTO> resourceDTOOptional = Optional.ofNullable(resourceService.get(Long.valueOf(index.getResourceId())));
if (!resourceDTOOptional.isPresent()) { // 从本库内查不到 视为其它平台的基础设施资源
return true;
}
if ("基础设施".equals(resourceDTOOptional.get().getType())) { // 基础设施
return true;
}
return false;
}).filter(index -> index).findAny().orElse(Boolean.FALSE);
logger.error("--------------------是否全是基础设施 {}----------------------------------------------", basicFacilities);
final List<Long> ids = dtoList.stream().map(TAbilityApplicationDTO::getId).distinct().collect(Collectors.toList()); // 发起申请的表单id
// 仿照请求接口 /act/running/startOfBusinessKey
ProcessStartDTO processStartDTO = new ProcessStartDTO();
processStartDTO.setBusinessKey(Boolean.TRUE.equals(basicFacilities) ? tAbilityApplicationDTOList.stream().filter(index -> StringUtils.isNotEmpty(index.getResourceId()))
.map(TAbilityApplicationDTO::getResourceId).findFirst().orElse(null) :
JSON.toJSONString(ids.stream().limit(5).collect(Collectors.toList()))); // 申请的id列表 json字符 做businesskey
processStartDTO.setProcessDefinitionKey(KEY); //限定
AuditingBaseDTO auditingBaseDTO = new AuditingBaseDTO();
auditingBaseDTO.setCompleteEntry(Boolean.TRUE); // 首次录入
auditingBaseDTO.setFlowType("能力申请");
Boolean cityApply = Boolean.FALSE; // 是否为市级部门发起申请
Boolean crossRegion = Boolean.FALSE; // 是否跨区
Boolean cityApplyCity = Boolean.FALSE; // 是否为市区申请市区
// TODO
if (user.getDeptId() != null) {
SysDeptDTO applyUserDeptDTO = sysDeptService.get(user.getDeptId()); // 发起人的部门
Integer applyUserDeptType = applyUserDeptDTO.getType(); // 发起人
Integer resourceDeptType = sysDeptDTO.getType(); // 资源所属部门
if (applyUserDeptType == 2) {
cityApply = Boolean.TRUE; // 市级部门发起申请
}
if (cityApply && resourceDeptType == 2) {
cityApplyCity = Boolean.TRUE; // 市区申请市区
}
if (!cityApply && (user.getDeptId() != sysDeptDTO.getId())) { // 非市申请且发起人与资源所属部门不一致
crossRegion = Boolean.TRUE; // 跨区
}
}
Map<String, Object> variables = oMapper.convertValue(auditingBaseDTO, Map.class);
Boolean finalCityApply = cityApply;
Boolean finalCityApplyCity = cityApplyCity;
Boolean finalCrossRegion = crossRegion;
variables.putAll(new HashMap<String, Object>() { // 流程内携带属性值
{
put("tAbilityApplicationDTOList", dtoList); // 归属该部门的申请
put("key", processStartDTO.getBusinessKey()); // 归属该部门申请的表单id
put("deptId", deptId); // 归属部门
put("_id", applyFlag); //申请id
put("creator", user == null ? null : user.getId().toString()); // 创建人
put("userId", user == null ? null : user.getId().toString()); // 创建人
put("userDeptId", user == null ? null : user.getDeptId().toString()); // 发起人部门id
put("basic_facilities", basicFacilities); // 是否为基础设施
// 以下为V3增加
put("city_apply", finalCityApply); // 是否为市级部门发起申请
put("cross_region", finalCrossRegion); // 是否跨区
put("city_apply_city", finalCityApplyCity); // 是否为市区申请市区
}
});
processStartDTO.setVariables(variables);
ProcessInstanceDTO dto = actRunningService.startOfBusinessKey(processStartDTO);
// 仿照请求接口 /processForm/tabilityapplication/updateInstanceId
CompletableFuture.runAsync(() -> {
if (dto.getBusinessKey() != null) {
String[] sqls = dtoList.stream().map(i -> String.format("UPDATE t_ability_application SET instance_id = %s WHERE id = %s", dto.getProcessInstanceId(), i.getId()))
.collect(Collectors.toList()).toArray(new String[dtoList.size()]);
jdbcTemplate.batchUpdate(sqls);
}
}, executor);
});
}
}
}

View File

@ -209,6 +209,9 @@ public class ResourceMountController {
}
dto.setUndercarriageReason(tResourceUndercarriageApplyDTO.getReason());
dto.setUndercarriageEnclosure(tResourceUndercarriageApplyDTO.getEnclosure());
dto.setUndercarriageEnclosureName(tResourceUndercarriageApplyDTO.getEnclosureName());
dto.setUndercarriageTitle(tResourceUndercarriageApplyDTO.getTitle());
dto.setUndercarriageUserPhone(tResourceUndercarriageApplyDTO.getPhone());
dto.setDelFlag(ResourceEntityDelFlag.NORMAL.getFlag()); // 设置为正常
dto.setFlowType("资源下架");
String userId = SecurityUser.getUserId().toString();

View File

@ -259,7 +259,7 @@ public class TAbilityApplicationController {
try {
backToFirst = Boolean.parseBoolean(processInstanceDTO.getProcessVariables().getOrDefault("backToFirst", "false").toString());
} catch (Exception exception) {
logger.info("{}未被驳回", tAbilityApplicationDTOList.get(0).getInstanceId());
logger.info("{} 未被驳回", tAbilityApplicationDTOList.get(0).getInstanceId());
}
}
}

View File

@ -0,0 +1,127 @@
package io.renren.modules.processForm.listener.v3;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import io.renren.common.annotation.ActivitiNoticeOperation;
import io.renren.modules.processForm.dto.TAbilityApplicationDTO;
import io.renren.modules.sys.dto.SysDeptDTO;
import io.renren.modules.sys.dto.SysRoleDTO;
import io.renren.modules.sys.dto.SysUserDTO;
import io.renren.modules.sys.service.SysDeptService;
import io.renren.modules.sys.service.SysRoleService;
import io.renren.modules.sys.service.SysUserService;
import org.activiti.engine.TaskService;
import org.activiti.engine.delegate.*;
import org.activiti.engine.delegate.event.ActivitiEvent;
import org.activiti.engine.delegate.event.ActivitiEventListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.Map;
/**
* 发起人部门负责人
*/
@Component
public class ApplyDeptListener implements TaskListener, ExecutionListener, ActivitiEventListener, JavaDelegate {
private static final Logger logger = LoggerFactory.getLogger(ApplyDeptListener.class);
@Autowired
private TaskService taskService;
@Autowired
private SysUserService sysUserService;
@Autowired
private SysRoleService sysRoleService;
@Autowired
private SysDeptService sysDeptService;
@Value("${big_date.assignee_role_name}")
private String roleName; // 具备审批的角色名称
@Value("${big_date.default_assignee_role_id}")
private String defaultAssigneeRoleId; // 当未查到审批人时将使用该用户审批
@Override
public void execute(DelegateExecution execution) throws Exception {
}
/**
* Called when an event has been fired
*
* @param event the event
*/
@Override
public void onEvent(ActivitiEvent event) {
}
/**
* @return whether or not the current operation should fail when this listeners execution
* throws an exception.
*/
@Override
public boolean isFailOnException() {
return false;
}
@Override
public void notify(DelegateExecution execution) throws Exception {
}
@Override
@ActivitiNoticeOperation(value = "申请人发起人部门负责人审批", process = "能力申请流程v3")
public void notify(DelegateTask delegateTask) {
logger.error("事件类型:" + delegateTask.getEventName());
final String eventName = delegateTask.getEventName();
switch (eventName) {
case EVENTNAME_CREATE:
create(delegateTask);
break;
case EVENTNAME_COMPLETE:
logger.error("----------------------申请人发起人部门负责人审批-complete------------------------------");
break;
default:
logger.error("未处理该事件:" + eventName);
}
}
private void create(DelegateTask delegateTask) {
String assignee;
Map<String, Object> kv = delegateTask.getVariables();
GsonBuilder builder = new GsonBuilder();
builder.registerTypeAdapter(Date.class, (JsonDeserializer<Date>) (json, typeOfT, context) -> new Date(json.getAsJsonPrimitive().getAsLong()));
Gson gson = builder.create();
JsonElement jsonElement = gson.toJsonTree(kv);
TAbilityApplicationDTO abilityApplicationDTO = gson.fromJson(jsonElement, TAbilityApplicationDTO.class);
/**
* 获取发起者部门id
*/
long deptId = Long.parseLong(kv.getOrDefault("userDeptId", sysUserService.get(Long.parseLong(abilityApplicationDTO.getUserId())).getDeptId()).toString());
SysDeptDTO deptDTO = sysDeptService.get(deptId);
logger.error("deptDTOId:" + deptDTO.getId());
SysRoleDTO roleDTO = sysRoleService.getByName(roleName);
logger.error("roleDTOId:" + roleDTO.getId());
SysUserDTO userDTO = sysUserService.getByDeptIdAndRoleId(deptDTO.getId(), roleDTO.getId());
if (userDTO != null) {
logger.error("审批人id:" + userDTO.getId());
taskService.setAssignee(delegateTask.getId(), userDTO.getId().toString());
assignee = userDTO.getId().toString();
} else {
logger.error("未查到 {} 对应 " + roleName, deptDTO.getName());
taskService.setAssignee(delegateTask.getId(), defaultAssigneeRoleId);
assignee = defaultAssigneeRoleId;
}
logger.error("分配的用户id为:{}", assignee);
}
}

View File

@ -0,0 +1,127 @@
package io.renren.modules.processForm.listener.v3;
import com.google.common.collect.ImmutableMap;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import io.renren.common.annotation.ActivitiNoticeOperation;
import io.renren.modules.processForm.dto.TAbilityApplicationDTO;
import io.renren.modules.sys.dao.SysUserDao;
import io.renren.modules.sys.dto.SysDeptDTO;
import io.renren.modules.sys.dto.SysRoleDTO;
import io.renren.modules.sys.entity.SysRegionEntity;
import io.renren.modules.sys.entity.SysUserEntity;
import io.renren.modules.sys.enums.RegionLevelEnum;
import io.renren.modules.sys.service.SysDeptService;
import io.renren.modules.sys.service.SysRegionService;
import io.renren.modules.sys.service.SysRoleService;
import io.renren.modules.sys.service.SysUserService;
import org.activiti.engine.TaskService;
import org.activiti.engine.delegate.*;
import org.activiti.engine.delegate.event.ActivitiEvent;
import org.activiti.engine.delegate.event.ActivitiEventListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.util.*;
/**
* 申请发起人区市管理员审批
*/
@Component
public class ApplyDistrictListener implements TaskListener, ExecutionListener, ActivitiEventListener, JavaDelegate {
private static final Logger logger = LoggerFactory.getLogger(ApplyDistrictListener.class);
@Autowired
private TaskService taskService;
@Autowired
private SysDeptService sysDeptService;
@Autowired
private SysUserService sysUserService;
@Autowired
private SysUserDao sysUserDao;
@Autowired
private SysRoleService sysRoleService;
@Autowired
private SysRegionService sysRegionService;
@Value("${big_date.assignee_district_role_name}")
private String roleName; // 具备审批的角色名称
@Value("${big_date.default_assignee_role_id}")
private String defaultAssigneeRoleId; // 当未查到审批人时将使用该用户审批
@Override
@ActivitiNoticeOperation(value = "申请发起人区市管理员审批", process = "能力申请流程")
public void notify(DelegateTask delegateTask) {
logger.error("事件类型:" + delegateTask.getEventName());
final String eventName = delegateTask.getEventName();
switch (eventName) {
case EVENTNAME_CREATE:
create(delegateTask);
break;
case EVENTNAME_COMPLETE:
logger.error("----------------------申请发起人区市管理员审批通过-complete------------------------------");
break;
default:
logger.error("未处理该事件:" + eventName);
}
}
private void create(DelegateTask delegateTask) {
String assignee;
Map<String, Object> kv = delegateTask.getVariables();
GsonBuilder builder = new GsonBuilder();
builder.registerTypeAdapter(Date.class, (JsonDeserializer<Date>) (json, typeOfT, context) -> new Date(json.getAsJsonPrimitive().getAsLong()));
Gson gson = builder.create();
JsonElement jsonElement = gson.toJsonTree(kv);
TAbilityApplicationDTO abilityApplicationDTO = gson.fromJson(jsonElement, TAbilityApplicationDTO.class);
SysDeptDTO deptDTO = sysDeptService.get(sysUserService.get(Long.parseLong(abilityApplicationDTO.getUserId())).getDeptId());
SysRegionEntity regionEntity = sysRegionService.getByLevel(deptDTO.getDistrict(), RegionLevelEnum.THREE);
logger.error("regionEntityId:" + regionEntity.getId());
SysRoleDTO roleDTO = sysRoleService.getByName(roleName);
logger.error("roleDTOId:" + roleDTO.getId());
List<SysUserEntity> userList = sysUserDao.getList(ImmutableMap.of("role_id", roleDTO.getId()));
Optional<SysUserEntity> userEntityOptional = userList.stream()
.filter(user -> Objects.equals(regionEntity.getId(), sysRegionService.getByLevel(sysDeptService.get(user.getDeptId()).getDistrict(), RegionLevelEnum.THREE).getId())).findFirst();
if (userEntityOptional.isPresent()) {
logger.error("审批人id:" + userEntityOptional.get().getId());
taskService.setAssignee(delegateTask.getId(), userEntityOptional.get().getId().toString());
assignee = userEntityOptional.get().getId().toString();
} else {
logger.error("未查到 {} 对应 " + roleName, deptDTO.getName());
taskService.setAssignee(delegateTask.getId(), defaultAssigneeRoleId);
assignee = defaultAssigneeRoleId;
}
logger.error("分配的用户id为:{}", assignee);
}
@Override
public void notify(DelegateExecution delegateExecution) throws Exception {
}
@Override
public void execute(DelegateExecution delegateExecution) throws Exception {
}
@Override
public void onEvent(ActivitiEvent activitiEvent) {
}
@Override
public boolean isFailOnException() {
return false;
}
}

View File

@ -0,0 +1,127 @@
package io.renren.modules.processForm.listener.v3;
import com.google.common.collect.ImmutableMap;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import io.renren.common.annotation.ActivitiNoticeOperation;
import io.renren.modules.processForm.dto.TAbilityApplicationDTO;
import io.renren.modules.sys.dao.SysUserDao;
import io.renren.modules.sys.dto.SysDeptDTO;
import io.renren.modules.sys.dto.SysRoleDTO;
import io.renren.modules.sys.entity.SysRegionEntity;
import io.renren.modules.sys.entity.SysUserEntity;
import io.renren.modules.sys.enums.RegionLevelEnum;
import io.renren.modules.sys.service.SysDeptService;
import io.renren.modules.sys.service.SysRegionService;
import io.renren.modules.sys.service.SysRoleService;
import io.renren.modules.sys.service.SysUserService;
import org.activiti.engine.TaskService;
import org.activiti.engine.delegate.*;
import org.activiti.engine.delegate.event.ActivitiEvent;
import org.activiti.engine.delegate.event.ActivitiEventListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.util.*;
/**
* 市级区市管理员审批
*/
@Component
public class CityListener implements TaskListener, ExecutionListener, ActivitiEventListener, JavaDelegate {
private static final Logger logger = LoggerFactory.getLogger(ApplyDistrictListener.class);
@Autowired
private TaskService taskService;
@Autowired
private SysDeptService sysDeptService;
@Autowired
private SysUserService sysUserService;
@Autowired
private SysUserDao sysUserDao;
@Autowired
private SysRoleService sysRoleService;
@Autowired
private SysRegionService sysRegionService;
@Value("${big_date.assignee_city_role_name}")
private String roleName; // 具备审批的角色名称
@Value("${big_date.default_assignee_role_id}")
private String defaultAssigneeRoleId; // 当未查到审批人时将使用该用户审批
@Override
@ActivitiNoticeOperation(value = "市级区市管理员审批", process = "能力申请流程")
public void notify(DelegateTask delegateTask) {
logger.error("事件类型:" + delegateTask.getEventName());
final String eventName = delegateTask.getEventName();
switch (eventName) {
case EVENTNAME_CREATE:
create(delegateTask);
break;
case EVENTNAME_COMPLETE:
logger.error("----------------------市级区市管理员审批通过-complete------------------------------");
break;
default:
logger.error("未处理该事件:" + eventName);
}
}
private void create(DelegateTask delegateTask) {
String assignee;
Map<String, Object> kv = delegateTask.getVariables();
GsonBuilder builder = new GsonBuilder();
builder.registerTypeAdapter(Date.class, (JsonDeserializer<Date>) (json, typeOfT, context) -> new Date(json.getAsJsonPrimitive().getAsLong()));
Gson gson = builder.create();
JsonElement jsonElement = gson.toJsonTree(kv);
TAbilityApplicationDTO abilityApplicationDTO = gson.fromJson(jsonElement, TAbilityApplicationDTO.class);
SysDeptDTO deptDTO = sysDeptService.get(sysUserService.get(Long.parseLong(abilityApplicationDTO.getUserId())).getDeptId());
SysRegionEntity regionEntity = sysRegionService.getByLevel(deptDTO.getDistrict(), RegionLevelEnum.TWO);
logger.error("regionEntityId:" + regionEntity.getId());
SysRoleDTO roleDTO = sysRoleService.getByName(roleName);
logger.error("roleDTOId:" + roleDTO.getId());
List<SysUserEntity> userList = sysUserDao.getList(ImmutableMap.of("role_id", roleDTO.getId()));
Optional<SysUserEntity> userEntityOptional = userList.stream()
.filter(user -> Objects.equals(regionEntity.getId(), sysRegionService.getByLevel(sysDeptService.get(user.getDeptId()).getDistrict(), RegionLevelEnum.TWO).getId())).findFirst();
if (userEntityOptional.isPresent()) {
logger.error("审批人id:" + userEntityOptional.get().getId());
taskService.setAssignee(delegateTask.getId(), userEntityOptional.get().getId().toString());
assignee = userEntityOptional.get().getId().toString();
} else {
logger.error("未查到 {} 对应 " + roleName, deptDTO.getName());
taskService.setAssignee(delegateTask.getId(), defaultAssigneeRoleId);
assignee = defaultAssigneeRoleId;
}
logger.error("分配的用户id为:{}", assignee);
}
@Override
public void notify(DelegateExecution delegateExecution) throws Exception {
}
@Override
public void execute(DelegateExecution delegateExecution) throws Exception {
}
@Override
public void onEvent(ActivitiEvent activitiEvent) {
}
@Override
public boolean isFailOnException() {
return false;
}
}

View File

@ -0,0 +1,341 @@
package io.renren.modules.processForm.listener.v3;
import com.alibaba.fastjson.JSON;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import io.renren.common.annotation.ActivitiNoticeOperation;
import io.renren.common.dto.AuditingBaseDTO;
import io.renren.modules.activiti.service.ActTaskService;
import io.renren.modules.processForm.dto.TAbilityApplicationDTO;
import io.renren.modules.processForm.service.ApiGatewayService;
import io.renren.modules.processForm.service.TAbilityApplicationService;
import io.renren.modules.resource.dto.ResourceDTO;
import io.renren.modules.resource.entity.ResourceEntity;
import io.renren.modules.resource.service.ResourceService;
import io.renren.modules.sys.dto.SysDeptDTO;
import io.renren.modules.sys.dto.SysRoleDTO;
import io.renren.modules.sys.dto.SysUserDTO;
import io.renren.modules.sys.service.SysDeptService;
import io.renren.modules.sys.service.SysRoleService;
import io.renren.modules.sys.service.SysRoleUserService;
import io.renren.modules.sys.service.SysUserService;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.TaskService;
import org.activiti.engine.delegate.*;
import org.activiti.engine.delegate.event.ActivitiEvent;
import org.activiti.engine.delegate.event.ActivitiEventListener;
import org.activiti.engine.task.Task;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import java.util.*;
import java.util.stream.Collectors;
/**
* 部门动态审批人 v3
*/
@Component
public class CorrectionListenerV3 implements TaskListener, ExecutionListener, ActivitiEventListener, JavaDelegate {
private static Logger logger = LoggerFactory.getLogger(CorrectionListenerV3.class);
@Value("${big_date.name}")
private String bigDateDeptName; // 大数据局名称
@Value("${big_date.default_assignee_role_id}")
private String defaultAssigneeRoleId; // 当某部门未设置部门审批人时将使用该用户审批
@Value("${big_date.assignee_role_name}")
private String roleName; // 具备审批的角色名称
@Autowired
private SysRoleService sysRoleService;
@Autowired
private TaskService taskService;
@Autowired
private SysUserService sysUserService;
@Autowired
private SysRoleUserService sysRoleUserService;
@Autowired
private SysDeptService sysDeptService;
@Autowired
private ApiGatewayService apiGatewayService;
@Autowired
private ResourceService resourceService;
@Autowired
private JdbcTemplate jdbcTemplate;
@Autowired
private TAbilityApplicationService tAbilityApplicationService;
@Override
@ActivitiNoticeOperation(value = "流程结束", process = "能力申请流程v2", type = 2)
public void notify(DelegateExecution delegateExecution) throws Exception {
logger.error("----------------------进入部门审批结束节点---------------------------");
delegateExecution.getProcessBusinessKey();
final String eventName = delegateExecution.getEventName();
if (EVENTNAME_END.equals(eventName)) {
endTake(delegateExecution);
}
}
@Override
public void execute(DelegateExecution execution) throws Exception {
}
@Override
@ActivitiNoticeOperation(value = "资源部门负责人审批", process = "能力申请流程")
public void notify(DelegateTask delegateTask) {
logger.error("-------------------------进入部门动态审批人流程-------------------------------");
final String eventName = delegateTask.getEventName();
switch (eventName) {
case EVENTNAME_CREATE:
create(delegateTask);
break;
case EVENTNAME_COMPLETE:
complete(delegateTask);
break;
default:
}
logger.error("-------------------------结束部门动态审批人流程-------------------------------");
}
/**
* Called when an event has been fired
*
* @param event the event
*/
@Override
public void onEvent(ActivitiEvent event) {
}
/**
* @return whether or not the current operation should fail when this listeners execution
* throws an exception.
*/
@Override
public boolean isFailOnException() {
return false;
}
/**
* 结束审批
*
* @param delegateExecution
*/
private void endTake(DelegateExecution delegateExecution) { // 进入最后结束节点
Map<String, Object> kv = delegateExecution.getVariables();
GsonBuilder builder = new GsonBuilder();
builder.registerTypeAdapter(Date.class, (JsonDeserializer<Date>) (json, typeOfT, context) -> new Date(json.getAsJsonPrimitive().getAsLong()));
Gson gson = builder.create();
JsonElement jsonElement = gson.toJsonTree(kv);
AuditingBaseDTO auditingBaseDTO = gson.fromJson(jsonElement, AuditingBaseDTO.class);
if (auditingBaseDTO != null) {
List<TAbilityApplicationDTO> dtoList = new ArrayList<>();
if (kv.containsKey("tAbilityApplicationDTOList")) {
dtoList = (List<TAbilityApplicationDTO>) kv.get("tAbilityApplicationDTOList");
}
String[] sqls;
if (auditingBaseDTO.getReject() != null && auditingBaseDTO.getReject() == Boolean.TRUE) { // 存在被拒绝的节点
sqls = dtoList.stream().map(i -> String.format("UPDATE t_ability_application SET del_flag = 0,approve_status = '不通过' WHERE id = %s", i.getId()))
.collect(Collectors.toList()).toArray(new String[dtoList.size()]);
} else {
sqls = dtoList.stream().map(i -> String.format("UPDATE t_ability_application SET del_flag = 0,approve_status = '通过' WHERE id = %s", i.getId()))
.collect(Collectors.toList()).toArray(new String[dtoList.size()]);
}
jdbcTemplate.batchUpdate(sqls);
if (auditingBaseDTO.getReject() == null || auditingBaseDTO.getReject() != Boolean.TRUE) { // 都是同意
try {
batchApplyCode(delegateExecution, dtoList);
} catch (Exception exception) {
logger.error("上架网关失败", exception);
}
}
}
}
/**
* 节点创建时动态分配资源部门审核人
*
* @param delegateTask
*/
private void create(DelegateTask delegateTask) {
String assignee;
Map<String, Object> kv = delegateTask.getVariables();
SysRoleDTO roleDTO = sysRoleService.getByName(roleName);
logger.error("roleDTOId:{}", roleDTO.getId());
Long deptId;
if (kv.containsKey("deptId")) { // 存在部门id
deptId = Long.valueOf(kv.get("deptId").toString());
SysDeptDTO deptDTO = sysDeptService.get(deptId);
SysUserDTO userDTO = null;
if (deptId != null) {
userDTO = sysUserService.getByDeptIdAndRoleId(deptId, roleDTO.getId()); // 搜出审批人
}
if (userDTO != null) {
logger.error("审批人id:{}", userDTO.getId());
taskService.setAssignee(delegateTask.getId(), userDTO.getId().toString());
assignee = userDTO.getId().toString();
} else {
logger.error("未查到该部门 {} 对应的 {}", deptId, roleName);
taskService.setAssignee(delegateTask.getId(), defaultAssigneeRoleId);
assignee = defaultAssigneeRoleId;
}
if (kv.containsKey("tAbilityApplicationDTOList")) {
List<TAbilityApplicationDTO> dtoList = (List<TAbilityApplicationDTO>) kv.get("tAbilityApplicationDTOList");
mpComplete(dtoList, delegateTask, assignee);
}
} else {
try {
logger.error("流程参数异常" + JSON.toJSONString(kv));
} catch (Exception exception) {
logger.error("流程参数异常", exception);
}
}
}
private void mpComplete(List<TAbilityApplicationDTO> abilityApplicationDTO, DelegateTask delegateTask, final String assignee) { // 处理免批或申请人为资源提供方部门审批人
Optional<TAbilityApplicationDTO> abilityApplicationDTOOptional = abilityApplicationDTO.stream().findAny();
abilityApplicationDTOOptional.ifPresent(index -> {
if (abilityApplicationDTOOptional.get().getUserId().equals(delegateTask.getAssignee())) {
taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), "申请人为资源提供方部门审批人,默认通过");
taskService.complete(delegateTask.getId(), delegateTask.getVariables());
return;
}
});
if (StringUtils.isNotEmpty(assignee)
&& StringUtils.isNotEmpty(delegateTask.getVariable("creator", String.class))
&& delegateTask.getVariable("creator", String.class).equals(assignee)) {
taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), "审批人为发起人,默认通过");
taskService.setVariable(delegateTask.getId(), ActTaskService.Task_HANDLE_STATE, ActTaskService.Task_HANDLE_STATE_AGREE);
taskService.setVariable(delegateTask.getId(), "backToFirst", Boolean.FALSE);
taskService.complete(delegateTask.getId(), delegateTask.getVariables());
return;
}
List<TAbilityApplicationDTO> dtoList = delegateTask.getVariable("tAbilityApplicationDTOList", List.class);
Optional<TAbilityApplicationDTO> tAbilityApplicationDTO = dtoList.stream().filter(index -> {
Optional<ResourceDTO> resourceDTOOptional = Optional.ofNullable(resourceService.get(Long.valueOf(index.getResourceId())));
if (resourceDTOOptional.isPresent()) {
return !StringUtils.contains(resourceDTOOptional.get().getShareCondition(), "免批"); // 存在非免批
} else {
return false;
}
}).findAny();
if (!tAbilityApplicationDTO.isPresent()) { // 全是免批
taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), "免批资源申请默认通过");
taskService.complete(delegateTask.getId(), delegateTask.getVariables());
return;
}
}
private void complete(DelegateTask delegateTask) {
Map<String, Object> kv = delegateTask.getVariables();
//如果有code说明已经注册过了,以及只有通过的流程申请
// if (kv.get("gatewayCode") != null ||
// !ActTaskService.Task_HANDLE_STATE_AGREE.equals(kv.get(ActTaskService.Task_HANDLE_STATE))) return;
// try {
// List<TAbilityApplicationDTO> dtoList = new ArrayList<>();
// if (kv.containsKey("tAbilityApplicationDTOList")) {
// dtoList = (List<TAbilityApplicationDTO>) kv.get("tAbilityApplicationDTOList");
// }
// dtoList.stream().forEach(index -> {
// applyCode(delegateTask, index); // 列表内都执行
// });
// } catch (Exception e) {
// logger.error(e.getLocalizedMessage(), e);
// }
}
/**
* 审批通过申请code
*
* @param delegateTask
* @param abilityApplicationDTO
*/
private void applyCode(DelegateTask delegateTask, TAbilityApplicationDTO abilityApplicationDTO) {
logger.info("-------能力申请code-------");
ResourceEntity resourceEntity = resourceService.selectById(abilityApplicationDTO.getResourceId());
//没有groupid当做没有接口直接跳过
if (resourceEntity.getGroupId() == null)
return;
String code = UUID.randomUUID().toString();
apiGatewayService.subscribeCode(String.valueOf(abilityApplicationDTO.getId()), code);
delegateTask.setVariable("gatewayCode", code);
String apiPrefix = "/juapi/" + abilityApplicationDTO.getResourceId();
TaskService taskService = ProcessEngines.getDefaultProcessEngine().getTaskService();
String msg = String.format("您的能力申请已通过接口认证code为%s, 接口公共前缀为:%s", code, apiPrefix);
taskService.addComment(delegateTask.getId(), delegateTask.getProcessInstanceId(), msg);
}
private void batchApplyCode(DelegateExecution delegateExecution, List<TAbilityApplicationDTO> dtoList) {
logger.info("-------能力申请code-------");
StringBuilder allMsg = new StringBuilder();
allMsg.append("您的能力申请已通过,访问令牌如下:");
allMsg.append('\n');
boolean hasData = false;
for (TAbilityApplicationDTO abilityApplicationDTO : dtoList) {
ResourceEntity resourceEntity = resourceService.selectById(abilityApplicationDTO.getResourceId());
if (resourceEntity == null) {
continue;
}
//没有groupid当做没有接口直接跳过
if (resourceEntity == null || resourceEntity.getGroupId() == null)
continue;
hasData = true;
String code = UUID.randomUUID().toString();
apiGatewayService.subscribeCode(String.valueOf(abilityApplicationDTO.getId()), code);
String apiPrefix = "/juapi/" + abilityApplicationDTO.getResourceId();
String msg = String.format("能力名称:%s接口认证code为%s, 接口公共前缀为:%s", resourceEntity.getName(), code, apiPrefix);
allMsg.append(msg);
allMsg.append('\n');
}
//一条也没有跳过
if (!hasData) return;
TaskService taskService = ProcessEngines.getDefaultProcessEngine().getTaskService();
//先用不正经方法找
List<Task> tasks = taskService.createTaskQuery().
processInstanceId(delegateExecution.getProcessInstanceId()).
list();
Task bigDataTask = null;
for (Task task : tasks) {
if ("大数据部门负责人审批".equals(task.getName())) {
bigDataTask = task;
break;
}
}
if (bigDataTask != null) {
taskService.addComment(bigDataTask.getId(), delegateExecution.getProcessInstanceId(), allMsg.toString());
}
}
}

View File

@ -0,0 +1,124 @@
package io.renren.modules.processForm.listener.v3;
import com.google.common.collect.ImmutableMap;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import io.renren.common.annotation.ActivitiNoticeOperation;
import io.renren.modules.processForm.dto.TAbilityApplicationDTO;
import io.renren.modules.sys.dao.SysUserDao;
import io.renren.modules.sys.dto.SysDeptDTO;
import io.renren.modules.sys.dto.SysRoleDTO;
import io.renren.modules.sys.entity.SysRegionEntity;
import io.renren.modules.sys.entity.SysUserEntity;
import io.renren.modules.sys.enums.RegionLevelEnum;
import io.renren.modules.sys.service.SysDeptService;
import io.renren.modules.sys.service.SysRegionService;
import io.renren.modules.sys.service.SysRoleService;
import org.activiti.engine.TaskService;
import org.activiti.engine.delegate.*;
import org.activiti.engine.delegate.event.ActivitiEvent;
import org.activiti.engine.delegate.event.ActivitiEventListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.util.*;
/**
* 资源所属区市管理员审批
*/
@Component
public class OwnerDistrictListener implements TaskListener, ExecutionListener, ActivitiEventListener, JavaDelegate {
private static final Logger logger = LoggerFactory.getLogger(ApplyDistrictListener.class);
@Autowired
private TaskService taskService;
@Autowired
private SysUserDao sysUserDao;
@Autowired
private SysRoleService sysRoleService;
@Autowired
private SysRegionService sysRegionService;
@Autowired
private SysDeptService sysDeptService;
@Value("${big_date.assignee_district_role_name}")
private String roleName; // 具备审批的角色名称
@Value("${big_date.default_assignee_role_id}")
private String defaultAssigneeRoleId; // 当未查到审批人时将使用该用户审批
@Override
@ActivitiNoticeOperation(value = "资源所属区市管理员审批", process = "能力申请流程")
public void notify(DelegateTask delegateTask) {
logger.error("事件类型:" + delegateTask.getEventName());
final String eventName = delegateTask.getEventName();
switch (eventName) {
case EVENTNAME_CREATE:
create(delegateTask);
break;
case EVENTNAME_COMPLETE:
logger.error("----------------------资源所属区市管理员审批通过-complete------------------------------");
break;
default:
logger.error("未处理该事件:" + eventName);
}
}
private void create(DelegateTask delegateTask) {
String assignee;
Map<String, Object> kv = delegateTask.getVariables();
GsonBuilder builder = new GsonBuilder();
builder.registerTypeAdapter(Date.class, (JsonDeserializer<Date>) (json, typeOfT, context) -> new Date(json.getAsJsonPrimitive().getAsLong()));
Gson gson = builder.create();
JsonElement jsonElement = gson.toJsonTree(kv);
TAbilityApplicationDTO abilityApplicationDTO = gson.fromJson(jsonElement, TAbilityApplicationDTO.class);
SysDeptDTO deptDTO = abilityApplicationDTO.getResourceOwnerDept();
SysRegionEntity regionEntity = sysRegionService.getByLevel(deptDTO.getDistrict(), RegionLevelEnum.THREE);
logger.error("regionEntityId:" + regionEntity.getId());
SysRoleDTO roleDTO = sysRoleService.getByName(roleName);
logger.error("roleDTOId:" + roleDTO.getId());
List<SysUserEntity> userList = sysUserDao.getList(ImmutableMap.of("role_id", roleDTO.getId()));
Optional<SysUserEntity> userEntityOptional = userList.stream()
.filter(user -> Objects.equals(regionEntity.getId(), sysRegionService.getByLevel(sysDeptService.get(user.getDeptId()).getDistrict(), RegionLevelEnum.THREE).getId())).findFirst();
if (userEntityOptional.isPresent()) {
logger.error("审批人id:" + userEntityOptional.get().getId());
taskService.setAssignee(delegateTask.getId(), userEntityOptional.get().getId().toString());
assignee = userEntityOptional.get().getId().toString();
} else {
logger.error("未查到 {} 对应 " + roleName, deptDTO.getName());
taskService.setAssignee(delegateTask.getId(), defaultAssigneeRoleId);
assignee = defaultAssigneeRoleId;
}
logger.error("分配的用户id为:{}", assignee);
}
@Override
public void notify(DelegateExecution delegateExecution) throws Exception {
}
@Override
public void execute(DelegateExecution delegateExecution) throws Exception {
}
@Override
public void onEvent(ActivitiEvent activitiEvent) {
}
@Override
public boolean isFailOnException() {
return false;
}
}

View File

@ -0,0 +1,64 @@
package io.renren.modules.resource.controller;
import io.renren.common.annotation.LogOperation;
import io.renren.common.utils.Result;
import io.renren.modules.resource.service.CIMService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
* 资源表
*
* @author dg
* @since 1.0 2022-04-13
*/
@RestController
@RequestMapping("/resource")
@Api(tags = "资源表")
public class CIMController {
private static final Logger logger = LoggerFactory.getLogger(CIMController.class);
@Autowired
private CIMService cimService;
@GetMapping("/countByType")
@ApiOperation("统计cim各类型资源数量")
@LogOperation(value = "统计cim各类型资源数量")
public Result<List<Map>> countByType() {
return new Result<List<Map>>().ok(cimService.countByType());
}
@GetMapping("/getCIMApplyApplicationList")
@ApiOperation("查询CIM平台列表")
@LogOperation(value = "查询CIM平台列表")
public Result<List<Map>> getCIMApplyApplicationList() {
return new Result<List<Map>>().ok(cimService.getCIMApplyApplicationList());
}
@GetMapping("/cimImgResources")
@ApiOperation("CIM平台根据应用领域查询图层服务")
@LogOperation(value = "CIM平台根据应用领域查询图层服务")
public Result<List<Map>> cimImgResources(@RequestParam String type){
return new Result<List<Map>>().ok(cimService.getImgServices(type));
}
@GetMapping("/cimAssemblyResources")
@ApiOperation("CIM平台查询智能算法组件")
@LogOperation(value = "CIM平台查询智能算法组件")
public Result<List<Map>> cimAssemblyResources(){
return new Result<List<Map>>().ok(cimService.cimAssemblyResources());
}
}

View File

@ -163,6 +163,16 @@ public class ResourceController {
return new Result<>().ok(id);
}
@PutMapping("/cancel_pin_top/{id}")
@LogOperation(value = "取消置顶该能力资源")
public Result cancelPinTop(@PathVariable("id") Long id) {
ResourceDTO data = resourceService.get(id);
data.setPinTop(0);
data.setPinTopTime(new Date());
resourceService.update(data);
return new Result<>().ok(id);
}
@GetMapping("/{id}")
@ApiOperation("查询能力资源详细信息")
@LogOperation("查询能力资源详细信息")

View File

@ -176,4 +176,13 @@ public interface ResourceDao extends BaseDao<ResourceEntity> {
String selectPicByResId(@Param("id") String id);
List<Map> selectTypeCountByName(@Param("keyWorld") String keyWorld);
List<Map> countByCIMType(@Param("deptId") Long deptId);
List<Map> getCIMApplyApplicationList(@Param("deptId") Long deptId);
List<Map> getImgServices(@Param("deptid") Long deptid,@Param("type") String type);
List<Map> cimAssemblyResources(@Param("deptid") Long deptid);
}

View File

@ -103,12 +103,19 @@ public class ResourceDTO extends AuditingBaseDTO implements Serializable {
@ApiModelProperty(value = "附件")
private String enclosure;
@ApiModelProperty(value = "下架理由")
private String undercarriageReason;
@ApiModelProperty(value = "提起下架人员姓名")
private String undercarriageUserName;
@ApiModelProperty(value = "下架附件")
private String undercarriageEnclosure;
@ApiModelProperty(value = "下架附件名称")
private String undercarriageEnclosureName;
@ApiModelProperty(value = "下架申请标题")
private String undercarriageTitle;
@ApiModelProperty(value = "下架申请电话")
private String undercarriageUserPhone;
@ApiModelProperty(value = "总体评价")
private Integer total;

View File

@ -140,6 +140,21 @@ public class ResourceEntity extends BaseEntity {
*/
private String undercarriageEnclosure;
/**
* 下架附件名称
*/
private String undercarriageEnclosureName;
/**
* 下架申请标题
*/
private String undercarriageTitle;
/**
* 下架申请电话
*/
@TableField(value = "undercarriage_phone")
private String undercarriageUserPhone;
/**
* 置顶标识

View File

@ -0,0 +1,15 @@
package io.renren.modules.resource.service;
import java.util.List;
import java.util.Map;
public interface CIMService {
List<Map> countByType();
List<Map> getCIMApplyApplicationList();
List<Map> getImgServices(String type);
List<Map> cimAssemblyResources();
}

View File

@ -0,0 +1,96 @@
package io.renren.modules.resource.service.impl;
import cn.hutool.core.util.ObjectUtil;
import io.renren.modules.resource.dao.ResourceDao;
import io.renren.modules.resource.service.CIMService;
import io.renren.modules.sys.dao.SysDeptDao;
import io.renren.modules.sys.entity.SysDeptEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.*;
@Service
public class CIMServiceImpl implements CIMService {
@Autowired
private ResourceDao resourceDao;
@Autowired
private SysDeptDao sysDeptDao;
private static final String[] cimtype = {"平台","组件","图层"};
/**
* 住建局名称
*/
@Value("${cim.zjj}")
private String zjjName;
@Override
public List<Map> countByType() {
SysDeptEntity sysDeptEntity = sysDeptDao.getByName(zjjName);
if (ObjectUtil.isEmpty(sysDeptEntity)) {
ArrayList<Map> re = new ArrayList<>();
Arrays.stream(cimtype).forEach(index -> {
Map<String, Object> nullMap = new HashMap<String, Object>() {
{
put("count", 0);
put("type", index);
}
};
re.add(nullMap);
});
return re;
}
List<Map> re = resourceDao.countByCIMType(sysDeptEntity.getId());
List<String> temp = new ArrayList<>();
re.forEach(map -> temp.add(map.get("type").toString()));
Arrays.stream(cimtype).filter(index -> !temp.contains(index)).forEach(index -> {
Map<String, Object> nullMap = new HashMap<String, Object>() {
{
put("count", 0);
put("type", index);
}
};
re.add(nullMap);
});
return re;
}
@Override
public List<Map> getCIMApplyApplicationList() {
SysDeptEntity sysDeptEntity = sysDeptDao.getByName(zjjName);
if (ObjectUtil.isEmpty(sysDeptEntity)) {
return new ArrayList<>();
}
return resourceDao.getCIMApplyApplicationList(sysDeptEntity.getId());
}
@Override
public List<Map> getImgServices(String type) {
SysDeptEntity sysDeptEntity = sysDeptDao.getByName(zjjName);
if (ObjectUtil.isEmpty(sysDeptEntity)) {
return new ArrayList<>();
}
List<Map> imgServices = new ArrayList<>();
imgServices = resourceDao.getImgServices(sysDeptEntity.getId(),type);
return imgServices;
}
@Override
public List<Map> cimAssemblyResources() {
SysDeptEntity sysDeptEntity = sysDeptDao.getByName(zjjName);
if (ObjectUtil.isEmpty(sysDeptEntity)) {
return new ArrayList<>();
}
List<Map> result = new ArrayList<>();
result = resourceDao.cimAssemblyResources(sysDeptEntity.getId());
return result;
}
}

View File

@ -307,13 +307,13 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
resourceDao.insert(resourceEntity);
BeanUtils.copyProperties(resourceEntity, dto);
List<AttrEntity> attrEntities = dto.getInfoList();
List<AttrEntity> attrEntities_ = new ArrayList<>();
List<AttrEntity> attrEntityList = new ArrayList<>();
if (attrEntities != null) {
attrEntities.forEach(item -> {
item.setDelFlag(ResourceEntityDelFlag.NORMAL.getFlag());
item.setDataResourceId(resourceID);
attrDao.insert(item);
attrEntities_.add(item);
attrEntityList.add(item);
});
}
for (AttrEntity attrEntity : resourceEntity.getInfoList()) {
@ -321,7 +321,6 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
if (StringUtils.isNotBlank(attrEntity.getAttrValue())) {
String[] ids = attrEntity.getAttrValue().split(",");
if (ids.length != 0) {
for (String keyid : ids) {
TbDataResourceRelEntity resourceRel = new TbDataResourceRelEntity();
resourceRel.setKeyId(Long.valueOf(keyid));
@ -332,7 +331,7 @@ public class ResourceServiceImpl extends CrudServiceImpl<ResourceDao, ResourceEn
}
}
}
resourceEntity.setInfoList(attrEntities_);
resourceEntity.setInfoList(attrEntityList);
resourceDao.updateById(resourceEntity);
}

View File

@ -3,6 +3,7 @@ package io.renren.modules.resourceCar.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.renren.common.constant.Constant;
import io.renren.common.service.impl.CrudServiceImpl;
import io.renren.modules.resource.service.ResourceService;
import io.renren.modules.resourceCar.dao.ResourceCarDao;
@ -19,6 +20,7 @@ import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* 申购记录表
@ -58,8 +60,7 @@ public class ResourceCarServiceImpl extends CrudServiceImpl<ResourceCarDao, Reso
selectMap.put("user_id", userId);
selectMap.put("del_flag", 0);
List<ResourceCarEntity> carEntities = resourceCarDao.selectByMap(selectMap);
//TODO: 固定资源id改为配置文件
if (carEntities.isEmpty() || dto.getResourceId() == 8888888880000000001L) {
if (carEntities.isEmpty() || Objects.equals(dto.getResourceId(), Constant.CEMERALISTID)) {
ResourceCarEntity carEntity = new ResourceCarEntity();
dto.setUserId(userId);
BeanUtils.copyProperties(dto, carEntity);

View File

@ -26,4 +26,8 @@ public class TResourceUndercarriageApplyDTO extends AuditingBaseDTO implements S
private String reason;
@ApiModelProperty(value = "下架附件")
private String enclosure;
@ApiModelProperty(value = "下架附件名称")
private String enclosureName;
@ApiModelProperty(value = "下架标题")
private String title;
}

View File

@ -24,101 +24,106 @@ import java.util.Date;
public class SysDeptDTO extends TreeNode implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id")
@Null(message="{id.null}", groups = AddGroup.class)
@NotNull(message="{id.require}", groups = UpdateGroup.class)
private Long id;
@ApiModelProperty(value = "id")
@Null(message = "{id.null}", groups = AddGroup.class)
@NotNull(message = "{id.require}", groups = UpdateGroup.class)
private Long id;
@ApiModelProperty(value = "上级ID")
@NotNull(message="{sysdept.pid.require}", groups = DefaultGroup.class)
private Long pid;
@ApiModelProperty(value = "上级ID")
@NotNull(message = "{sysdept.pid.require}", groups = DefaultGroup.class)
private Long pid;
@ApiModelProperty(value = "部门名称")
@NotBlank(message="{sysdept.name.require}", groups = DefaultGroup.class)
private String name;
@ApiModelProperty(value = "部门名称")
@NotBlank(message = "{sysdept.name.require}", groups = DefaultGroup.class)
private String name;
@ApiModelProperty(value = "类型1省级部门2市级部门3区级部门4企业")
private Integer type;
@ApiModelProperty(value = "类型1省级部门2市级部门3区级部门4企业")
private Integer type;
@ApiModelProperty(value = "地区")
private Long district;
@ApiModelProperty(value = "地区")
private Long district;
@ApiModelProperty(value = "排序")
@Min(value = 0, message = "{sort.number}", groups = DefaultGroup.class)
private Integer sort;
@ApiModelProperty(value = "排序")
@Min(value = 0, message = "{sort.number}", groups = DefaultGroup.class)
private Integer sort;
@ApiModelProperty(value = "创建时间")
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private Date createDate;
@ApiModelProperty(value = "创建时间")
@JsonProperty(access = JsonProperty.Access.READ_ONLY)
private Date createDate;
@ApiModelProperty(value = "上级部门名称")
private String parentName;
@ApiModelProperty(value = "上级部门名称")
private String parentName;
@Override
public Long getId() {
return id;
}
@Override
public Long getId() {
return id;
}
@Override
public void setId(Long id) {
this.id = id;
}
@Override
public void setId(Long id) {
this.id = id;
}
@Override
public Long getPid() {
return pid;
}
@Override
public Long getPid() {
return pid;
}
@Override
public void setPid(Long pid) {
this.pid = pid;
}
@Override
public void setPid(Long pid) {
this.pid = pid;
}
public String getName() {
return name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public void setName(String name) {
this.name = name;
}
public Integer getType() {
return type;
}
/**
* 类型1省级部门2市级部门3区级部门4企业
*
* @return
*/
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public void setType(Integer type) {
this.type = type;
}
public Long getDistrict() {
return district;
}
public Long getDistrict() {
return district;
}
public void setDistrict(Long district) {
this.district = district;
}
public void setDistrict(Long district) {
this.district = district;
}
public Integer getSort() {
return sort;
}
public Integer getSort() {
return sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public void setSort(Integer sort) {
this.sort = sort;
}
public Date getCreateDate() {
return createDate;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
public String getParentName() {
return parentName;
}
public String getParentName() {
return parentName;
}
public void setParentName(String parentName) {
this.parentName = parentName;
}
public void setParentName(String parentName) {
this.parentName = parentName;
}
}

View File

@ -4,6 +4,7 @@ import io.renren.common.service.BaseService;
import io.renren.modules.sys.dto.SysRegionDTO;
import io.renren.modules.sys.dto.region.RegionProvince;
import io.renren.modules.sys.entity.SysRegionEntity;
import io.renren.modules.sys.enums.RegionLevelEnum;
import java.util.List;
import java.util.Map;
@ -29,4 +30,9 @@ public interface SysRegionService extends BaseService<SysRegionEntity> {
int getCountByPid(Long pid);
List<RegionProvince> getRegion(boolean threeLevel);
/**
* 根据level获取当前或父级region
*/
SysRegionEntity getByLevel(Long regionId, RegionLevelEnum levelEnum);
}

View File

@ -164,4 +164,12 @@ public class SysRegionServiceImpl extends BaseServiceImpl<SysRegionDao, SysRegio
return provinces;
}
public SysRegionEntity getByLevel(Long regionId, RegionLevelEnum levelEnum) {
SysRegionEntity entity = baseDao.getById(regionId);
if (entity.getTreeLevel() > levelEnum.value()) {
entity = getByLevel(entity.getPid(), levelEnum);
}
return entity;
}
}

View File

@ -70,6 +70,8 @@ resource:
big_date:
name: 青岛市大数据发展管理局
assignee_role_name: 部门审批人
assignee_district_role_name: 区审批人
assignee_city_role_name: 市审批人
# 平台部署级别 (PROVINCE:省 PREFECTURE:地级市 DISTRICT:区县 STREET:街道)
stage: PREFECTURE

View File

@ -3,10 +3,15 @@ project:
place: 0
# 是否将资源归为上级
higher: false
# cim 住建局单位名称
cim:
zjj: 青岛市住房和城乡建设局
# 大数据部门相关配置
big_date:
name: 青岛市大数据发展管理局
assignee_role_name: 部门审批人
assignee_district_role_name: 区审批人
assignee_city_role_name: 市审批人
# 当某部门未设置部门审批人时,将使用该用户审批
default_assignee_role_id: 1516728698224427010
# 需要进行统计数目的资源 type/需要进行统计申请的资源类型 applyType

View File

@ -1,7 +1,7 @@
-- 涉及到的表sys_dict_datasys_dict_type
-- 注意更新时间
/*
Date: 18/07/2022 17:06:10
202281911:53:59
*/
REPLACE INTO `sys_dict_data` VALUES (1160061112075464705, 1160061077912858625, '', '0', '', 0, 1067246875800000001, '2022-02-25 10:37:18', 1067246875800000001, '2022-02-25 10:37:18', 0);
@ -68,6 +68,7 @@ REPLACE INTO `sys_dict_data` VALUES (1513713864000708610, 1513713662657339394, '
REPLACE INTO `sys_dict_data` VALUES (1513714259091562497, 1513714027213660162, '调用接口', '1', '', 1, 1513435534798127105, '2022-04-12 11:02:57', 1524924140178481154, '2022-07-01 14:26:55', NULL);
REPLACE INTO `sys_dict_data` VALUES (1513714288619462658, 1513714027213660162, '平台对接', '2', '', 2, 1513435534798127105, '2022-04-12 11:03:05', 1524924140178481154, '2022-07-01 14:27:15', NULL);
REPLACE INTO `sys_dict_data` VALUES (1513714321163067394, 1513714027213660162, 'SDK', '3', '', 3, 1513435534798127105, '2022-04-12 11:03:12', 1524924140178481154, '2022-07-01 14:27:56', NULL);
REPLACE INTO `sys_dict_data` VALUES (1513714443263451137, 1513714403530809346, '接口', '1', '', 1, 1513435534798127105, '2022-04-12 11:03:41', 1513435534798127105, '2022-04-12 11:03:41', NULL);
REPLACE INTO `sys_dict_data` VALUES (1513714474334855170, 1513714403530809346, 'SDK', '2', '', 2, 1513435534798127105, '2022-04-12 11:03:49', 1513435534798127105, '2022-04-12 11:03:49', NULL);
REPLACE INTO `sys_dict_data` VALUES (1513714504261214210, 1513714403530809346, 'Web页面', '3', '', 3, 1513435534798127105, '2022-04-12 11:03:56', 1513435534798127105, '2022-04-12 11:03:56', NULL);
REPLACE INTO `sys_dict_data` VALUES (1513714541603102722, 1513714403530809346, '其他', '99', '', 99, 1513435534798127105, '2022-04-12 11:04:05', 1513435534798127105, '2022-04-12 11:04:05', NULL);
@ -172,6 +173,16 @@ REPLACE INTO `sys_dict_data` VALUES (1543899506717712386, 1531163741457014785, '
REPLACE INTO `sys_dict_data` VALUES (1545342103516487682, 1531163741457014785, '富文本编辑', 'richText', '', 20, 1513433709613187073, '2022-07-08 17:40:43', 1513433709613187073, '2022-07-08 17:40:43', NULL);
REPLACE INTO `sys_dict_data` VALUES (1545610536514695170, 1531163741457014785, '多条添加', ' multipleAdditions', '', 20, 1513433709613187073, '2022-07-09 11:27:23', 1513433709613187073, '2022-07-09 11:27:23', NULL);
REPLACE INTO `sys_dict_data` VALUES (1547520739196383234, 1531163741457014785, '压缩包', 'package', '', 21, 1524924140178481154, '2022-07-14 17:57:50', 1524924140178481154, '2022-07-14 17:58:03', NULL);
REPLACE INTO `sys_dict_data` VALUES (1560463928171958273, 1560456227954102274, '行政区划', '行政区划', '', 0, 1067246875800000001, '2022-08-19 11:09:27', 1067246875800000001, '2022-08-19 11:09:27', NULL);
REPLACE INTO `sys_dict_data` VALUES (1560463980319739905, 1560456227954102274, '房屋普查', '房屋普查', '', 0, 1067246875800000001, '2022-08-19 11:09:40', 1067246875800000001, '2022-08-19 11:09:40', NULL);
REPLACE INTO `sys_dict_data` VALUES (1560464050129735681, 1560456227954102274, '市政设施', '市政设施', '', 0, 1067246875800000001, '2022-08-19 11:09:56', 1067246875800000001, '2022-08-19 11:09:56', NULL);
REPLACE INTO `sys_dict_data` VALUES (1560464121869111298, 1560456227954102274, '人口数据', '人口数据', '', 0, 1067246875800000001, '2022-08-19 11:10:13', 1067246875800000001, '2022-08-19 11:10:13', NULL);
REPLACE INTO `sys_dict_data` VALUES (1560464163044593666, 1560456227954102274, '地名地址', '地名地址', '', 0, 1067246875800000001, '2022-08-19 11:10:23', 1067246875800000001, '2022-08-19 11:10:23', NULL);
REPLACE INTO `sys_dict_data` VALUES (1560464221148286977, 1560456227954102274, '城市绿区', '城市绿区', '', 0, 1067246875800000001, '2022-08-19 11:10:37', 1067246875800000001, '2022-08-19 11:10:37', NULL);
REPLACE INTO `sys_dict_data` VALUES (1560464295676874754, 1560456227954102274, '海洋河岸', '海洋河岸', '', 0, 1067246875800000001, '2022-08-19 11:10:55', 1067246875800000001, '2022-08-19 11:10:55', NULL);
REPLACE INTO `sys_dict_data` VALUES (1560464354506182658, 1560456227954102274, '规划管控', '规划管控', '', 0, 1067246875800000001, '2022-08-19 11:11:09', 1067246875800000001, '2022-08-19 11:11:09', NULL);
REPLACE INTO `sys_dict_data` VALUES (1560464452883582978, 1560456227954102274, '工程建设', '工程建设', '', 0, 1067246875800000001, '2022-08-19 11:11:32', 1067246875800000001, '2022-08-19 11:11:32', NULL);
REPLACE INTO `sys_dict_data` VALUES (1560464526996934657, 1560456227954102274, '其他', '其他', '', 0, 1067246875800000001, '2022-08-19 11:11:50', 1067246875800000001, '2022-08-19 11:11:50', NULL);
REPLACE INTO `sys_dict_type` VALUES (1160061077912858625, 'gender', '性别', '', 0, 1067246875800000001, '2022-02-25 10:37:18', 1067246875800000001, '2022-02-25 10:37:18', NULL);
REPLACE INTO `sys_dict_type` VALUES (1225813644059140097, 'notice_type', '站内通知-类型', '', 1, 1067246875800000001, '2022-02-25 10:37:18', 1067246875800000001, '2022-02-25 10:37:18', NULL);
REPLACE INTO `sys_dict_type` VALUES (1341593474355838978, 'post_status', '岗位管理状态', '', 0, 1067246875800000001, '2022-02-25 10:37:18', 1067246875800000001, '2022-02-25 10:37:18', NULL);
@ -198,3 +209,4 @@ REPLACE INTO `sys_dict_type` VALUES (1539527547234017282, 'layer_style ', '图
REPLACE INTO `sys_dict_type` VALUES (1539528437391155202, 'Service_type', '服务类型', '', 21, 1515973081575276545, '2022-06-22 16:39:17', 1515973081575276545, '2022-06-22 16:39:17', NULL);
REPLACE INTO `sys_dict_type` VALUES (1541336217898848257, 'videoLabel', '视频标签', '', 31, 1513433270406643713, '2022-06-27 16:22:46', 1513433270406643713, '2022-06-27 16:22:46', NULL);
REPLACE INTO `sys_dict_type` VALUES (1542788081786019842, 'publishingTerminal', '发布端', '', 0, 1524924140178481154, '2022-07-01 16:31:57', 1524924140178481154, '2022-07-01 16:31:57', NULL);
REPLACE INTO `sys_dict_type` VALUES (1560456227954102274, 'layer_class', '图层分类', '', 0, 1067246875800000001, '2022-08-19 10:38:51', 1067246875800000001, '2022-08-19 10:38:51', NULL);

View File

@ -1,7 +1,7 @@
-- 涉及到的表tb_data_category
-- 注意更新时间
/*
20228910:00:46
202282410:27:24
*/
REPLACE INTO `tb_data_category` VALUES (1514138753379680257, '组件服务', NULL, NULL, 'false', NULL, 'false', 'false', '', 10, 0, 1067246875800000001, '2022-04-13 15:09:45', 1513437369940344833, '2022-07-12 16:16:11', NULL, NULL, NULL, NULL, NULL);
@ -70,7 +70,7 @@ REPLACE INTO `tb_data_category` VALUES (1514428953217581058, '共享方式', '
REPLACE INTO `tb_data_category` VALUES (1514428979914326018, '共享条件', '应用资源', '1514418051789471745', 'true', NULL, 'false', 'false', '', 1, 1, 1513437369940344833, '2022-04-14 10:23:00', 1513437369940344833, '2022-05-31 17:39:26', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1514429049392971777, '应用名称', '应用资源', '1514417974589112321', 'true', NULL, 'false', 'false', '', 1, 1, 1513437369940344833, '2022-04-14 10:23:17', 1513437369940344833, '2022-05-31 17:34:26', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1514429081416482818, '应用状态', '应用资源', '1514417974589112321', 'true', 'select', 'false', 'true', '1513711991655014402', 7, 0, 1513437369940344833, '2022-04-14 10:23:24', 1513437369940344833, '2022-04-14 10:23:24', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1514429108071284738, '应用类型', '应用资源', '1514417974589112321', 'true', 'select', 'true', 'true', '1513690812521160705', 2, 0, 1513437369940344833, '2022-04-14 10:23:31', 1513437369940344833, '2022-04-14 10:23:31', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1514429108071284738, '应用类型', '应用资源', '1514417974589112321', 'true', 'select', 'false', 'true', '1513690812521160705', 2, 0, 1513437369940344833, '2022-04-14 10:23:31', 1513437369940344833, '2022-04-14 10:23:31', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1514429134558314497, '应用领域', '应用资源', '1514417974589112321', 'true', 'select', 'true', 'true', '1513712507692818433', 1, 0, 1513437369940344833, '2022-04-14 10:23:37', 1513437369940344833, '2022-04-14 10:23:37', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1514429164702777346, '应用描述', '应用资源', '1514417974589112321', 'true', NULL, 'false', 'false', '', 1, 1, 1513437369940344833, '2022-04-14 10:23:44', 1513437369940344833, '2022-05-31 17:34:30', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1514429196948586498, '部署位置', '应用资源', '1514417974589112321', 'true', 'input', 'false', 'false', '', 3, 0, 1513437369940344833, '2022-04-14 10:23:52', 1513437369940344833, '2022-04-14 10:23:52', NULL, NULL, NULL, NULL, NULL);
@ -485,7 +485,7 @@ REPLACE INTO `tb_data_category` VALUES (1539538615381483522, '切片策略', '
REPLACE INTO `tb_data_category` VALUES (1539538660365393922, '最小级别', '组件服务一', '1539537928253825026', 'true', 'input', 'false', 'false', '', 10, 0, 1515973081575276545, '2022-06-22 17:19:55', 1515973081575276545, '2022-06-22 17:19:55', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1539538689041850370, '最大级别', '组件服务一', '1539537928253825026', 'true', 'input', 'false', 'false', '', 11, 0, 1515973081575276545, '2022-06-22 17:20:01', 1515973081575276545, '2022-06-22 17:20:01', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1539538721136664578, '是否可预览', '组件服务一', '1539537928253825026', 'true', 'radio', 'false', 'true', '1529028127496343554', 13, 0, 1515973081575276545, '2022-06-22 17:20:09', 1515973081575276545, '2022-06-22 17:20:09', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1539538762714800130, '预览服务地址', '组件服务一', '1539537928253825026', 'true', 'input', 'false', 'false', '', 14, 0, 1515973081575276545, '2022-06-22 17:20:19', 1515973081575276545, '2022-06-22 17:20:19', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1539538762714800130, '图层服务地址', '组件服务一', '1539537928253825026', 'true', 'input', 'false', 'false', '', 14, 0, 1515973081575276545, '2022-06-22 17:20:19', 1515973081575276545, '2022-06-22 17:20:19', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1541958011009875969, '数据范围', '组件服务一', '1539537928253825026', 'true', 'input', 'false', 'false', '', 12, 0, 1524924140178481154, '2022-06-29 09:33:33', 1524924140178481154, '2022-06-29 09:33:33', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1541958848058736642, '样式服务地址', '组件服务一', '1539529687759314945', 'true', 'input', 'false', 'false', '', 4, 0, 1524924140178481154, '2022-06-29 09:36:52', 1524924140178481154, '2022-06-29 09:36:52', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1542755260526624769, '能力类型', '组件服务一', '1534718048405012481', 'true', 'AbilityType', 'false', 'false', '', 1, 0, 1524924140178481154, '2022-07-01 14:21:32', 1524924140178481154, '2022-07-01 14:21:32', NULL, NULL, NULL, NULL, NULL);
@ -540,3 +540,4 @@ REPLACE INTO `tb_data_category` VALUES (1548960050394947586, '共享条件', '
REPLACE INTO `tb_data_category` VALUES (1548962537742970881, '部门联系人', '组件服务一', '1534718048405012481', 'true', 'input', 'false', 'false', '', 17, 0, 1513437369940344833, '2022-07-18 17:27:02', 1513437369940344833, '2022-07-18 17:27:02', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1548962613546627073, '部门联系人电话', '组件服务一', '1534718048405012481', 'true', 'input', 'false', 'false', '', 18, 0, 1513437369940344833, '2022-07-18 17:27:20', 1513437369940344833, '2022-07-18 17:27:20', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1548980404643405825, '使用方式', '组件服务', '1531208527270404097', 'true', 'input', 'true', 'true', '1513714027213660162', 8, 1, 1524924140178481154, '2022-07-18 18:38:02', 1524924140178481154, '2022-07-18 18:43:36', NULL, NULL, NULL, NULL, NULL);
REPLACE INTO `tb_data_category` VALUES (1560464775119376386, '分类', '组件服务一', '1539536463208636417', 'true', 'radio', 'false', 'true', '1560456227954102274', 13, 0, 1067246875800000001, '2022-08-19 11:12:49', 1067246875800000001, '2022-08-19 11:12:49', NULL, NULL, NULL, NULL, NULL);

View File

@ -0,0 +1,3 @@
alter table `tb_data_resource`
ADD COLUMN `undercarriage_title` varchar(255) NULL comment '下架申请标题' ,
ADD COLUMN `undercarriage_phone` varchar(255) NULL comment '下架申请电话';

View File

@ -0,0 +1,2 @@
alter table `tb_data_resource`
ADD COLUMN `undercarriage_enclosure_name` varchar(255) NULL comment '下架申请文件名';

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -39,6 +39,9 @@
<result property="applyNumber" column="apply_number"/>
<result property="pinTop" column="pin_top"/>
<result property="pinTopTime" column="pin_top_time"/>
<result property="undercarriageTitle" column="undercarriage_title"/>
<result property="undercarriageUserPhone" column="undercarriage_phone"/>
<result property="undercarriageEnclosureName" column="undercarriage_enclosure_name"/>
</resultMap>
<resultMap id="resourceDTO" type="io.renren.modules.resource.dto.ResourceDTO">
@ -85,6 +88,9 @@
<result property="applyNumber" column="apply_number"/>
<result property="pinTop" column="pin_top"/>
<result property="pinTopTime" column="pin_top_time"/>
<result property="undercarriageTitle" column="undercarriage_title"/>
<result property="undercarriageUserPhone" column="undercarriage_phone"/>
<result property="undercarriageEnclosureName" column="undercarriage_enclosure_name"/>
</resultMap>
<update id="deleteByIds">
@ -139,7 +145,8 @@
AND user_id = #{dto.creator}
GROUP BY id) taa2 ON tdr.id = taa2.resource_id
LEFT JOIN ( SELECT resource_id, COUNT( approve_status ) approve_status FROM t_ability_application WHERE 1 = 1
AND del_flag = 0 AND user_id = #{dto.creator} AND approve_status = '通过' GROUP BY resource_id ) taa3 ON tdr.id =
AND del_flag = 0 AND user_id = #{dto.creator} AND approve_status = '通过' GROUP BY resource_id ) taa3 ON tdr.id
=
taa3.resource_id
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
LEFT JOIN sys_region sr ON sd.district = sr.id
@ -271,7 +278,7 @@
WHERE
1 = 1
AND tdr.del_flag = 0
AND tdr.type != '知识库'
AND tdr.type != '知识库'
AND tdr.type != '赋能案例'
<if test="type != null and type != ''">
AND MATCH (tdr.type) AGAINST ( #{type} IN BOOLEAN MODE)
@ -426,7 +433,8 @@
AND user_id = #{dto.creator}
GROUP BY id) taa2 ON tdr.id = taa2.resource_id
LEFT JOIN ( SELECT resource_id, COUNT( approve_status ) approve_status FROM t_ability_application WHERE 1 = 1
AND del_flag = 0 AND user_id = #{dto.creator} AND approve_status = '通过' GROUP BY resource_id ) taa3 ON tdr.id =
AND del_flag = 0 AND user_id = #{dto.creator} AND approve_status = '通过' GROUP BY resource_id ) taa3 ON tdr.id
=
taa3.resource_id
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
LEFT JOIN sys_region sr ON sd.district = sr.id
@ -610,7 +618,8 @@
FROM
(
SELECT
( CASE sd.type WHEN 1 THEN '省级' WHEN 2 THEN '市级' WHEN 3 THEN '区级' WHEN 4 THEN '企业' ELSE '其他' END ) AS "type",
( CASE sd.type WHEN 1 THEN '省级' WHEN 2 THEN '市级' WHEN 3 THEN '区级' WHEN 4 THEN '企业' ELSE '其他' END ) AS
"type",
sd.NAME AS "deptName",
IFNULL( tdr.deptCount, 0 ) AS "deptCount",
sd.id AS "deptId",
@ -644,7 +653,8 @@
FROM
(
SELECT
( CASE sd.type WHEN 1 THEN '省级' WHEN 2 THEN '市级' WHEN 3 THEN '区级' WHEN 4 THEN '企业' ELSE '其他' END ) AS "type",
( CASE sd.type WHEN 1 THEN '省级' WHEN 2 THEN '市级' WHEN 3 THEN '区级' WHEN 4 THEN '企业' ELSE '其他' END ) AS
"type",
IFNULL( tdr.deptCount, 0 ) AS "deptCount"
FROM
sys_dept sd
@ -682,7 +692,8 @@
FROM
(
SELECT
( CASE sd.type WHEN 1 THEN '省级' WHEN 2 THEN '市级' WHEN 3 THEN '区级' WHEN 4 THEN '企业' ELSE '其他' END ) AS "type",
( CASE sd.type WHEN 1 THEN '省级' WHEN 2 THEN '市级' WHEN 3 THEN '区级' WHEN 4 THEN '企业' ELSE '其他' END ) AS
"type",
IFNULL( tdr.deptCount, 0) AS "deptCount",
IFNULL(sr.name, '暂无该地区') AS "districtName"
FROM
@ -1512,7 +1523,7 @@
<select id="resourceInstallationOrDataResourceDetails" parameterType="java.util.Map" resultType="java.util.Map">
SELECT COUNT(a.id) AS resourceNum,a.dept_id AS deptId,b.name AS deptName
FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id
FROM tb_data_resource a INNER JOIN sys_dept b ON a.dept_id = b.id
WHERE a.type = #{resourceType} AND a.del_flag = 0
<if test="id != '0'.toString()">
AND (b.ID = #{id} OR INSTR(b.pids,#{id}))
@ -1522,40 +1533,40 @@
</select>
<select id="selectAppList" resultType="java.util.Map">
SELECT
tdr.id,
tdr.`name`,
tdr.dept_id,
sd.name AS "deptName",
sd.sort AS "deptSort",
sd.type AS "deptType",
sr.sort AS "regionSort",
tdr.visitor
tdr.id,
tdr.`name`,
tdr.dept_id,
sd.name AS "deptName",
sd.sort AS "deptSort",
sd.type AS "deptType",
sr.sort AS "regionSort",
tdr.visitor
FROM
tb_data_resource tdr
tb_data_resource tdr
LEFT JOIN sys_dept sd ON tdr.dept_id = sd.id
LEFT JOIN sys_region sr ON sd.district = sr.id
WHERE
1 = 1
AND tdr.type = '应用资源'
AND tdr.del_flag = 0
<if test=" type != null and type != ''">
AND sd.type = #{type}
</if>
1 = 1
AND tdr.type = '应用资源'
AND tdr.del_flag = 0
<if test=" type != null and type != ''">
AND sd.type = #{type}
</if>
ORDER BY
sd.type, sr.sort, sd.sort, tdr.dept_id, tdr.visitor DESC, tdr.id DESC
sd.type, sr.sort, sd.sort, tdr.dept_id, tdr.visitor DESC, tdr.id DESC
LIMIT ${pageNum}, 9
</select>
<select id="selectPicByResId" resultType="java.lang.String">
SELECT
tda.attr_value
tda.attr_value
FROM
tb_data_attr tda
LEFT JOIN tb_data_resource tdr ON tda.data_resource_id = tdr.id
tb_data_attr tda
LEFT JOIN tb_data_resource tdr ON tda.data_resource_id = tdr.id
WHERE
tda.attr_type = '应用图片'
AND tdr.id = #{id}
AND tda.del_flag = 0
tda.attr_type = '应用图片'
AND tdr.id = #{id}
AND tda.del_flag = 0
</select>
<select id="selectTypeCountByName" resultType="java.util.Map">
SELECT
@ -1571,4 +1582,82 @@
GROUP BY type
ORDER BY type
</select>
<select id="countByCIMType" resultType="java.util.Map">
SELECT
'平台' AS type,
COUNT( id ) AS "count"
FROM
tb_data_resource tdr
WHERE
del_flag = 0
AND dept_id = #{deptId}
AND type = '应用资源' UNION
SELECT
( CASE tda.attr_value WHEN '智能算法' THEN '组件' WHEN '图层服务' THEN '图层' ELSE '其他' END ) AS "type",
COUNT( tdr.id ) AS "count"
FROM
tb_data_resource tdr,
tb_data_attr tda
WHERE
tdr.del_flag = 0
AND tda.del_flag = 0
AND tdr.id = tda.data_resource_id
AND tdr.dept_id = #{deptId}
AND tdr.type = '组件服务'
AND tda.attr_type = '组件类型'
AND tda.attr_value IN ( '智能算法', '图层服务' )
GROUP BY
tda.attr_value
</select>
<select id="getCIMApplyApplicationList" resultType="java.util.Map">
SELECT
tdr.id,
tdr.name,
tdr.description,
tda.attr_value AS "pic",
tdr.create_date
FROM
tb_data_resource tdr,
tb_data_attr tda
WHERE
tdr.id = tda.data_resource_id
AND tdr.del_flag = 0
AND tda.del_flag = 0
AND tdr.type = '应用资源'
AND tda.attr_type = '应用图片'
AND tdr.dept_id = #{deptId}
ORDER BY
tdr.create_date
</select>
<select id="getImgServices" resultType="java.util.Map">
SELECT A.*,IFNULL(c.attr_value,'') as link
FROM
(
SELECT m.* FROM
(
SELECT a.name,a.id,a.info_list FROM tb_data_resource a INNER JOIN tb_data_attr b ON a.id = b.data_resource_id
WHERE a.dept_id = #{deptid} AND a.del_flag = 0 and a.type = '组件服务'
AND (b.attr_type = '组件类型' AND b.attr_value = '图层服务' ) AND b.del_flag = 0
) m
INNER JOIN tb_data_attr b ON m.id = b.data_resource_id
AND b.attr_type = '分类' AND LOCATE(#{type},b.attr_value) AND b.del_flag = 0
) A
LEFT JOIN tb_data_attr c
ON A.id = c.data_resource_id
AND c.attr_type = '图层缩略图'
AND c.del_flag = 0
</select>
<select id="cimAssemblyResources" resultType="java.util.Map">
SELECT a.name,a.id
FROM tb_data_resource a INNER JOIN tb_data_attr b ON a.id = b.data_resource_id
WHERE
a.dept_id = #{deptid}
AND a.type = '组件服务'
AND a.del_flag = 0
AND (b.attr_type = '组件类型' AND b.attr_value = '智能算法' )
AND b.del_flag = 0
</select>
</mapper>

View File

@ -94,6 +94,10 @@ public interface Constant {
* 代码生成参数KEY
*/
String DEV_TOOLS_PARAM_KEY = "DEV_TOOLS_PARAM_KEY";
/**
* 将视频资源申请全部视为一个特殊能力使用此ID
*/
Long CEMERALISTID = 8888888880000000001L;
/**
* 定时任务状态