From 09c8120288ea7df454c10d67911ab8643f2f4235 Mon Sep 17 00:00:00 2001 From: hcong <1050828145@qq.com> Date: 星期二, 17 十二月 2024 11:06:33 +0800 Subject: [PATCH] 1. 完成数据产品中间结果基本信息和具体信息入库 --- src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ProTypeStatusSummaryResult.kt | 7 + src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeRankSummary.kt | 7 src/main/resources/mapper/ds1/DataProductProDetailMapper.xml | 49 --------- src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/DataProductRep.kt | 65 +++++++----- src/main/resources/mapper/ds1/DataProductTownProAnalysisMapper.xml | 35 ------- src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeDetailSummary.kt | 4 src/main/kotlin/cn/flightfeather/supervision/business/report/template/ScoreDetailSummary.kt | 3 src/main/kotlin/cn/flightfeather/supervision/business/report/BaseExcel.kt | 3 src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeStatusSummary.kt | 5 src/main/kotlin/cn/flightfeather/supervision/business/report/template/ScoreAnalysisSummary.kt | 6 src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ScoreAnalysisSummaryResult.kt | 7 + src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/DataProductTownProAnalysisMapper.kt | 5 src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ScoreDetailSummaryResult.kt | 7 + src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ProTypeDetailSummaryResult.kt | 8 + src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/DataProductMapper.java | 4 src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ProTypeRankMainSummaryResult.kt | 7 + src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ProTypeRankSummaryResult.kt | 7 + src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/DataProductProDetailMapper.kt | 6 src/main/kotlin/cn/flightfeather/supervision/business/report/BaseTemplate.kt | 3 src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ProDetailSummaryResult.kt | 2 src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeRankMainSummary.kt | 4 21 files changed, 115 insertions(+), 129 deletions(-) diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/report/BaseExcel.kt b/src/main/kotlin/cn/flightfeather/supervision/business/report/BaseExcel.kt index 86d3475..ab3cf6f 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/business/report/BaseExcel.kt +++ b/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) } } diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/report/BaseTemplate.kt b/src/main/kotlin/cn/flightfeather/supervision/business/report/BaseTemplate.kt index 0c8047d..f143323 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/business/report/BaseTemplate.kt +++ b/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 } /** diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ProDetailSummaryResult.kt b/src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ProDetailSummaryResult.kt index 0877fe1..0896414 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ProDetailSummaryResult.kt +++ b/src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ProDetailSummaryResult.kt @@ -101,7 +101,7 @@ entity.sceneType = this.sceneType entity.sceneName = this.sceneName // 灏哠tring绫诲瀷鐨勭洃绠℃椂闂磋浆鎹负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 diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ProTypeDetailSummaryResult.kt b/src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ProTypeDetailSummaryResult.kt new file mode 100644 index 0000000..fa24018 --- /dev/null +++ b/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") + } +} \ No newline at end of file diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ProTypeRankMainSummaryResult.kt b/src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ProTypeRankMainSummaryResult.kt new file mode 100644 index 0000000..7f9805d --- /dev/null +++ b/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") + } +} \ No newline at end of file diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ProTypeRankSummaryResult.kt b/src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ProTypeRankSummaryResult.kt new file mode 100644 index 0000000..c61e3c5 --- /dev/null +++ b/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") + } +} \ No newline at end of file diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ProTypeStatusSummaryResult.kt b/src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ProTypeStatusSummaryResult.kt new file mode 100644 index 0000000..b723f6e --- /dev/null +++ b/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") + } +} \ No newline at end of file diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ScoreAnalysisSummaryResult.kt b/src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ScoreAnalysisSummaryResult.kt new file mode 100644 index 0000000..1c56ecc --- /dev/null +++ b/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") + } +} \ No newline at end of file diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ScoreDetailSummaryResult.kt b/src/main/kotlin/cn/flightfeather/supervision/business/report/bean/ScoreDetailSummaryResult.kt new file mode 100644 index 0000000..915020a --- /dev/null +++ b/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") + } +} \ No newline at end of file diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeDetailSummary.kt b/src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeDetailSummary.kt index faf72d7..1c9f826 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeDetailSummary.kt +++ b/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 = "闂涓庢暣鏀瑰垎绫荤粺璁¤〃" } \ No newline at end of file diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeRankMainSummary.kt b/src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeRankMainSummary.kt index 1de9b3d..7b8bb95 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeRankMainSummary.kt +++ b/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>) { //鎺掑悕闈犲墠鐨刴ax涓棶棰樿璁ゅ畾涓轰富瑕佹垨鍏稿瀷闂 val max = when (dataSource.config.sceneType.toString()) { diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeRankSummary.kt b/src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeRankSummary.kt index 04aef32..642e304 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeRankSummary.kt +++ b/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>() diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeStatusSummary.kt b/src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeStatusSummary.kt index 2a12726..01ee856 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/business/report/template/ProTypeStatusSummary.kt +++ b/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") diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/report/template/ScoreAnalysisSummary.kt b/src/main/kotlin/cn/flightfeather/supervision/business/report/template/ScoreAnalysisSummary.kt index 1dce64b..26a30c6 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/business/report/template/ScoreAnalysisSummary.kt +++ b/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) } diff --git a/src/main/kotlin/cn/flightfeather/supervision/business/report/template/ScoreDetailSummary.kt b/src/main/kotlin/cn/flightfeather/supervision/business/report/template/ScoreDetailSummary.kt index c42eada..b0c5c50 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/business/report/template/ScoreDetailSummary.kt +++ b/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 = "瑙勮寖鎬ц瘎浼拌鎯呰〃" } \ No newline at end of file diff --git a/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/DataProductMapper.java b/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/DataProductMapper.java index f120443..b39afdf 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/DataProductMapper.java +++ b/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> { } \ No newline at end of file diff --git a/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/DataProductProDetailMapper.kt b/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/DataProductProDetailMapper.kt index 2e86083..6a73f2f 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/DataProductProDetailMapper.kt +++ b/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> { + } \ No newline at end of file diff --git a/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/DataProductTownProAnalysisMapper.kt b/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/DataProductTownProAnalysisMapper.kt index f1e2f78..2479912 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/mapper/DataProductTownProAnalysisMapper.kt +++ b/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> { + } \ No newline at end of file diff --git a/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/DataProductRep.kt b/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/DataProductRep.kt index bd282a9..edc336f 100644 --- a/src/main/kotlin/cn/flightfeather/supervision/domain/ds1/repository/DataProductRep.kt +++ b/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,33 +42,46 @@ for_it.dpGuid = dataProduct.guid } dataProduct.typeId = Constant.DataProductType.PRO_ANALYSIS_SUMMARY.value - dataProductTownProAnalysisMapper.insertBatch(let_it) + insertTownProAnalysisSpecificInfo(let_it) } } } } - // 琛屾斂鍖哄煙name濉厖 - if (dataProduct.townCode != null) { - townMapper.selectByExample(Example(Town::class.java).apply { - createCriteria().andEqualTo("towncode", dataProduct.townCode) - })?.takeIf { it.isNotEmpty() }?.get(0)?.let { dataProduct.townName = it.townname ?: "" } - } - if (dataProduct.provinceCode != null) { - provinceMapper.selectByExample(Example(Province::class.java).apply { - createCriteria().andEqualTo("provincecode", dataProduct.provinceCode) - })?.takeIf { it.isNotEmpty() }?.get(0)?.let { dataProduct.provinceName = it.provincename ?: "" } - } - if (dataProduct.cityCode != null) { - cityMapper.selectByExample(Example(City::class.java).apply { - createCriteria().andEqualTo("citycode", dataProduct.cityCode) - })?.takeIf { it.isNotEmpty() }?.get(0)?.let { dataProduct.cityName = it.cityname ?: "" } - } - if (dataProduct.districtCode != null) { - districtMapper.selectByExample(Example(District::class.java).apply { - createCriteria().andEqualTo("districtcode", dataProduct.districtCode) - })?.takeIf { it.isNotEmpty() }?.get(0)?.let { dataProduct.districtName = it.districtname ?: "" } - } - dataProduct.createTime = Date() - dataProductMapper.insert(dataProduct) + 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 { + createCriteria().andEqualTo("towncode", dataProduct.townCode) + })?.takeIf { it.isNotEmpty() }?.get(0)?.let { dataProduct.townName = it.townname ?: "" } + } + if (dataProduct.provinceCode != null) { + provinceMapper.selectByExample(Example(Province::class.java).apply { + createCriteria().andEqualTo("provincecode", dataProduct.provinceCode) + })?.takeIf { it.isNotEmpty() }?.get(0)?.let { dataProduct.provinceName = it.provincename ?: "" } + } + if (dataProduct.cityCode != null) { + cityMapper.selectByExample(Example(City::class.java).apply { + createCriteria().andEqualTo("citycode", dataProduct.cityCode) + })?.takeIf { it.isNotEmpty() }?.get(0)?.let { dataProduct.cityName = it.cityname ?: "" } + } + if (dataProduct.districtCode != null) { + districtMapper.selectByExample(Example(District::class.java).apply { + createCriteria().andEqualTo("districtcode", dataProduct.districtCode) + })?.takeIf { it.isNotEmpty() }?.get(0)?.let { dataProduct.districtName = it.districtname ?: "" } + } + dataProduct.createTime = Date() + dataProductMapper.insert(dataProduct) } } \ No newline at end of file diff --git a/src/main/resources/mapper/ds1/DataProductProDetailMapper.xml b/src/main/resources/mapper/ds1/DataProductProDetailMapper.xml index 2ac3127..8938c0d 100644 --- a/src/main/resources/mapper/ds1/DataProductProDetailMapper.xml +++ b/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> \ No newline at end of file diff --git a/src/main/resources/mapper/ds1/DataProductTownProAnalysisMapper.xml b/src/main/resources/mapper/ds1/DataProductTownProAnalysisMapper.xml index 0fcbcd7..5de608e 100644 --- a/src/main/resources/mapper/ds1/DataProductTownProAnalysisMapper.xml +++ b/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> \ No newline at end of file -- Gitblit v1.9.3