cjl
2023-10-19 2a4a9ef52b0d76efb9712fd8d4268f658546f99f
Merge remote-tracking branch 'origin/cjl' into qa
1 files added
13 files modified
367 ■■■■■ changed files
screen-api/src/main/java/com/moral/api/controller/MonitorPointController.java 1 ●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/mapper/SysDictTypeMapper.java 3 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/dto/Wind/WindData.java 2 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/enums/SysDictTypeEnum.java 1 ●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/pojo/ext/wind/WindListExt.java 33 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/service/SysDictTypeService.java 2 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/service/impl/HistoryFiveMinutelyServiceImpl.java 254 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/service/impl/MonitorPointServiceImpl.java 35 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/service/impl/SysDictTypeServiceImpl.java 6 ●●●●● patch | view | raw | blame | history
screen-api/src/main/resources/mapper/HistoryFiveMinutelyMapper.xml 2 ●●● patch | view | raw | blame | history
screen-api/src/main/resources/mapper/HistoryHourlyMapper.xml 2 ●●● patch | view | raw | blame | history
screen-api/src/main/resources/mapper/SysDictTypeMapper.xml 12 ●●●●● patch | view | raw | blame | history
screen-job/src/main/java/com/moral/api/service/impl/HistoryHourlyServiceImpl.java 9 ●●●●● patch | view | raw | blame | history
screen-manage/src/main/java/com/moral/api/service/impl/DeviceAdjustValueServiceImpl.java 5 ●●●●● patch | view | raw | blame | history
screen-api/src/main/java/com/moral/api/controller/MonitorPointController.java
@@ -113,6 +113,7 @@
        /*if(monitorPoint.contains("")){
        }*/
        params.put("monitorPointList", monitorPoint);
        String[] monitorPointIds = monitorPoint.split(",");
        if (monitorPointIds.length > 3) {
            return ResultMessage.ok();
screen-api/src/main/java/com/moral/api/mapper/SysDictTypeMapper.java
@@ -18,4 +18,7 @@
public interface SysDictTypeMapper extends BaseMapper<SysDictType> {
    List<SysDictData> selectCodeList(@Param("code") String code, @Param("id") String id);
    List<SysDictData> selectIdList(@Param("code") String code, @Param("ids") List<String> ids);
}
screen-api/src/main/java/com/moral/api/pojo/dto/Wind/WindData.java
@@ -17,4 +17,6 @@
    //风速
    private Double windSpeed;
    private String mac;
}
screen-api/src/main/java/com/moral/api/pojo/enums/SysDictTypeEnum.java
@@ -22,6 +22,7 @@
    SYS_SECOND_CRUISER("ZHC","秒级走航车"),
    WIND_FARM_SCOPE("WIND","风场范围"),
    ;
    @EnumValue
screen-api/src/main/java/com/moral/api/pojo/ext/wind/WindListExt.java
New file
@@ -0,0 +1,33 @@
package com.moral.api.pojo.ext.wind;
import com.moral.api.pojo.vo.file.FileVo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.List;
/**
 * @ClassName WindList
 * @Description TODO
 * @Author @cjl
 * @Date 2023-10-17 9:39
 * @Version 1.0
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class WindListExt {
    @ApiModelProperty(value = "u分量")
    private List<Double> uList;
    @ApiModelProperty(value = "v分量")
    private List<Double> vList;
    @ApiModelProperty(value = "u分量")
    private Double uValue;
    @ApiModelProperty(value = "v分量")
    private Double vValue;
}
screen-api/src/main/java/com/moral/api/service/SysDictTypeService.java
@@ -20,4 +20,6 @@
    List<SysDictData> listAll(String code, String dataKey);
    SysDictData listOne(String code, String dataKey);
    List<SysDictData> listWindAll(String code, List<String> dataKey);
}
screen-api/src/main/java/com/moral/api/service/impl/HistoryFiveMinutelyServiceImpl.java
@@ -3,6 +3,8 @@
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.moral.api.config.Interceptor.UserHelper;
import com.moral.api.config.mybatis.MybatisPlusConfig;
import com.moral.api.entity.*;
import com.moral.api.mapper.DeviceMapper;
@@ -11,11 +13,15 @@
import com.moral.api.mapper.HistoryHourlyMapper;
import com.moral.api.pojo.dto.Wind.WindData;
import com.moral.api.pojo.dto.historyFiveMinutely.DeviceAndFiveMinuteDataDTO;
import com.moral.api.pojo.enums.SysDictTypeEnum;
import com.moral.api.pojo.ext.wind.WindListExt;
import com.moral.api.pojo.form.device.MonitorPointQueryForm;
import com.moral.api.pojo.form.historyFiveMinutely.QueryDeviceAndFiveMinuteDataForm;
import com.moral.api.pojo.vo.user.QxUser;
import com.moral.api.service.DeviceService;
import com.moral.api.service.HistoryFiveMinutelyService;
import com.moral.api.service.MonitorPointService;
import com.moral.api.service.SysDictTypeService;
import com.moral.api.utils.UnitConvertUtils;
import com.moral.constant.Constants;
import com.moral.constant.RedisConstants;
@@ -25,12 +31,15 @@
import com.moral.util.RegionCodeUtils;
import io.lettuce.core.GeoCoordinates;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.*;
import java.util.stream.Collectors;
/**
 * <p>
@@ -57,6 +66,8 @@
    DeviceService deviceService;
    @Autowired
    DeviceMapper deviceMapper;
    @Autowired
    private SysDictTypeService sysDictTypeService;
    @Override
    public List<Map<String, Object>> queryDeviceAndFiveMinuteData(QueryDeviceAndFiveMinuteDataForm form) {
@@ -176,7 +187,7 @@
            //风场数据
            windData = historyFiveMinutelyMapper.getAreaWindData(params);
        }
        return getWindData(windData);
        return getWindData(windData,params);
    }
@@ -309,22 +320,38 @@
        map.put("lat", Lat * 180 / Math.PI);
        return map;
    }
    private int windDate(String ids){
        int num = 200;
        if(StringUtils.isEmpty(ids)){
            return num;
        }
        List<Integer> list = Arrays.asList(ids.split(",")).stream().map(s->Integer.parseInt(s.trim())).collect(Collectors.toList());
        LambdaQueryChainWrapper<MonitorPoint> wrapper = monitorPointService.lambdaQuery();
        wrapper.in(MonitorPoint::getId,list);
        List<MonitorPoint> resultList = wrapper.list();
        if(CollectionUtils.isEmpty(resultList)){
            return num;
        }
        List<String> integerList = resultList.stream().map(s->s.getOrganizationId().toString()).collect(Collectors.toList());
        List<SysDictData> sysDictList = sysDictTypeService.listWindAll(SysDictTypeEnum.WIND_FARM_SCOPE.value,integerList);
        if(CollectionUtils.isEmpty(sysDictList)){
            return num;
        }
        num = sysDictList.stream().mapToInt(s->Integer.parseInt(s.getDataValue())).max().getAsInt();
        return num;
    }
    public List<Object> getWindData(List<WindData> windData) {
    public List<Object> getWindData(List<WindData> windData,Map<String, Object> params) {
        List<GeoCoordinates> points = new ArrayList<>();
        int length = 2000;
        int perdlen = 200;
        Double loma = 0d;
        Double lomi = 0d;
        Double lama = 0d;
        Double lami = 0d;
        List<Double> loList = new ArrayList<>();
        List<Double> laList = new ArrayList<>();
        List<Map<String, Object>> mapList = new ArrayList<>();
        Double U;
        Double V;
        //结果集
        List<Object> list = new ArrayList<>();
        List<Map<String, Object>> mapList = new ArrayList<>();
        for (WindData data : windData) {
            //经度
            Double longitude = data.getLongitude();
@@ -353,6 +380,7 @@
            map.put("la", latitude);
            map.put("U", U);
            map.put("V", V);
            map.put("mac", data.getMac());
            mapList.add(map);
        }
@@ -372,6 +400,11 @@
        laLaMap.put("minLo", lomi);
        laLaMap.put("maxLa", lama);
        laLaMap.put("minLa", lami);
        int perdlen = windDate(Objects.nonNull(params.get("monitorPointList"))?params.get("monitorPointList").toString():null);
        int length = perdlen*10;
        Double lo1 = lomi - length * 0.00001141;
       //Double lo1 = lomi - length * 0.000001141 * 2;
        Double lo2 = loma + length * 0.00001141;
@@ -392,23 +425,27 @@
        int nums = Objects.nonNull(nx*ny)?nx*ny+100:100;
        List<Double> uList = new ArrayList<>(nums);
        List<Double> vList = new ArrayList<>(nums);
        for (int j = 0; j < nx * ny; j++) {
            uList.add(0.0);
            vList.add(0.0);
        }
        int x;
        int y;
        for (int i = 0; i < mapList.size(); i++) {
            Double lo = (Double) mapList.get(i).get("lo");
            Double la = (Double) mapList.get(i).get("la");
            x = (int) Math.floor((lo - lo1) / dx);
            y = Math.abs((int) Math.floor((la - la1) / dy));
            U = (Double) mapList.get(i).get("U");
            V = (Double) mapList.get(i).get("V");
            if (i == 0) {
                for (int j = 0; j < nx * ny; j++) {
                    uList.add(0.0);
                    vList.add(0.0);
                }
            }
            // 微动风场
           /* WindListExt windListExt = getWindList(mapList.get(i),loList,laList,500,50);
            if(Objects.nonNull(windListExt)&&Objects.nonNull(windListExt.getUValue()) ){
                U = windListExt.getUValue();
                V = windListExt.getVValue();
            }*/
            for (int j = 0; j < nx * ny; j++) {
                if (i == 0) {
                    if ((y >= 2 && j == (y) * nx + x)) {
@@ -446,8 +483,21 @@
                }
            }
        }
        /*WindListExt windList = getWindList(length,perdlen,params);
        for(int i =0; i< windList.getUList().size(); i++){
            Double d = windList.getUList().get(i);
            if(Objects.nonNull(d)&& (!d.equals(0d))){
                uList.set(i,d);
            }
        }
        for(int i =0; i< windList.getVList().size(); i++){
            Double d = windList.getVList().get(i);
            if(Objects.nonNull(d)&& (!d.equals(0d))){
                vList.set(i,d);
            }
        }*/
        /*//结果集
        List<Object> list = new ArrayList<>();
        String uData = "\"" + "data" + "\"" + ": " + uList;
        String vData = "\"" + "data" + "\"" + ": " + vList;
@@ -471,7 +521,175 @@
        list.add(jsonArray);
        list.add(centerPoint.get("lng"));
        list.add(centerPoint.get("lat"));
        list.add(laLaMap);
        list.add(laLaMap);*/
        Map<String,Object> map = new HashMap<>();
        map.put("uList",uList);
        map.put("vList",vList);
        map.put("dx",dx);
        map.put("dy",dy);
        map.put("nx",nx);
        map.put("ny",ny);
        map.put("la1",la1);
        map.put("la2",la2);
        map.put("lo1",lo1);
        map.put("lo2",lo2);
        map.put("laLaMap",laLaMap);
        return getWindData(map,centerPoint);
    }
    private WindListExt getWindList(int length,int perdlen,Map<String, Object> params){
        params.put("time","2023-10-16 04:00");
        String time = params.get("time").toString();
        String timeUnits = DateUtils.stringToDateString(time, "yyyy-MM-dd HH:mm", DateUtils.yyyyMM_EN);
        params.put("timeUnits", timeUnits);
        List<WindData> windData = historyHourlyMapper.getArea(params);
        WindListExt windListExt = new WindListExt();
        List<String> stringList = Arrays.asList("p5dnd7a0245400","p5dnd7a0245472","p5dnd7a0245374","p5dnd7a0245385");
        List<GeoCoordinates> points = new ArrayList<>();
        Double loma = 0d;
        Double lomi = 0d;
        Double lama = 0d;
        Double lami = 0d;
        List<Double> loList = new ArrayList<>();
        List<Double> laList = new ArrayList<>();
        List<Map<String, Object>> mapList = new ArrayList<>();
        Double U = 0d;
        Double V = 0d;
        for (WindData data : windData) {
            //经度
            Double longitude = data.getLongitude();
            //纬度
            Double latitude = data.getLatitude();
            GeoCoordinates geoCoordinates = GeoCoordinates.create(longitude, latitude);
            points.add(geoCoordinates);
            loList.add(longitude);
            laList.add(latitude);
            Map<String, Object> map = new HashMap<>();
            //风向
            Double windDir = data.getWindDir();
            //风速
            Double windSpeed = data.getWindSpeed();
            if (windDir == null) {
                windDir = 0d;
                windSpeed = 0d;
            }
            double dir = (360.0 - (windDir + 180.0) * Math.PI / 180.0);
            //余弦值
            U = windSpeed * Math.cos(dir);
            //三角正弦值
            V = windSpeed * Math.sin(dir);
            if(stringList.contains(data.getMac())){
                map.put("lo", longitude);
                map.put("la", latitude);
                map.put("U", U);
                map.put("V", V);
                map.put("mac", data.getMac());
                mapList.add(map);
            }
        }
        if (loList.size() > 0) {
            loma = Collections.max(loList);
            lomi = Collections.min(loList);
        }
        if (laList.size() > 0) {
            lama = Collections.max(laList);
            lami = Collections.min(laList);
        }
        Double lo1 = lomi - length * 0.00001141;
        Double lo2 = loma + length * 0.00001141;
        Double la2 = lami - length * 0.00000899;
        Double la1 = lama + length * 0.00000899;
        double dx = 0.00001141 * perdlen;
        double dy = 0.00000899 * perdlen;
        int nx = (int) Math.floor((lo2 - lo1) / dx);
        int ny = (int) Math.floor((la1 - la2) / dy);
        int nums = Objects.nonNull(nx*ny)?nx*ny+100:100;
        List<Double> uList = new ArrayList<>(nums);
        List<Double> vList = new ArrayList<>(nums);
        for (int j = 0; j < nx * ny; j++) {
            uList.add(0.0);
            vList.add(0.0);
        }
        int x;
        int y;
        for (int i = 0; i < mapList.size(); i++) {
            Double lo = (Double) mapList.get(i).get("lo");
            Double la = (Double) mapList.get(i).get("la");
            x = (int) Math.floor((lo - lo1) / dx);
            y = Math.abs((int) Math.floor((la - la1) / dy));
            U = (Double) mapList.get(i).get("U");
            V = (Double) mapList.get(i).get("V");
            for (int j = 0; j < nx * ny; j++) {
                if (i == 0) {
                    if ((y >= 2 && j == (y) * nx + x)) {
                        int k;
                        for (k = j - 2 * nx; k <= j + 2 * nx; k = k + nx) {
                            uList.set(k, U);
                            uList.set(k - 1, U);
                            uList.set(k - 2, U);
                            uList.set(k + 1, U);
                            uList.set(k + 2, U);
                            vList.set(k, V);
                            vList.set(k - 1, V);
                            vList.set(k - 2, V);
                            vList.set(k + 1, V);
                            vList.set(k + 2, V);
                        }
                    }
                } else {
                    if (y >= 1 && j == y * nx + x) {
                        int k;
                        for (k = j - 2 * nx; k <= j + 2 * nx; ) {
                            uList.set(k - 1, U);
                            uList.set(k - 2, U);
                            uList.set(k + 1, U);
                            uList.set(k + 2, U);
                            vList.set(k - 1, V);
                            vList.set(k - 2, V);
                            vList.set(k + 1, V);
                            vList.set(k + 2, V);
                            k = k + nx;
                        }
                        uList.set(j, U);
                        vList.set(j, V);
                    }
                }
            }
        }
        windListExt.setUList(uList);
        windListExt.setVList(vList);
        return windListExt;
    }
    private List<Object> getWindData(Map<String,Object> map, Map<String, Double> centerPoint){
        List<Object> list = new ArrayList<>();
        String uData = "\"" + "data" + "\"" + ": " + map.get("uList");
        String vData = "\"" + "data" + "\"" + ": " + map.get("vList");
        String header1 = "\"" + "header" + "\"" + ": " + "{" + "\"" + "parameterUnit" + "\"" + ": " + "\"" + "m/s" + "\"" + ", " + "\"" + "parameterNumber" + "\"" + ": " + 2 +
                ", " + "\"" + "dx" + "\"" + ": " + map.get("dx") + ", " + "\"" + "dy" + "\"" + ": " + map.get("dy") +
                ", " + "\"" + "parameterNumberName" + "\"" + ": " + "\"" + "eastward_wind" + "\"" + ", " + "\"" + "la1" + "\"" + ": " + map.get("la1") + ", " + "\"" + "la2" + "\"" + ": " + map.get("la2") +
                ", " + "\"" + "parameterCategory" + "\"" + ": " + 2 + ", " + "\"" + "lo1" + "\"" + ": " + map.get("lo1") + ", " + "\"" + "lo2" + "\"" + ": " + map.get("lo2") +
                ", " + "\"" + "nx" + "\"" + ": " + map.get("nx") + ", " + "\"" + "ny" + "\"" + ": " + map.get("ny") + ", " + "\"" + "refTime" + "\"" + ": " + "\"" + "2020-07-22 23:00:00" + "\"" + "}";
        String header2 = "\"" + "header" + "\"" + ": " + "{" + "\"" + "parameterUnit" + "\"" + ": " + "\"" + "m/s" + "\"" + ", " + "\"" + "parameterNumber" + "\"" + ": " + 3 +
                ", " + "\"" + "dx" + "\"" + ": " + map.get("dx") + ", " + "\"" + "dy" + "\"" + ": " + map.get("dy") +
                ", " + "\"" + "parameterNumberName" + "\"" + ": " + "\"" + "eastward_wind" + "\"" + ", " + "\"" + "la1" + "\"" + ": " + map.get("la1") + ", " + "\"" + "la2" + "\"" + ": " + map.get("la2") +
                ", " + "\"" + "parameterCategory" + "\"" + ": " + 2 + ", " + "\"" + "lo1" + "\"" + ": " + map.get("lo1") + ", " + "\"" + "lo2" + "\"" + ": " + map.get("lo2") +
                ", " + "\"" + "nx" + "\"" + ": " + map.get("nx") + ", " + "\"" + "ny" + "\"" + ": " + map.get("ny") + ", " + "\"" + "refTime" + "\"" + ": " + "\"" + "2020-07-22 23:00:00" + "\"" + "}";
        String s1 = "[" + "{" + header1 + ", " + uData + "}" + ", " + "{" + header2 + ", " + vData + "}" + "]";
        //System.out.println(s1);
        JSONArray jsonArray = JSONArray.parseArray(s1);
        list.add(jsonArray);
        list.add(centerPoint.get("lng"));
        list.add(centerPoint.get("lat"));
        list.add(map.get("laLaMap"));
        return list;
    }
screen-api/src/main/java/com/moral/api/service/impl/MonitorPointServiceImpl.java
@@ -524,6 +524,37 @@
        if(CollectionUtils.isEmpty(historyDailyByMacAndTimeSlot)){
            return list;
        }
        //海城分组均值  海州 p5dnd7a0000001 -响堂 p5dnd7a0000002 -兴海 p5dnd7a0000003
        List<String> hzRoad = Arrays.asList("p5dnd7a0245491","p5dnd7a0392159","p5dnd7a0243605","p5dnd7a0392176");
        List<String> xtRoad = Arrays.asList("p5dnd7a0243603","p5dnd7a0391986","p5dnd7a0392003","p5dnd7a0392144","p5dnd7a0392167","p5dnd7a0391990");
        List<String> xhRoad = Arrays.asList("p5dnd7a0392158","p5dnd7a0392173","p5dnd7a0391975","p5dnd7a0392153","p5dnd7a0391961","p5dnd7a0243608","p5dnd7a0243618");
        List<HistoryDaily> hcHz= new ArrayList<>();
        List<HistoryDaily> xtHz= new ArrayList<>();
        List<HistoryDaily> xhHz= new ArrayList<>();
        for(HistoryDaily h : historyDailyByMacAndTimeSlot) {
            HistoryDaily historyDaily = new HistoryDaily();
            historyDaily.setTime( h.getTime());
            historyDaily.setValue(h.getValue());
            if(hzRoad.contains(h.getMac())){
                historyDaily.setMac("p5dnd7a0000001");
                hcHz.add(historyDaily);
            }else if(xtRoad.contains(h.getMac())){
                historyDaily.setMac("p5dnd7a0000002");
                xtHz.add(historyDaily);
            }else if(xhRoad.contains(h.getMac())){
                historyDaily.setMac("p5dnd7a0000003");
                xhHz.add(historyDaily);
            }
        }
        if(CollectionUtils.isNotEmpty(hcHz)){
            historyDailyByMacAndTimeSlot.addAll(hcHz);
        }
        if(CollectionUtils.isNotEmpty(xtHz)){
            historyDailyByMacAndTimeSlot.addAll(xtHz);
        }
        if(CollectionUtils.isNotEmpty(xhHz)){
            historyDailyByMacAndTimeSlot.addAll(xhHz);
        }
        Map<String,Map<String,ArrayList<Double>>> resultMap = new HashMap<>();
        for(HistoryDaily h : historyDailyByMacAndTimeSlot) {
            JSONObject jsonObject = JSONObject.parseObject(h.getValue());
@@ -657,7 +688,9 @@
        wrapper.eq(Device::getIsDelete,0);
        Map<String,String> deviceMap =  new HashMap<>();
        wrapper.list().forEach(it->deviceMap.put(it.getMac(),it.getName()));
        deviceMap.put("p5dnd7a0000001","海州街道均值");
        deviceMap.put("p5dnd7a0000002","响堂街道均值");
        deviceMap.put("p5dnd7a0000003","兴海街道均值");
        for (MonitoringStationDTO m :compositeListResult ){
            MonitoringStationDTO monit = new MonitoringStationDTO();
            String mac = m.getMac();
screen-api/src/main/java/com/moral/api/service/impl/SysDictTypeServiceImpl.java
@@ -37,4 +37,10 @@
        sysDictData.setDataValue("0");
        return sysDictData;
    }
    @Override
    public List<SysDictData> listWindAll(String code, List<String> dataKey) {
        List<SysDictData> listAll = this.baseMapper.selectIdList(code,dataKey);
        return listAll;
    }
}
screen-api/src/main/resources/mapper/HistoryFiveMinutelyMapper.xml
@@ -6,7 +6,7 @@
    <select id="getAreaWindData" resultType="com.moral.api.pojo.dto.Wind.WindData">
        SELECT
        d.longitude AS longitude,
        d.latitude AS latitude,
        d.latitude AS latitude,d.mac,
        CASE WHEN
        h.value->'$.a01007' = 0 THEN 0.1 ELSE h.value->'$.a01007' END AS windSpeed,
        h.value->'$.a01008' AS windDir
screen-api/src/main/resources/mapper/HistoryHourlyMapper.xml
@@ -38,7 +38,7 @@
    <select id="getArea" resultType="com.moral.api.pojo.dto.Wind.WindData">
        SELECT
        d.longitude AS longitude,
        d.latitude AS latitude,
        d.latitude AS latitude,d.mac,
        CASE WHEN
        h.value->'$.a01007' = 0 THEN 0.1 ELSE h.value->'$.a01007' END AS windSpeed,
        h.value->'$.a01008' AS windDir
screen-api/src/main/resources/mapper/SysDictTypeMapper.xml
@@ -18,4 +18,16 @@
        where t.is_delete = 0 and t.name = #{code} and t1.dataKey = #{id} and t1.is_delete = 0
        order by t1.create_time desc
    </select>
    <select id="selectIdList" resultType="com.moral.api.entity.SysDictData">
        select DISTINCT t1.id,t1.dict_type_id,t1.dataKey,t1.dataValue from sys_dict_type t
        left join sys_dict_data t1 on t1.dict_type_id = t.id
        where t.is_delete = 0 and t.name = #{code} and
        t1.dataKey in
        <foreach collection="ids" item="id" index="index" open="(" close=")" separator=",">
            #{id}
        </foreach>
         and t1.is_delete = 0
        order by t1.create_time desc
    </select>
</mapper>
screen-job/src/main/java/com/moral/api/service/impl/HistoryHourlyServiceImpl.java
@@ -661,6 +661,15 @@
        return  "##"+s+result+s1+"\r\n";
    }
    public static void main(String[] args) {
        String result = "QN=20231019000100001;ST=31;CN=2051;PW=123456;MN=P5DND7A0392082;Flag=4;CP=&&DataTime=20231019000100;a01001-Avg=25.0,a01001-Flag=N;a01002-Avg=61.0,a01002-Flag=N;a34004-Avg=19.3,a34004-Flag=N;a34002-Avg=38.5,a34002-Flag=N;a34001-Avg=41.2,a34001-Flag=N;a01007-Avg=0.00,a01007-Flag=N;a01008-Avg=137.53,a01008-Flag=N;a01006-Avg=4255.774,a01006-Flag=T;a00e13-Avg=39.2,a00e13-Flag=N&&";
        String s = Crc16Utils.padLeftTest(String.valueOf(result.length()),4,null);
        String s1 = Crc16Utils.crc16_2017(result, result.length());
        System.out.println("##"+s+result+s1+"\r\n");
        int i = 0;
    }
    private static String sendSocket(String host, Integer port, String message) {
        log.debug("请求地址:{},端口:{},报文:{}", host, port, message);
        Socket socket = null;
screen-manage/src/main/java/com/moral/api/service/impl/DeviceAdjustValueServiceImpl.java
@@ -324,6 +324,7 @@
    @Transactional
    public Map<String, Object> updateAllAdjust(List<AdjustForm> paras) {
        Map<String,Object> resultMap = new HashMap<>();
        StringBuffer buffer = new StringBuffer();
        for (AdjustForm adjustForm : paras) {
            DeviceAdjustValue deviceAdjustValue = new DeviceAdjustValue();
            QueryWrapper<DeviceAdjustValue> wrapper1 = new QueryWrapper<>();
@@ -346,12 +347,16 @@
                deviceAdjustValue.setId(adjustForm.getId());
                deviceAdjustValueMapper.updateById(deviceAdjustValue);
            }
            buffer.append("mac: "+adjustForm.getMac()).append(", value: "+adjustForm.getAgehou()+"; ");
            //刷新缓存
            refreshCache(adjustForm.getMac());
        }
        resultMap.put("code",ResponseCodeEnum.SUCCESS.getCode());
        resultMap.put("msg",ResponseCodeEnum.SUCCESS.getMsg());
        //插入日志
        HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
        LogUtils.saveOperationForManage(request,"批量修改效准值: "+buffer.toString(),Constants.UPDATE_OPERATE_TYPE);
        return resultMap;
    }