1. 新增用电量数据查询接口
2. 调整污染权重算法
| | |
| | | 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() |
| | |
| | | if (dateStyle != null) { |
| | | var myDate = StringToDate(date, dateStyle) |
| | | myDate = addInteger(myDate, dateType, amount) |
| | | dateString = DateToString(myDate, dateStyle) |
| | | dateString = dateToString(myDate, dateStyle) |
| | | } |
| | | return dateString |
| | | } |
| | |
| | | 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 |
| | | } |
| | |
| | | * @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 { |
| | |
| | | * @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 |
| | | } |
| | |
| | | * @return æ°æ¥æå符串 |
| | | */ |
| | | fun StringToString(date: String, olddPattern: String, newPattern: String): String? { |
| | | return DateToString(StringToDate(date, olddPattern), newPattern) |
| | | return dateToString(StringToDate(date, olddPattern), newPattern) |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return æ¥æ |
| | | */ |
| | | fun getDate(date: Date?): String? { |
| | | return DateToString(date, DateStyle.YYYY_MM_DD) |
| | | return dateToString(date, DateStyle.YYYY_MM_DD) |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return æ¶é´ |
| | | */ |
| | | fun getTime(date: Date): String? { |
| | | return DateToString(date, DateStyle.HH_MM_SS) |
| | | return dateToString(date, DateStyle.HH_MM_SS) |
| | | } |
| | | |
| | | /** |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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 |
| | | }, |
| | | ) |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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?> |
| | |
| | | } |
| | | 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() |
| | | } |
| | | } |
| | |
| | | |
| | | 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>>>> |
| | | } |
| | |
| | | |
| | | 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>> |
| | | } |
| | |
| | | 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 { |
| | | |
| | |
| | | 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 |
| | | } |
| | |
| | | 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) |
| | | } |
| | | } |
| | |
| | | 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") |
| | | |
| | |
| | | } |
| | | 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) |
| | | } |
| | | } |
| | |
| | | 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 |
| | |
| | | import java.io.InputStream |
| | | import java.text.DateFormat |
| | | import java.text.SimpleDateFormat |
| | | import javax.servlet.http.HttpServletResponse |
| | | |
| | | @Service |
| | | class RealTimeDataServiceImpl(val realTimeDataMapper: RealTimeDataMapper) : RealTimeDataService { |
| | |
| | | } |
| | | 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 |
| | | } |
| | | } |
| | |
| | | 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æ¥å£"]) |
| | |
| | | |
| | | @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) |
| | | } |
| | |
| | | @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) |
| | | } |
| | |
| | | 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 |
| | |
| | | */ |
| | | 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> |
| | | |
| | | // æéå åï¼å¨è¿è¡è®¡ç®åææ¶ä½¿ç¨ççæµå å |
| | |
| | | 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>> |
| | |
| | | * @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) |
| | |
| | | sections.forEach { it.filter(mData, sop, effect) } |
| | | |
| | | // ä¿åç»æ |
| | | // result.add(effect) |
| | | formatConversion2(effect) |
| | | } |
| | | |
| | |
| | | // 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" |
| | |
| | | // æ°å»ºä¸è¡ |
| | | 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 { |
| | |
| | | } |
| | | 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)" |
| | |
| | | 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) { |
| | |
| | | } |
| | | } |
| | | |
| | | 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() |
| | | } |
| | |
| | | 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++ |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | // emptyList<String>() |
| | | WeightType.prep |
| | | |
| | | private val lastData = mutableListOf<DataVo>() |
| | | |
| | | override fun mDataPrep(mDataList: List<DataVo>): List<DataVo> { |
| | | mDataList.forEach { |
| | | it.values?.forEach v@{a -> |
| | |
| | | // } |
| | | |
| | | 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 |
| | |
| | | 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) |
| | | // å»é¤æ æå¼çæ åå·® |
| | |
| | | i++ |
| | | } |
| | | |
| | | lastData.clear() |
| | | mDataList.subList(mDataList.lastIndex - ncal + 1, mDataList.lastIndex + 1).forEach { |
| | | lastData.add(it.copy()) |
| | | } |
| | | |
| | | return mDataList |
| | | } |
| | | |
| | |
| | | */ |
| | | 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()) |
| | | |
| | |
| | | /** |
| | | * é£åæé |
| | | */ |
| | | class WindDirWeight : BaseWeight<DataVo, CompanySOP>() { |
| | | class WindDirWeight(var defaultLocation: Pair<Double, Double>?) : BaseWeight<DataVo, CompanySOP>() { |
| | | |
| | | override val tag: String = "é£åæé" |
| | | |
| | |
| | | |
| | | 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) |
| | |
| | | * é£éè·ç¦»æé |
| | | * çæµç¹ä¸æ±¡ææºä¹é´çç©çè·ç¦»ä¸å½åé£éå¾åºçæé |
| | | */ |
| | | class WindDisWeight : BaseWeight<DataVo, CompanySOP>() { |
| | | class WindDisWeight(var defaultLocation: Pair<Double, Double>?) : BaseWeight<DataVo, CompanySOP>() { |
| | | |
| | | override val tag: String = "é£éè·ç¦»æé" |
| | | |
| | |
| | | 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) |
| | |
| | | |
| | | @Component |
| | | class ElectricDataDecoder:BaseDataDecoder<ElectricMessage>() { |
| | | private val dateUtil = DateUtil() |
| | | private val dateUtil = DateUtil.instance |
| | | |
| | | override fun messageClass(): Class<ElectricMessage> = ElectricMessage::class.java |
| | | |
| | |
| | | <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"/> |
| | |
| | | <!-- è¦çæç表 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> |
| | |
| | | <!-- <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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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() |
| | | } |
| | | } |
| | | } |
| | |
| | | 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 |
| | |
| | | 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 |
| | |
| | | |
| | | 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"), |
| | |
| | | // 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 |
| | |
| | | |
| | | 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), |
| | |
| | | // 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, "综å") |
| | | } |
| | | } |