feiyu02
2024-01-10 30a53b41f09d2eefd33513a409d472c2166ba1ea
1. 新增自动评估相关数据源的检查接口
已修改24个文件
已删除1个文件
已添加14个文件
844 ■■■■ 文件已修改
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/dataanalysis/AopDataDeviceMap.kt 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/datasource/AopDataSource.kt 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/report/DataSource.kt 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/common/utils/Constant.kt 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/common/utils/DateUtil.kt 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/MonitorobjectversionMapper.kt 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/ScenseMapper.kt 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/SceneRep.kt 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/UserInfoSVRep.kt 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds2/entity/UserMap.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds2/mapper/ComplaintMapper.kt 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds2/mapper/PunishmentMapper.kt 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds2/repository/ComplaintAndPunishmentRep.kt 50 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds2/repository/JADustSiteMapRep.kt 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds2/repository/UserInfoTZRep.kt 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds2/repository/UserMapRep.kt 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds3/repository/JSDustSiteMapRep.kt 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds3/repository/XHFumeSiteMapRep.kt 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/repository/TaskRepository.kt 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/ComplaintService.kt 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/EvaluationService.kt 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/UserMapService.kt 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ComplaintServiceImpl.kt 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/EvaluationServiceImpl.kt 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/UserMapServiceImpl.kt 47 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/UserinfoServiceImpl.kt 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/AreaVo.kt 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ComplaintVo.kt 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/DeviceMapVo.kt 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/EvaluateResVo.kt 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/PunishmentVo.kt 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/BaseResPack.kt 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ComplaintController.kt 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/UserMapController.kt 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ds1/MonitorobjectversionMapper.xml 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ds1/ScenseMapper.xml 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ds2/ComplaintMapper.xml 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ds2/PunishmentMapper.xml 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ds2/UserMapMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/dataanalysis/AopDataDeviceMap.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,75 @@
package cn.flightfeather.supervision.business.autooutput.dataanalysis
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.domain.ds2.repository.JADustSiteMapRep
import cn.flightfeather.supervision.domain.ds3.repository.JSDustSiteMapRep
import cn.flightfeather.supervision.domain.ds3.repository.XHFumeSiteMapRep
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import cn.flightfeather.supervision.lightshare.vo.DeviceMapVo
import org.springframework.stereotype.Component
/**
 * ç›‘测数据和系统用户的映射管理
 */
@Component
class AopDataDeviceMap(
    private val jaDustSiteMapRep: JADustSiteMapRep,
    private val jsDustSiteMapRep: JSDustSiteMapRep,
    private val xhFumeSiteMapRep: XHFumeSiteMapRep,
) {
    /**
     * èŽ·å–åŒºåŸŸæ¡ä»¶ä¸‹çš„è®¾å¤‡å’Œç”¨æˆ·çš„æ˜ å°„å…³ç³»
     */
    fun findMapSet(areaVo: AreaVo, userIdList: List<String?>): List<DeviceMapVo> {
        return when (areaVo.sourceType) {
            //以飞羽环境系统中的用户为主体
            1 -> find1(areaVo, userIdList)
            //以飞羽监管系统中的用户为主体
            2 -> find2(areaVo, userIdList)
            else -> emptyList()
        }
    }
    private fun find1(areaVo: AreaVo, userIdList: List<String?>): List<DeviceMapVo> {
        return when (areaVo.districtcode) {
            //徐汇区
            "310104" -> {
                when (areaVo.scensetypeid) {
                    //汽修
                    Constant.SceneTypeTZ.VehicleRepair.value.toString() -> emptyList()
                    else -> emptyList()
                }
            }
            else -> emptyList()
        }
    }
    private fun find2(areaVo: AreaVo, userIdList: List<String?>): List<DeviceMapVo> {
        return when (areaVo.districtcode) {
            //静安区
            "310106" -> when (areaVo.scensetypeid) {
                //工地
                Constant.SceneType.TYPE1.value -> jaDustSiteMapRep.findBySVUserId(userIdList)
                else -> emptyList()
            }
            //金山区
            "310116" -> when (areaVo.scensetypeid) {
                //工地,码头水泥搅拌站
                Constant.SceneType.TYPE1.value,
                Constant.SceneType.TYPE2.value,
                Constant.SceneType.TYPE3.value,
                -> jsDustSiteMapRep.findBySVUserId(userIdList)
                else -> emptyList()
            }
            //徐汇区
            "310104" -> when (areaVo.scensetypeid) {
                //餐饮
                Constant.SceneType.TYPE5.value -> xhFumeSiteMapRep.findBySVUserId(userIdList)
                else -> emptyList()
            }
            else -> emptyList()
        }
    }
}
src/main/kotlin/cn/flightfeather/supervision/business/autooutput/datasource/AopDataSource.kt
@@ -90,12 +90,8 @@
        this.mode = 0
        sceneSourceList.clear()
        val taskSceneIdList =
            aopDbMapper.monitorobjectversionMapper.getSceneByType(config.topTaskGuid, config.sceneType, config.townCode)
        aopDbMapper.scenseMapper.selectByExample(Example(Scense::class.java).apply {
            createCriteria()
                .andIn("guid", taskSceneIdList)
        })?.let { sceneSourceList.addAll(it) }
            aopDbMapper.scenseMapper.getSceneByType(config.topTaskGuid, config.sceneType, config.townCode)
        sceneSourceList.addAll(taskSceneIdList)
    }
    // ä»Žå°è´¦ç³»ç»ŸèŽ·å–åœºæ™¯
src/main/kotlin/cn/flightfeather/supervision/business/report/DataSource.kt
@@ -110,7 +110,8 @@
                }
            })
        } else {
            taskSceneIdList = dbMapper.monitorobjectversionMapper.getSceneByType(config.topTaskGuid, config.sceneType, config.townCode)
            taskSceneIdList = dbMapper.scenseMapper.getSceneByType(config.topTaskGuid, config
                .sceneType, config.townCode).map { it.guid ?: "" }
            dbMapper.subtaskMapper.selectByExample(Example(Subtask::class.java).apply {
                createCriteria().andIn("scenseid", taskSceneIdList)
                    .andEqualTo("tguid", config.topTaskGuid)
src/main/kotlin/cn/flightfeather/supervision/common/utils/Constant.kt
@@ -85,6 +85,47 @@
        }
    }
    enum class  SceneTypeTZ(val value: Int, val des: String) {
        NoType(0, "无类型"),
        Restaurant(1, "餐饮"),
        Construction(2, "工地"),
        Wharf(3, "码头"),
        StorageYard(4, "堆场"),
        MixingPlant(5, "搅拌站"),
        Industrial(6, "工业企业"),
        VehicleRepair(7, "汽修"),
        Laboratory(8, "实验室"),
        MedicalInstitution(9, "医疗机构");
        companion object {
            fun getNameByValue(value: Int?): String = when (value) {
                0 -> NoType.des
                1 -> Restaurant.des
                2 -> Construction.des
                3 -> Wharf.des
                4 -> StorageYard.des
                5 -> MixingPlant.des
                6 -> Industrial.des
                7 -> VehicleRepair.des
                8 -> Laboratory.des
                9 -> MedicalInstitution.des
                else -> NoType.des
            }
            fun toPairList() = listOf(
                Pair(Restaurant.value.toString(), Restaurant.des),
                Pair(Construction.value.toString(), Construction.des),
                Pair(Wharf.value.toString(), Wharf.des),
                Pair(StorageYard.value.toString(), StorageYard.des),
                Pair(MixingPlant.value.toString(), MixingPlant.des),
                Pair(Industrial.value.toString(), Industrial.des),
                Pair(VehicleRepair.value.toString(), VehicleRepair.des),
                Pair(Laboratory.value.toString(), Laboratory.des),
                Pair(MedicalInstitution.value.toString(), MedicalInstitution.des),
            )
        }
    }
    companion object {
        //问题审核
        const val PROBLEM_CHECK_PASS = "pass"//问题审核通过
src/main/kotlin/cn/flightfeather/supervision/common/utils/DateUtil.kt
@@ -1,10 +1,12 @@
package cn.flightfeather.supervision.common.utils
import org.springframework.stereotype.Component
import java.sql.Timestamp
import java.text.ParsePosition
import java.text.SimpleDateFormat
import java.util.*
@Component
class DateUtil {
    private val threadLocal = ThreadLocal<SimpleDateFormat>()
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/MonitorobjectversionMapper.kt
@@ -1,14 +1,10 @@
package cn.flightfeather.supervision.domain.ds1.mapper
import cn.flightfeather.supervision.domain.ds1.entity.Monitorobjectversion
import cn.flightfeather.supervision.domain.ds1.entity.Scense
import cn.flightfeather.supervision.domain.util.MyMapper
import org.apache.ibatis.annotations.Mapper
import org.apache.ibatis.annotations.Select
@Mapper
interface MonitorobjectversionMapper:MyMapper<Monitorobjectversion> {
    //    @Select("select b.S_GUID from sm_t_monitorobjectversion as a left join sm_t_scense as b on a.S_GUID = b.S_GUID" +
//            " where a.T_ID = #{param1} and b.S_TypeID = #{param2}")
    fun getSceneByType(topTaskId: String, sceneTypeId: Int? = null, townCode: String? = null): List<String>
}
interface MonitorobjectversionMapper:MyMapper<Monitorobjectversion>
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/ScenseMapper.kt
@@ -8,5 +8,10 @@
@Mapper
interface ScenseMapper:MyMapper<Scense>, MutableList<Scense> {
    /**
     * èŽ·å–æœªåˆ›å»ºç”¨æˆ·çš„åœºæ™¯
     */
    fun selectNoAccountScene(): List<Scense>
    fun getSceneByType(topTaskId: String, sceneTypeId: Int? = null, townCode: String? = null): List<Scense>
}
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/SceneRep.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,21 @@
package cn.flightfeather.supervision.domain.ds1.repository
import cn.flightfeather.supervision.domain.ds1.entity.Scense
import cn.flightfeather.supervision.domain.ds1.mapper.ScenseMapper
import org.springframework.stereotype.Repository
/**
 * åœºæ™¯ä¿¡æ¯æ•°æ®åº“相关操作
 */
@Repository
class SceneRep(
    private val scenseMapper: ScenseMapper,
) {
    /**
     * æŸ¥æ‰¾åœºæ™¯
     */
    fun findScene(topTaskId: String, sceneTypeId: Int? = null, townCode: String? = null): List<Scense?> {
        return scenseMapper.getSceneByType(topTaskId, sceneTypeId, townCode)
    }
}
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/UserInfoSVRep.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,31 @@
package cn.flightfeather.supervision.domain.ds1.repository
import cn.flightfeather.supervision.domain.ds1.entity.Scense
import cn.flightfeather.supervision.domain.ds1.entity.Userinfo
import cn.flightfeather.supervision.domain.ds1.mapper.UserinfoMapper
import org.springframework.stereotype.Repository
import tk.mybatis.mapper.entity.Example
/**
 * é£žç¾½ç›‘管用户信息数据库相关操作
 */
@Repository
class UserInfoSVRep(
    private val userinfoMapper: UserinfoMapper,
) {
    /**
     * æŸ¥æ‰¾åœºæ™¯
     */
    fun findUser(sceneIdList: List<String?>): List<Userinfo?> {
        return userinfoMapper.selectByExample(Example(Userinfo::class.java).apply {
            createCriteria().andIn("dGuid", sceneIdList)
        })
    }
    fun findUser(sceneId: String): List<Userinfo?> {
        return userinfoMapper.selectByExample(Example(Userinfo::class.java).apply {
            createCriteria().andEqualTo("dGuid", sceneId)
        })
    }
}
src/main/kotlin/cn/flightfeather/supervision/domain/ds2/entity/UserMap.java
@@ -3,6 +3,7 @@
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
@Table(name = "ts_t_user_map")
public class UserMap {
@@ -30,6 +31,9 @@
     */
    @Column(name = "SV_User_Name")
    private String svUserName;
    @Column(name = "UM_Create_Time")
    private Date umCreateTime;
    /**
     * èŽ·å–é£žç¾½çŽ¯å¢ƒç”¨æˆ·id
@@ -102,4 +106,18 @@
    public void setSvUserName(String svUserName) {
        this.svUserName = svUserName == null ? null : svUserName.trim();
    }
    /**
     * @return UM_Create_Time
     */
    public Date getUmCreateTime() {
        return umCreateTime;
    }
    /**
     * @param umCreateTime
     */
    public void setUmCreateTime(Date umCreateTime) {
        this.umCreateTime = umCreateTime;
    }
}
src/main/kotlin/cn/flightfeather/supervision/domain/ds2/mapper/ComplaintMapper.kt
@@ -2,7 +2,15 @@
import cn.flightfeather.supervision.domain.ds2.entity.Complaint
import cn.flightfeather.supervision.domain.util.MyMapper
import cn.flightfeather.supervision.lightshare.vo.ComplaintVo
import org.apache.ibatis.annotations.Mapper
import java.util.*
@Mapper
interface ComplaintMapper : MyMapper<Complaint>
interface ComplaintMapper : MyMapper<Complaint> {
    /**
     *
     */
    fun findComplaint(tzUserIdList: List<String?>, sTime: String?, eTime: String?): List<ComplaintVo?>
}
src/main/kotlin/cn/flightfeather/supervision/domain/ds2/mapper/PunishmentMapper.kt
@@ -2,7 +2,13 @@
import cn.flightfeather.supervision.domain.ds2.entity.Punishment
import cn.flightfeather.supervision.domain.util.MyMapper
import cn.flightfeather.supervision.lightshare.vo.ComplaintVo
import cn.flightfeather.supervision.lightshare.vo.PunishmentVo
import org.apache.ibatis.annotations.Mapper
import java.util.*
@Mapper
interface PunishmentMapper : MyMapper<Punishment>
interface PunishmentMapper : MyMapper<Punishment> {
    fun findPunishment(tzUserIdList: List<String?>, sTime: String?, eTime: String?): List<PunishmentVo?>
}
src/main/kotlin/cn/flightfeather/supervision/domain/ds2/repository/ComplaintAndPunishmentRep.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,50 @@
package cn.flightfeather.supervision.domain.ds2.repository
import cn.flightfeather.supervision.common.utils.DateUtil
import cn.flightfeather.supervision.domain.ds2.mapper.ComplaintMapper
import cn.flightfeather.supervision.domain.ds2.mapper.PunishmentMapper
import cn.flightfeather.supervision.lightshare.vo.ComplaintVo
import cn.flightfeather.supervision.lightshare.vo.PunishmentVo
import org.springframework.stereotype.Repository
import java.util.*
/**
     * ä¿¡è®¿æŠ•诉和行政处罚数据库相关操作
 */
@Repository
class ComplaintAndPunishmentRep(
    private val complaintMapper: ComplaintMapper,
    private val punishmentMapper: PunishmentMapper,
    private val dateUtil: DateUtil,
){
    /**
     * æŸ¥è¯¢ä¿¡è®¿æŠ•诉
     * @param tzUserIdList é£žç¾½çŽ¯å¢ƒç³»ç»Ÿä¸‹çš„ç”¨æˆ·id列表
     */
    fun findComplaint(tzUserIdList: List<String?>, sTime: Date?, eTime: Date?): List<ComplaintVo?> {
        val s = dateUtil.DateToString(sTime, DateUtil.DateStyle.YYYY_MM_DD_HH_MM_SS)
        val e = dateUtil.DateToString(eTime, DateUtil.DateStyle.YYYY_MM_DD_HH_MM_SS)
        return findComplaint(tzUserIdList, s, e)
    }
    fun findComplaint(tzUserIdList: List<String?>, sTime: String?, eTime: String?): List<ComplaintVo?> {
        return complaintMapper.findComplaint(tzUserIdList, sTime, eTime)
    }
    /**
     * æŸ¥è¯¢è¡Œæ”¿å¤„罚
     * @param tzUserIdList é£žç¾½çŽ¯å¢ƒç³»ç»Ÿä¸‹çš„ç”¨æˆ·id列表
     */
    fun findPunishment(tzUserIdList: List<String?>, sTime: Date?, eTime: Date?): List<PunishmentVo?> {
        val s = dateUtil.DateToString(sTime, DateUtil.DateStyle.YYYY_MM_DD_HH_MM_SS)
        val e = dateUtil.DateToString(eTime, DateUtil.DateStyle.YYYY_MM_DD_HH_MM_SS)
        return findPunishment(tzUserIdList, s, e)
    }
    fun findPunishment(tzUserIdList: List<String?>, sTime: String?, eTime: String?): List<PunishmentVo?> {
        return punishmentMapper.findPunishment(tzUserIdList, sTime, eTime)
    }
}
src/main/kotlin/cn/flightfeather/supervision/domain/ds2/repository/JADustSiteMapRep.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,26 @@
package cn.flightfeather.supervision.domain.ds2.repository
import cn.flightfeather.supervision.domain.ds2.entity.DustSiteMap
import cn.flightfeather.supervision.domain.ds2.mapper.DustSiteMapMapper
import cn.flightfeather.supervision.lightshare.vo.DeviceMapVo
import org.springframework.stereotype.Repository
import tk.mybatis.mapper.entity.Example
/**
 * é™å®‰å·¥åœ°æ‰¬å°˜ç›‘测点位和系统用户映射关系数据库相关操作
 */
@Repository
class JADustSiteMapRep(
    private val dustSiteMapMapper: DustSiteMapMapper,
) {
    /**
     * æ ¹æ®é£žç¾½ç›‘管用户id查询
     */
    fun findBySVUserId(idList: List<String?>): List<DeviceMapVo> {
        val res = dustSiteMapMapper.selectByExample(Example(DustSiteMap::class.java).apply {
            createCriteria().andIn("svUserId", idList)
        })
        return DeviceMapVo.fromJADustSiteMap(res)
    }
}
src/main/kotlin/cn/flightfeather/supervision/domain/ds2/repository/UserInfoTZRep.kt
@@ -17,8 +17,16 @@
     */
    fun findEnterpriseUser(district: String?, sceneType: Constant.SceneType): List<UserinfoTZ?> {
        val type = Constant.SceneType.typeMap(sceneType.value.toByte())
        return findEnterpriseUser(district, type?.toInt())
    }
    /**
     * æŸ¥æ‰¾åœ¨çº¿çš„æ­£å¼ä¼ä¸šç”¨æˆ·
     * @param sceneTypeTZ é£žç¾½çŽ¯å¢ƒç³»ç»Ÿä¸­çš„åœºæ™¯ç±»åž‹
     */
    fun findEnterpriseUser(district: String?, sceneTypeTZ: Int?): List<UserinfoTZ?> {
        return userinfoTZMapper.selectByExample(Example(UserinfoTZ::class.java).apply {
            createCriteria().andEqualTo("extension2", type)
            createCriteria().andEqualTo("extension2", sceneTypeTZ)
                .andEqualTo("extension1", district)
                .andEqualTo("usertypeid", Constant.UserType.ENTERPRISE.value)
                .andEqualTo("isenable", true)
src/main/kotlin/cn/flightfeather/supervision/domain/ds2/repository/UserMapRep.kt
@@ -7,6 +7,7 @@
import cn.flightfeather.supervision.domain.ds2.entity.UserinfoTZ
import cn.flightfeather.supervision.domain.ds2.mapper.UserMapMapper
import org.springframework.stereotype.Repository
import tk.mybatis.mapper.entity.Example
@Repository
class UserMapRep(
@@ -35,4 +36,13 @@
        // æ‰¾åˆ°é£žç¾½ç›‘管中的场景信息
        return scenseMapper.selectByPrimaryKey(userInfoSp.dGuid)
    }
    /**
     * é€šè¿‡é£žç¾½ç›‘管用户id查询飞羽环境用户id
     */
    fun findBySVUserId(idList: List<String?>): List<UserMap?> {
        return userMapMapper.selectByExample(Example(UserMap::class.java).apply {
            createCriteria().andIn("svUserId", idList)
        })
    }
}
src/main/kotlin/cn/flightfeather/supervision/domain/ds3/repository/JSDustSiteMapRep.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,26 @@
package cn.flightfeather.supervision.domain.ds3.repository
import cn.flightfeather.supervision.domain.ds3.entity.JSDustSiteMap
import cn.flightfeather.supervision.domain.ds3.mapper.JSDustSiteMapMapper
import cn.flightfeather.supervision.lightshare.vo.DeviceMapVo
import org.springframework.stereotype.Repository
import tk.mybatis.mapper.entity.Example
/**
 * é‡‘山扬尘监测点位和系统用户映射关系数据库相关操作
 */
@Repository
class JSDustSiteMapRep(
    private val jsDustSiteMapMapper: JSDustSiteMapMapper,
) {
    /**
     * æ ¹æ®é£žç¾½ç›‘管用户id查询
     */
    fun findBySVUserId(idList: List<String?>): List<DeviceMapVo> {
        val res = jsDustSiteMapMapper.selectByExample(Example(JSDustSiteMap::class.java).apply {
            createCriteria().andIn("svUserId", idList)
        })
        return DeviceMapVo.fromJSDustSiteMap(res)
    }
}
src/main/kotlin/cn/flightfeather/supervision/domain/ds3/repository/XHFumeSiteMapRep.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,26 @@
package cn.flightfeather.supervision.domain.ds3.repository
import cn.flightfeather.supervision.domain.ds3.entity.FumeSiteMap
import cn.flightfeather.supervision.domain.ds3.mapper.FumeSiteMapMapper
import cn.flightfeather.supervision.lightshare.vo.DeviceMapVo
import org.springframework.stereotype.Repository
import tk.mybatis.mapper.entity.Example
/**
 * å¾æ±‡æ²¹çƒŸç›‘测点位和系统用户映射关系数据库相关操作
 */
@Repository
class XHFumeSiteMapRep(
    private val fumeSiteMapMapper: FumeSiteMapMapper,
) {
    /**
     * æ ¹æ®é£žç¾½ç›‘管用户id查询
     */
    fun findBySVUserId(idList: List<String?>): List<DeviceMapVo> {
        val res = fumeSiteMapMapper.selectByExample(Example(FumeSiteMap::class.java).apply {
            createCriteria().andIn("svUserId", idList)
        })
        return DeviceMapVo.fromXHFumeSiteMap(res)
    }
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/repository/TaskRepository.kt
ÎļþÒÑɾ³ý
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/ComplaintService.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,14 @@
package cn.flightfeather.supervision.lightshare.service
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import cn.flightfeather.supervision.lightshare.vo.ComplaintVo
import cn.flightfeather.supervision.lightshare.vo.PunishmentVo
interface ComplaintService {
    // ä¿¡è®¿æŠ•诉
    fun findComplaints(areaVo: AreaVo): List<ComplaintVo?>
    // è¡Œæ”¿å¤„罚
    fun findPunishment(areaVo: AreaVo): List<PunishmentVo?>
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/EvaluationService.kt
@@ -6,6 +6,7 @@
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import cn.flightfeather.supervision.lightshare.vo.AutoScoreResultVo
import cn.flightfeather.supervision.lightshare.vo.BaseResponse
import cn.flightfeather.supervision.lightshare.vo.EvaluateResVo
interface EvaluationService {
@@ -21,7 +22,7 @@
    fun getRankOfSense(tguid: String, scensetypeid: String?, ruletypeid: ByteArray?): List<Evaluation>
    fun getRankOfTown(tguid: String, scensetypeid: String?):List<AreaVo>
    fun getRankOfTown(tguid: String, scensetypeid: String?):List<EvaluateResVo>
    fun autoScore(districtCode: String, time: String): List<String>
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/UserMapService.kt
@@ -1,12 +1,17 @@
package cn.flightfeather.supervision.lightshare.service
import cn.flightfeather.supervision.domain.ds1.entity.Version
import cn.flightfeather.supervision.domain.ds2.entity.UserMap
import org.springframework.web.multipart.MultipartFile
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import cn.flightfeather.supervision.lightshare.vo.DeviceMapVo
interface UserMapService {
    /**
     * æ ¹æ®é£žç¾½ç›‘管系统中的场景id,获取与飞羽环境系统中的关联用户
     */
    fun getTZIdBySceneId(sceneId: String): UserMap
    fun autoCreateMap()
    fun fetchDeviceMap(areaVo: AreaVo): List<DeviceMapVo?>
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/ComplaintServiceImpl.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,58 @@
package cn.flightfeather.supervision.lightshare.service.impl
import cn.flightfeather.supervision.domain.ds1.repository.SceneRep
import cn.flightfeather.supervision.domain.ds1.repository.TaskRep
import cn.flightfeather.supervision.domain.ds1.repository.UserInfoSVRep
import cn.flightfeather.supervision.domain.ds2.entity.Complaint
import cn.flightfeather.supervision.domain.ds2.entity.Punishment
import cn.flightfeather.supervision.domain.ds2.mapper.ComplaintMapper
import cn.flightfeather.supervision.domain.ds2.mapper.PunishmentMapper
import cn.flightfeather.supervision.domain.ds2.repository.ComplaintAndPunishmentRep
import cn.flightfeather.supervision.domain.ds2.repository.UserInfoTZRep
import cn.flightfeather.supervision.domain.ds2.repository.UserMapRep
import cn.flightfeather.supervision.lightshare.service.ComplaintService
import cn.flightfeather.supervision.lightshare.service.UserinfoService
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import cn.flightfeather.supervision.lightshare.vo.ComplaintVo
import cn.flightfeather.supervision.lightshare.vo.PunishmentVo
import org.springframework.stereotype.Service
@Service
class ComplaintServiceImpl(
    private val complaintAndPunishmentRep: ComplaintAndPunishmentRep,
    private val sceneRep: SceneRep,
    private val taskRep: TaskRep,
    private val userInfoSVRep: UserInfoSVRep,
    private val userInfoTZRep: UserInfoTZRep,
    private val userMapRep: UserMapRep,
) : ComplaintService {
    private fun getTZUserId(areaVo: AreaVo): List<String?> {
        return when (areaVo.sourceType) {
            //以飞羽环境系统中的用户为主体
            1 -> {
                val u = userInfoTZRep.findEnterpriseUser(areaVo.districtname, areaVo.scensetypeid?.toInt())
                u.map { it?.guid }
            }
            //以飞羽监管系统中的用户为主体
            2 -> {
                val task = taskRep.findOneTask(areaVo) ?: throw IllegalStateException("当前查询条件下未找到对应顶层任务")
                val scenes = sceneRep.findScene(task.tguid!!, areaVo.scensetypeid?.toInt(), areaVo.towncode)
                    .map { it?.guid }
                val idList = userInfoSVRep.findUser(scenes).map { it?.guid }
                userMapRep.findBySVUserId(idList).map { it?.tzUserId }
            }
            else -> emptyList()
        }
    }
    override fun findComplaints(areaVo: AreaVo): List<ComplaintVo?> {
        val userIdList = getTZUserId(areaVo)
        return complaintAndPunishmentRep.findComplaint(userIdList, areaVo.starttime, areaVo.endtime)
    }
    override fun findPunishment(areaVo: AreaVo): List<PunishmentVo?> {
        val userIdList = getTZUserId(areaVo)
        return complaintAndPunishmentRep.findPunishment(userIdList, areaVo.starttime, areaVo.endtime)
    }
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/EvaluationServiceImpl.kt
@@ -16,11 +16,13 @@
import cn.flightfeather.supervision.common.utils.DateUtil
import cn.flightfeather.supervision.common.utils.Domain
import cn.flightfeather.supervision.domain.ds1.repository.EvaluationRep
import cn.flightfeather.supervision.domain.ds1.repository.TaskRep
import cn.flightfeather.supervision.lightshare.service.EvaluationService
import cn.flightfeather.supervision.lightshare.service.SubtaskService
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import cn.flightfeather.supervision.lightshare.vo.AutoScoreResultVo
import cn.flightfeather.supervision.lightshare.vo.BaseResponse
import cn.flightfeather.supervision.lightshare.vo.EvaluateResVo
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service
import tk.mybatis.mapper.entity.Example
@@ -31,6 +33,7 @@
class EvaluationServiceImpl(
    private val evaluationMapper: EvaluationMapper,
    private val evaluationRep: EvaluationRep,
    private val taskRep: TaskRep,
    private val aopTaskCtrl: AopTaskCtrl,
) : EvaluationService {
@@ -45,9 +48,9 @@
    private var isAutoScoreRunning = false
    //获取某顶层任务下某个场景的街道评分排名
    override fun getRankOfTown(tguid: String, scensetypeid: String?): List<AreaVo> {
    override fun getRankOfTown(tguid: String, scensetypeid: String?): List<EvaluateResVo> {
        val evaluationlist = getRankInfo(tguid, scensetypeid, null)
        var areaVolist = mutableListOf<AreaVo>()
        var areaVolist = mutableListOf<EvaluateResVo>()
        //考核类型是规范考核
        if (evaluationlist.isNotEmpty() &&
                Objects.equals(evaluationlist.get(0).ertype, Constant.RuleType.STANDARD.value)) {
@@ -63,7 +66,7 @@
                val iterator: MutableIterator<Evaluation> = tmplist.iterator()
                val evaluation = evaluationlist.get(0)//获取一种街镇
                var areaVo = AreaVo()
                var areaVo = EvaluateResVo()
                areaVo = transform(areaVo, evaluation)
                while (iterator.hasNext()){
                    val tmp = iterator.next()
@@ -95,7 +98,7 @@
                val iterator: MutableIterator<Evaluation> = tmplist.iterator()
                val evaluation = evaluationlist.get(0)//获取一种街镇
                var areaVo = AreaVo()
                var areaVo = EvaluateResVo()
                areaVo = transform(areaVo, evaluation)
                while (iterator.hasNext()){
                    val tmp = iterator.next()
@@ -169,7 +172,7 @@
    }
    //Evaluation传递数据给AreaVo
    fun transform(areaVo: AreaVo, evaluation: Evaluation):AreaVo{
    fun transform(areaVo: EvaluateResVo, evaluation: Evaluation):EvaluateResVo{
        areaVo.provincecode = evaluation.provincecode
        areaVo.provincename = evaluation.provincename
        areaVo.citycode = evaluation.citycode
@@ -182,9 +185,9 @@
    }
    //按街道严重不规范场景百分比排序
    fun sort(areaVolist: MutableList<AreaVo>):MutableList<AreaVo>{
        Collections.sort(areaVolist, object : Comparator<AreaVo>{
            override fun compare(o1: AreaVo?, o2: AreaVo?): Int {
    fun sort(areaVolist: MutableList<EvaluateResVo>):MutableList<EvaluateResVo>{
        Collections.sort(areaVolist, object : Comparator<EvaluateResVo>{
            override fun compare(o1: EvaluateResVo?, o2: EvaluateResVo?): Int {
                var num1 = 0.0
                if (o1!!.allsensenum != 0)
                    num1 = (o1.notstandardnum/o1.allsensenum).toDouble()
@@ -267,6 +270,8 @@
    override fun findAutoEvaluation(areaVo: AreaVo): List<AutoScoreResultVo?>? {
        //1. æŸ¥æ‰¾åŽ†å²è®°å½•ï¼ŒæŸ¥çœ‹è¯„ä¼°æ˜¯å¦å·²å­˜åœ¨
        areaVo.scensetypeid ?: throw IllegalStateException("查询时必须选择一个场景类型")
        val task = taskRep.findOneTask(areaVo) ?: throw IllegalStateException("查询时必须选择一个场景类型")
        return evaluationRep.findAutoScore(areaVo)
    }
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/UserMapServiceImpl.kt
@@ -1,13 +1,22 @@
package cn.flightfeather.supervision.lightshare.service.impl
import cn.flightfeather.supervision.business.autooutput.dataanalysis.AopDataDeviceMap
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.common.utils.UUIDGenerator
import cn.flightfeather.supervision.domain.ds1.entity.Userinfo
import cn.flightfeather.supervision.domain.ds1.mapper.UserinfoMapper
import cn.flightfeather.supervision.domain.ds1.repository.SceneRep
import cn.flightfeather.supervision.domain.ds1.repository.TaskRep
import cn.flightfeather.supervision.domain.ds1.repository.UserInfoSVRep
import cn.flightfeather.supervision.domain.ds2.entity.UserMap
import cn.flightfeather.supervision.domain.ds2.entity.UserinfoTZ
import cn.flightfeather.supervision.domain.ds2.mapper.UserMapMapper
import cn.flightfeather.supervision.domain.ds2.mapper.UserinfoTZMapper
import cn.flightfeather.supervision.domain.ds2.repository.UserInfoTZRep
import cn.flightfeather.supervision.lightshare.service.UserMapService
import cn.flightfeather.supervision.lightshare.service.UserinfoService
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import cn.flightfeather.supervision.lightshare.vo.DeviceMapVo
import org.springframework.stereotype.Service
import tk.mybatis.mapper.entity.Example
@@ -15,15 +24,18 @@
class UserMapServiceImpl(
    private val userMapMapper: UserMapMapper,
    private val userinfoMapper: UserinfoMapper,
    private val userinfoTZMapper: UserinfoTZMapper
    ) : UserMapService {
    private val userinfoTZMapper: UserinfoTZMapper,
    private val sceneRep: SceneRep,
    private val taskRep: TaskRep,
    private val userInfoSVRep: UserInfoSVRep,
    private val userInfoTZRep: UserInfoTZRep,
    private val aopDataDeviceMap: AopDataDeviceMap,
) : UserMapService {
    override fun getTZIdBySceneId(sceneId: String): UserMap {
        val list = userinfoMapper.selectByExample(Example(Userinfo::class.java).apply {
            createCriteria().andEqualTo("dGuid", sceneId)
        })
        val list = userInfoSVRep.findUser(sceneId)
        if (list.isEmpty()) return UserMap()
        val userId = list[0].guid
        val userId = list[0]?.guid
        val result = userMapMapper.selectByExample(Example(UserMap::class.java).apply {
            createCriteria().andEqualTo("svUserId", userId)
        })
@@ -60,7 +72,7 @@
                // 2、 æ— æ³•精确匹配的,采用默认的编号,插入记录。后续人工修改(暂定)
                else {
                    if (userMapMapper.selectByExample(Example(UserMap::class.java).apply {
                        createCriteria().andEqualTo("svUserId", it.guid)
                            createCriteria().andEqualTo("svUserId", it.guid)
                        }).isEmpty()) {
                        val id = "temp" + UUIDGenerator.generateShortUUID()
                        userMapMapper.insert(UserMap().apply {
@@ -74,4 +86,25 @@
            }
        }
    }
    override fun fetchDeviceMap(areaVo: AreaVo): List<DeviceMapVo?> {
        // 1.通过区域条件获取主体用户
        val userIdList = when (areaVo.sourceType) {
            //以飞羽环境系统中的用户为主体
            1 -> {
                val u = userInfoTZRep.findEnterpriseUser(areaVo.districtname, areaVo.scensetypeid?.toInt())
                u.map { it?.guid }
            }
            //以飞羽监管系统中的用户为主体
            2 -> {
                val task = taskRep.findOneTask(areaVo) ?: throw IllegalStateException("当前查询条件下未找到对应顶层任务")
                val scenes = sceneRep.findScene(task.tguid!!, areaVo.scensetypeid?.toInt(), areaVo.towncode)
                    .map { it?.guid }
                userInfoSVRep.findUser(scenes).map { it?.guid }
            }
            else -> emptyList()
        }
        // 2.通过区域条件决定匹配的数据来源
        return aopDataDeviceMap.findMapSet(areaVo, userIdList)
    }
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/service/impl/UserinfoServiceImpl.kt
@@ -6,19 +6,29 @@
import cn.flightfeather.supervision.domain.ds1.entity.Userinfo
import cn.flightfeather.supervision.domain.ds1.mapper.ScenseMapper
import cn.flightfeather.supervision.domain.ds1.mapper.UserinfoMapper
import cn.flightfeather.supervision.domain.ds1.repository.SceneRep
import cn.flightfeather.supervision.domain.ds1.repository.TaskRep
import cn.flightfeather.supervision.domain.ds1.repository.UserInfoSVRep
import cn.flightfeather.supervision.domain.ds2.repository.UserInfoTZRep
import cn.flightfeather.supervision.lightshare.service.UserinfoService
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import org.springframework.stereotype.Service
import tk.mybatis.mapper.entity.Example
import kotlin.random.Random
import kotlin.random.nextInt
@Service
class UserinfoServiceImpl(val userinfoMapper: UserinfoMapper, private val scenseMapper: ScenseMapper) : UserinfoService {
class UserinfoServiceImpl(
    val userinfoMapper: UserinfoMapper,
    private val scenseMapper: ScenseMapper,
) : UserinfoService {
    //根据userinfo条件查询
    override fun findOneByName(userinfo: Userinfo): Userinfo? {
        val example = Example(Userinfo::class.java)
        val criteria = example.createCriteria()
        criteria.andEqualTo("acountname", userinfo.acountname)
                .andEqualTo("password", userinfo.password)
            .andEqualTo("password", userinfo.password)
        val result = userinfoMapper.selectByExample(example)
        return if (result.isNotEmpty()) {
            result[0]
@@ -91,21 +101,22 @@
    private fun getUName(sceneName: String): String {
        var uName = PinYin.getPinYinHeader(sceneName)
        var repeated = false
        var suffix = ""
        var repeated: Boolean
        var i = 1
        do {
            userinfoMapper.selectByExample(Example(Userinfo::class.java).apply {
                createCriteria().andEqualTo("acountname", uName)
                createCriteria().andEqualTo("acountname", uName + suffix)
            }).let {
                repeated = it.isNotEmpty()
                if (repeated) {
                    uName += i
                    suffix = Random.nextInt(100..999).toString()
                }
            }
            i++
        } while (repeated && i < 20)
        if (repeated) uName = UUIDGenerator.generateShortUUID()
        return uName
        return uName + suffix
    }
    override fun autoCreateAccount() {
@@ -115,8 +126,8 @@
        }
    }
    private fun createAccount(sence: Scense) {
        sence.let {
    private fun createAccount(scence: Scense) {
        scence.let {
            val sceneName = it.name ?: return
            val uName = getUName(sceneName)
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/AreaVo.kt
@@ -2,37 +2,33 @@
import com.fasterxml.jackson.annotation.JsonInclude
/**
 * åŒºåŸŸæ¡ä»¶
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
open class AreaVo{
    // è¡Œæ”¿åŒºåˆ’
    var provincecode: String? = null
    var provincename: String? = null
    var citycode: String? = null
    var cityname: String? = null
    var districtcode: String? = null
    var districtname: String? = null
    var towncode: String? = null
    var townname: String? = null
    // æ—¶é—´èŒƒå›´
    var starttime: String? = null
    var endtime: String? = null
    // åœºæ™¯åç§°
    var sceneName: String? = null
    // åœºæ™¯ç±»åž‹
    var scensetypeid: String? = null
    var notstandardnum: Int = 0
    var allsensenum: Int = 0
    //是否上线
    // æ˜¯å¦ä¸Šçº¿
    var online: Boolean? = null
    // ä¸»æ•°æ®æºï¼Œ1:以飞羽环境系统中的用户为主体;2:以飞羽监管系统中的用户为主体
    var sourceType:Int = 1
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/ComplaintVo.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,11 @@
package cn.flightfeather.supervision.lightshare.vo
import cn.flightfeather.supervision.domain.ds2.entity.BaseInfo
import cn.flightfeather.supervision.domain.ds2.entity.Complaint
/**
 * ä¿¡è®¿æŠ•诉
 */
class ComplaintVo : Complaint() {
    var baseInfo: BaseInfo? = null
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/DeviceMapVo.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,77 @@
package cn.flightfeather.supervision.lightshare.vo
import cn.flightfeather.supervision.domain.ds2.entity.DustSiteMap
import cn.flightfeather.supervision.domain.ds3.entity.FumeSiteMap
import cn.flightfeather.supervision.domain.ds3.entity.JSDustSiteMap
import org.springframework.beans.BeanUtils
import java.util.*
/**
 * ç›‘测设备和飞羽监管系统、飞羽环境系统用户的匹配关系
 */
class DeviceMapVo {
    // ç›‘测设备id
    var deviceCode:String?=null
    // ç›‘测设备或站点名称
    var deviceName:String?=null
    // é£žç¾½ç›‘管系统用户id
    var svUserId:String?=null
    // é£žç¾½ç›‘管系统用户名称
    var svUserName:String?=null
    // é£žç¾½çŽ¯å¢ƒç³»ç»Ÿç”¨æˆ·id
    var tzUserId:String?=null
    // é£žç¾½çŽ¯å¢ƒç³»ç»Ÿç”¨æˆ·åç§°
    var tzUserName:String?=null
    var createTime: Date? = null
    companion object {
        fun fromJADustSiteMap(list: List<DustSiteMap?>): List<DeviceMapVo> {
            val res = mutableListOf<DeviceMapVo>()
            list.forEach {
                it ?: return@forEach
                res.add(DeviceMapVo().apply {
                    deviceCode = it.jaMnCode
                    deviceName = it.jaSceneName
                    svUserId = it.svUserId
                    svUserName = it.svUserName
                    tzUserId = it.tzUserId
                    tzUserName = it.tzUserName
                })
            }
            return res
        }
        fun fromJSDustSiteMap(list: List<JSDustSiteMap?>): List<DeviceMapVo> {
            val res = mutableListOf<DeviceMapVo>()
            list.forEach {
                it ?: return@forEach
                res.add(DeviceMapVo().apply {
                    deviceCode = it.jsDeviceCode
                    deviceName = it.jsDeviceName
                    svUserId = it.svUserId
                    svUserName = it.svUserName
                    tzUserId = it.tzUserId
                    tzUserName = it.tzUserName
                })
            }
            return res
        }
        fun fromXHFumeSiteMap(list: List<FumeSiteMap?>): List<DeviceMapVo> {
            val res = mutableListOf<DeviceMapVo>()
            list.forEach {
                it ?: return@forEach
                res.add(DeviceMapVo().apply {
                    deviceCode = it.xhDeviceCode
                    deviceName = it.xhDeviceName
                    svUserId = it.svUserId
                    svUserName = it.svUserName
                    tzUserId = it.tzUserId
                    tzUserName = it.tzUserName
                })
            }
            return res
        }
    }
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/EvaluateResVo.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,11 @@
package cn.flightfeather.supervision.lightshare.vo
/**
 * è¯„估结果统计
 */
class EvaluateResVo:AreaVo() {
    // ä¸¥é‡ä¸è§„范数量
    var notstandardnum: Int = 0
    // åœºæ™¯æ€»æ•°
    var allsensenum: Int = 0
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/vo/PunishmentVo.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,11 @@
package cn.flightfeather.supervision.lightshare.vo
import cn.flightfeather.supervision.domain.ds2.entity.BaseInfo
import cn.flightfeather.supervision.domain.ds2.entity.Punishment
/**
 * è¡Œæ”¿å¤„罚
 */
class PunishmentVo : Punishment() {
    var baseInfo: BaseInfo? = null
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/BaseResPack.kt
@@ -14,12 +14,12 @@
            if (head is DataHead) {
                BaseResponse(true, head = head, data = res.second)
            } else {
                BaseResponse(true, data = res.second)
                BaseResponse(true, data = res)
            }
        } else {
            BaseResponse(true, data = res)
        }
    } catch (e: Exception) {
    } catch (e: IllegalStateException) {
        BaseResponse(false, message = e.message ?: "")
    }
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/ComplaintController.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,22 @@
package cn.flightfeather.supervision.lightshare.web
import cn.flightfeather.supervision.lightshare.service.ComplaintService
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import io.swagger.annotations.ApiParam
import org.springframework.web.bind.annotation.*
@Api(tags = ["信访投诉及行政处罚相关API接口"])
@RestController
@RequestMapping("")
class ComplaintController(val complaintService: ComplaintService) {
    @ApiOperation(value = "获取信访投诉信息")
    @PostMapping("/complaint/find")
    fun findComplaints(@ApiParam(value = "区域条件") @RequestBody areaVo: AreaVo) = complaintService.findComplaints(areaVo)
    @ApiOperation(value = "获取行政处罚信息")
    @PostMapping("/punishment/find")
    fun findPunishment(@ApiParam(value = "区域条件") @RequestBody areaVo: AreaVo) = complaintService.findPunishment(areaVo)
}
src/main/kotlin/cn/flightfeather/supervision/lightshare/web/UserMapController.kt
@@ -1,14 +1,21 @@
package cn.flightfeather.supervision.lightshare.web
import cn.flightfeather.supervision.lightshare.service.UserMapService
import cn.flightfeather.supervision.lightshare.vo.AreaVo
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import org.springframework.web.bind.annotation.*
@Api(tags = ["VersionController"], description = "用户id对应API接口")
@Api(tags = ["UserMapController"], description = "用户id对应API接口")
@RestController
@RequestMapping("/usermap")
class UserMapController(val userMapService: UserMapService) {
    @ApiOperation(value = "根据飞羽监管系统中的场景id,获取与飞羽环境系统中的关联用户")
    @GetMapping
    fun getTZId(@RequestParam("sceneId") sceneId: String) = userMapService.getTZIdBySceneId(sceneId)
    @ApiOperation(value = "获取区域用户的监测设备和飞羽监管系统、飞羽环境系统的匹配记录")
    @PostMapping("/device")
    fun fetchDeviceMap(@RequestBody areaVo: AreaVo) = resPack { userMapService.fetchDeviceMap(areaVo) }
}
src/main/resources/mapper/ds1/MonitorobjectversionMapper.xml
@@ -32,19 +32,4 @@
    MOV_Suitable, MOV_DisplayID, MOV_Year, MOV_Month, MOV_Day, MOV_ISCP, MOV_CustomPeriod, 
    MOV_Extension1, MOV_Extension2, MOV_Extension3, MOV_Remark
  </sql>
  <select id="getSceneByType" resultType="String">
    select
    b.S_GUID
    from sm_t_monitorobjectversion as a
    left join sm_t_scense as b
    on a.S_GUID = b.S_GUID
    where a.T_ID = #{param1}
    <if test="param2 != null">
      and b.S_TypeID = #{param2}
    </if>
    <if test="param3 != null">
      and b.S_TownCode = #{param3}
    </if>
  </select>
</mapper>
src/main/resources/mapper/ds1/ScenseMapper.xml
@@ -45,4 +45,19 @@
  <select id="selectNoAccountScene" resultMap="BaseResultMap">
    select a.* FROM sm_t_scense as a LEFT JOIN sm_t_userinfo as b on a.S_GUID = b.D_GUID WHERE b.UI_GUID is null
  </select>
  <select id="getSceneByType" resultMap="BaseResultMap">
    select
    b.*
    from sm_t_monitorobjectversion as a
    left join sm_t_scense as b
    on a.S_GUID = b.S_GUID
    where a.T_ID = #{param1}
    <if test="param2 != null">
      and b.S_TypeID = #{param2}
    </if>
    <if test="param3 != null">
      and b.S_TownCode = #{param3}
    </if>
  </select>
</mapper>
src/main/resources/mapper/ds2/ComplaintMapper.xml
@@ -28,4 +28,25 @@
    CP_Mediate_Unit, CP_Mediate_Result, CP_Extension1, CP_Extension2, CP_Extension3, 
    CP_Remark
  </sql>
  <resultMap id="ComplaintVo" type="cn.flightfeather.supervision.lightshare.vo.ComplaintVo" extends="BaseResultMap">
    <association property="baseInfo" resultMap="cn.flightfeather.supervision.domain.ds2.mapper.BaseInfoMapper.BaseResultMap" />
  </resultMap>
  <select id="findComplaint" resultMap="ComplaintVo">
    select
    *
    from ea_t_complaint as a
    left join ea_t_baseinfo as b
    on a.CP_SceneId = b.BI_GUID
    <where>
      a.CP_SceneId in #{tzUserIdList}
      <if test="sTime != null">
        and a.CP_Time >= #{sTime}
      </if>
      <if test="eTime != null">
        and a.CP_Time &lt;= #{eTime}
      </if>
    </where>
  </select>
</mapper>
src/main/resources/mapper/ds2/PunishmentMapper.xml
@@ -25,4 +25,25 @@
    PM_GUID, PM_Name, PM_Time, PM_Reason, PM_Result, PM_Department, PM_Basis, PM_Scene_Id, 
    PM_Extension1, PM_Extension2, PM_Extension3, PM_Remark
  </sql>
  <resultMap id="PunishmentVo" type="cn.flightfeather.supervision.lightshare.vo.PunishmentVo" extends="BaseResultMap">
    <association property="baseInfo" resultMap="cn.flightfeather.supervision.domain.ds2.mapper.BaseInfoMapper.BaseResultMap" />
  </resultMap>
  <select id="findPunishment" resultMap="PunishmentVo">
    select
    *
    from ea_t_punishment as a
    left join ea_t_baseinfo as b
    on a.PM_Scene_Id = b.BI_GUID
    <where>
      a.PM_Scene_Id in #{tzUserIdList}
      <if test="sTime != null">
        and a.PM_Time >= #{sTime}
      </if>
      <if test="eTime != null">
        and a.PM_Time &lt;= #{eTime}
      </if>
    </where>
  </select>
</mapper>
src/main/resources/mapper/ds2/UserMapMapper.xml
@@ -9,11 +9,12 @@
    <result column="TZ_User_Name" property="tzUserName" jdbcType="VARCHAR" />
    <result column="SV_User_Id" property="svUserId" jdbcType="VARCHAR" />
    <result column="SV_User_Name" property="svUserName" jdbcType="VARCHAR" />
    <result column="UM_Create_Time" jdbcType="TIMESTAMP" property="umCreateTime" />
  </resultMap>
  <sql id="Base_Column_List" >
    <!--
      WARNING - @mbg.generated
    -->
    TZ_User_Id, TZ_User_Name, SV_User_Id, SV_User_Name
    TZ_User_Id, TZ_User_Name, SV_User_Id, SV_User_Name, UM_Create_Time
  </sql>
</mapper>