hcong
2024-12-17 09c8120288ea7df454c10d67911ab8643f2f4235
1. 完成数据产品中间结果基本信息和具体信息入库
已修改15个文件
已添加6个文件
198 ■■■■ 文件已修改
src/main/kotlin/cn/flightfeather/supervision/business/report/BaseExcel.kt 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/report/BaseTemplate.kt 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ProDetailSummaryResult.kt 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ProTypeDetailSummaryResult.kt 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ProTypeRankMainSummaryResult.kt 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ProTypeRankSummaryResult.kt 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ProTypeStatusSummaryResult.kt 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ScoreAnalysisSummaryResult.kt 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ScoreDetailSummaryResult.kt 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeDetailSummary.kt 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeRankMainSummary.kt 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeRankSummary.kt 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeStatusSummary.kt 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/report/template/ScoreAnalysisSummary.kt 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/report/template/ScoreDetailSummary.kt 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/DataProductMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/DataProductProDetailMapper.kt 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/DataProductTownProAnalysisMapper.kt 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/DataProductRep.kt 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ds1/DataProductProDetailMapper.xml 49 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/ds1/DataProductTownProAnalysisMapper.xml 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/kotlin/cn/flightfeather/supervision/business/report/BaseExcel.kt
@@ -30,7 +30,8 @@
            if (!it.isExecuted) {
                it.execute()
            }
            objectResults.add(it.toObject())
            it.toObject()
            objectResults.add(it.resultObjects)
        }
    }
src/main/kotlin/cn/flightfeather/supervision/business/report/BaseTemplate.kt
@@ -86,7 +86,7 @@
     * è¾“出到对象
     * hc 2024.12.06
     */
    fun toObject(): MutableList<BaseTemplateResult>  {
    fun toObject() {
        if (!isExecuted) {
            execute()
        }
@@ -106,7 +106,6 @@
            resultObjects.clear()
            resultObjects.add(classType.createInstance())
        }
        return resultObjects
    }
    /**
src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ProDetailSummaryResult.kt
@@ -101,7 +101,7 @@
        entity.sceneType = this.sceneType
        entity.sceneName = this.sceneName
        // å°†String类型的监管时间转换为Date类型
        entity.inspectionTime = DateUtil.StringToDate(this.subTaskPlanstarttime, "mm-dd")
        entity.inspectionTime = DateUtil.StringToDate(this.subTaskPlanstarttime, "yyyy-mm-dd")
        entity.executors = this.subTaskExecutorrealtimes
        entity.problemType = this.problemTypename
        entity.problemDescription = this.problemDescription
src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ProTypeDetailSummaryResult.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
package cn.flightfeather.supervision.business.report.bean
class ProTypeDetailSummaryResult() : BaseTemplateResult() {
    override fun convertToDBEntity(): Any {
        TODO("Not yet implemented")
    }
}
src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ProTypeRankMainSummaryResult.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
package cn.flightfeather.supervision.business.report.bean
class ProTypeRankMainSummaryResult : BaseTemplateResult()  {
    override fun convertToDBEntity(): Any {
        TODO("Not yet implemented")
    }
}
src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ProTypeRankSummaryResult.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
package cn.flightfeather.supervision.business.report.bean
class ProTypeRankSummaryResult : BaseTemplateResult()  {
    override fun convertToDBEntity(): Any {
        TODO("Not yet implemented")
    }
}
src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ProTypeStatusSummaryResult.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
package cn.flightfeather.supervision.business.report.bean
class ProTypeStatusSummaryResult : BaseTemplateResult()  {
    override fun convertToDBEntity(): Any {
        TODO("Not yet implemented")
    }
}
src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ScoreAnalysisSummaryResult.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
package cn.flightfeather.supervision.business.report.bean
class ScoreAnalysisSummaryResult : BaseTemplateResult()  {
    override fun convertToDBEntity(): Any {
        TODO("Not yet implemented")
    }
}
src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ScoreDetailSummaryResult.kt
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
package cn.flightfeather.supervision.business.report.bean
class ScoreDetailSummaryResult : BaseTemplateResult() {
    override fun convertToDBEntity(): Any {
        TODO("Not yet implemented")
    }
}
src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeDetailSummary.kt
@@ -3,10 +3,12 @@
import cn.flightfeather.supervision.business.report.BaseCols
import cn.flightfeather.supervision.business.report.BaseTemplate
import cn.flightfeather.supervision.business.report.DataSource
import cn.flightfeather.supervision.business.report.bean.BaseTemplateResult
import cn.flightfeather.supervision.business.report.bean.ProTypeDetailSummaryResult
import cn.flightfeather.supervision.business.report.cols.*
class ProTypeDetailSummary(dataSource: DataSource) : BaseTemplate(dataSource) {
    override val cols: List<BaseCols> = listOf(ColSceneName(), ColTown(), ColStatus(), ColProChange(), ColProblemDistribution())
    override var resultObjects: MutableList<BaseTemplateResult> = mutableListOf(ProTypeDetailSummaryResult())
    override val templateName: String = "问题与整改分类统计表"
}
src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeRankMainSummary.kt
@@ -1,12 +1,14 @@
package cn.flightfeather.supervision.business.report.template
import cn.flightfeather.supervision.business.report.DataSource
import cn.flightfeather.supervision.business.report.bean.BaseTemplateResult
import cn.flightfeather.supervision.business.report.bean.ProTypeRankMainSummaryResult
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.common.utils.ExcelUtil
class ProTypeRankMainSummary(dataSource: DataSource) : ProTypeRankSummary(dataSource) {
    override val templateName: String = "月度主要或典型问题分析表"
    override var resultObjects: MutableList<BaseTemplateResult> = mutableListOf(ProTypeRankMainSummaryResult())
    override fun formatTable(summarys: MutableList<Summary>) {
        //排名靠前的max个问题被认定为主要或典型问题
        val max = when (dataSource.config.sceneType.toString()) {
src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeRankSummary.kt
@@ -3,15 +3,16 @@
import cn.flightfeather.supervision.business.report.BaseCols
import cn.flightfeather.supervision.business.report.BaseTemplate
import cn.flightfeather.supervision.business.report.DataSource
import cn.flightfeather.supervision.business.report.cols.*
import cn.flightfeather.supervision.business.report.bean.BaseTemplateResult
import cn.flightfeather.supervision.business.report.bean.ProTypeRankSummaryResult
import cn.flightfeather.supervision.common.utils.ExcelUtil
import kotlin.math.round
open class ProTypeRankSummary(dataSource: DataSource) : BaseTemplate(dataSource) {
    override val cols: List<BaseCols> = listOf()
    override val templateName: String = "问题与整改分类排名"
    override fun execute() {
    override var resultObjects: MutableList<BaseTemplateResult> = mutableListOf(ProTypeRankSummaryResult())
    override fun genData() {
        dataSource.reset()
        val proMap = mutableMapOf<String?, Summary>()
src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeStatusSummary.kt
@@ -3,16 +3,19 @@
import cn.flightfeather.supervision.business.report.BaseCols
import cn.flightfeather.supervision.business.report.BaseTemplate
import cn.flightfeather.supervision.business.report.DataSource
import cn.flightfeather.supervision.business.report.bean.BaseTemplateResult
import cn.flightfeather.supervision.business.report.bean.ProTypeStatusSummaryResult
import cn.flightfeather.supervision.common.utils.Constant
import cn.flightfeather.supervision.common.utils.ExcelUtil
import cn.flightfeather.supervision.domain.ds1.entity.SceneConstructionSite
class ProTypeStatusSummary(dataSource: DataSource) : BaseTemplate(dataSource) {
    override val cols: List<BaseCols> = listOf()
    override var resultObjects: MutableList<BaseTemplateResult> = mutableListOf(ProTypeStatusSummaryResult())
    override val templateName: String = "工地施工阶段问题分类分析表"
    @Throws(Exception::class)
    override fun execute() {
    override fun genData() {
        if (dataSource.config.sceneType.toString() != Constant.SceneType.TYPE1.value) {
//            throw IllegalStateException("${templateName}只能针对工地进行分析,当前传入场景类型编号为${dataSource.config.sceneType}")
            println("sadas")
src/main/kotlin/cn/flightfeather/supervision/business/report/template/ScoreAnalysisSummary.kt
@@ -3,16 +3,18 @@
import cn.flightfeather.supervision.business.report.BaseCols
import cn.flightfeather.supervision.business.report.BaseTemplate
import cn.flightfeather.supervision.business.report.DataSource
import cn.flightfeather.supervision.business.report.bean.BaseTemplateResult
import cn.flightfeather.supervision.business.report.bean.ScoreAnalysisSummaryResult
import cn.flightfeather.supervision.business.report.cols.ColTotalGrade
import cn.flightfeather.supervision.common.utils.ExcelUtil
import kotlin.math.round
class ScoreAnalysisSummary(dataSource: DataSource) : BaseTemplate(dataSource) {
    override val cols: List<BaseCols> = listOf(ColTotalGrade())
    override var resultObjects: MutableList<BaseTemplateResult> = mutableListOf(ScoreAnalysisSummaryResult())
    override val templateName: String = "分街镇规范性分析表"
    override fun execute() {
    override fun genData() {
        dataSource.reset()
        cols.forEach { it.combineHead(head,dataSource) }
src/main/kotlin/cn/flightfeather/supervision/business/report/template/ScoreDetailSummary.kt
@@ -3,6 +3,8 @@
import cn.flightfeather.supervision.business.report.BaseCols
import cn.flightfeather.supervision.business.report.BaseTemplate
import cn.flightfeather.supervision.business.report.DataSource
import cn.flightfeather.supervision.business.report.bean.BaseTemplateResult
import cn.flightfeather.supervision.business.report.bean.ScoreDetailSummaryResult
import cn.flightfeather.supervision.business.report.cols.*
class ScoreDetailSummary(dataSource: DataSource) : BaseTemplate(dataSource) {
@@ -11,5 +13,6 @@
        ColTotalGrade(),
        ColItemGrade()
    )
    override var resultObjects: MutableList<BaseTemplateResult> = mutableListOf(ScoreDetailSummaryResult())
    override val templateName: String = "规范性评估详情表"
}
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/DataProductMapper.java
@@ -1,7 +1,7 @@
package cn.flightfeather.supervision.domain.ds1.mapper;
import cn.flightfeather.supervision.domain.ds1.entity.DataProduct;
import tk.mybatis.mapper.common.Mapper;
import cn.flightfeather.supervision.domain.util.MyMapper;
public interface DataProductMapper extends Mapper<DataProduct> {
public interface DataProductMapper extends MyMapper<DataProduct> {
}
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/DataProductProDetailMapper.kt
@@ -1,8 +1,8 @@
package cn.flightfeather.supervision.domain.ds1.mapper
import cn.flightfeather.supervision.domain.ds1.entity.DataProductProDetail
import tk.mybatis.mapper.common.Mapper
import cn.flightfeather.supervision.domain.util.MyMapper
interface DataProductProDetailMapper : Mapper<DataProductProDetail> {
    fun insertBatch(list: List<DataProductProDetail>)
interface DataProductProDetailMapper : MyMapper<DataProductProDetail> {
}
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/DataProductTownProAnalysisMapper.kt
@@ -1,8 +1,9 @@
package cn.flightfeather.supervision.domain.ds1.mapper
import cn.flightfeather.supervision.domain.ds1.entity.DataProductTownProAnalysis
import cn.flightfeather.supervision.domain.util.MyMapper
import tk.mybatis.mapper.common.Mapper
interface DataProductTownProAnalysisMapper : Mapper<DataProductTownProAnalysis> {
    fun insertBatch(list: List<DataProductTownProAnalysis>)
interface DataProductTownProAnalysisMapper : MyMapper<DataProductTownProAnalysis> {
}
src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/DataProductRep.kt
@@ -25,7 +25,7 @@
     */
    fun insertDataProduct(dataProduct: DataProduct, specificEntities: List<Any>) {
        // æ ¹æ®ç±»åž‹æ’入指定数据库表
        if (!ObjectUtils.isEmpty(specificEntities)) {
        if (specificEntities.isNotEmpty()) {
            when (specificEntities.first()::class) {
                DataProductProDetail::class -> {
                    (specificEntities as? List<DataProductProDetail>)?.let { let_it ->
@@ -33,7 +33,7 @@
                            for_it.dpGuid = dataProduct.guid
                        }
                        dataProduct.typeId = Constant.DataProductType.PRO_DETAIL_SUMMARY.value
                        dataProductProDetailMapper.insertBatch(let_it)
                        insertProDetailSpecificInfo(let_it)
                    }
                }
                DataProductTownProAnalysis::class -> {
@@ -42,11 +42,24 @@
                            for_it.dpGuid = dataProduct.guid
                        }
                        dataProduct.typeId = Constant.DataProductType.PRO_ANALYSIS_SUMMARY.value
                        dataProductTownProAnalysisMapper.insertBatch(let_it)
                        insertTownProAnalysisSpecificInfo(let_it)
                    }
                }
            }
        }
        insertDataProductBaseInfo(dataProduct)
    }
    private fun insertProDetailSpecificInfo(specificEntities: List<DataProductProDetail>) {
        dataProductProDetailMapper.insertList(specificEntities)
    }
    private fun insertTownProAnalysisSpecificInfo(specificEntities: List<DataProductTownProAnalysis>) {
        dataProductTownProAnalysisMapper.insertList(specificEntities)
    }
     private fun insertDataProductBaseInfo(dataProduct: DataProduct) {
        // è¡Œæ”¿åŒºåŸŸname填充
        if (dataProduct.townCode != null) {
            townMapper.selectByExample(Example(Town::class.java).apply {
src/main/resources/mapper/ds1/DataProductProDetailMapper.xml
@@ -48,53 +48,4 @@
    Change_Check_Per, Ledger_Percent, Ledger_Submit_Date, Ledger_Check_Time, Change_Tracking_Reminder, 
    Create_Time
  </sql>
  <sql id="Base_Column_List_Without_ID" >
    <!--
      WARNING - @mbg.generated
    -->
    DP_GUID, Form_Index, Scene_Index, Scene_Type, Scene_Name, Inspection_Time, Executors,
    Problem_Type, Problem_Description, Problem_Location, Problem_Num, Change_Time, Problem_Changed,
    Changed_Problem, Changed_Num, Unchanged_Problems, UnChanged_Num, Change_Percent,
    Check_Status, Pro_Check_Time, Change_Check_Time, Pro_Check_Num, Pro_Check_Per, Change_Check_Num,
    Change_Check_Per, Ledger_Percent, Ledger_Submit_Date, Ledger_Check_Time, Change_Tracking_Reminder,
    Create_Time
  </sql>
  <insert id="insertBatch" parameterType="java.util.List">
    INSERT INTO sm_t_data_product_prodetail
    ( <include refid="Base_Column_List_Without_ID" /> )
    VALUES
    <foreach collection="list" item="item" separator=",">
      (#{item.dpGuid,jdbcType=VARCHAR},
      #{item.formIndex,jdbcType=INTEGER},
      #{item.sceneIndex,jdbcType=INTEGER},
      #{item.sceneType,jdbcType=VARCHAR},
      #{item.sceneName,jdbcType=VARCHAR},
      #{item.inspectionTime,jdbcType=TIMESTAMP},
      #{item.executors,jdbcType=VARCHAR},
      #{item.problemType,jdbcType=VARCHAR},
      #{item.problemDescription,jdbcType=VARCHAR},
      #{item.problemLocation,jdbcType=VARCHAR},
      #{item.problemNum,jdbcType=INTEGER},
      #{item.changeTime,jdbcType=VARCHAR},
      #{item.problemChanged,jdbcType=VARCHAR},
      #{item.changedProblem,jdbcType=VARCHAR},
      #{item.changedNum,jdbcType=INTEGER},
      #{item.unchangedProblems,jdbcType=VARCHAR},
      #{item.unchangedNum,jdbcType=INTEGER},
      #{item.changePercent,jdbcType=DECIMAL},
      #{item.checkStatus,jdbcType=VARCHAR},
      #{item.proCheckTime,jdbcType=VARCHAR},
      #{item.changeCheckTime,jdbcType=VARCHAR},
      #{item.proCheckNum,jdbcType=INTEGER},
      #{item.proCheckPer,jdbcType=DECIMAL},
      #{item.changeCheckNum,jdbcType=INTEGER},
      #{item.changeCheckPer,jdbcType=DECIMAL},
      #{item.ledgerPercent,jdbcType=DECIMAL},
      #{item.ledgerSubmitDate,jdbcType=TIMESTAMP},
      #{item.ledgerCheckTime,jdbcType=TIMESTAMP},
      #{item.changeTrackingReminder,jdbcType=VARCHAR},
      #{item.createTime,jdbcType=TIMESTAMP})
    </foreach>
  </insert>
</mapper>
src/main/resources/mapper/ds1/DataProductTownProAnalysisMapper.xml
@@ -34,39 +34,4 @@
    Change_Per, Change_Scene_Rank, Pro_Change_Rank, Focus_Scene_Count, Focus_Scene_Per, 
    Create_Time
  </sql>
  <sql id="Base_Column_List_Without_ID" >
    <!--
      WARNING - @mbg.generated
    -->
    DP_GUID, Form_Index, Town_Name, Scene_Type, Scene_Count, Inactive_Scene_Count,
    Active_Scene_Count, Change_Scene_Count, Change_Scene_Per, Pro_Count, Pro_Per, Change_Count,
    Change_Per, Change_Scene_Rank, Pro_Change_Rank, Focus_Scene_Count, Focus_Scene_Per,
    Create_Time
  </sql>
  <insert id="insertBatch" parameterType="java.util.List">
    INSERT INTO sm_t_data_product_townproanalysis
    ( <include refid="Base_Column_List_Without_ID" /> )
    VALUES
    <foreach collection="list" item="item" index="index" separator=",">
      ( #{item.dpGuid,jdbcType=VARCHAR},
      #{item.formIndex,jdbcType=INTEGER},
      #{item.townName,jdbcType=VARCHAR},
      #{item.sceneType,jdbcType=VARCHAR},
      #{item.sceneCount,jdbcType=INTEGER},
      #{item.inactiveSceneCount,jdbcType=INTEGER},
      #{item.activeSceneCount,jdbcType=INTEGER},
      #{item.changeSceneCount,jdbcType=INTEGER},
      #{item.changeScenePer,jdbcType=DECIMAL},
      #{item.proCount,jdbcType=INTEGER},
      #{item.proPer,jdbcType=DECIMAL},
      #{item.changeCount,jdbcType=INTEGER},
      #{item.changePer,jdbcType=DECIMAL},
      #{item.changeSceneRank,jdbcType=INTEGER},
      #{item.proChangeRank,jdbcType=INTEGER},
      #{item.focusSceneCount,jdbcType=INTEGER},
      #{item.focusScenePer,jdbcType=DECIMAL},
      #{item.createTime,jdbcType=TIMESTAMP})
    </foreach>
  </insert>
</mapper>