riku
2021-07-12 d978297ae85b2d7453054e616bbbe87bfabe9cbe
1. 新增用电量数据查询接口
2. 调整污染权重算法
已修改19个文件
已添加5个文件
695 ■■■■ 文件已修改
src/main/kotlin/com/flightfeather/uav/common/utils/DateUtil.kt 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/domain/entity/CompanyDevice.java 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/domain/entity/ExpandFun.kt 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/domain/mapper/CompanyDeviceMapper.kt 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/lightshare/bean/DataVo.kt 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/lightshare/service/CompanyService.kt 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/lightshare/service/ElectricityService.kt 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/lightshare/service/RealTimeDataService.kt 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/CompanyServiceImpl.kt 59 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/ElectricityServiceImpl.kt 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/RealTimeDataServiceImpl.kt 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/lightshare/web/CompanyController.kt 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/lightshare/web/ElectricityController.kt 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/model/BaseModel.kt 83 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/model/epw/EPWDataPrep.kt 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/model/epw/EPWModel.kt 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/model/epw/WindDirWeight.kt 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/model/epw/WindDisWeight.kt 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/socket/decoder/ElectricDataDecoder.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/generator/generatorConfig.xml 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/log4j2.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/CompanyDeviceMapper.xml 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/RealTimeDataServiceImplTest.kt 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/test/kotlin/com/flightfeather/uav/model/epw/EPWModelTest.kt 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/com/flightfeather/uav/common/utils/DateUtil.kt
@@ -5,7 +5,24 @@
import java.text.SimpleDateFormat
import java.util.*
class DateUtil {
class DateUtil private constructor(){
    companion object {
        @Volatile
        private var dateUtil: DateUtil? = null
        @JvmStatic
        val instance: DateUtil
        get() {
            if (dateUtil == null) {
                synchronized(DateUtil::class.java) {
                    dateUtil = DateUtil()
                }
            }
            return dateUtil!!
        }
    }
    private val threadLocal = ThreadLocal<SimpleDateFormat>()
    private val `object` = Any()
@@ -61,7 +78,7 @@
        if (dateStyle != null) {
            var myDate = StringToDate(date, dateStyle)
            myDate = addInteger(myDate, dateType, amount)
            dateString = DateToString(myDate, dateStyle)
            dateString = dateToString(myDate, dateStyle)
        }
        return dateString
    }
@@ -259,7 +276,7 @@
    fun LongToString(millisecondStamp: Long?, dateStyle: DateStyle?): String? {
        var dateString: String? = null
        if (dateStyle != null) {
            dateString = DateToString(Date(millisecondStamp!!), dateStyle.value)
            dateString = dateToString(Date(millisecondStamp!!), dateStyle.value)
        }
        return dateString
    }
@@ -270,7 +287,7 @@
     * @param pattern æ—¥æœŸæ ¼å¼
     * @return æ—¥æœŸå­—符串
     */
    fun DateToString(date: Date?, pattern: String): String? {
    fun dateToString(date: Date?, pattern: String): String? {
        var dateString: String? = null
        if (date != null) {
            try {
@@ -287,10 +304,10 @@
     * @param dateStyle æ—¥æœŸé£Žæ ¼
     * @return æ—¥æœŸå­—符串
     */
    fun DateToString(date: Date?, dateStyle: DateStyle?): String? {
    fun dateToString(date: Date?, dateStyle: DateStyle?): String? {
        var dateString: String? = null
        if (dateStyle != null) {
            dateString = DateToString(date, dateStyle.value)
            dateString = dateToString(date, dateStyle.value)
        }
        return dateString
    }
@@ -325,7 +342,7 @@
     * @return æ–°æ—¥æœŸå­—符串
     */
    fun StringToString(date: String, olddPattern: String, newPattern: String): String? {
        return DateToString(StringToDate(date, olddPattern), newPattern)
        return dateToString(StringToDate(date, olddPattern), newPattern)
    }
    /**
@@ -616,7 +633,7 @@
     * @return æ—¥æœŸ
     */
    fun getDate(date: Date?): String? {
        return DateToString(date, DateStyle.YYYY_MM_DD)
        return dateToString(date, DateStyle.YYYY_MM_DD)
    }
    /**
@@ -634,7 +651,7 @@
     * @return æ—¶é—´
     */
    fun getTime(date: Date): String? {
        return DateToString(date, DateStyle.HH_MM_SS)
        return dateToString(date, DateStyle.HH_MM_SS)
    }
    /**
src/main/kotlin/com/flightfeather/uav/domain/entity/CompanyDevice.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,58 @@
package com.flightfeather.uav.domain.entity;
import javax.persistence.*;
@Table(name = "el_company_device")
public class CompanyDevice {
    @Id
    @Column(name = "CD_Id")
    private Integer cdId;
    @Column(name = "CD_Company_Id")
    private String cdCompanyId;
    @Column(name = "CD_Device_Code")
    private String cdDeviceCode;
    /**
     * @return CD_Id
     */
    public Integer getCdId() {
        return cdId;
    }
    /**
     * @param cdId
     */
    public void setCdId(Integer cdId) {
        this.cdId = cdId;
    }
    /**
     * @return CD_Company_Id
     */
    public String getCdCompanyId() {
        return cdCompanyId;
    }
    /**
     * @param cdCompanyId
     */
    public void setCdCompanyId(String cdCompanyId) {
        this.cdCompanyId = cdCompanyId == null ? null : cdCompanyId.trim();
    }
    /**
     * @return CD_Device_Code
     */
    public String getCdDeviceCode() {
        return cdDeviceCode;
    }
    /**
     * @param cdDeviceCode
     */
    public void setCdDeviceCode(String cdDeviceCode) {
        this.cdDeviceCode = cdDeviceCode == null ? null : cdDeviceCode.trim();
    }
}
src/main/kotlin/com/flightfeather/uav/domain/entity/ExpandFun.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,95 @@
package com.flightfeather.uav.domain.entity
import com.flightfeather.uav.common.utils.DateUtil
import com.flightfeather.uav.common.utils.GsonUtils
import com.flightfeather.uav.socket.bean.AirData
/**
 * æ•°æ®åº“表实体扩展方法
 */
fun RealTimeData.toRowTitle(): Array<String> {
    val list = mutableListOf<String>()
    list.add("编号")
    list.add("采样时间")
    list.add("经度")
    list.add("纬度")
    val values = GsonUtils.parserJsonToArrayBeans(factors, AirData::class.java)
    values.forEach {
        val name = it.factorName ?: ""
        list.add(name)
        list.add("$name(物理量)")
    }
    return list.toTypedArray()
}
fun RealTimeData.toRowContent(): Array<Any> {
    val row = mutableListOf<Any>()
    row.add(deviceCode ?: "")
    row.add(DateUtil.instance.dateToString(dataTime, "yyyy-MM-dd HH:mm:ss") ?: "")
    if (longitude == null) {
        row.add(-1.0)
    } else {
        row.add(longitude.toDouble())
    }
    if (latitude == null) {
        row.add(-1.0)
    } else {
        row.add(latitude.toDouble())
    }
    val values = GsonUtils.parserJsonToArrayBeans(factors, AirData::class.java)
    values.forEach {
        row.add(it.factorData ?: -1.0)
        row.add(it.physicalQuantity ?: -1.0)
    }
    return row.toTypedArray()
}
fun ElectricMinuteValue.toAirData(): List<AirData> {
    return listOf(
        AirData().apply {
            factorId = "1"
            factorName = "EA"
            factorData = mvElectricityA
        },
        AirData().apply {
            factorId = "2"
            factorName = "EB"
            factorData = mvElectricityB
        },
        AirData().apply {
            factorId = "3"
            factorName = "EC"
            factorData = mvElectricityC
        },
        AirData().apply {
            factorId = "4"
            factorName = "VA"
            factorData = mvVoltageA
        },
        AirData().apply {
            factorId = "5"
            factorName = "VB"
            factorData = mvVoltageB
        },
        AirData().apply {
            factorId = "6"
            factorName = "VC"
            factorData = mvVoltageC
        },
        AirData().apply {
            factorId = "7"
            factorName = "PA"
            factorData = mvPowerA
        },
        AirData().apply {
            factorId = "8"
            factorName = "PB"
            factorData = mvPowerB
        },
        AirData().apply {
            factorId = "9"
            factorName = "PC"
            factorData = mvPowerC
        },
    )
}
src/main/kotlin/com/flightfeather/uav/domain/mapper/CompanyDeviceMapper.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
package com.flightfeather.uav.domain.mapper
import com.flightfeather.uav.domain.MyMapper
import com.flightfeather.uav.domain.entity.CompanyDevice
import org.apache.ibatis.annotations.Mapper
@Mapper
interface CompanyDeviceMapper : MyMapper<CompanyDevice?>
src/main/kotlin/com/flightfeather/uav/lightshare/bean/DataVo.kt
@@ -31,4 +31,31 @@
                }
                return null
        }
        fun toRowContent(): Array<Any> {
                val row = mutableListOf<Any>()
                row.add(deviceCode ?: "")
                row.add(time ?: "")
                row.add(lng ?: -1.0)
                row.add(lat ?: -1.0)
                values?.forEach {
                        row.add(it.factorData ?: -1.0)
                        row.add(it.physicalQuantity ?: -1.0)
                }
                return row.toTypedArray()
        }
        fun toRowTitle(): Array<String> {
                val list = mutableListOf<String>()
                list.add("编号")
                list.add("采样时间")
                list.add("经度")
                list.add("纬度")
                values?.forEach {
                        val name = it.factorName ?: ""
                        list.add(name)
                        list.add("$name(物理量)")
                }
                return list.toTypedArray()
        }
}
src/main/kotlin/com/flightfeather/uav/lightshare/service/CompanyService.kt
@@ -2,9 +2,21 @@
import com.flightfeather.uav.domain.entity.Company
import com.flightfeather.uav.lightshare.bean.BaseResponse
import com.flightfeather.uav.lightshare.bean.DataVo
import com.flightfeather.uav.model.BaseModel
interface CompanyService {
    fun getCompanyInfo(): BaseResponse<List<Company>>
    fun getCompany(cId: String): BaseResponse<Company>
    /**
     * è®¡ç®—污染源的污染权重影响
     */
    fun getEpwModelResult(
        deviceCode: String,
        startTime: String,
        endTime: String,
        companyIds: List<String>? = null
    ): BaseResponse<MutableMap<String, MutableMap<String, MutableMap<String, BaseModel.ResultCell>>>>
}
src/main/kotlin/com/flightfeather/uav/lightshare/service/ElectricityService.kt
@@ -2,8 +2,13 @@
import com.flightfeather.uav.domain.entity.ElectricMinuteValue
import com.flightfeather.uav.lightshare.bean.BaseResponse
import com.flightfeather.uav.lightshare.bean.DataVo
interface ElectricityService {
    fun getMinuteData(deviceCode: String, startTime: String?, endTime: String?, page: Int?, perPage: Int?): BaseResponse<List<ElectricMinuteValue>>
    fun getMinuteData2(deviceCode: String, startTime: String?, endTime: String?, page: Int?, perPage: Int?): BaseResponse<List<DataVo>>
    fun getByCompany(cId:String):BaseResponse<List<ElectricMinuteValue>>
}
src/main/kotlin/com/flightfeather/uav/lightshare/service/RealTimeDataService.kt
@@ -3,7 +3,9 @@
import com.flightfeather.uav.lightshare.bean.BaseResponse
import com.flightfeather.uav.lightshare.bean.DataImportResult
import com.flightfeather.uav.lightshare.bean.DataVo
import org.apache.poi.hssf.usermodel.HSSFWorkbook
import org.springframework.web.multipart.MultipartFile
import javax.servlet.http.HttpServletResponse
interface RealTimeDataService {
@@ -12,4 +14,8 @@
    fun getNextData(deviceCode: String, updateTime: String, page: Int?, perPage: Int?): BaseResponse<List<DataVo>>
    fun importData(file: MultipartFile): BaseResponse<DataImportResult>
    fun outToWorkbook(deviceCode: String, startTime: String, endTime: String): HSSFWorkbook
    fun outToExcel(deviceCode: String, startTime: String, endTime: String, response: HttpServletResponse): HttpServletResponse
}
src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/CompanyServiceImpl.kt
@@ -3,14 +3,71 @@
import com.flightfeather.uav.domain.entity.Company
import com.flightfeather.uav.domain.mapper.CompanyMapper
import com.flightfeather.uav.lightshare.bean.BaseResponse
import com.flightfeather.uav.lightshare.bean.CompanySOP
import com.flightfeather.uav.lightshare.service.CompanyService
import com.flightfeather.uav.lightshare.service.RealTimeDataService
import com.flightfeather.uav.model.BaseModel
import com.flightfeather.uav.model.epw.EPWModel
import org.springframework.beans.BeanUtils
import org.springframework.stereotype.Service
import tk.mybatis.mapper.entity.Example
@Service
class CompanyServiceImpl(private val companyMapper: CompanyMapper) : CompanyService {
class CompanyServiceImpl(
    private val companyMapper: CompanyMapper, private val realTimeDataService: RealTimeDataService) : CompanyService {
    override fun getCompanyInfo(): BaseResponse<List<Company>> {
        val result = companyMapper.selectAll()
        return BaseResponse(true, data = result)
    }
    override fun getCompany(cId: String): BaseResponse<Company> {
        companyMapper.selectByPrimaryKey(cId)?.let {
            return BaseResponse(true, data = it)
        }
        return BaseResponse(false, "企业id不存在")
    }
    override fun getEpwModelResult(
        deviceCode: String,
        startTime: String,
        endTime: String,
        companyIds: List<String>?
    ): BaseResponse<MutableMap<String, MutableMap<String, MutableMap<String, BaseModel.ResultCell>>>> {
        val company = if (companyIds == null) {
            companyMapper.selectAll()
        } else {
            companyMapper.selectByExample(Example(Company::class.java).apply {
                createCriteria().apply {
                    companyIds.forEach { orEqualTo("ciGuid", it) }
                }
            })
        }
        val companySOPList = mutableListOf<CompanySOP>()
        company.forEach {
            val companySOP = CompanySOP(it.ciGuid, it.ciName, it.ciExtension1)
            BeanUtils.copyProperties(it, companySOP)
            companySOPList.add(companySOP)
        }
        val epwModel = EPWModel()
        // TODO: 2021/7/6 éƒ¨åˆ†è®¾å¤‡æ˜¯å›ºå®šç‚¹ç›‘测设备,不会移动,因此数据中没有经纬度,需要额外设置监测点经纬度
//        epwModel.defaultLocation =
        var page = 1
        var totalPage = -1
        while (totalPage == -1 || page <= totalPage) {
            realTimeDataService.getSecondData(deviceCode, startTime, endTime, page, 5000).apply {
                if (totalPage == -1) {
                    totalPage = head?.totalPage ?: 0
                }
                val dataList = data?: emptyList()
                epwModel.execute(dataList, companySOPList, true)
                page++
            }
        }
        val r = epwModel.outputResult()
        return BaseResponse(true, data = r)
    }
}
src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/ElectricityServiceImpl.kt
@@ -1,17 +1,25 @@
package com.flightfeather.uav.lightshare.service.impl
import com.flightfeather.uav.common.utils.DateUtil
import com.flightfeather.uav.domain.entity.CompanyDevice
import com.flightfeather.uav.domain.entity.ElectricMinuteValue
import com.flightfeather.uav.domain.entity.toAirData
import com.flightfeather.uav.domain.mapper.CompanyDeviceMapper
import com.flightfeather.uav.domain.mapper.ElectricMinuteValueMapper
import com.flightfeather.uav.lightshare.bean.BaseResponse
import com.flightfeather.uav.lightshare.bean.DataHead
import com.flightfeather.uav.lightshare.bean.DataVo
import com.flightfeather.uav.lightshare.service.ElectricityService
import com.flightfeather.uav.socket.bean.AirData
import com.github.pagehelper.PageHelper
import org.springframework.stereotype.Service
import tk.mybatis.mapper.entity.Example
import java.text.SimpleDateFormat
@Service
class ElectricityServiceImpl(private val electricMinuteValueMapper: ElectricMinuteValueMapper) : ElectricityService {
class ElectricityServiceImpl(
    private val electricMinuteValueMapper: ElectricMinuteValueMapper, private val companyDeviceMapper: CompanyDeviceMapper
) : ElectricityService {
    private var dateFormatter = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
@@ -37,4 +45,37 @@
        }
        return BaseResponse(true, head = DataHead(pageInfo.pageNum, pageInfo.pages), data = result)
    }
    override fun getMinuteData2(deviceCode: String, startTime: String?, endTime: String?, page: Int?, perPage: Int?): BaseResponse<List<DataVo>> {
        val result = mutableListOf<DataVo>()
        getMinuteData(deviceCode, startTime, endTime, page, perPage).run {
            data?.forEach {
                result.add(DataVo(
                    DateUtil.instance.dateToString(it.mvDataTime, DateUtil.DateStyle.YYYY_MM_DD_HH_MM_SS),
                    it.mvStatCode,
                    it.toAirData()
                ))
            }
            return BaseResponse(success, head = head, data = result)
        }
    }
    override fun getByCompany(cId: String): BaseResponse<List<ElectricMinuteValue>> {
        val result = mutableListOf<ElectricMinuteValue>()
        companyDeviceMapper.selectByExample(Example(CompanyDevice::class.java).apply {
            createCriteria().andEqualTo("cdCompanyId", cId)
        }).forEach {
            val p = PageHelper.startPage<ElectricMinuteValue>(1, 1)
            electricMinuteValueMapper.selectByExample(Example(ElectricMinuteValue::class.java).apply {
                createCriteria().andEqualTo("mvStatCode", it?.cdDeviceCode)
                orderBy("mvDataTime").desc()
            })?.let {
                if (it.isNotEmpty()) {
                    it[0]?.let {e-> result.add(e) }
                }
            }
        }
        return BaseResponse(true, data = result)
    }
}
src/main/kotlin/com/flightfeather/uav/lightshare/service/impl/RealTimeDataServiceImpl.kt
@@ -1,16 +1,17 @@
package com.flightfeather.uav.lightshare.service.impl
import com.flightfeather.uav.common.utils.ExcelUtil
import com.flightfeather.uav.common.utils.FileExchange
import com.flightfeather.uav.common.utils.GsonUtils
import com.flightfeather.uav.domain.entity.RealTimeData
import com.flightfeather.uav.domain.entity.toRowContent
import com.flightfeather.uav.domain.entity.toRowTitle
import com.flightfeather.uav.domain.mapper.RealTimeDataMapper
import com.flightfeather.uav.lightshare.bean.BaseResponse
import com.flightfeather.uav.lightshare.bean.DataHead
import com.flightfeather.uav.lightshare.bean.DataImportResult
import com.flightfeather.uav.lightshare.bean.DataVo
import com.flightfeather.uav.lightshare.bean.*
import com.flightfeather.uav.lightshare.service.RealTimeDataService
import com.flightfeather.uav.socket.bean.AirData
import com.github.pagehelper.PageHelper
import org.apache.poi.hssf.usermodel.HSSFWorkbook
import org.springframework.stereotype.Service
import org.springframework.web.multipart.MultipartFile
import tk.mybatis.mapper.entity.Example
@@ -19,6 +20,7 @@
import java.io.InputStream
import java.text.DateFormat
import java.text.SimpleDateFormat
import javax.servlet.http.HttpServletResponse
@Service
class RealTimeDataServiceImpl(val realTimeDataMapper: RealTimeDataMapper) : RealTimeDataService {
@@ -86,4 +88,48 @@
        }
        return BaseResponse(true, data = DataImportResult(""))
    }
    override fun outToWorkbook(deviceCode: String, startTime: String, endTime: String): HSSFWorkbook {
        val sTime = dateFormatter.parse(startTime)
        val eTime = dateFormatter.parse(endTime)
        val r = realTimeDataMapper.selectByExample(Example(RealTimeData::class.java).apply {
            createCriteria().andEqualTo("deviceCode", deviceCode)
                .apply {
                    sTime?.let { andGreaterThanOrEqualTo("dataTime", it) }
                    eTime?.let { andLessThanOrEqualTo("dataTime", it) }
                }
        })
        val workbook = HSSFWorkbook()
        if (r.isNotEmpty()) {
            val heads = getTableTitle(r[0])
            val contents = getTableContents(r)
            ExcelUtil.write(heads, contents, workbook)
        }
        return workbook
    }
    override fun outToExcel(deviceCode: String, startTime: String, endTime: String, response: HttpServletResponse): HttpServletResponse {
        val workbook = outToWorkbook(deviceCode, startTime, endTime)
        val out = response.outputStream
        workbook.write(out)
        workbook.close()
        out.flush()
        out.close()
        return response
    }
    fun getTableTitle(d: RealTimeData): List<Array<String>> {
        return listOf(d.toRowTitle())
    }
    fun getTableContents(list: List<RealTimeData>): List<Array<Any>> {
        val contents = mutableListOf<Array<Any>>()
        list.forEach {
            contents.add(it.toRowContent())
        }
        return contents
    }
}
src/main/kotlin/com/flightfeather/uav/lightshare/web/CompanyController.kt
@@ -4,6 +4,7 @@
import io.swagger.annotations.Api
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
@Api(tags = ["工业企业信息API接口"])
@@ -13,4 +14,17 @@
    @GetMapping("/info")
    fun getCompanyInfo() = companyService.getCompanyInfo()
    @GetMapping("/id")
    fun getCompany(
        @RequestParam(value = "cId", required = true) cId: String,
    ) = companyService.getCompany(cId)
    @GetMapping("/epw")
    fun epwModel(
        @RequestParam(value = "deviceCode", required = true) deviceCode: String,
        @RequestParam(value = "startTime", required = true) startTime: String,
        @RequestParam(value = "endTime", required = true) endTime: String,
        @RequestParam(value = "companyIds", required = false) companyIds: List<String>?,
    ) = companyService.getEpwModelResult(deviceCode, startTime, endTime, companyIds)
}
src/main/kotlin/com/flightfeather/uav/lightshare/web/ElectricityController.kt
@@ -23,4 +23,19 @@
        @RequestParam(value = "page", required = false) page: Int?,
        @RequestParam(value = "perPage", required = false) perPage: Int?
    ) = electricityService.getMinuteData(deviceCode, startTime, endTime, page, perPage)
    @ApiOperation(value = "获取企业用电量分钟均值,结果格式为走航数据格式")
    @GetMapping("/minute2")
    fun getMinuteData2(
        @ApiParam("设备编号") @RequestParam(value = "deviceCode") deviceCode: String,
        @ApiParam(value = "开始时间", example = "yyyy-MM-dd HH:mm:ss") @RequestParam(value = "startTime", required = false) startTime: String?,
        @ApiParam(value = "结束时间", example = "yyyy-MM-dd HH:mm:ss") @RequestParam(value = "endTime", required = false) endTime: String?,
        @RequestParam(value = "page", required = false) page: Int?,
        @RequestParam(value = "perPage", required = false) perPage: Int?
    ) = electricityService.getMinuteData(deviceCode, startTime, endTime, page, perPage)
    @GetMapping("/company")
    fun  getByCompany(
        @ApiParam("企业id") @RequestParam(value = "cId") cId: String,
    ) = electricityService.getByCompany(cId)
}
src/main/kotlin/com/flightfeather/uav/model/BaseModel.kt
@@ -3,7 +3,6 @@
import com.flightfeather.uav.common.utils.DateUtil
import com.flightfeather.uav.common.utils.ExcelUtil
import com.flightfeather.uav.socket.eunm.FactorType
import org.apache.poi.hssf.usermodel.HSSFEvaluationWorkbook
import org.apache.poi.hssf.usermodel.HSSFWorkbook
import java.io.File
import java.io.FileOutputStream
@@ -16,6 +15,17 @@
 */
abstract class BaseModel<M : BaseMData, S : BaseSOP> {
    data class ResultCell(
        var total: Double = 0.0,
        var count: Int = 0,
        var average: Double = 0.0
    ) {
        fun average(): Double {
            average = if (count == 0) .0 else round(total / count * 100) / 100
            return average
        }
    }
    abstract var dataPrep: BaseDataPrep<M, S>
    // æƒé‡å› å­ï¼Œåœ¨è¿›è¡Œè®¡ç®—分析时使用的监测因子
@@ -25,9 +35,7 @@
    abstract var weights: List<BaseWeight<M, S>>
    // è®¡ç®—结果
    private val result = mutableSetOf<BaseEffect>()
    private val rMap = mutableMapOf<String, MutableMap<String, MutableMap<String?, MutableList<Double>>>>()
    private val rMap = mutableMapOf<String, MutableMap<String, MutableMap<String, ResultCell>>>()
    // ç»“果筛选方式
    abstract var sections: List<BaseSection<M, S>>
@@ -37,9 +45,8 @@
     * @param mDataList ç›‘测数据集合
     * @param sopList æ±¡æŸ“源集合
     */
    fun execute(mDataList: List<M>, sopList: List<S>) {
        result.clear()
        rMap.clear()
    fun execute(mDataList: List<M>, sopList: List<S>, hasNext: Boolean = false) {
        if (!hasNext) rMap.clear()
        //1. æ•°æ®é¢„处理
        val mList = dataPrep.mDataPrep(mDataList)
@@ -76,7 +83,6 @@
        sections.forEach { it.filter(mData, sop, effect) }
        // ä¿å­˜ç»“æžœ
//        result.add(effect)
        formatConversion2(effect)
    }
@@ -90,7 +96,7 @@
//        val rMap = formatConversion()
        val workbook = _workbook ?: HSSFWorkbook()
        val fileName = fName ?: "污染溯源权重模型${DateUtil().DateToString(Date(), "yyyy-MM-ddHHmmss")}.xls"
        val fileName = fName ?: "污染溯源权重模型${DateUtil.instance.dateToString(Date(), "yyyy-MM-ddHHmmss")}.xls"
//        val filePath = "E:\\work\\export\\$fileName"
//        val filePath = "E:\\工作\\开发\\走航监测\\算法相关\\自动输出\\$fileName"
        val filePath = "E:\\工作\\开发\\走航监测\\算法相关\\自动输出\\网格化\\$fileName"
@@ -110,9 +116,8 @@
            // æ–°å»ºä¸€è¡Œ
            val contentList = mutableListOf<Any>()
            // æ·»åŠ æ±¡æŸ“æºåç§°
            val l = source.split("(")
            val index = l[1].substring(0, l[1].lastIndex)
            contentList.add(index.toIntOrNull() ?: 0)
            val l = source.split(";")
            contentList.add(l[1].toIntOrNull() ?: 0)
            contentList.add(l[0])
            tMap.forEach { (factorType, lMap) ->
                sections.forEach {
@@ -122,11 +127,11 @@
                    }
                    var max = 0.0
                    var maxP = types[0]
                    types.forEach {se ->
                    types.forEach type@{se ->
                        val lKey = "$se($factorType)"
                        if (lMap.containsKey(lKey)) {
                            val dataList = lMap[lKey]
                            val size = dataList?.size
                            val resultCell = lMap[lKey] ?: return@type
                            val size = resultCell.count
                            // æ·»åŠ è¯¥åˆ†ç±»ä½œä¸ºè¡¨å¤´
                            val h = lKey
//                            val h = "$lKey($size)"
@@ -134,17 +139,17 @@
                                h1.add(h)
                            }
                            // å°†åŽŸå§‹çš„æ•°æ®æ¢ç®—å¾—å‡ºç»“æžœï¼Œå¯ä»¥æ˜¯æ±‚å‡ºå‡å€¼ã€æ€»å’Œç­‰ç­‰ï¼ŒåŽç»­ä¿®æ”¹ä¸ºå¯ç”±ç”¨æˆ·è®¾å®š
                            // å°†åŽŸå§‹çš„æ•°æ®æ¢ç®—å¾—å‡ºç»“æžœï¼Œå¯ä»¥æ˜¯æ±‚å‡ºå‡å€¼ã€æ€»å’Œç­‰ç­‰
                            // FIXME: 2021/6/23 æ­¤å¤„先默认为求均值
                            val average = dataList?.average()
                            val average = resultCell.average()
                            if (average ?: 0.0 > max) {
                                max = average ?: 0.0
                            if (average > max) {
                                max = average
                                maxP = se
                            }
                            // å½“前行添加该分类下的结果值
                            contentList.add(average ?: 0.0)
                            contentList.add(average)
                        }
                    }
                    if (isFirst) {
@@ -181,35 +186,20 @@
        }
    }
    private fun formatConversion(): Map<String, Map<String, Map<String?, MutableList<Double>>>> {
        val rMap = mutableMapOf<String, MutableMap<String, MutableMap<String?, MutableList<Double>>>>()
        println("结果长度:${result.size}")
        result.forEach { e ->
            val rKey = "${e.sourceName}(${e.index})"
            if (!rMap.containsKey(rKey)) {
                rMap[rKey] = mutableMapOf()
            }
            val lMap = rMap[rKey]!!
            e.value.forEach { v ->
                if (!lMap.containsKey(v.first.des)) {
                    lMap[v.first.des] = mutableMapOf()
                }
                val tMap = lMap[v.first.des]!!
                e.tag.forEach { t ->
                    val factorName = v.first.des
                    val lKey = t.levelName + "($factorName)"
                    if (!tMap.containsKey(lKey)) {
                        tMap[lKey] = mutableListOf()
                    }
                    tMap[lKey]?.add(v.second)
    fun outputResult(): MutableMap<String, MutableMap<String, MutableMap<String, ResultCell>>> {
        rMap.forEach { (_, v) ->
            v.forEach { (_, v2) ->
                v2.forEach { (_, v3) ->
                    v3.average()
                }
            }
        }
        return rMap
    }
    private fun formatConversion2(e: BaseEffect) {
        val rKey = "${e.sourceName}(${e.index})"
        val rKey = "${e.sourceName};${e.index}"
        if (!rMap.containsKey(rKey)) {
            rMap[rKey] = mutableMapOf()
        }
@@ -223,9 +213,14 @@
                val factorName = v.first.des
                val lKey = t.levelName + "($factorName)"
                if (!tMap.containsKey(lKey)) {
                    tMap[lKey] = mutableListOf()
                    tMap[lKey] = ResultCell()
                }
                tMap[lKey]?.add(v.second)
                tMap[lKey]?.run {
                    total += v.second
                    if (factorName != FactorType.H2S.name || v.second > 0) {
                        count++
                    }
                }
            }
        }
    }
src/main/kotlin/com/flightfeather/uav/model/epw/EPWDataPrep.kt
@@ -21,6 +21,8 @@
//        emptyList<String>()
        WeightType.prep
    private val lastData = mutableListOf<DataVo>()
    override fun mDataPrep(mDataList: List<DataVo>): List<DataVo> {
        mDataList.forEach {
            it.values?.forEach v@{a ->
@@ -40,6 +42,9 @@
//        }
        var i = ncal
        if (lastData.isNotEmpty()) {
            i = 0
        }
        while (i < mDataList.size) {
            for (y in mDataList[i].values?.indices ?: 0..0) {
                val it = mDataList[i].values?.get(y) ?: continue
@@ -49,7 +54,14 @@
                it.factorData ?: continue
                if (it.factorData!! > vMax) {
                    val list = mDataList.subList(i - ncal, i)
                    val lastDataIndex = i
                    val thisIndex = if (i-ncal<0) 0 else i - ncal
                    val list = mutableListOf<DataVo>()
                    if (lastDataIndex < lastData.size) {
                        list.addAll(lastData.subList(lastDataIndex, lastData.lastIndex + 1))
                    }
                    list.addAll(mDataList.subList(thisIndex, i))
                    // åŽ»é™¤æ— æ•ˆå€¼çš„å¹³å‡
                    val avg = average(list, it.factorName)
                    // åŽ»é™¤æ— æ•ˆå€¼çš„æ ‡å‡†å·®
@@ -73,6 +85,11 @@
            i++
        }
        lastData.clear()
        mDataList.subList(mDataList.lastIndex - ncal + 1, mDataList.lastIndex + 1).forEach {
            lastData.add(it.copy())
        }
        return mDataList
    }
src/main/kotlin/com/flightfeather/uav/model/epw/EPWModel.kt
@@ -13,11 +13,17 @@
 */
class EPWModel : BaseModel<DataVo, CompanySOP>() {
    // é»˜è®¤ç›‘测点经纬度
    var defaultLocation: Pair<Double, Double>? = null
        set(value) {
            weights = listOf(WindDirWeight(value), WindDisWeight(value))
        }
    override var dataPrep: BaseDataPrep<DataVo, CompanySOP> = EPWDataPrep()
    override var factorTypes: List<FactorType> = WeightType.weightType
    override var weights: List<BaseWeight<DataVo, CompanySOP>> = listOf(WindDirWeight(), WindDisWeight())
    override var weights: List<BaseWeight<DataVo, CompanySOP>> = listOf(WindDirWeight(defaultLocation), WindDisWeight(defaultLocation))
    override var sections: List<BaseSection<DataVo, CompanySOP>> = listOf(TimeSection())
src/main/kotlin/com/flightfeather/uav/model/epw/WindDirWeight.kt
@@ -11,7 +11,7 @@
/**
 * é£Žå‘权重
 */
class WindDirWeight : BaseWeight<DataVo, CompanySOP>() {
class WindDirWeight(var defaultLocation: Pair<Double, Double>?) : BaseWeight<DataVo, CompanySOP>() {
    override val tag: String = "风向权重"
@@ -19,8 +19,9 @@
    override val weights: List<Double> = listOf(1.0, 0.8, 0.5, 0.2, 0.1)
    override fun onWeightFactor(mData: DataVo, sop: CompanySOP): Double? {
        val p1 = Pair(mData.lng!!, mData.lat!!)
    override fun onWeightFactor(mData: DataVo, sop: CompanySOP): Double {
        val p1 = if (mData.lng == null || mData.lat == null || mData.lng == .0 || mData.lat == .0) defaultLocation else Pair(mData.lng!!, mData.lat!!)
        p1 ?: return .0
        val p2 = Pair(sop.ciLongitude!!.toDouble(), sop.ciLatitude!!.toDouble())
        val wd = mData.getFactorData(FactorType.WIND_DIRECTION) ?: 0.0
        return getAngle(p1, p2, wd)
src/main/kotlin/com/flightfeather/uav/model/epw/WindDisWeight.kt
@@ -12,7 +12,7 @@
 * é£Žé€Ÿè·ç¦»æƒé‡
 * ç›‘测点与污染源之间的物理距离与当前风速得出的权重
 */
class WindDisWeight : BaseWeight<DataVo, CompanySOP>() {
class WindDisWeight(var defaultLocation: Pair<Double, Double>?) : BaseWeight<DataVo, CompanySOP>() {
    override val tag: String = "风速距离权重"
@@ -21,7 +21,8 @@
    override val weights: List<Double> = listOf(1.0, 0.8, 0.6, 0.5, 0.3, 0.0)
    override fun onWeightFactor(mData: DataVo, sop: CompanySOP): Double? {
        val p1 = Pair(mData.lng!!, mData.lat!!)
        val p1 = if (mData.lng == null || mData.lat == null || mData.lng == .0 || mData.lat == .0) defaultLocation else Pair(mData.lng!!, mData.lat!!)
        p1 ?: return .0
        val p2 = Pair(sop.ciLongitude!!.toDouble(), sop.ciLatitude!!.toDouble())
        val ws = mData.getFactorData(FactorType.WIND_SPEED)
        return if (ws == null) null else getWindSpeed(p1, p2, ws)
src/main/kotlin/com/flightfeather/uav/socket/decoder/ElectricDataDecoder.kt
@@ -6,7 +6,7 @@
@Component
class ElectricDataDecoder:BaseDataDecoder<ElectricMessage>() {
    private val dateUtil = DateUtil()
    private val dateUtil = DateUtil.instance
    override fun messageClass(): Class<ElectricMessage> = ElectricMessage::class.java
src/main/resources/generator/generatorConfig.xml
@@ -24,9 +24,9 @@
            <property name="suppressAllComments" value="true"/>
        </commentGenerator>
        <!--数据库链接URL,用户名、密码 -->
        <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://localhost:3306/dronemonitor"
                        userId="root"
                        password="123456">
        <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://47.100.191.150:3306/dronemonitor"
                        userId="remoteU1"
                        password="eSoF8DnzfGTlhAjE">
        </jdbcConnection>
        <javaTypeResolver>
            <property name="forceBigDecimals" value="false"/>
@@ -47,6 +47,7 @@
        <!-- è¦ç”Ÿæˆçš„表 tableName是数据库中的表名或视图名 domainObjectName是实体类名-->
<!--        <table tableName="air_real_time_data" domainObjectName="RealTimeData" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
<!--        <table tableName="mission" domainObjectName="Mission" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
        <table tableName="el_minutevalue" domainObjectName="ElectricMinuteValue" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>
<!--        <table tableName="el_minutevalue" domainObjectName="ElectricMinuteValue" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>-->
        <table tableName="el_company_device" domainObjectName="CompanyDevice" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"/>
    </context>
</generatorConfiguration>
src/main/resources/log4j2.xml
@@ -60,7 +60,7 @@
<!--            <appender-ref ref="Console"/>-->
<!--            <appender-ref ref="allLog"/>-->
<!--            <appender-ref ref="debugLog"/>-->
<!--            <appender-ref ref="errorLog"/>-->
            <appender-ref ref="errorLog"/>
<!--            <appender-ref ref="RollingFile"/>-->
        </root>
    </loggers>
src/main/resources/mapper/CompanyDeviceMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.flightfeather.uav.domain.mapper.CompanyDeviceMapper">
  <resultMap id="BaseResultMap" type="com.flightfeather.uav.domain.entity.CompanyDevice">
    <!--
      WARNING - @mbg.generated
    -->
    <id column="CD_Id" jdbcType="INTEGER" property="cdId" />
    <result column="CD_Company_Id" jdbcType="VARCHAR" property="cdCompanyId" />
    <result column="CD_Device_Code" jdbcType="VARCHAR" property="cdDeviceCode" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
    -->
    CD_Id, CD_Company_Id, CD_Device_Code
  </sql>
</mapper>
src/test/kotlin/com/flightfeather/uav/lightshare/service/impl/RealTimeDataServiceImplTest.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,36 @@
package com.flightfeather.uav.lightshare.service.impl
import com.flightfeather.uav.common.utils.DateUtil
import com.flightfeather.uav.lightshare.service.RealTimeDataService
import org.junit.Test
import org.junit.Assert.*
import org.junit.runner.RunWith
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.test.context.junit4.SpringRunner
import java.io.File
import java.io.FileOutputStream
import java.util.*
@RunWith(SpringRunner::class)
@SpringBootTest
class RealTimeDataServiceImplTest {
    @Autowired
    lateinit var realTimeDataService: RealTimeDataService
    @Test
    fun outToExcel() {
        if (realTimeDataService is RealTimeDataServiceImpl) {
            val workbook = realTimeDataService.outToWorkbook("0a0000000001", "2021-07-05 00:00:00", "2021-07-06 23:59:59")
            val fileName = "污染溯源权重模型${DateUtil.instance.dateToString(Date(), "yyyy-MM-ddHHmmss")}.xls"
            val filePath = "E:\\工作\\开发\\走航监测\\格式化数据\\$fileName"
            val out = FileOutputStream(File(filePath))
            workbook.write(out)
            workbook.close()
            out.flush()
            out.close()
        }
    }
}
src/test/kotlin/com/flightfeather/uav/model/epw/EPWModelTest.kt
@@ -1,7 +1,6 @@
package com.flightfeather.uav.model.epw
import com.flightfeather.uav.common.utils.DateUtil
import com.flightfeather.uav.domain.entity.Company
import com.flightfeather.uav.domain.mapper.CompanyMapper
import com.flightfeather.uav.lightshare.bean.CompanySOP
import com.flightfeather.uav.lightshare.bean.DataVo
@@ -13,9 +12,10 @@
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.test.context.junit4.SpringRunner
import tk.mybatis.mapper.entity.Example
import java.io.FileOutputStream
import java.util.*
import kotlin.math.ceil
import kotlin.math.floor
@RunWith(SpringRunner::class)
@SpringBootTest
@@ -56,6 +56,7 @@
        val dataSet = mutableListOf<DataVo>()
        val timeSet = listOf(
//            ç½‘格化监测每日
//            Pair("2021-06-18 15:00:00", "2021-06-18 23:59:59"),
//            Pair("2021-06-19 00:00:00", "2021-06-19 23:59:59"),
//            Pair("2021-06-20 00:00:00", "2021-06-20 23:59:59"),
@@ -69,13 +70,20 @@
//            Pair("2021-06-28 00:00:00", "2021-06-28 23:59:59"),
//            Pair("2021-06-29 00:00:00", "2021-06-29 23:59:59"),
//            Pair("2021-06-30 00:00:00", "2021-06-30 08:00:00"),
            Pair("2021-03-26 11:28:12", "2021-03-26 21:30:00"),
            Pair("2021-04-09 07:18:12", "2021-04-09 22:04:39"),
            Pair("2021-04-10 08:00:02", "2021-04-10 09:44:18"),
            Pair("2021-04-21 16:46:12", "2021-04-21 21:18:35"),
            Pair("2021-05-24 11:10:12", "2021-05-24 19:31:02"),
            Pair("2021-06-04 09:02:40", "2021-06-04 20:14:18"),
//            ç½‘格化监测
            Pair("2021-06-18 15:00:00", "2021-06-30 08:00:00"),
//            èµ°èˆªç›‘测
//            Pair("2021-03-26 11:28:12", "2021-03-26 21:30:00"),
//            Pair("2021-04-09 07:18:12", "2021-04-09 22:04:39"),
//            Pair("2021-04-10 08:00:02", "2021-04-10 09:44:18"),
//            Pair("2021-04-21 16:46:12", "2021-04-21 21:18:35"),
//            Pair("2021-05-24 11:10:12", "2021-05-24 19:31:02"),
//            Pair("2021-06-04 09:02:40", "2021-06-04 20:14:18"),
        )
        val deviceCode = "0d0000000001"
        val epwModel = EPWModel()
        var workbook: HSSFWorkbook? = null
@@ -83,23 +91,38 @@
        for (i in timeSet.indices) {
            val it = timeSet[i]
            val dataList =
                realTimeDataService.getSecondData("0d0000000001", it.first, it.second, 1, 100000).data ?: emptyList()
            dataList.forEach {
                if (it.lng == 0.0 && it.lat == 0.0) {
                    it.lng = 121.235813
                    it.lat = 30.835898
            var page = 1
            var totalPage = -1
            while (totalPage == -1 || page <= totalPage) {
                realTimeDataService.getSecondData(deviceCode, it.first, it.second, page, 10000).apply {
                    if (totalPage == -1) {
                        totalPage = head?.totalPage ?: 0
                    }
                    val dataList = data?: emptyList()
                    dataList.forEach {
                        if (it.lng == 0.0 && it.lat == 0.0) {
                            it.lng = 121.235813
                            it.lat = 30.835898
                        }
                    }
                    dataSet.addAll(dataList)
//                    println()
//                    println("[${page}]数据量: ${dataList.size}")
                    epwModel.execute(dataList, companySOPList, true)
                    page++
                }
            }
            dataSet.addAll(dataList)
            println()
            println("[${it.first}]数据量: ${dataList.size}")
            epwModel.execute(dataList, companySOPList)
            val p = epwModel.outputToExcel(
//                "污染权重分析结果-综合-${DateUtil().DateToString(Date(), "yyyy-MM-ddHHmmss")}.xls",
                "污染权重分析结果-综合-${DateUtil.instance.dateToString(Date(), "yyyy-MM-ddHHmmss")}.xls",
//                "污染权重分析结果-${it.first.substring(0, 10)}.xls",
                "污染权重分析结果-网格化-${it.first.substring(0, 10)}.xls",
//                "污染权重分析结果-网格化-${it.first.substring(0, 10)}.xls",
                workbook,
                out,
                it.first.substring(0, 10),
@@ -110,8 +133,12 @@
//            p?.second?.let { out = it }
        }
        println(dataSet.size)
        epwModel.execute(dataSet, companySOPList)
        epwModel.outputToExcel("污染权重分析结果-综合-${DateUtil().DateToString(Date(), "yyyy-MM-ddHHmmss")}.xls", workbook, out, "综合")
//        var page = 1
//        var totalPage = ceil(dataSet.size.toDouble() / 5000)
//        println(dataSet.size)
//        val epwModel1 = EPWModel()
//        epwModel1.execute(dataSet, companySOPList)
//        epwModel1.outputToExcel("污染权重分析结果-综合-${DateUtil.instance.dateToString(Date(), "yyyy-MM-ddHHmmss")}.xls", workbook, out, "综合")
    }
}