b602f18e 康伟

Merge remote-tracking branch 'origin/master'

2 个父辈 dad7c4d6 ea10bd28
......@@ -2,7 +2,7 @@ package com.skua.modules.dataAnalysis.controller;
import com.skua.core.api.vo.Result;
import com.skua.core.aspect.annotation.AutoLog;
import com.skua.modules.dataAnalysis.service.impl.WaterAnalysisNewService;
import com.skua.modules.dataAnalysis.service.WaterAnalysisNewService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
......
......@@ -343,7 +343,7 @@
IFNULL( a.totalCount, 0 ) AS totalCount
FROM
sys_factory_info sfi
LEFT JOIN alarm_level_standard_config alsc ON alsc.alarm_standard_level_code = sfi.out_level
LEFT JOIN alarm_level_standard_config alsc ON alsc.id = sfi.out_level
LEFT JOIN sys_depart d ON sfi.depart_id = d.id
LEFT JOIN (
SELECT
......
package com.skua.modules.dataAnalysis.service.impl;
package com.skua.modules.dataAnalysis.service;
import java.util.List;
import java.util.Map;
......
......@@ -7,7 +7,7 @@ import com.skua.core.api.vo.DictModel;
import com.skua.core.context.BaseContextHandler;
import com.skua.core.util.DateUtils;
import com.skua.modules.dataAnalysis.mapper.WaterAnalysisNewMapper;
import com.skua.modules.dataAnalysis.service.impl.WaterAnalysisNewService;
import com.skua.modules.dataAnalysis.service.WaterAnalysisNewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -17,18 +17,14 @@ import java.util.concurrent.atomic.AtomicReference;
@Service
public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService {
private static String REPOART_ID_HY = "9bffaf9187093d6e6a4390e8c56acca8";
private static String FACTORYIDS = "1519193830953553920,1519200041706954752,1816759403152666624,1818214145808531456,1818214519948836864," +
" 1818214642204409856,1818214704200417280,1818214745841467392,1818214781186867200,1818214830096646144,1818214870622011392," +
" 1818214905388597248,1818214961122508800,1818215007217909760,1818215052952600576,1818215093192753152,1818215141427249152," +
" 1818215178001580032,1818215228744269824,1818215268359471104,1818215307165171712,1818215363477897216,1818215411217465344";
@Autowired
private WaterAnalysisNewMapper waterAnalysisNewMapper;
@Override
public Map<String, Object> queryTotalBySummary(String time) {
Map<String, Object> result = Maps.newHashMap();
// String departIds = BaseContextHandler.getDeparts();
List<Map<String, Object>> facs = waterAnalysisNewMapper.queryTotalBySummary(time,FACTORYIDS);
Long facCount = waterAnalysisNewMapper.queryTotalCount(FACTORYIDS);
String departIds = BaseContextHandler.getDeparts();
List<Map<String, Object>> facs = waterAnalysisNewMapper.queryTotalBySummary(time,departIds);
Long facCount = waterAnalysisNewMapper.queryTotalCount(departIds);
Long summaryCount = facCount;
Long noSummaryCount = 0L;
StringBuilder facInfo = new StringBuilder();
......@@ -67,10 +63,10 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService {
@Override
public List<Map<String, Object>> queryFacListWaterQCL(String time) {
// String factoryIds = BaseContextHandler.getDeparts();
String departIds = BaseContextHandler.getDeparts();
List<Map<String, Object>> result = Lists.newArrayList();
String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_HY,"CSCOD,CSTN,CSZL,CSAD,JSCOD,JSZD,JSZL,JSAD", FACTORYIDS, time);
List<Map<String, Object>> list = waterAnalysisNewMapper.queryAllFactoryList(time,FACTORYIDS,dataViewName);
String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_HY,"CSCOD,CSTN,CSZL,CSAD,JSCOD,JSZD,JSZL,JSAD", departIds, time);
List<Map<String, Object>> list = waterAnalysisNewMapper.queryAllFactoryList(time,departIds,dataViewName);
if (list != null) {
for (Map<String, Object> map : list) {
Double jsCODAvgSum = Double.parseDouble(map.get("jscod").toString());
......@@ -110,9 +106,9 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService {
@Override
public Map<String, Object> queryWaterQCL(String time) {
Map<String, Object> result = Maps.newHashMap();
// String factoryIds = BaseContextHandler.getDeparts();
String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_HY,"CSCOD,CSTN,CSZL,CSAD,JSCOD,JSZD,JSZL,JSAD", FACTORYIDS, time);
result = waterAnalysisNewMapper.queryAvgQcl(dataViewName, time, FACTORYIDS);
String departIds = BaseContextHandler.getDeparts();
String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_HY,"CSCOD,CSTN,CSZL,CSAD,JSCOD,JSZD,JSZL,JSAD", departIds, time);
result = waterAnalysisNewMapper.queryAvgQcl(dataViewName, time, departIds);
if(result==null){
result = new HashMap<>();
result.put("COD", 0.00);
......@@ -124,7 +120,7 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService {
}
@Override
public List<Map<String, Object>> queryCSAnalysis(String time) {
// String factoryIds = BaseContextHandler.getDeparts();
String departIds = BaseContextHandler.getDeparts();
//获取负荷比例
List<DictModel> fhData = waterAnalysisNewMapper.queryDictItemsByCode("water_analysis_proportion");
Double low = 0.0;
......@@ -143,7 +139,7 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService {
Double finalUp = up;
data.forEach(v -> {
String code = (String) v.get("id");
List<Double> datan = waterAnalysisNewMapper.queryAvgByCode(code, time, FACTORYIDS);
List<Double> datan = waterAnalysisNewMapper.queryAvgByCode(code, time, departIds);
if (datan != null && datan.size() > 0) {
DoubleSummaryStatistics statistics = datan.stream().mapToDouble(Number::doubleValue).summaryStatistics();
//取最大值
......@@ -168,18 +164,18 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService {
@Override
public List<Map<String, Object>> queryNoSummaryList(String time) {
Map<String, Map<String, Object>> tmpMap = Maps.newHashMap();
// String factoryIds = BaseContextHandler.getDeparts();
String departIds = BaseContextHandler.getDeparts();
List<Map<String, Object>> facs = new ArrayList<>();
facs = waterAnalysisNewMapper.queryNewFacList(time,FACTORYIDS);
facs = waterAnalysisNewMapper.queryNewFacList(time,departIds);
return facs;
}
@Override
public Map<String, Object> queryNewSummaryCount(String time) {
// String factoryIds = BaseContextHandler.getDeparts();
String departIds = BaseContextHandler.getDeparts();
Map<String, Object> csbzCharData = Maps.newHashMap();
//上个月DateUtils.getLastMonthOfMonth(time)
List<Map<String, Object>> maps = waterAnalysisNewMapper.queryNewSummaryCount(time,FACTORYIDS);
List<Map<String, Object>> maps = waterAnalysisNewMapper.queryNewSummaryCount(time,departIds);
List<String> names = Lists.newArrayList();
List<Long> data = Lists.newArrayList();
List<Long> max = Lists.newArrayList();
......@@ -307,8 +303,8 @@ public class WaterAnalysisNewServiceImpl implements WaterAnalysisNewService {
}
@Override
public List<Map<String, Object>> queryFacListBySummary(String time) {
// String factoryIds = BaseContextHandler.getDeparts();
List<Map<String, Object>> maps = waterAnalysisNewMapper.queryFacListBySummary(time, DateUtils.getDayCountOfMonth(time),FACTORYIDS);
String departIds = BaseContextHandler.getDeparts();
List<Map<String, Object>> maps = waterAnalysisNewMapper.queryFacListBySummary(time, DateUtils.getDayCountOfMonth(time),departIds);
maps.forEach(v -> {
Double db = Double.parseDouble(String.valueOf(v.get("db")));
if (db < 90) {
......
......@@ -20,25 +20,21 @@ import java.util.Map;
@Service
public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewService {
private static String REPOART_ID_SL = "2119ecbf53a1d2d0708258ff67cfd9e1";
private static String FACTORYIDS = "1519193830953553920,1519200041706954752,1816759403152666624,1818214145808531456,1818214519948836864," +
" 1818214642204409856,1818214704200417280,1818214745841467392,1818214781186867200,1818214830096646144,1818214870622011392," +
" 1818214905388597248,1818214961122508800,1818215007217909760,1818215052952600576,1818215093192753152,1818215141427249152," +
" 1818215178001580032,1818215228744269824,1818215268359471104,1818215307165171712,1818215363477897216,1818215411217465344";
@Autowired
private WaterCountAnalysisNewMapper waterCountAnalysisNewMapper;
@Autowired
private ISysMonitorMetricInfoService sysMonitorMetricInfoService;
@Override
public Map<String, Object> querySLDeatailList(String startTime, String endTime) {
// String factoryIds = BaseContextHandler.getDeparts();
String departIds = BaseContextHandler.getDeparts();
DecimalFormat df = new DecimalFormat("#.##");
Map<String, Object> result = Maps.newHashMap();
Map<String, List<Map<String, Object>>> tmp = Maps.newTreeMap();
List<String> list = DateUtils.sliceUpDateRange(startTime, endTime, "year");
String dataViewName = ReportViewUtil.buildView(REPOART_ID_SL,"CSL", FACTORYIDS, startTime, endTime);
String dataViewName = ReportViewUtil.buildView(REPOART_ID_SL,"CSL", departIds, startTime, endTime);
//查询年度水量数据
List<Map<String, Object>> facLists = waterCountAnalysisNewMapper.queryFacLists("",FACTORYIDS);
List<Map<String, Object>> data = waterCountAnalysisNewMapper.queryTimesSLDataByFac(dataViewName, startTime, endTime, FACTORYIDS);
List<Map<String, Object>> facLists = waterCountAnalysisNewMapper.queryFacLists("",departIds);
List<Map<String, Object>> data = waterCountAnalysisNewMapper.queryTimesSLDataByFac(dataViewName, startTime, endTime, departIds);
if (data != null && data.size() > 0) {
data.forEach(v -> {
String ti = (String) v.get("time");
......@@ -87,19 +83,19 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe
@Override
public List<Map<String, Object>> queryZLSAnalysis(String time) {
// String factoryIds = BaseContextHandler.getDeparts();
String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"JSL,CSL", FACTORYIDS, time);
String departIds = BaseContextHandler.getDeparts();
String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"JSL,CSL", departIds, time);
List<Map<String, Object>> list = new ArrayList<>();
list = waterCountAnalysisNewMapper.queryZLSAnalysis(dataViewName, time, FACTORYIDS);
list = waterCountAnalysisNewMapper.queryZLSAnalysis(dataViewName, time, departIds);
return list;
}
@Override
public Map<String, Object> querySLFHLAnalysis(String time) {
// String factoryIds = BaseContextHandler.getDeparts();
String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", FACTORYIDS, time);
String departIds = BaseContextHandler.getDeparts();
String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", departIds, time);
Map<String, Object> result = Maps.newHashMap();
List<Map<String, Object>> mets = waterCountAnalysisNewMapper.queryWaterListAllByMonth(dataViewName, time, FACTORYIDS);
List<Map<String, Object>> mets = waterCountAnalysisNewMapper.queryWaterListAllByMonth(dataViewName, time, departIds);
List<Map<String, Object>> upList = Lists.newArrayList();
List<Map<String, Object>> lowList = Lists.newArrayList();
List<Map<String, Object>> list = Lists.newArrayList();
......@@ -157,22 +153,22 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe
}
@Override
public Map<String, Object> querySLAnalysis(String time) {
// String factoryIds = BaseContextHandler.getDeparts();
String thisDataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", FACTORYIDS, time);
String lastDataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", FACTORYIDS, DateUtils.getLastMonthOfMonth(time));
String departIds = BaseContextHandler.getDeparts();
String thisDataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", departIds, time);
String lastDataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", departIds, DateUtils.getLastMonthOfMonth(time));
Map<String, Object> result = Maps.newHashMap();
//增长率
List<Map<String, Object>> upData = waterCountAnalysisNewMapper.queryUpFacList(thisDataViewName, lastDataViewName, time, DateUtils.getLastMonthOfMonth(time), FACTORYIDS);
List<Map<String, Object>> upData = waterCountAnalysisNewMapper.queryUpFacList(thisDataViewName, lastDataViewName, time, DateUtils.getLastMonthOfMonth(time), departIds);
//下降率
List<Map<String, Object>> lowData = waterCountAnalysisNewMapper.queryLowFacList(thisDataViewName, lastDataViewName, time, DateUtils.getLastMonthOfMonth(time), FACTORYIDS);
List<Map<String, Object>> lowData = waterCountAnalysisNewMapper.queryLowFacList(thisDataViewName, lastDataViewName, time, DateUtils.getLastMonthOfMonth(time), departIds);
result.put("upData", upData);
result.put("lowData", lowData);
return result;
}
@Override
public Map<String, Object> queryTotalSLList(String time) {
// String factoryIds = BaseContextHandler.getDeparts();
String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", FACTORYIDS, time);
String departIds = BaseContextHandler.getDeparts();
String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", departIds, time);
Map<String, Object> result = Maps.newHashMap();
Map<String, List<Map<String, Object>>> tmp = Maps.newTreeMap();
String nowYear = DateUtils.getDate("yyyy");
......@@ -183,8 +179,8 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe
list = DateUtils.sliceUpDateRange(time + "-01", time + "-12", "year");
}
//查询年度水量数据
List<Map<String, Object>> facLists = waterCountAnalysisNewMapper.queryFacLists("",FACTORYIDS);
List<Map<String, Object>> data = waterCountAnalysisNewMapper.queryTotalSLDataByFac(dataViewName, time, FACTORYIDS);
List<Map<String, Object>> facLists = waterCountAnalysisNewMapper.queryFacLists("",departIds);
List<Map<String, Object>> data = waterCountAnalysisNewMapper.queryTotalSLDataByFac(dataViewName, time, departIds);
if (data != null && data.size() > 0) {
data.forEach(v -> {
String ti = (String) v.get("time");
......@@ -219,16 +215,16 @@ public class WaterCountAnalysisNewServiceImpl implements WaterCountAnalysisNewSe
}
@Override
public Map<String, Object> queryTotalSLData(String time) {
// String factoryIds = BaseContextHandler.getDeparts();
String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", FACTORYIDS, time);
String departIds = BaseContextHandler.getDeparts();
String dataViewName = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", departIds, time);
Map<String, Object> result = Maps.newHashMap();
StringBuilder stringBuilder = new StringBuilder();
List<Map<String, Object>> data = waterCountAnalysisNewMapper.queryTotalSLData(dataViewName, time, FACTORYIDS);
List<Map<String, Object>> data = waterCountAnalysisNewMapper.queryTotalSLData(dataViewName, time, departIds);
String time2 = String.valueOf(Integer.parseInt(time) - 1);
String dataViewName2 = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", FACTORYIDS, time2);
List<Map<String, Object>> lastData = waterCountAnalysisNewMapper.queryTotalSLData(dataViewName2, time2, FACTORYIDS);
String dataViewName2 = ReportViewUtil.buildViewLike(REPOART_ID_SL,"CSL", departIds, time2);
List<Map<String, Object>> lastData = waterCountAnalysisNewMapper.queryTotalSLData(dataViewName2, time2, departIds);
for (int i =0 ;i<data.size();i++){
Map<String, Object> map = data.get(i);
......
package com.skua.modules.report.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.skua.core.api.vo.Result;
import com.skua.modules.report.entity.ReportDisplay;
import com.skua.modules.report.entity.ReportHeader;
import com.skua.modules.report.mapper.FReportManageMapper;
import com.skua.modules.report.mapper.ReportHeaderMapper;
import com.skua.modules.report.service.IJmReportService;
import com.skua.modules.report.service.IReportDisplayService;
import com.skua.modules.report.vo.ReportShow;
import com.skua.modules.util.ReportUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
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 javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
@Slf4j
@Api(tags = "积木 报表展示")
@RestController
@RequestMapping("/report/jmReport")
public class JmReportController {
@Autowired
ReportDisplayController reportDisplayController;
@Autowired
FReportManageMapper reportManageMapper;
@Autowired
IReportDisplayService reportDisplayService;
@Autowired
ReportHeaderMapper reportHeaderMapper;
@Autowired
IJmReportService jmReportService;
@ApiOperation(value = "化验日报-在线值", notes = "积木报表")
@GetMapping(value = "/hyrbZxz")
public Map trCount(
@RequestParam(name = "departId" ) String departId,
@RequestParam(name = "date" ) String date //yyyy-MM-dd
) {
Map returnData = new HashMap();
//查询【表头】 保持和[生产报表]一致
QueryWrapper<ReportDisplay> reportDisplayQueryWrapper = new QueryWrapper<>();
reportDisplayQueryWrapper.eq("depart_id",departId);
reportDisplayQueryWrapper.eq("report_name","生产报表");
ReportDisplay reportDisplay = reportDisplayService.getOne(reportDisplayQueryWrapper);
if (reportDisplay == null) {
return returnData;
}
List<Map<String, String>> reportHeaderList = reportHeaderMapper.hyrbZxz(reportDisplay.getId());
Map<String, String> reportHeaderMap = reportHeaderList.stream().collect(Collectors.toMap(v -> v.get("tag"), o -> o.get("metricId")));
//查询【数据】
ReportShow params = new ReportShow();
params.setId(reportDisplay.getId());
params.setDepartId(departId);
params.setStartDateTime(date + " 00:00:00");
params.setEndDateTime(date + " 23:59:59");
params.setReportType("day");
Result<List<Map<String, Object>>> dataListResult = reportDisplayController.reprotShow(params);
List<Map<String, Object>> dataList = CollectionUtils.isEmpty(dataListResult.getResult()) ? new LinkedList<>() : dataListResult.getResult();//(正常情况下只有一条)
//查询【告警上限】
List<Map<String, String>> limitList = reportHeaderMapper.queryLimit(departId);
Map<String, String> limitMap = limitList.stream().collect(Collectors.toMap(v -> v.get("tag"), o -> o.get("maxValue")));
List<String> tagList = Arrays.asList("CSCOD","CSNH3N","CSPH","CSTN","CSTP","JSCOD","JSNH3N","JSPH","JSTN","JSTP","JSSS","CSSS");
//组装数据
for (Map<String, Object> dataMap : dataList) {
for (String tag : tagList) {
String metricId = reportHeaderMap.get(tag);//点位Id
dataMap.put(tag, dataMap.get(metricId));
BigDecimal minValue = tag.contains("PH") ? new BigDecimal("6") : BigDecimal.ZERO; //PH的阈值固定为6~9
BigDecimal maxValue = tag.contains("PH") ? new BigDecimal("9") : ReportUtil.getBigDecimalValue(tag, limitMap);
maxValue = maxValue == null ? new BigDecimal("9999999") : maxValue;
boolean flag = false;
BigDecimal valueBigDecimal = ReportUtil.newBigDecimal(metricId, null);
if(valueBigDecimal != null && (valueBigDecimal.compareTo(minValue) < 0 || valueBigDecimal.compareTo(maxValue) > 0)){
flag = true; //超标!
}
dataMap.put(tag + "_是否超标", flag ? "yes" : "no"); //判断是否告警
}
}
returnData.put("data",dataList);
return returnData;
}
}
package com.skua.modules.report.mapper;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import com.skua.modules.report.entity.ReportHeader;
......@@ -15,4 +16,13 @@ public interface ReportHeaderMapper extends BaseMapper<ReportHeader> {
//查询报表信息
List<ReportHeader> headerAll(@Param("reportId") String reportId);
List<Map<String, String>> hyrbZxz(String id);
/**
* 查询告警上限值
* @param depart
* @return
*/
List<Map<String, String>> queryLimit(String depart);
}
......
......@@ -30,4 +30,31 @@
report_id =#{reportId}
ORDER BY sort_num
</select>
<select id="hyrbZxz" resultType="java.util.Map">
select m.metric_uid_tag as 'tag', h.key_index as 'metricId', h.title
from report_header h
join sys_monitor_metric_info m on h.key_index = m.id
where
h.report_id = #{id}
and metric_uid_tag is not null
and metric_uid_tag != ''
</select>
<select id="queryLimit" resultType="java.util.Map">
SELECT
b.alarm_param_code AS tag,
b.alarm_param_upper_limit AS `maxValue`
FROM
sys_factory_info a
LEFT JOIN alarm_param_standard_config b ON a.out_level = b.alarm_level_standard_id
WHERE
depart_id = #{depart}
UNION ALL
SELECT
index_code,
upper
FROM
water_quality_in_level
WHERE
depart_id = #{depart}
</select>
</mapper>
......
package com.skua.modules.util;
import cn.hutool.core.util.NumberUtil;
import com.skua.core.util.ConvertUtils;
import com.skua.modules.report.entity.FReportItem;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
public class ReportUtil {
/**
* 计算加权平均,权重固定为‘今日处理水量’
* @param everyDayList 每天的数据
* @param keys 要计算 加权平均 的key
* @return Map<key, 加权平均值>
*/
public static Map<String, BigDecimal> calWeighAvg(List<Map> everyDayList, String ... keys) {
//水质key, 累计值
Map<String, BigDecimal> accValueMap = new HashMap<>();
for (String key : keys) {
//数据初始化
accValueMap.put(key, BigDecimal.ZERO);
}
//累计水量
BigDecimal totalSl = BigDecimal.ZERO;
for (Map dayData : everyDayList) {
//今日水量
BigDecimal sl = dayData.get("今日水处理量") == null || StringUtils.isBlank(dayData.get("今日水处理量").toString()) ? null : new BigDecimal(dayData.get("今日水处理量").toString());
if(sl == null || sl.compareTo(BigDecimal.ZERO) == 0){
continue;
}
totalSl = NumberUtil.add(totalSl, sl);
for (String key : keys) {
//COD*水量
BigDecimal value = dayData.get(key) == null || !NumberUtil.isNumber(dayData.get(key).toString()) ? null : new BigDecimal(dayData.get(key).toString());
BigDecimal mulValue = NumberUtil.mul(value, sl);
accValueMap.put(key, NumberUtil.add(accValueMap.get(key), mulValue));
}
}
if(totalSl.compareTo(BigDecimal.ZERO) == 0){
//累计水量为0,直接返回
return accValueMap;
}
for (Map.Entry<String, BigDecimal> entry : accValueMap.entrySet()) {
// value / 权重
entry.setValue(NumberUtil.round(NumberUtil.div(entry.getValue(), totalSl), 2));
}
return accValueMap;
}
/**
* sum
* @param allValueMap 同一个key的数据,汇总到一起
* @param key
* @return 0 or 计算的值,不会返回null
*/
public static BigDecimal calSumValue(Map<String, List<BigDecimal>> allValueMap, String key) {
return NumberUtil.add(Optional.ofNullable(allValueMap.get(key)).orElse(new LinkedList<>()).toArray(new BigDecimal[0]));
}
/**
* max
* @param allValueMap 同一个key的数据,汇总到一起
* @param key
* @return 0 or 计算的值,不会返回null
*/
public static BigDecimal calMaxValue(Map<String, List<BigDecimal>> allValueMap, String key) {
if (CollectionUtils.isEmpty(allValueMap.get(key))) {
return null;
}
return NumberUtil.max(Optional.ofNullable(allValueMap.get(key)).orElse(new LinkedList<>()).toArray(new BigDecimal[0]));
}
/**
* min
* @param allValueMap 同一个key的数据,汇总到一起
* @param key
* @return 0 or 计算的值,不会返回null
*/
public static BigDecimal calMinValue(Map<String, List<BigDecimal>> allValueMap, String key) {
if (CollectionUtils.isEmpty(allValueMap.get(key))) {
return null;
}
return NumberUtil.min(Optional.ofNullable(allValueMap.get(key)).orElse(new LinkedList<>()).toArray(new BigDecimal[0]));
}
/**
* max(包含小于符号)
* @param notLessThanMonthValueMap 同一个key的数据,汇总到一起 (不包含小于符号的数据)
* @param lessThanValueMap 同一个key的数据,汇总到一起 包含【小于符号】的值,但会去掉小于符号
* @param key
* @return 0 or 计算的值,不会返回null
*/
public static String calMaxValueContainsLessThan(Map<String, List<BigDecimal>> notLessThanMonthValueMap,Map<String, List<BigDecimal>> lessThanValueMap, String key) {
//最大值(不包含小于符号的数据)
BigDecimal maxInNotLessValue = null;
if (CollectionUtils.isNotEmpty(notLessThanMonthValueMap.get(key))) {
maxInNotLessValue = NumberUtil.max(Optional.ofNullable(notLessThanMonthValueMap.get(key)).orElse(new LinkedList<>()).toArray(new BigDecimal[0]));
}
if(CollectionUtils.isNotEmpty(lessThanValueMap.get(key))){
//最大值(在所有的包含'<'数据中)
BigDecimal maxInLessThanValue = NumberUtil.max(Optional.ofNullable(lessThanValueMap.get(key)).orElse(new LinkedList<>()).toArray(new BigDecimal[0]));
if(maxInLessThanValue == null){
return maxInNotLessValue == null ? "" : maxInNotLessValue.toPlainString();
}
if(maxInNotLessValue == null || maxInLessThanValue.compareTo(maxInNotLessValue) > 0){
return "<" + maxInLessThanValue.toPlainString();
}
}
return maxInNotLessValue == null ? "" : maxInNotLessValue.toPlainString();
}
/**
* min(包含小于符号)
* @param allValueMap 同一个key的数据,汇总到一起 (所有的数据)
* @param lessThanValueMap 同一个key的数据,汇总到一起 包含【小于符号】的值
* @param key
* @return 0 or 计算的值,不会返回null
*/
public static String calMinValueContainsLessThan(Map<String, List<BigDecimal>> allValueMap, Map<String, List<BigDecimal>> lessThanValueMap, String key) {
if (CollectionUtils.isEmpty(allValueMap.get(key))) {
return null;
}
//最小值(在所有的数据中)
BigDecimal minInAllValue = NumberUtil.min(Optional.ofNullable(allValueMap.get(key)).orElse(new LinkedList<>()).toArray(new BigDecimal[0]));
if(CollectionUtils.isNotEmpty(lessThanValueMap.get(key))){
//最小值(在所有的包含'<'数据中)
BigDecimal minInLessThanValue = NumberUtil.min(Optional.ofNullable(lessThanValueMap.get(key)).orElse(new LinkedList<>()).toArray(new BigDecimal[0]));
if(minInLessThanValue != null && minInLessThanValue.compareTo(minInAllValue) <= 0){
return "<" + minInLessThanValue.toPlainString();
}
}
return minInAllValue.toPlainString();
}
/**
* 计算平均值
* @param allValueMap 同一个key的数据,汇总到一起
* @param key
* @return 0 or 计算的值,不会返回null
*/
public static BigDecimal calAvgValue(Map<String, List<BigDecimal>> allValueMap, String key) {
return calAvgValue(allValueMap, key, 4);
}
/**
* 计算平均值
* @param allValueMap 同一个key的数据,汇总到一起
* @param key
* @return 0 or 计算的值,不会返回null
*/
public static BigDecimal calAvgValue(Map<String, List<BigDecimal>> allValueMap, String key, int scale) {
BigDecimal avgValue;
List<BigDecimal> valueList = Optional.ofNullable(allValueMap.get(key)).orElse(new LinkedList<>());
if (CollectionUtils.isNotEmpty(valueList)) {
double sum = NumberUtil.add(valueList.toArray(new BigDecimal[0])).doubleValue();
avgValue = ReportUtil.div(sum, valueList.size());
avgValue = NumberUtil.round(avgValue ,scale);
} else {
avgValue = null;
}
return avgValue;
}
/**
* 同一个key的数据,汇总到一起
* 非数字的值将被忽略(null 空字符串 非法数字)
* 去掉<
* @param everyDayReportList
* @return
*/
public static Map<String, List<BigDecimal>> valueListGroupByKey(List<Map> everyDayReportList) {
Map<String, List<BigDecimal>> allValueMap = new HashMap();
for (Map<String,Object> dayData : everyDayReportList) {
for (Map.Entry<String, Object> entry : dayData.entrySet()) {
Object value = entry.getValue();
String key = entry.getKey();
if (!allValueMap.containsKey(key)) {
allValueMap.put(key, new LinkedList<>());
}
if(value == null || StringUtils.isBlank(value.toString())){
continue;
}
//客户要求支持填写 '<'
String valueString = value.toString().replaceAll("\\<", "").replaceAll("<", "").trim();
if(NumberUtil.isNumber(valueString)){
List<BigDecimal> valueList = allValueMap.get(key);
valueList.add(new BigDecimal(valueString));
}
}
}
return allValueMap;
}
/**
* 只获取【包含小于符号】的值,但是返回的值会把小于符号去掉
* @param everyDayReportList
* @return
*/
public static Map<String, List<BigDecimal>> lessThanValueListGroupByKey(List<Map> everyDayReportList) {
Map<String, List<BigDecimal>> allValueMap = new HashMap();
for (Map<String,Object> dayData : everyDayReportList) {
for (Map.Entry<String, Object> entry : dayData.entrySet()) {
Object value = entry.getValue();
String key = entry.getKey();
if (!allValueMap.containsKey(key)) {
allValueMap.put(key, new LinkedList<>());
}
if(value == null || StringUtils.isBlank(value.toString())){
continue;
}
if(!(value.toString().startsWith("<") || value.toString().startsWith("<"))){
continue;
}
//去掉 '<'
String valueString = value.toString().replaceAll("\\<", "").replaceAll("<", "").trim();
if(NumberUtil.isNumber(valueString)){
List<BigDecimal> valueList = allValueMap.get(key);
valueList.add(new BigDecimal(valueString));
}
}
}
return allValueMap;
}
/**
* 只获取【不包含小于符号】的值
* @param everyDayReportList
* @return
*/
public static Map<String, List<BigDecimal>> notLessThanValueListGroupByKey(List<Map> everyDayReportList) {
Map<String, List<BigDecimal>> allValueMap = new HashMap();
for (Map<String,Object> dayData : everyDayReportList) {
for (Map.Entry<String, Object> entry : dayData.entrySet()) {
Object value = entry.getValue();
String key = entry.getKey();
if (!allValueMap.containsKey(key)) {
allValueMap.put(key, new LinkedList<>());
}
if(value == null || StringUtils.isBlank(value.toString())){
continue;
}
if((value.toString().startsWith("<") || value.toString().startsWith("<"))){
continue;
}
String valueString = value.toString().trim();
if(NumberUtil.isNumber(valueString)){
List<BigDecimal> valueList = allValueMap.get(key);
valueList.add(new BigDecimal(valueString));
}
}
}
return allValueMap;
}
/**
* 对于包含【小于符号】的值,返回的值会替换成0
* @param everyDayReportList
* @return
*/
public static Map<String, List<BigDecimal>> lessThanValueToZeroListGroupByKey(List<Map> everyDayReportList) {
Map<String, List<BigDecimal>> allValueMap = new HashMap();
for (Map<String,Object> dayData : everyDayReportList) {
for (Map.Entry<String, Object> entry : dayData.entrySet()) {
Object value = entry.getValue();
String key = entry.getKey();
if (!allValueMap.containsKey(key)) {
allValueMap.put(key, new LinkedList<>());
}
if(value == null || StringUtils.isBlank(value.toString())){
continue;
}
String valueString = value.toString();
if(value.toString().startsWith("<") || value.toString().startsWith("<")){
valueString = "0";
}
if(NumberUtil.isNumber(valueString)){
List<BigDecimal> valueList = allValueMap.get(key);
valueList.add(new BigDecimal(valueString));
}
}
}
return allValueMap;
}
/**
* 同一个key的数据,汇总到一起
* 非数字的值将被忽略(null 空字符串 非法数字)
* @param everyDayReportList
* @return
*/
public static Map<String, List<BigDecimal>> valueListGroupByKey1(List<Map<String, Object>> everyDayReportList) {
return valueListGroupByKey(transformListMap(everyDayReportList));
}
public static List<Map> transformListMap(List<Map<String, Object>> list){
List<Map> returnData = new LinkedList<>();
returnData.addAll(list);
return returnData;
}
/**
* 多个数据集,合并每天的数据
*
* @param startTime yyyy-MM-dd
* @param endTime
* @param dataList 各个数据集(报表数据必须包含key为time的日期)
* @return
*/
public static List<Map> mergeEveryDayData(String startTime, String endTime, List<Map>... dataList){
List<Map<String, Map>> mapList = new LinkedList<>();
for (List<Map> maps : dataList) {
//Map<日期, 报表数据> 报表数据必须包含key为time的日期 否则可能报错:IllegalStateException: Duplicate key
for (Map map : maps) {
Object time = map.get("time");
System.out.println();
}
Map<String, Map> mapByTime = maps.stream().collect(Collectors.toMap(m -> (String) m.get("time"), po -> po));
mapList.add(mapByTime);
}
LocalDate startLocalDate = LocalDate.parse(startTime);
LocalDate endLocalDate = LocalDate.parse(endTime).plusDays(1);
List<Map> returnData = new LinkedList<>();
int index = 1;
while(startLocalDate.compareTo(endLocalDate) < 0){
String currentDate = startLocalDate.format(DateTimeFormatter.ISO_LOCAL_DATE);
Map map = new HashMap();
for (Map<String, Map> reportDataMap : mapList) {
map.putAll(reportDataMap.getOrDefault(currentDate, new HashMap<>()));
}
map.put("time", currentDate);
map.put("序号", index++);
returnData.add(map);
startLocalDate = startLocalDate.plusDays(1);
}
return returnData;
}
/**
* 计算每天电量
* @param startTime
* @param endTime
* @param xjReportData 巡检填报 原始数据
* @return
*/
public static List<Map> calEveryDayDlData(String startTime, String endTime, List<Map<String, Object>> xjReportData){
Map<String, Map<String, Object>> xjReportDataMap = xjReportData.stream().collect(Collectors.toMap(m -> (String) m.get("time"), po -> po));
LocalDate startLocalDate = LocalDate.parse(startTime);
LocalDate endLocalDate = LocalDate.parse(endTime).plusDays(1);
List<Map> returnData = new LinkedList<>();
while(startLocalDate.compareTo(endLocalDate) < 0) {
String currentDate = startLocalDate.format(DateTimeFormatter.ISO_LOCAL_DATE);
Map dataMap = new HashMap();
dataMap.put("time", currentDate);
returnData.add(dataMap);
if (xjReportDataMap.containsKey(currentDate)) {
dataMap.put("今日电量", String.valueOf(ReportUtil.getBigDecimalValue("MRDL", xjReportDataMap.get(currentDate))));
}
startLocalDate = startLocalDate.plusDays(1);
}
return returnData;
}
private static String generateKey(String time, String departId){
return departId + "_" + time;
}
/**
* key翻译成中文
* @param oldMap
* @param attributeList
* @return
*/
public static Map<String, Object> transformKey(Map<String, Object> oldMap, List<FReportItem> attributeList) {
Map<String, FReportItem> reportItemMap = attributeList.stream().collect(Collectors.toMap(FReportItem::getItemCode, po -> po));
Map<String, Object> newMap = new LinkedHashMap<>();
for (String key : oldMap.keySet()) {
String newKey = key;
if(reportItemMap.containsKey(key)){
newKey = reportItemMap.get(key).getItemAlias();
}
newMap.put(newKey, oldMap.get(key));
}
return newMap;
}
/**
* 计算加权平均
* (a1*b1 + a2*b2)/ (b1+b2)
* @param dataList
* @param a1
* @param b1
* @param a2
* @param b2
* @param key 新数据key (结果将会被保存到Map中)
*/
public static void calWeightAvg(List<Map> dataList, String a1, String b1, String a2, String b2, String key) {
//(a1*b1 + a2*b2)/ (b1+b2)
for (Map map : dataList) {
BigDecimal value = null;
BigDecimal a1value = getBigDecimalValue(a1, map);
BigDecimal b1value = getBigDecimalValue(b1, map);
BigDecimal a2value = getBigDecimalValue(a2, map);
BigDecimal b2value = getBigDecimalValue(b2, map);
// (b1+b2)
BigDecimal b1AddB2 = NumberUtil.add(b1value, b2value);
if(b1AddB2.compareTo(BigDecimal.ZERO) == 0){
value = null;
} else {
//有bug:NumberUtil.mul(30, null) = 30 ,而不是期望的0
BigDecimal a1MulB1 = (a1value == null || b1value == null) ? null : ReportUtil.mul(a1value, b1value);
BigDecimal a2MulB2 = (a2value == null || b2value == null) ? null : ReportUtil.mul(a2value, b2value);
value = ReportUtil.div(ReportUtil.add(a1MulB1, a2MulB2), b1AddB2);
}
map.put(key, value);
}
}
/**
* 计算加权平均
* (key1*weight1 + key2*weight2 + keyN*weightN) / sum (weight1+weight2+weightN)
* @param dataList
* @param valueKey
* @param weightKey
* @param valueKey 新数据key (结果将会被保存到Map中)
*/
public static BigDecimal calTotalWeightAvgAB(List<Map> dataList, String weightKey, String valueKey, Integer scale) {
BigDecimal total = BigDecimal.ZERO;
BigDecimal totalWeight = BigDecimal.ZERO;
scale = scale == null ? 4 : scale;//默认4位小数
for (Map map : dataList) {
BigDecimal keyValue = getBigDecimalValue(valueKey, map);
BigDecimal weightValue = getBigDecimalValue(weightKey, map);
if(keyValue == null || keyValue.compareTo(BigDecimal.ZERO) == 0 || weightValue == null || weightValue.compareTo(BigDecimal.ZERO) == 0 ){
continue;
}
total = NumberUtil.add(total, NumberUtil.mul(keyValue , weightValue));
totalWeight = NumberUtil.add(totalWeight, weightValue);
}
if (totalWeight.compareTo(BigDecimal.ZERO) == 0) {
return null;//返回null
} else {
return NumberUtil.round(NumberUtil.div(total, totalWeight), scale);
}
}
public static BigDecimal getBigDecimalValue(String a1, Map map) {
if(map == null){
return null;
}
Object value = map.get(a1);
if(value == null || StringUtils.isBlank(value.toString())){
return null;
}
//客户要求支持填写 '<'
String valueString = value.toString().replaceAll("\\<", "").replaceAll("<", "").trim();
return !NumberUtil.isNumber(valueString) ? null : new BigDecimal(valueString);
}
public static void main(String[] args) {
System.out.println(roundContainsEndZero(1, 2));
List<Map<String, Object>> monthReportData = new LinkedList<>();
// Map<String, Object> map1 = new HashMap<>();
// map1.put("java", "0.1");
// monthReportData.add(map1);
// Map<String, Object> map2 = new HashMap<>();
// map2.put("java", "0.2");
// monthReportData.add(map2);
System.out.println("=======");
System.out.println(calMaxValueContainsLessThan(notLessThanValueListGroupByKey(transformListMap(monthReportData)),
lessThanValueListGroupByKey(transformListMap(monthReportData)), "java"));
Map<String, Object> map3 = new HashMap<>();
map3.put("java", "<0.1");
monthReportData.add(map3);
Map<String, Object> map4 = new HashMap<>();
map4.put("java", "<0.3");
monthReportData.add(map4);
System.out.println("=======");
System.out.println(calMaxValueContainsLessThan(notLessThanValueListGroupByKey(transformListMap(monthReportData)),
lessThanValueListGroupByKey(transformListMap(monthReportData)), "java"));
Map<String, Object> map5 = new HashMap<>();
map5.put("java", "<10");
monthReportData.add(map5);
Map<String, Object> map6 = new HashMap<>();
map6.put("java", "10");
monthReportData.add(map6);
System.out.println("=======");
System.out.println(calMaxValueContainsLessThan(notLessThanValueListGroupByKey(transformListMap(monthReportData)),
lessThanValueListGroupByKey(transformListMap(monthReportData)), "java"));
double number = 3.1415926;
DecimalFormat df = new DecimalFormat("#.##");
String formattedNumber = df.format(number);
// System.out.println(df.format(0d));
// System.out.println(df.format(0.0d));
// System.out.println(df.format(0.666d));
// System.out.println(round(0d, 0));
// System.out.println(round(0.1001d, 2));
// System.out.println(round(0.0001d, 1));
// System.out.println(round(111.555d, 1));
// System.out.println(round(1.455d, 2));
// System.out.println(round(1.555d, 2));
// System.out.println(round(111.555d, 3));
}
/**
* 数字格式化,保留小数位,并会去掉末尾0
* 有bug:1.455d=》1.46 ; 1.555d 》 1.55
* @param value
* @param scale 小数位数
* @return
*/
@Deprecated
public static String format(double value, int scale){
StringBuilder sb = new StringBuilder("#");
if(scale > 0){
sb.append(".");
for (int i = 0; i < scale; i++) {
sb.append("#");
}
}
DecimalFormat df = new DecimalFormat(sb.toString());
return df.format(value);
}
/**
* 数字格式化,保留小数位,并会去掉末尾0
* @param value
* @param scale 小数位数
* @return
*/
public static String roundForDouble(double value, int scale){
// return NumberUtil.round(value,scale).toString().replaceAll("\\.?0*$", "");
return NumberUtil.round(value,scale).stripTrailingZeros().toPlainString();
}
/**
* 乘法
* @param a1value
* @param b1value
* @return
*/
public static BigDecimal mul(Number a1value, Number b1value){
//NumberUtil.mul(30, null) = 30 ,而不是期望的0
return (a1value == null || b1value == null) ? null : NumberUtil.mul(a1value, b1value);
}
/**
* add
* @param a1value
* @param b1value
* @return
*/
public static BigDecimal add(Number a1value, Number b1value){
//NumberUtil.add(null, null) = 0 ,而不是期望的null
return (a1value == null && b1value == null) ? null : NumberUtil.add(a1value, b1value);
}
/**
* 除法
* @param a1value
* @param b1value
* @return
*/
public static BigDecimal div(Number a1value, Number b1value){
//NumberUtil.div(null, 1) 会出现空指针异常
return (a1value == null || b1value == null || new BigDecimal(b1value.toString()).compareTo(BigDecimal.ZERO) == 0) ? null : NumberUtil.div(a1value, b1value);
}
/**
* 保留小数位,并会去掉末尾0,规避科学计数法
* @param value
* @param scale
* @return
*/
public static BigDecimal round(Number value, int scale){
//NumberUtil.round(null) 会返回0,这不合理,并且不会舍弃小数点后的末尾0
if (value == null) {
return null;
}
//stripTrailingZeros:可以去掉末尾0,但是可能会返回科学计数法,比如10:1E+2
//.toPlainString() : 返回非科学技术法的字符串表示
return new BigDecimal(NumberUtil.round(new BigDecimal(value.toString()), scale).stripTrailingZeros().toPlainString());
}
/**
* 保留小数位,[不会]去掉末尾0,规避科学计数法
* @param value
* @param scale
* @return
*/
public static BigDecimal roundContainsEndZero(Number value, int scale){
//NumberUtil.round(null) 会返回0,这不合理,并且不会舍弃小数点后的末尾0
if (value == null) {
return null;
}
//stripTrailingZeros:可以去掉末尾0,但是可能会返回科学计数法,比如10:1E+2
//.toPlainString() : 返回非科学技术法的字符串表示
return new BigDecimal(NumberUtil.round(new BigDecimal(value.toString()), scale).toPlainString());
}
/**
* 保留小数位,[不会]去掉末尾0,规避科学计数法
* @param value
* @param scale
* @return
*/
public static String roundStringContainsEndZero(Number value, int scale){
//NumberUtil.round(null) 会返回0,这不合理,并且不会舍弃小数点后的末尾0
if (value == null) {
return null;
}
//stripTrailingZeros:可以去掉末尾0,但是可能会返回科学计数法,比如10:1E+2
//.toPlainString() : 返回非科学技术法的字符串表示
return NumberUtil.round(new BigDecimal(value.toString()), scale).toPlainString();
}
/**
* 四舍五入 并会去掉末尾0,规避科学计数法(包含小于符号的返回原值)
* @param value
* @param scale
* @return
*/
public static String roundForContainsLessThan(String value, int scale){
if (StringUtils.isBlank(value)) {
return null;
}
if(value.startsWith("<") || value.startsWith("<")){
//包含小于符号:返回原值
return value;
}
//stripTrailingZeros:可以去掉末尾0,但是可能会返回科学计数法,比如10:1E+2
//.toPlainString() : 返回非科学技术法的字符串表示
return NumberUtil.round(new BigDecimal(value), scale).stripTrailingZeros().toPlainString();
}
/**
* 四舍五入 去掉末尾0,规避科学计数法(返回字符串)
* @param value
* @param scale
* @return
*/
public static String roundToString(Number value, int scale){
if (value == null) {
return null;
}
return NumberUtil.round(new BigDecimal(value.toString()), scale).stripTrailingZeros().toPlainString();
}
/**
* 字符串转为数字
* @param s
* @return
*/
public static BigDecimal strToDecimal(String s){
if (s == null) {
return null;
} else {
try {
return new BigDecimal(s);
} catch (Exception e) {
return null;
}
}
}
public static BigDecimal newBigDecimal(String value, BigDecimal defaultValue){
if(value!= null && NumberUtil.isNumber(value)){
return new BigDecimal(value);
}
return defaultValue;
}
}
......@@ -11,7 +11,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......
......@@ -49,6 +49,7 @@ public class ShiroConfig {
filterChainDefinitionMap.put("/sys/logout", "anon"); //登出接口排除
filterChainDefinitionMap.put("/sys/getEncryptedString", "anon"); //获取加密串
filterChainDefinitionMap.put("/sys/sms", "anon");//短信验证码
filterChainDefinitionMap.put("/report/jmReport/*", "anon");//积木报表
filterChainDefinitionMap.put("/sys/phoneLogin", "anon");//手机登录
filterChainDefinitionMap.put("/sys/user/checkOnlyUser", "anon");//校验用户是否存在
filterChainDefinitionMap.put("/sys/user/register", "anon");//用户注册
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!