Browse Source

Merge remote-tracking branch 'origin/dev' into dev

wuyuan
杨威 1 month ago
parent
commit
7486db2f68
  1. 4
      dk-common/common-encrypt/src/main/java/org/dromara/common/encrypt/utils/EncryptUtils.java
  2. 21
      dk-modules/business/src/main/java/org/dromara/business/controller/BusinessAlertStatisticsController.java
  3. 2
      dk-modules/business/src/main/java/org/dromara/business/controller/BusinessTaskController.java
  4. 6
      dk-modules/business/src/main/java/org/dromara/business/domain/bo/BusinessAlertBo.java
  5. 1
      dk-modules/business/src/main/java/org/dromara/business/domain/vo/BusinessAlertVo.java
  6. 1
      dk-modules/business/src/main/java/org/dromara/business/mapper/BusinessAlertMapper.java
  7. 4
      dk-modules/business/src/main/java/org/dromara/business/service/IBusinessAlertService.java
  8. 48
      dk-modules/business/src/main/java/org/dromara/business/service/impl/BusinessAlertServiceImpl.java
  9. 35
      dk-modules/business/src/main/resources/mapper/business/BusinessAlertMapper.xml
  10. 4
      dk-modules/system/src/main/java/org/dromara/system/controller/system/SysMenuController.java

4
dk-common/common-encrypt/src/main/java/org/dromara/common/encrypt/utils/EncryptUtils.java

@ -175,6 +175,10 @@ public class EncryptUtils {
return keyMap;
}
public static void main(String[] args) {
Map<String, String> map = generateRsaKey();
System.out.println(map);
}
/**
* sm2公钥加密
*

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

@ -142,6 +142,27 @@ public class BusinessAlertStatisticsController extends BaseController {
return R.ok(businessAlertService.cityListAlert(businessAlertBo));
}
/**
* 预警信息-资规/农水-热力图
* @param businessAlertBo
* @return
*/
@Operation(summary="预警信息-资规/农水-标签分组", description="预警信息-资规/农水-标签分组")
@GetMapping(value = "/alert/heatList")
public R<Map<String,Object>> heatList(BusinessAlertBo businessAlertBo) {
return R.ok(businessAlertService.heatList(businessAlertBo));
}
/**
* 预警信息-城管/环保-热力图
* @param businessAlertBo
* @return
*/
@Operation(summary="预警信息-城管/环保/住建-标签分组", description="预警信息-城管/环保/住建-标签分组")
@GetMapping(value = "/city/alert/heatList")
public R<Map<String, Object>> cityHeatList(BusinessAlertBo businessAlertBo) {
return R.ok(businessAlertService.cityHeatList(businessAlertBo));
}
//饼图显示每个月根据部门
@Operation(summary="根据月份显示预警个数", description="根据月份显示预警个数")

2
dk-modules/business/src/main/java/org/dromara/business/controller/BusinessTaskController.java

@ -11,6 +11,7 @@ import lombok.extern.slf4j.Slf4j;
import org.dromara.business.domain.bo.BusinessTaskBo;
import org.dromara.business.domain.vo.BusinessTaskVo;
import org.dromara.business.service.IBusinessTaskService;
import org.dromara.common.encrypt.annotation.ApiEncrypt;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.dromara.common.idempotent.annotation.RepeatSubmit;
@ -45,6 +46,7 @@ public class BusinessTaskController extends BaseController {
/**
* 查询工单预约列表
*/
@ApiEncrypt(response=true)
@SaCheckPermission("business:task:list")
@GetMapping("/list")
public TableDataInfo<BusinessTaskVo> list(BusinessTaskBo bo, PageQuery pageQuery) {

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

@ -41,6 +41,9 @@ public class BusinessAlertBo {
*/
private String images;
private String startTime;
private String endTime;
/**
* 预警类型
@ -235,9 +238,6 @@ public class BusinessAlertBo {
*/
private Integer dateType;
private String startTime;
private String endTime;
private String aiName;
private Integer businessType;

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

@ -190,6 +190,7 @@ public class BusinessAlertVo implements Serializable {
* 忽略原因
*/
private String ignoringCause;
private Integer value;
/**
* 来源0平台 1小程序

1
dk-modules/business/src/main/java/org/dromara/business/mapper/BusinessAlertMapper.java

@ -96,6 +96,7 @@ public interface BusinessAlertMapper extends BaseMapperPlus<BusinessAlert, Busin
List<BusinessAlert> listAlert(@Param("param") BusinessAlertBo businessAlertBo,@Param("startTime") String startTime,@Param("endTime") String endTime);
List<BusinessAlertVo> heatList(@Param("param") BusinessAlertBo businessAlertBo,@Param("startTime") String startTime,@Param("endTime") String endTime);
List<Map<String,Object>> countStreetRateAlert(@Param("param") BusinessAlertBo businessAlertBo,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("deptIdList") List<Long> deptIdList);
Map<String, Object> streetRateTopAlert(@Param("param") BusinessAlertBo businessAlertBo,@Param("startTime") String startTime,@Param("endTime") String endTime,@Param("deptIdList") List<Long> deptIdList);

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

@ -74,9 +74,11 @@ public interface IBusinessAlertService {
TableDataInfo<BusinessAlert> getInfo(BusinessAlertBo bo, PageQuery pageQuery, String alertCode);
Map<String,Object> listAlert(BusinessAlertBo businessAlertBo);
Map<String,Object> heatList(BusinessAlertBo businessAlertBo);
Map<String, Object> cityListAlert(BusinessAlertBo businessAlertBo);
Map<String, Object> cityHeatList(BusinessAlertBo businessAlertBo);
List<BusinessAlertVo> listVerifyAlert(RemoteBusinessAlertBo businessAlertBo);
Boolean deleteAlert(List<Long> alertIdList);

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

@ -537,6 +537,32 @@ public class BusinessAlertServiceImpl implements IBusinessAlertService {
}
@Override
public Map<String, Object> heatList(BusinessAlertBo businessAlertBo) {
Map<String,Object> result = new HashMap<>();
/* //生成近一周开始时间、结束时间
List<String> dayList = getLastSixDays();
String startTime = dayList.get(dayList.size() - 1);
String endTime = dayList.get(0);
result.put("date", startTime + "~" + endTime);*/
//查看的是总览的预警信息
if (ObjectUtil.isEmpty(businessAlertBo.getPostCode())) {
List<BusinessAlertVo> businessAlerts = this.baseMapper.heatList(businessAlertBo, businessAlertBo.getStartTime(), businessAlertBo.getEndTime());
Map<String, List<BusinessAlertVo>> listMap = businessAlerts.stream().collect(Collectors.groupingBy(BusinessAlertVo::getLabelCn));
result.putAll(listMap);
return result;
}
//不是空的话查看是对应各局的
businessAlertBo.setAiLabelEnList(List.of(businessAlertBo.getLabelEn()));
List<BusinessAlertVo> alertList = this.baseMapper.heatList(businessAlertBo,businessAlertBo.getStartTime(), businessAlertBo.getEndTime());
Map<String, List<BusinessAlertVo>> listMap = alertList.stream().collect(Collectors.groupingBy(BusinessAlertVo::getLabelCn));
result.putAll(listMap);
return result;
}
@Override
public Map<String, Object> cityListAlert(BusinessAlertBo businessAlertBo) {
if (ObjectUtil.hasEmpty(businessAlertBo.getPostCode(),businessAlertBo.getAiName())) {
@ -603,6 +629,28 @@ public class BusinessAlertServiceImpl implements IBusinessAlertService {
return infoMap;
}
@Override
public Map<String, Object> cityHeatList(BusinessAlertBo businessAlertBo) {
if (ObjectUtil.hasEmpty(businessAlertBo.getPostCode(),businessAlertBo.getAiName())) {
throw new ServiceException("参数为空!");
}
Map<String,Object> infoMap = new HashMap<>();
//不是空的话查看是对应各局的
List<RemoteAiLabelPostVo> postVoList = remoteLablePostService.selectLabelByList(businessAlertBo.getPostCode(), LoginHelper.getDeptId());
Map<String, List<RemoteAiLabelPostVo>> aiNameMap = postVoList.stream().collect(Collectors.groupingBy(RemoteAiLabelPostVo::getAiName));
if (ObjectUtil.isEmpty(postVoList)){
return infoMap;
}
businessAlertBo.setAiLabelEnList(aiNameMap.get(businessAlertBo.getAiName()).stream().map(RemoteAiLabelPostVo::getLabelEn).distinct().toList());
List<BusinessAlertVo> alertList = this.baseMapper.heatList(businessAlertBo, businessAlertBo.getStartTime(), businessAlertBo.getEndTime());
Map<String, List<BusinessAlertVo>> listMap = alertList.stream().collect(Collectors.groupingBy(BusinessAlertVo::getLabelCn));
infoMap.putAll(listMap);
return infoMap;
}
@Override
public List<BusinessAlertVo> listVerifyAlert(RemoteBusinessAlertBo businessAlertBo) {
LambdaQueryWrapper<BusinessAlert> wrapper = new LambdaQueryWrapper<>();

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

@ -16,6 +16,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="param.createTime != null and param.createTime != ''">
and DATE_FORMAT(ba.create_time,'%Y-%m-%d') = #{param.createTime}
</if>
<if test="param.startTime != null and param.startTime != ''">
and <![CDATA[ DATE_FORMAT(ba.create_time, '%Y-%m-%d') >= #{param.startTime} ]]>
</if>
<if test="param.endTime != null and param.endTime != ''">
and <![CDATA[ DATE_FORMAT(ba.create_time, '%Y-%m-%d') <= #{param.endTime} ]]>
</if>
<if test="param.deptIdList != null and param.deptIdList.size > 0">
and ba.dept_id in
<foreach collection="param.deptIdList" item="item" open="(" close=")" separator=",">
@ -880,7 +886,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
GROUP BY
dc.dept_id,dc.dept_name
</select>
<select id="heatList" resultType="org.dromara.business.domain.vo.BusinessAlertVo">
SELECT
temp.label_en AS labelEn,
temp.label_cn as labelCn,
bl.lat AS lat,
bl.lng AS lng,
COUNT(*) AS value
FROM
(
SELECT
ba.label_en,
ba.label_cn
FROM
dk_business.business_alert ba
GROUP BY
ba.label_en, ba.label_cn
) temp
INNER JOIN
business_alert bl ON temp.label_en = bl.label_en
AND bl.lat IS NOT NULL
<where>
<include refid="searchSql"></include>
</where>
GROUP BY
temp.label_en,temp.label_cn, bl.lat, bl.lng
HAVING
<![CDATA[ ST_Distance_Sphere(POINT(lng, lat), POINT(bl.lng, bl.lat)) <= 30 ]]>
</select>
</mapper>

4
dk-modules/system/src/main/java/org/dromara/system/controller/system/SysMenuController.java

@ -9,6 +9,7 @@ import org.dromara.common.core.constant.TenantConstants;
import org.dromara.common.core.constant.UserConstants;
import org.dromara.common.core.domain.R;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.encrypt.annotation.ApiEncrypt;
import org.dromara.common.web.core.BaseController;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.log.enums.BusinessType;
@ -42,8 +43,9 @@ public class SysMenuController extends BaseController {
*
* @return 路由信息
*/
@ApiEncrypt(response=true)
@GetMapping("/{platformType}/getRouters")
public R<List<RouterVo>> getRouters(@PathVariable String platformType) {
public R<List<RouterVo>> getRouters(@PathVariable String platformType) {
List<SysMenu> menus = menuService.selectMenuTreeByUserId(LoginHelper.getUserId(),platformType);
return R.ok(menuService.buildMenus(menus));
}

Loading…
Cancel
Save