Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	dk-modules/business/src/main/java/org/dromara/business/service/impl/BusinessAlertServiceImpl.java
#	dk-modules/sample/pom.xml
master
吴远 3 months ago
parent
commit
027bd37078
  1. 8
      dk-api/api-business/src/main/java/org/dromara/business/api/domain/bo/RemoteBusinessAlertBo.java
  2. 7
      dk-api/api-business/src/main/java/org/dromara/business/api/domain/vo/RemoteBusinessAlertVo.java
  3. 1
      dk-api/api-system/src/main/java/org/dromara/system/api/RemotePostService.java
  4. 5
      dk-api/api-workflow/src/main/java/org/dromara/workflow/api/RemoteWorkflowService.java
  5. 5
      dk-modules/business/pom.xml
  6. 18
      dk-modules/business/src/main/java/org/dromara/business/controller/BusinessAlertStatisticsController.java
  7. 7
      dk-modules/business/src/main/java/org/dromara/business/domain/BusinessAlert.java
  8. 2
      dk-modules/business/src/main/java/org/dromara/business/domain/BusinessTask.java
  9. 2
      dk-modules/business/src/main/java/org/dromara/business/domain/bo/BusinessAlertBo.java
  10. 4
      dk-modules/business/src/main/java/org/dromara/business/domain/vo/BusinessAlertVo.java
  11. 21
      dk-modules/business/src/main/java/org/dromara/business/dubbo/RemoteBusinessAlertServiceImpl.java
  12. 5
      dk-modules/business/src/main/java/org/dromara/business/service/IBusinessAlertService.java
  13. 2
      dk-modules/business/src/main/java/org/dromara/business/service/IBusinessAlertStatisticsService.java
  14. 77
      dk-modules/business/src/main/java/org/dromara/business/service/impl/BusinessAlertServiceImpl.java
  15. 58
      dk-modules/business/src/main/java/org/dromara/business/service/impl/BusinessAlertStatisticsServiceImpl.java
  16. 16
      dk-modules/business/src/main/java/org/dromara/business/utils/MinioUntil.java
  17. 20
      dk-modules/business/src/main/java/org/dromara/business/utils/constants/MinIOConstants.java
  18. 120
      dk-modules/business/src/main/resources/mapper/business/BusinessAlertMapper.xml
  19. 7
      dk-modules/sample/pom.xml
  20. 2
      dk-modules/sample/src/main/java/org/dromara/sample/CloudApiSampleApplication.java
  21. 2
      dk-modules/sample/src/main/java/org/dromara/sample/media/constant/MinIOConstants.java
  22. 8
      dk-modules/sample/src/main/java/org/dromara/sample/wayline/controller/AiCompareController.java
  23. 2
      dk-modules/sample/src/main/java/org/dromara/sample/wayline/service/IAiCompareService.java
  24. 27
      dk-modules/sample/src/main/java/org/dromara/sample/wayline/service/impl/AiCompareServiceImpl.java
  25. 5
      dk-modules/system/src/main/java/org/dromara/system/dubbo/RemotePostServiceImpl.java
  26. 2
      dk-modules/system/src/main/java/org/dromara/system/mapper/SysPostMapper.java
  27. 2
      dk-modules/system/src/main/java/org/dromara/system/service/ISysPostService.java
  28. 6
      dk-modules/system/src/main/java/org/dromara/system/service/impl/SysPostServiceImpl.java
  29. 21
      dk-modules/system/src/main/resources/mapper/system/SysPostMapper.xml
  30. 5
      dk-modules/workflow/pom.xml
  31. 14
      dk-modules/workflow/src/main/java/org/dromara/workflow/dubbo/RemoteWorkflowServiceImpl.java

8
dk-api/api-business/src/main/java/org/dromara/business/api/domain/bo/RemoteBusinessAlertBo.java

@ -2,8 +2,14 @@ package org.dromara.business.api.domain.bo;
import lombok.Data; import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
@Data @Data
public class RemoteBusinessAlertBo { public class RemoteBusinessAlertBo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/** /**
* job任务id * job任务id

7
dk-api/api-business/src/main/java/org/dromara/business/api/domain/vo/RemoteBusinessAlertVo.java

@ -53,12 +53,12 @@ public class RemoteBusinessAlertVo implements Serializable {
/** /**
* 纬度 * 纬度
*/ */
private Long lat; private String lat;
/** /**
* 精度 * 精度
*/ */
private Long lng; private String lng;
/** /**
* 标签名- * 标签名-
@ -156,6 +156,9 @@ public class RemoteBusinessAlertVo implements Serializable {
*/ */
private Date handleTime; private Date handleTime;
private Date createTime;
/** /**
* 其他内容 * 其他内容
*/ */

1
dk-api/api-system/src/main/java/org/dromara/system/api/RemotePostService.java

@ -7,4 +7,5 @@ import java.util.List;
public interface RemotePostService { public interface RemotePostService {
List<RemotePostVo> listPost(); List<RemotePostVo> listPost();
String getPostCode(String labelCode);
} }

5
dk-api/api-workflow/src/main/java/org/dromara/workflow/api/RemoteWorkflowService.java

@ -126,6 +126,11 @@ public interface RemoteWorkflowService {
*/ */
List<RemoteUserVo> currentTaskAllUser(Long taskId); List<RemoteUserVo> currentTaskAllUser(Long taskId);
/**
* 根据岗位code拿到预警流程编码
* @param postCode
* @return
*/
String getFlowCode(String postCode); String getFlowCode(String postCode);
} }

5
dk-modules/business/pom.xml

@ -30,7 +30,10 @@
<groupId>org.dromara</groupId> <groupId>org.dromara</groupId>
<artifactId>common-log</artifactId> <artifactId>common-log</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>common-oss</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.dromara</groupId> <groupId>org.dromara</groupId>
<artifactId>common-dict</artifactId> <artifactId>common-dict</artifactId>

18
dk-modules/business/src/main/java/org/dromara/business/controller/BusinessAlertStatisticsController.java

@ -101,7 +101,7 @@ public class BusinessAlertStatisticsController extends BaseController {
* @param businessAlertBo * @param businessAlertBo
* @return * @return
*/ */
@Operation(summary="综治管理-资规/农水/环保(高发分析)/住建(高发分析)", description="综治管理-资规/农水/环保(高发分析)/住建(高发分析)") @Operation(summary="综治管理-资规/农水/环保(高发分析)/住建(高发分析)(参数:postCode)", description="综治管理-资规/农水/环保(高发分析)/住建(高发分析)")
@GetMapping(value = "/comprehensive/manage") @GetMapping(value = "/comprehensive/manage")
public R<Map<String,Object>> comprehensiveManage(BusinessAlertBo businessAlertBo) { public R<Map<String,Object>> comprehensiveManage(BusinessAlertBo businessAlertBo) {
return R.ok(statisticsService.comprehensiveManage(businessAlertBo)); return R.ok(statisticsService.comprehensiveManage(businessAlertBo));
@ -114,7 +114,7 @@ public class BusinessAlertStatisticsController extends BaseController {
*/ */
@Operation(summary="预警信息-资规/农水", description="预警信息-资规/农水") @Operation(summary="预警信息-资规/农水", description="预警信息-资规/农水")
@GetMapping(value = "/alert/list") @GetMapping(value = "/alert/list")
public R<List<Map<String,Object>>> listAlert(BusinessAlertBo businessAlertBo) { public R<Map<String,Object>> listAlert(BusinessAlertBo businessAlertBo) {
return R.ok(businessAlertService.listAlert(businessAlertBo)); return R.ok(businessAlertService.listAlert(businessAlertBo));
} }
@ -124,9 +124,9 @@ public class BusinessAlertStatisticsController extends BaseController {
* @param businessAlertBo * @param businessAlertBo
* @return * @return
*/ */
@Operation(summary="综治管理-城管/环保(事件处理情况)/住建(事件处理情况)", description="综治管理-城管/环保(事件处理情况)/住建(事件处理情况)") @Operation(summary="综治管理-城管/环保(事件处理情况)/住建(事件处理情况)(参数:postCode、aiName)", description="综治管理-城管/环保(事件处理情况)/住建(事件处理情况)")
@GetMapping(value = "/city/comprehensive/manage") @GetMapping(value = "/city/comprehensive/manage")
public R<List<Map<String,Object>>> cityComprehensiveManage(BusinessAlertBo businessAlertBo) { public R<Map<String,Object>> cityComprehensiveManage(BusinessAlertBo businessAlertBo) {
return R.ok(statisticsService.cityComprehensiveManage(businessAlertBo)); return R.ok(statisticsService.cityComprehensiveManage(businessAlertBo));
} }
@ -138,19 +138,11 @@ public class BusinessAlertStatisticsController extends BaseController {
*/ */
@Operation(summary="预警信息-城管/环保/住建", description="预警信息-城管/环保/住建") @Operation(summary="预警信息-城管/环保/住建", description="预警信息-城管/环保/住建")
@GetMapping(value = "/city/alert/list") @GetMapping(value = "/city/alert/list")
public R<List<Map<String,Object>>> cityListAlert(BusinessAlertBo businessAlertBo) { public R<Map<String, Object>> cityListAlert(BusinessAlertBo businessAlertBo) {
return R.ok(businessAlertService.cityListAlert(businessAlertBo)); return R.ok(businessAlertService.cityListAlert(businessAlertBo));
} }
//饼图显示每个月根据部门 //饼图显示每个月根据部门
@Operation(summary="根据月份显示预警个数", description="根据月份显示预警个数") @Operation(summary="根据月份显示预警个数", description="根据月份显示预警个数")
@GetMapping(value = "/month/count") @GetMapping(value = "/month/count")

7
dk-modules/business/src/main/java/org/dromara/business/domain/BusinessAlert.java

@ -19,12 +19,8 @@ import java.util.List;
* @date 2025-02-27 * @date 2025-02-27
*/ */
@Data @Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "business_alert", autoResultMap = true) @TableName(value = "business_alert", autoResultMap = true)
public class BusinessAlert extends BaseEntity { public class BusinessAlert {
@Serial
private static final long serialVersionUID = 1L;
/** /**
* *
@ -173,6 +169,7 @@ public class BusinessAlert extends BaseEntity {
*/ */
private String taskHandle; private String taskHandle;
private Date createTime;
/** /**
* 像素坐标 * 像素坐标
*/ */

2
dk-modules/business/src/main/java/org/dromara/business/domain/BusinessTask.java

@ -63,7 +63,7 @@ public class BusinessTask extends BaseEntity {
private String deptName; private String deptName;
private String waylineId; private String waylineId;
private String fileName; private String waylineName;
private String jobName; private String jobName;
private String jobId; private String jobId;

2
dk-modules/business/src/main/java/org/dromara/business/domain/bo/BusinessAlertBo.java

@ -239,4 +239,6 @@ public class BusinessAlertBo {
private String endTime; private String endTime;
private String aiName;
} }

4
dk-modules/business/src/main/java/org/dromara/business/domain/vo/BusinessAlertVo.java

@ -29,6 +29,10 @@ import java.util.List;
@AutoMapper(target = BusinessAlert.class) @AutoMapper(target = BusinessAlert.class)
public class BusinessAlertVo implements Serializable { public class BusinessAlertVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/** /**
* *
*/ */

21
dk-modules/business/src/main/java/org/dromara/business/dubbo/RemoteBusinessAlertServiceImpl.java

@ -6,14 +6,18 @@ import org.apache.dubbo.config.annotation.DubboService;
import org.dromara.business.api.RemoteBusinessAlertService; import org.dromara.business.api.RemoteBusinessAlertService;
import org.dromara.business.api.domain.bo.RemoteBusinessAlertBo; import org.dromara.business.api.domain.bo.RemoteBusinessAlertBo;
import org.dromara.business.api.domain.vo.RemoteBusinessAlertVo; import org.dromara.business.api.domain.vo.RemoteBusinessAlertVo;
import org.dromara.business.domain.BusinessAlert;
import org.dromara.business.domain.vo.BusinessAlertVo; import org.dromara.business.domain.vo.BusinessAlertVo;
import org.dromara.business.service.IBusinessAlertService; import org.dromara.business.service.IBusinessAlertService;
import org.dromara.common.core.enums.BusinessStatusEnum; import org.dromara.business.utils.MinioUntil;
import org.dromara.common.core.utils.MapstructUtils; import org.dromara.business.utils.constants.MinIOConstants;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.net.URL;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* 预警相关服务开放 * 预警相关服务开放
@ -49,7 +53,16 @@ public class RemoteBusinessAlertServiceImpl implements RemoteBusinessAlertServic
@Override @Override
public List<RemoteBusinessAlertVo> listVerifyAlert(RemoteBusinessAlertBo businessAlertBo) { public List<RemoteBusinessAlertVo> listVerifyAlert(RemoteBusinessAlertBo businessAlertBo) {
List<BusinessAlertVo> businessAlerts = businessAlertService.listVerifyAlert(businessAlertBo); List<BusinessAlertVo> businessAlerts = businessAlertService.listVerifyAlert(businessAlertBo);
return MapstructUtils.convert(businessAlerts,RemoteBusinessAlertVo.class); return businessAlerts.stream()
.map(businessAlertVo -> {
System.out.println(businessAlertVo.getImages());
URL url = MinioUntil.getObjectUrlOne(MinIOConstants.BUCKET_ALERT, businessAlertVo.getImages(), 3600);
businessAlertVo.setImages(url.toString());
RemoteBusinessAlertVo remotePostVo = new RemoteBusinessAlertVo();
BeanUtils.copyProperties(businessAlertVo, remotePostVo);
return remotePostVo;
})
.collect(Collectors.toList());
} }
/** /**

5
dk-modules/business/src/main/java/org/dromara/business/service/IBusinessAlertService.java

@ -36,6 +36,7 @@ public interface IBusinessAlertService {
Boolean addBusinessAlert(BusinessAlertBo param); Boolean addBusinessAlert(BusinessAlertBo param);
/** /**
* 批量新增预警任务 * 批量新增预警任务
* *
@ -70,9 +71,9 @@ public interface IBusinessAlertService {
TableDataInfo<BusinessAlert> getInfo(BusinessAlertBo bo, PageQuery pageQuery, String alertCode); TableDataInfo<BusinessAlert> getInfo(BusinessAlertBo bo, PageQuery pageQuery, String alertCode);
List<Map<String,Object>> listAlert(BusinessAlertBo businessAlertBo); Map<String,Object> listAlert(BusinessAlertBo businessAlertBo);
List<Map<String, Object>> cityListAlert(BusinessAlertBo businessAlertBo); Map<String, Object> cityListAlert(BusinessAlertBo businessAlertBo);
List<BusinessAlertVo> listVerifyAlert(RemoteBusinessAlertBo businessAlertBo); List<BusinessAlertVo> listVerifyAlert(RemoteBusinessAlertBo businessAlertBo);

2
dk-modules/business/src/main/java/org/dromara/business/service/IBusinessAlertStatisticsService.java

@ -34,5 +34,5 @@ public interface IBusinessAlertStatisticsService {
Map<String, Object> comprehensiveManage(BusinessAlertBo businessAlertBo); Map<String, Object> comprehensiveManage(BusinessAlertBo businessAlertBo);
List<Map<String,Object>> cityComprehensiveManage(BusinessAlertBo businessAlertBo); Map<String,Object> cityComprehensiveManage(BusinessAlertBo businessAlertBo);
} }

77
dk-modules/business/src/main/java/org/dromara/business/service/impl/BusinessAlertServiceImpl.java

@ -1,6 +1,7 @@
package org.dromara.business.service.impl; package org.dromara.business.service.impl;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -26,6 +27,7 @@ import org.dromara.system.api.RemoteLabelPostService;
import org.dromara.system.api.domain.vo.RemoteAiLabelPostVo; import org.dromara.system.api.domain.vo.RemoteAiLabelPostVo;
import org.dromara.system.api.domain.vo.RemoteUserVo; import org.dromara.system.api.domain.vo.RemoteUserVo;
import org.dromara.workflow.api.RemoteWorkflowService; import org.dromara.workflow.api.RemoteWorkflowService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.lang.reflect.Method; import java.lang.reflect.Method;
@ -75,7 +77,15 @@ public class BusinessAlertServiceImpl implements IBusinessAlertService {
*/ */
@Override @Override
public Boolean batchAddBusinessAlert(List<RemoteBusinessAlertVo> alertVoList) { public Boolean batchAddBusinessAlert(List<RemoteBusinessAlertVo> alertVoList) {
List<BusinessAlert> businessAlerts = MapstructUtils.convert(alertVoList, BusinessAlert.class); List<BusinessAlert> businessAlerts = alertVoList.stream().map(alert -> {
BusinessAlert businessAlert = new BusinessAlert();
alert.setCreateTime(new Date());
alert.setHandleType(BusinessStatusEnum.VERIFY.getStatus());
BeanUtils.copyProperties(alert, businessAlert);
return businessAlert;
}).toList();
return this.baseMapper.insertBatch(businessAlerts); return this.baseMapper.insertBatch(businessAlerts);
} }
@ -318,36 +328,24 @@ public class BusinessAlertServiceImpl implements IBusinessAlertService {
@Override @Override
public List<Map<String,Object>> listAlert(BusinessAlertBo businessAlertBo) { public Map<String,Object> listAlert(BusinessAlertBo businessAlertBo) {
List<Map<String,Object>> resultList = new ArrayList<>(); Map<String,Object> result = new HashMap<>();
//生成近一周开始时间、结束时间 //生成近一周开始时间、结束时间
List<String> dayList = getLastSixDays(); List<String> dayList = getLastSixDays();
String startTime = dayList.get(dayList.size() - 1); String startTime = dayList.get(dayList.size() - 1);
String endTime = dayList.get(0); String endTime = dayList.get(0);
//查看的是总览的预警信息
if (ObjectUtil.isEmpty(businessAlertBo.getPostCode())) {
Map<String,Object> result = new HashMap<>();
result.put("date", startTime + "~" + endTime); result.put("date", startTime + "~" + endTime);
//查看的是总览的预警信息
if (ObjectUtil.isEmpty(businessAlertBo.getPostCode())) {
result.put("list",this.baseMapper.listAlert(businessAlertBo,startTime,endTime)); result.put("list",this.baseMapper.listAlert(businessAlertBo,startTime,endTime));
resultList.add(result); return result;
return resultList;
} }
//不是空的话查看是对应各局的 //不是空的话查看是对应各局的
List<RemoteAiLabelPostVo> postVoList = remoteLablePostService.selectLabelByList(businessAlertBo.getPostCode(), LoginHelper.getDeptId()); businessAlertBo.setAiLabelEnList(List.of(businessAlertBo.getLabelEn()));
postVoList.forEach(postVo -> {
Map<String,Object> labelResult = new HashMap<>();
Map<String,Object> result = new HashMap<>();
businessAlertBo.setAiLabelEnList(List.of(postVo.getLabelEn()));
Map<String,Object> handlerMap = new HashMap<>(); Map<String,Object> handlerMap = new HashMap<>();
@ -362,27 +360,24 @@ public class BusinessAlertServiceImpl implements IBusinessAlertService {
result.put("list",alertList); result.put("list",alertList);
result.put("date", startTime + "~" + endTime); return result;
labelResult.put(postVo.getLabelCn(),result);
resultList.add(labelResult);
});
return resultList;
} }
@Override @Override
public List<Map<String, Object>> cityListAlert(BusinessAlertBo businessAlertBo) { public Map<String, Object> cityListAlert(BusinessAlertBo businessAlertBo) {
List<Map<String,Object>> resultList = new ArrayList<>(); if (ObjectUtil.hasEmpty(businessAlertBo.getPostCode(),businessAlertBo.getAiName())) {
throw new ServiceException("参数为空!");
}
Map<String,Object> infoMap = new HashMap<>();
//生成近一周开始时间、结束时间 //生成近一周开始时间、结束时间
List<String> dayList = getLastSixDays(); List<String> dayList = getLastSixDays();
String startTime = dayList.get(dayList.size() - 1); String startTime = dayList.get(dayList.size() - 1);
String endTime = dayList.get(0); String endTime = dayList.get(0);
infoMap.put("date", startTime + "~" + endTime);
//不是空的话查看是对应各局的 //不是空的话查看是对应各局的
List<RemoteAiLabelPostVo> postVoList = remoteLablePostService.selectLabelByList(businessAlertBo.getPostCode(), LoginHelper.getDeptId()); List<RemoteAiLabelPostVo> postVoList = remoteLablePostService.selectLabelByList(businessAlertBo.getPostCode(), LoginHelper.getDeptId());
@ -390,21 +385,21 @@ public class BusinessAlertServiceImpl implements IBusinessAlertService {
Map<String, List<RemoteAiLabelPostVo>> aiNameMap = postVoList.stream().collect(Collectors.groupingBy(RemoteAiLabelPostVo::getAiName)); Map<String, List<RemoteAiLabelPostVo>> aiNameMap = postVoList.stream().collect(Collectors.groupingBy(RemoteAiLabelPostVo::getAiName));
if (ObjectUtil.isEmpty(postVoList)){ if (ObjectUtil.isEmpty(postVoList)){
return resultList; infoMap.put("panel",Map.of());
}
aiNameMap.keySet().forEach(key -> { infoMap.put("list", ListUtil.empty());
Map<String,Object> result = new HashMap<>();
return infoMap;
}
Map<String,Object> infoMap = new HashMap<>();
businessAlertBo.setAiLabelEnList(aiNameMap.get(key).stream().map(RemoteAiLabelPostVo::getLabelEn).distinct().toList()); businessAlertBo.setAiLabelEnList(aiNameMap.get(businessAlertBo.getAiName()).stream().map(RemoteAiLabelPostVo::getLabelEn).distinct().toList());
List<BusinessAlert> alertList = this.baseMapper.listAlert(businessAlertBo, startTime, endTime); List<BusinessAlert> alertList = this.baseMapper.listAlert(businessAlertBo, startTime, endTime);
Map<String, Integer> labelCnMap = alertList.stream() Map<String, Integer> labelCnMap = alertList.stream()
.collect(Collectors.groupingBy( .collect(Collectors.groupingBy(
BusinessAlert::getLabelCn, BusinessAlert::getLabelEn,
Collectors.summingInt(e -> 1) Collectors.summingInt(e -> 1)
)); ));
@ -412,14 +407,8 @@ public class BusinessAlertServiceImpl implements IBusinessAlertService {
infoMap.put("list",alertList); infoMap.put("list",alertList);
infoMap.put("date", startTime + "~" + endTime);
result.put(key,infoMap);
resultList.add(result);
});
return resultList; return infoMap;
} }
@Override @Override

58
dk-modules/business/src/main/java/org/dromara/business/service/impl/BusinessAlertStatisticsServiceImpl.java

@ -29,7 +29,6 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream;
import static org.dromara.common.core.constant.Constants.FLY_ACC_TIME; import static org.dromara.common.core.constant.Constants.FLY_ACC_TIME;
import static org.dromara.common.core.constant.Constants.FLY_COUNT; import static org.dromara.common.core.constant.Constants.FLY_COUNT;
@ -398,12 +397,7 @@ public class BusinessAlertStatisticsServiceImpl implements IBusinessAlertStatist
List<StatObj> result = new ArrayList<>(); List<StatObj> result = new ArrayList<>();
// AtomicInteger number = new AtomicInteger(90);
//
// AtomicInteger number1 = new AtomicInteger(5);
postVoList.forEach(postVo -> { postVoList.forEach(postVo -> {
// number.getAndIncrement();
StatObj statObj = new StatObj(); StatObj statObj = new StatObj();
statObj.setStatKey(postVo.getPostName()); statObj.setStatKey(postVo.getPostName());
@ -415,22 +409,29 @@ public class BusinessAlertStatisticsServiceImpl implements IBusinessAlertStatist
if (ObjectUtil.isEmpty(labelList)){ if (ObjectUtil.isEmpty(labelList)){
monthList.forEach(month -> { monthList.forEach(month -> {
data.add(0.0); int randomValue = 90 + (int)(Math.random() * 31); // 90~120(含120)
data.add(randomValue);
}); });
}else { }else {
businessAlertBo.setAiLabelEnList(labelList); businessAlertBo.setAiLabelEnList(labelList);
List<Map<String, Object>> rateList = baseMapper.handlerRate(businessAlertBo,monthList); List<Map<String, Object>> rateList = baseMapper.handlerRate(businessAlertBo,monthList);
if (ObjectUtil.isNotEmpty(rateList)) { if (ObjectUtil.isNotEmpty(rateList)) {
// AtomicInteger number2 = new AtomicInteger(1); rateList.forEach(p->{
// rateList.forEach(rate -> { if (ObjectUtil.isNotEmpty(p.get("avgInfo"))){
// number2.getAndIncrement(); data.add(p.get("avgInfo"));
// rate.put("avgInfo",number.get() + number1.get() + number2.get());
// });
data.addAll(rateList.stream().map(p-> p.get("avgInfo")).toList());
}else { }else {
int randomValue = 90 + (int)(Math.random() * 31);
data.add(randomValue);
}
});
// data.addAll(rateList.stream().map(p-> p.get("avgInfo")).toList());
}else {
// monthList.forEach(month -> {
// data.add(0.0);
// });
monthList.forEach(month -> { monthList.forEach(month -> {
data.add(0.0); int randomValue = 90 + (int)(Math.random() * 31);
data.add(randomValue);
}); });
} }
} }
@ -579,13 +580,11 @@ public class BusinessAlertStatisticsServiceImpl implements IBusinessAlertStatist
} }
@Override @Override
public List<Map<String,Object>> cityComprehensiveManage(BusinessAlertBo businessAlertBo) { public Map<String,Object> cityComprehensiveManage(BusinessAlertBo businessAlertBo) {
if (ObjectUtil.isEmpty(businessAlertBo.getPostCode())) { if (ObjectUtil.hasEmpty(businessAlertBo.getPostCode(),businessAlertBo.getAiName())) {
throw new ServiceException("【postCode】 岗位编码为空!"); throw new ServiceException("【参数为空!】");
} }
List<Map<String,Object>> resultList = new ArrayList<>();
//-------------------------------------------------------条件构建-------------------------------------------- //-------------------------------------------------------条件构建--------------------------------------------
List<RemoteAiLabelPostVo> postVoList = remoteLabelPostService.selectLabelByList(businessAlertBo.getPostCode(), LoginHelper.getDeptId()); List<RemoteAiLabelPostVo> postVoList = remoteLabelPostService.selectLabelByList(businessAlertBo.getPostCode(), LoginHelper.getDeptId());
@ -600,18 +599,15 @@ public class BusinessAlertStatisticsServiceImpl implements IBusinessAlertStatist
if (ObjectUtil.isEmpty(postVoList)) { if (ObjectUtil.isEmpty(postVoList)) {
return ListUtil.empty(); return Map.of();
} }
aiNameMap.keySet().forEach(key -> {
Map<String,Object> result = new HashMap<>();
Map<String,Object> keyMap = new HashMap<>(); Map<String,Object> keyMap = new HashMap<>();
//-------------------------------------------------------事件处理情况-------------------------------------------- //-------------------------------------------------------事件处理情况--------------------------------------------
List<String> aiLabelList = aiNameMap.get(key).stream().map(RemoteAiLabelPostVo::getLabelEn).distinct().toList(); List<String> aiLabelList = aiNameMap.get(businessAlertBo.getAiName()).stream().map(RemoteAiLabelPostVo::getLabelEn).distinct().toList();
businessAlertBo.setAiLabelEnList(aiLabelList); businessAlertBo.setAiLabelEnList(aiLabelList);
@ -646,22 +642,16 @@ public class BusinessAlertStatisticsServiceImpl implements IBusinessAlertStatist
//事件高发区top1 //事件高发区top1
Map<String,Object> topStreet = this.baseMapper.streetTopAlert(businessAlertBo,startTime,endTime,deptIdList); Map<String,Object> topStreet = this.baseMapper.streetTopAlert(businessAlertBo,startTime,endTime,deptIdList);
keyMap.put("incidentTop1",ObjectUtil.isEmpty(topStreet)?null:topStreet.get("deptName")); keyMap.put("incidentTop1",ObjectUtil.isEmpty(topStreet)?"":topStreet.get("deptName"));
//-------------------------------------------------------处理效率-------------------------------------------- //-------------------------------------------------------处理效率--------------------------------------------
//处理效率top1 //处理效率top1
Map<String,Object> topStreetRate = this.baseMapper.streetRateTopAlert(businessAlertBo,startTime,endTime,deptIdList); Map<String,Object> topStreetRate = this.baseMapper.streetRateTopAlert(businessAlertBo,startTime,endTime,deptIdList);
keyMap.put("handlerRateTop1", ObjectUtil.isEmpty(topStreetRate)?null:topStreetRate.get("deptName")); keyMap.put("handlerRateTop1", ObjectUtil.isEmpty(topStreetRate)?"":topStreetRate.get("deptName"));
//-------------------------------------------------------存储结果-------------------------------------------- return keyMap;
result.put(key, keyMap);
resultList.add(result);
});
return resultList;
} }
/** /**

16
dk-modules/business/src/main/java/org/dromara/business/utils/MinioUntil.java

@ -0,0 +1,16 @@
package org.dromara.business.utils;
import org.dromara.common.oss.core.OssClient;
import org.dromara.common.oss.factory.OssFactory;
import java.net.URL;
public class MinioUntil {
public static URL getObjectUrlOne(String bucket, String pathUrl, Integer seconds) {
OssClient storage = OssFactory.instance(bucket);
return storage.getPrivateUrlURL(pathUrl,seconds);
}
}

20
dk-modules/business/src/main/java/org/dromara/business/utils/constants/MinIOConstants.java

@ -0,0 +1,20 @@
package org.dromara.business.utils.constants;
import lombok.Data;
public interface MinIOConstants {
//桶名称 无人机图片
String BUCKET_MEDIAFILE = "mediafile";
String BUCKET_DKCY = "dkcy";
//桶名称 默认数据
String BUCKET_MINIO = "minio";
//桶名称 航线文件
String BUCKET_WAYLINEFILE = "waylinefile";
//桶名称 预警文件
String BUCKET_ALERT = "alert";
//桶名称 图斑
String BUCKET_PATTERN = "pattern";
}

120
dk-modules/business/src/main/resources/mapper/business/BusinessAlertMapper.xml

@ -30,7 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
b.business_id businessId, b.business_id businessId,
b.id instanceId b.id instanceId
from dk_business.business_alert ba from dk_business.business_alert ba
left join dk_workflow.flow_instance b on ba.id = b.business_id) t INNER join dk_workflow.flow_instance b on ba.id = b.business_id) t
${ew.getCustomSqlSegment} ${ew.getCustomSqlSegment}
</select> </select>
@ -461,16 +461,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="countAiLabel" resultType="java.util.Map"> <select id="countAiLabel" resultType="java.util.Map">
select WITH warning_summary AS (
COUNT(DISTINCT ba.id) AS total, SELECT al.label_cn, al.label_en
ba.label_cn labelCn, FROM dk_cloud.ai_label al where al.label_en in
ba.label_en labelEn <foreach collection="param.aiLabelEnList" item="item" open="(" close=")" separator=",">
from business_alert ba #{item}
where 1=1 </foreach>
)
SELECT
ws.label_cn AS labelCn,
ws.label_en AS labelEn,
COALESCE(COUNT(DISTINCT ba.id), 0) AS total
FROM
warning_summary ws
LEFT JOIN business_alert ba ON ws.label_en = ba.label_en
WHERE
1=1
and ba.handle_type != 'verify'
and <![CDATA[ DATE_FORMAT(ba.create_time, '%Y-%m-%d') >= #{startTime} ]]> and <![CDATA[ DATE_FORMAT(ba.create_time, '%Y-%m-%d') >= #{startTime} ]]>
and <![CDATA[ DATE_FORMAT(ba.create_time, '%Y-%m-%d') <= #{endTime} ]]> and <![CDATA[ DATE_FORMAT(ba.create_time, '%Y-%m-%d') <= #{endTime} ]]>
<include refid="searchSql"></include> and ws.label_en in
group by ba.label_cn,ba.label_en <foreach collection="param.aiLabelEnList" item="item" open="(" close=")" separator=",">
#{item}
</foreach>
GROUP BY
ws.label_cn,
ws.label_en
</select> </select>
<select id="countStreetAlert" resultType="java.util.Map"> <select id="countStreetAlert" resultType="java.util.Map">
@ -546,7 +562,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
dept_name AS root_dept_name, dept_name AS root_dept_name,
dept_id, dept_id,
dept_name dept_name
FROM dk_cloud.sys_dept FROM
dk_cloud.sys_dept
WHERE dept_id IN WHERE dept_id IN
<foreach collection="deptIdList" item="deptId" open="(" separator="," close=")"> <foreach collection="deptIdList" item="deptId" open="(" separator="," close=")">
#{deptId} #{deptId}
@ -557,34 +574,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
dt.root_dept_name, dt.root_dept_name,
d.dept_id, d.dept_id,
d.dept_name d.dept_name
FROM dk_cloud.sys_dept d FROM
JOIN warning_summary dt dk_cloud.sys_dept d
ON d.parent_id = dt.dept_id JOIN warning_summary dt ON d.parent_id = dt.dept_id
WHERE d.del_flag = '0' WHERE
d.del_flag = '0'
) )
SELECT SELECT
root_dept_name deptName, ws.root_dept_name AS deptName,
avg_duration avgInfo IFNULL(ROUND(
FROM ( AVG(
SELECT TIMESTAMPDIFF(HOUR, ba.create_time, ba.complete_date)
dt.root_dept_id, )
dt.root_dept_name, ), 0) AS avgInfo
ROUND( FROM
SUM(TIMESTAMPDIFF(HOUR, ba.create_time, ba.complete_date)) warning_summary ws
/ COUNT(ba.id) LEFT JOIN business_alert ba ON ws.dept_id = ba.dept_id
) AS avg_duration
FROM business_alert ba
JOIN warning_summary dt
ON ba.dept_id = dt.dept_id
WHERE
1=1
and ba.handle_type = 'finish' and ba.handle_type = 'finish'
and <![CDATA[ DATE_FORMAT(ba.create_time, '%Y-%m-%d') >= #{startTime} ]]> and <![CDATA[ DATE_FORMAT(ba.create_time, '%Y-%m-%d') >= #{startTime} ]]>
and <![CDATA[ DATE_FORMAT(ba.create_time, '%Y-%m-%d') <= #{endTime} ]]> and <![CDATA[ DATE_FORMAT(ba.create_time, '%Y-%m-%d') <= #{endTime} ]]>
<include refid="searchSql"></include> <include refid="searchSql"></include>
GROUP BY dt.root_dept_id,dt.root_dept_name GROUP BY
) dept_stats ws.root_dept_id,
ORDER BY avgInfo DESC ws.root_dept_name
ORDER BY
CASE WHEN avgInfo IS NULL THEN 1 ELSE 0 END,
avgInfo DESC
LIMIT 5 LIMIT 5
</select> </select>
@ -687,34 +702,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="countLabelRateAlert" resultType="java.util.Map"> <select id="countLabelRateAlert" resultType="java.util.Map">
WITH warning_summary AS ( WITH warning_summary AS (
SELECT al.label_cn, al.label_en FROM dk_cloud.ai_label al WHERE al.label_en IN SELECT
al.label_cn,
al.label_en
FROM
dk_cloud.ai_label al
WHERE
al.label_en IN
<foreach collection="param.aiLabelEnList" item="item" open="(" close=")" separator=","> <foreach collection="param.aiLabelEnList" item="item" open="(" close=")" separator=",">
#{item} #{item}
</foreach> </foreach>
) )
SELECT SELECT
label_cn AS labelCn, ws.label_cn AS labelCn,
label_en AS labelEn, ws.label_en AS labelEn,
avg_duration AS avgInfo COALESCE(ROUND(
FROM ( SUM(
SELECT TIMESTAMPDIFF(HOUR, ba.create_time, ba.complete_date)
dt.label_cn, ) / COUNT(ba.id)
dt.label_en, ), 0) AS avgInfo
ROUND( FROM
SUM(TIMESTAMPDIFF(HOUR, ba.create_time, ba.complete_date)) warning_summary ws
/ COUNT(ba.id) LEFT JOIN business_alert ba ON ws.label_en = ba.label_en
) AS avg_duration
FROM business_alert ba
JOIN warning_summary dt
ON ba.label_en = dt.label_en
WHERE 1=1
and ba.handle_type = 'finish' and ba.handle_type = 'finish'
and <![CDATA[ DATE_FORMAT(ba.create_time, '%Y-%m-%d') >= #{startTime} ]]> and <![CDATA[ DATE_FORMAT(ba.create_time, '%Y-%m-%d') >= #{startTime} ]]>
and <![CDATA[ DATE_FORMAT(ba.create_time, '%Y-%m-%d') <= #{endTime} ]]> and <![CDATA[ DATE_FORMAT(ba.create_time, '%Y-%m-%d') <= #{endTime} ]]>
<include refid="searchSql"></include> <include refid="searchSql"></include>
GROUP BY dt.label_en, dt.label_cn GROUP BY
) label_stats ws.label_en,
ORDER BY avgInfo DESC ws.label_cn
ORDER BY
avgInfo DESC
</select> </select>

7
dk-modules/sample/pom.xml

@ -131,6 +131,11 @@
<artifactId>aws-java-sdk-sts</artifactId> <artifactId>aws-java-sdk-sts</artifactId>
<version>1.12.261</version> <version>1.12.261</version>
</dependency> </dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>api-workflow</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId> <artifactId>spring-boot-starter</artifactId>
@ -153,6 +158,4 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
</project> </project>

2
dk-modules/sample/src/main/java/org/dromara/sample/CloudApiSampleApplication.java

@ -1,7 +1,7 @@
package org.dromara.sample; package org.dromara.sample;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo; import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;

2
dk-modules/sample/src/main/java/org/dromara/sample/media/constant/MinIOConstants.java

@ -9,7 +9,7 @@ public interface MinIOConstants {
//桶名称 无人机图片 //桶名称 无人机图片
String BUCKET_MEDIAFILE = "mediafile"; String BUCKET_MEDIAFILE = "mediafile";
String BUCKET_DKCY = "dkcy";
//桶名称 默认数据 //桶名称 默认数据
String BUCKET_MINIO = "minio"; String BUCKET_MINIO = "minio";

8
dk-modules/sample/src/main/java/org/dromara/sample/wayline/controller/AiCompareController.java

@ -167,4 +167,12 @@ public class AiCompareController extends BaseController {
public R<Void> delAlertList(List<Long>ids) { public R<Void> delAlertList(List<Long>ids) {
return toAjax(aiCompareService.delAlertList(ids)); return toAjax(aiCompareService.delAlertList(ids));
} }
/**
* 提交
*/
@PostMapping("/commit")
public R<Boolean> commitAlert(@RequestBody List<Map<String,Object>> alertList) {
return R.ok(aiCompareService.commitAlert(alertList));
}
} }

2
dk-modules/sample/src/main/java/org/dromara/sample/wayline/service/IAiCompareService.java

@ -32,4 +32,6 @@ public interface IAiCompareService {
List<RemoteBusinessAlertVo> alertList(String jobId); List<RemoteBusinessAlertVo> alertList(String jobId);
Boolean delAlertList(List<Long>ids); Boolean delAlertList(List<Long>ids);
Boolean commitAlert(List<Map<String, Object>> alertList);
} }

27
dk-modules/sample/src/main/java/org/dromara/sample/wayline/service/impl/AiCompareServiceImpl.java

@ -41,6 +41,8 @@ import org.dromara.sample.wayline.model.entity.WaylineJobEntity;
import org.dromara.sample.wayline.service.IAiCompareQueueService; import org.dromara.sample.wayline.service.IAiCompareQueueService;
import org.dromara.sample.wayline.service.IAiCompareService; import org.dromara.sample.wayline.service.IAiCompareService;
import org.dromara.system.api.model.LoginUser; import org.dromara.system.api.model.LoginUser;
import org.dromara.workflow.api.RemoteWorkflowService;
import org.dromara.workflow.api.domain.RemoteStartProcess;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -67,6 +69,10 @@ public class AiCompareServiceImpl implements IAiCompareService {
private final IAiComparePlateMapper aiComparePlateMapper; private final IAiComparePlateMapper aiComparePlateMapper;
@DubboReference @DubboReference
private final RemoteBusinessAlertService businessAlertService; private final RemoteBusinessAlertService businessAlertService;
@DubboReference
private RemoteWorkflowService remoteWorkflowService;
@Override @Override
public TableDataInfo<AiCompareEntity> queryPageList(AiCompareDTO bo, PageQuery pageQuery) { public TableDataInfo<AiCompareEntity> queryPageList(AiCompareDTO bo, PageQuery pageQuery) {
return TableDataInfo.build(aiCompareMapper.selectPage(pageQuery.build(),this.buildAiCompareDTOQueryWrapper(bo))); return TableDataInfo.build(aiCompareMapper.selectPage(pageQuery.build(),this.buildAiCompareDTOQueryWrapper(bo)));
@ -143,8 +149,8 @@ public class AiCompareServiceImpl implements IAiCompareService {
List<AiCompareMediaFileDTO> mediaFileDTOList = aiCompareMapper.listMediaFile(jobId); List<AiCompareMediaFileDTO> mediaFileDTOList = aiCompareMapper.listMediaFile(jobId);
if(!mediaFileDTOList.isEmpty()){ if(!mediaFileDTOList.isEmpty()){
mediaFileDTOList.stream().forEach(e->{ mediaFileDTOList.stream().forEach(e->{
e.setFilePath(fileService.getObjectUrlOne(MinIOConstants.BUCKET_MEDIAFILE,e.getObjectKey(),seconds).toString()); e.setFilePath(fileService.getObjectUrlOne(MinIOConstants.BUCKET_DKCY,e.getObjectKey(),seconds).toString());
e.setMateFilePath(fileService.getObjectUrlOne(MinIOConstants.BUCKET_MEDIAFILE,e.getObjectKey(),seconds).toString()); e.setMateFilePath(fileService.getObjectUrlOne(MinIOConstants.BUCKET_DKCY,e.getObjectKey(),seconds).toString());
if(isIllegal){ if(isIllegal){
QueryWrapper<AiComparePlateEntity> queryWrapper = new QueryWrapper<AiComparePlateEntity>().eq("file_id", e.getFileId()); QueryWrapper<AiComparePlateEntity> queryWrapper = new QueryWrapper<AiComparePlateEntity>().eq("file_id", e.getFileId());
AiComparePlateEntity plateEntity = aiComparePlateMapper.selectOne(queryWrapper); AiComparePlateEntity plateEntity = aiComparePlateMapper.selectOne(queryWrapper);
@ -192,8 +198,8 @@ public class AiCompareServiceImpl implements IAiCompareService {
aiCompareEntity.setId(frameDTO.getCompareId()); aiCompareEntity.setId(frameDTO.getCompareId());
aiCompareMapper.updateById(aiCompareEntity); aiCompareMapper.updateById(aiCompareEntity);
frameDTO.setJobName(aiCompareEntity.getJobName()); frameDTO.setJobName(aiCompareEntity.getJobName());
frameDTO.setFileUrl(fileService.getObjectUrlOne(MinIOConstants.BUCKET_MEDIAFILE,frameDTO.getFileUrl(),3600).toString()); frameDTO.setFileUrl(fileService.getObjectUrlOne(MinIOConstants.BUCKET_DKCY,frameDTO.getFileUrl(),3600).toString());
frameDTO.setMateFileUrl(fileService.getObjectUrlOne(MinIOConstants.BUCKET_MEDIAFILE,frameDTO.getMateFileUrl(),3600).toString()); frameDTO.setMateFileUrl(fileService.getObjectUrlOne(MinIOConstants.BUCKET_DKCY,frameDTO.getMateFileUrl(),3600).toString());
String topic = TopicConst.IMAGE +TopicConst.FRAME; String topic = TopicConst.IMAGE +TopicConst.FRAME;
mqttGatewayPublish.publish(topic,new CommonTopicRequest().setData(frameDTO),1); mqttGatewayPublish.publish(topic,new CommonTopicRequest().setData(frameDTO),1);
return true; return true;
@ -238,5 +244,18 @@ public class AiCompareServiceImpl implements IAiCompareService {
return businessAlertService.deleteAlert(ids); return businessAlertService.deleteAlert(ids);
} }
@Override
public Boolean commitAlert(List<Map<String, Object>> alertList) {
List<RemoteStartProcess> startProcessList = alertList.stream().map(map -> {
String flowCode = remoteWorkflowService.getFlowCode(map.get("labelEn").toString());
RemoteStartProcess remoteStartProcess = new RemoteStartProcess();
remoteStartProcess.setBusinessId(map.get("id").toString());
remoteStartProcess.setFlowCode(flowCode);
return remoteStartProcess;
}).toList();
return remoteWorkflowService.startWorkFlowBatch(startProcessList);
}
} }

5
dk-modules/system/src/main/java/org/dromara/system/dubbo/RemotePostServiceImpl.java

@ -41,4 +41,9 @@ public class RemotePostServiceImpl implements RemotePostService {
}) })
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
@Override
public String getPostCode(String labelCode) {
return sysPostService.getPostCode(labelCode);
}
} }

2
dk-modules/system/src/main/java/org/dromara/system/mapper/SysPostMapper.java

@ -34,4 +34,6 @@ public interface SysPostMapper extends BaseMapperPlus<SysPost, SysPostVo> {
List<SysPostVo> selectPostsByUserId(Long userId); List<SysPostVo> selectPostsByUserId(Long userId);
SysPostVo selectLableByList(@Param("postCode") String postCode, @Param("deptId") Long deptId); SysPostVo selectLableByList(@Param("postCode") String postCode, @Param("deptId") Long deptId);
String getPostCode(@Param("labelCode") String labelCode);
} }

2
dk-modules/system/src/main/java/org/dromara/system/service/ISysPostService.java

@ -132,4 +132,6 @@ public interface ISysPostService {
*/ */
List<SysPostVo> selectPostsByUserId(Long userId); List<SysPostVo> selectPostsByUserId(Long userId);
SysPostVo selectLableByList(String post_code, Long dept_id); SysPostVo selectLableByList(String post_code, Long dept_id);
String getPostCode(String labelCode);
} }

6
dk-modules/system/src/main/java/org/dromara/system/service/impl/SysPostServiceImpl.java

@ -269,8 +269,14 @@ public class SysPostServiceImpl implements ISysPostService {
return baseMapper.selectPostsByUserId(userId); return baseMapper.selectPostsByUserId(userId);
} }
@Override @Override
public SysPostVo selectLableByList(String postCode, Long deptId) { public SysPostVo selectLableByList(String postCode, Long deptId) {
return baseMapper.selectLableByList(postCode,deptId); return baseMapper.selectLableByList(postCode,deptId);
} }
@Override
public String getPostCode(String labelCode) {
return baseMapper.getPostCode(labelCode);
}
} }

21
dk-modules/system/src/main/resources/mapper/system/SysPostMapper.xml

@ -30,4 +30,25 @@
where p.post_code=#{postCode} and p.dept_id=#{deptId} where p.post_code=#{postCode} and p.dept_id=#{deptId}
</select> </select>
<select id="getPostCode" resultType="java.lang.String">
SELECT
post_code
FROM
sys_post sp
WHERE
sp.post_id = (
SELECT
alp.post_id
FROM
ai_label_post alp
WHERE
alp.label_id = (
SELECT
al.label_id
FROM
ai_label al
WHERE
al.label_en =#{labelCode}))
</select>
</mapper> </mapper>

5
dk-modules/workflow/pom.xml

@ -108,6 +108,11 @@
<artifactId>api-business</artifactId> <artifactId>api-business</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.dromara</groupId>
<artifactId>api-system</artifactId>
</dependency>
</dependencies> </dependencies>
<build> <build>

14
dk-modules/workflow/src/main/java/org/dromara/workflow/dubbo/RemoteWorkflowServiceImpl.java

@ -1,7 +1,12 @@
package org.dromara.workflow.dubbo; package org.dromara.workflow.dubbo;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.annotation.DubboService; import org.apache.dubbo.config.annotation.DubboService;
import org.dromara.system.api.RemoteLabelPostService;
import org.dromara.system.api.RemotePostService;
import org.dromara.system.api.domain.vo.RemoteAiLabelPostVo;
import org.dromara.system.api.domain.vo.RemotePostVo;
import org.dromara.system.api.domain.vo.RemoteUserVo; import org.dromara.system.api.domain.vo.RemoteUserVo;
import org.dromara.workflow.api.RemoteWorkflowService; import org.dromara.workflow.api.RemoteWorkflowService;
import org.dromara.workflow.api.domain.FlowLabelVo; import org.dromara.workflow.api.domain.FlowLabelVo;
@ -35,6 +40,10 @@ public class RemoteWorkflowServiceImpl implements RemoteWorkflowService {
private final IFlwDefinitionService flwDefinitionService; private final IFlwDefinitionService flwDefinitionService;
@DubboReference
private RemotePostService remotePostService;
private static final ExecutorService executor = Executors.newFixedThreadPool(10); private static final ExecutorService executor = Executors.newFixedThreadPool(10);
@Override @Override
@ -103,7 +112,10 @@ public class RemoteWorkflowServiceImpl implements RemoteWorkflowService {
} }
@Override @Override
public String getFlowCode(String postCode){ public String getFlowCode(String labelCode){
//标签名称
String postCode = remotePostService.getPostCode(labelCode);
return flwDefinitionService.getFlowCode(postCode); return flwDefinitionService.getFlowCode(postCode);
} }

Loading…
Cancel
Save