From fe37d194a39fc081868e5431a84665885f91e66f Mon Sep 17 00:00:00 2001 From: ic_excellent <2570192571@qq.com> Date: Wed, 19 Jul 2023 17:19:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E5=A4=84=E7=90=86=E6=98=8E?= =?UTF-8?q?=E7=BB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../response_deal/ResponseMappingDeal.java | 1 + .../utils/response_deal/state/InsertSate.java | 18 ++++++---- .../response_deal/state/NoHandleState.java | 34 +++++++++++++++---- .../xiao/sh_bigdata/mapper/ReportMapper.java | 8 ++--- 4 files changed, 45 insertions(+), 16 deletions(-) diff --git a/src/main/java/aiyh/utils/response_deal/ResponseMappingDeal.java b/src/main/java/aiyh/utils/response_deal/ResponseMappingDeal.java index 81f6d36..0f1977c 100644 --- a/src/main/java/aiyh/utils/response_deal/ResponseMappingDeal.java +++ b/src/main/java/aiyh/utils/response_deal/ResponseMappingDeal.java @@ -117,6 +117,7 @@ public class ResponseMappingDeal { .tableDefinitionCallback(this.tableCallback) .tableType(responseConfig.getTableType()) .assignType(ResponseConfigConstant.NO_HANDLE) + .tableDefinitionCallback(tableCallback) .assignTable(responseConfig.getModelTableName()).build(); } // 做数据处理 diff --git a/src/main/java/aiyh/utils/response_deal/state/InsertSate.java b/src/main/java/aiyh/utils/response_deal/state/InsertSate.java index e0965cc..5863560 100644 --- a/src/main/java/aiyh/utils/response_deal/state/InsertSate.java +++ b/src/main/java/aiyh/utils/response_deal/state/InsertSate.java @@ -65,17 +65,23 @@ public class InsertSate extends State{ flag = this.configMapper.executeUpdateBatchCusSql(updateSql, updateList, whereList); String modeId = Util.getModeIdByTableName(assignTable); Util.rebuildModeDataShareByAsyncList(1,modeId,dataIdList); - if(ResponseUtil.parameterIsNotNull(detailTableMap) && flag){ - detailTableMap.forEach((key,value)->{ - value.setDefaultState(null); - value.dataProcess(); - }); - } }else { String insertSql = MapperBuilderSql.builderInsertSql(assignTable, tempRowDefinition.getUpdateParam(),"item"); List> insertList = rowDefinitionList.stream().map(RowDefinition::getUpdateParam).collect(Collectors.toList()); + rowDefinitionList.forEach(item ->{ + if(mainOrDetail == ResponseConfigConstant.MAIN_TABLE){ + detailTableDeal(item,detailTableMap); + } + insertList.add(item.getUpdateParam()); + }); flag = this.configMapper.executeInsertBatchCusSql(insertSql, insertList); } + if(ResponseUtil.parameterIsNotNull(detailTableMap) && flag){ + detailTableMap.forEach((key,value)->{ + value.setDefaultState(null); + value.dataProcess(); + }); + } if(ResponseUtil.parameterIsNotNull(this.context.getTableDefinitionCallback())){ this.context.getTableDefinitionCallback().afterHandle(this.context,flag); } diff --git a/src/main/java/aiyh/utils/response_deal/state/NoHandleState.java b/src/main/java/aiyh/utils/response_deal/state/NoHandleState.java index 09b5348..537b4fd 100644 --- a/src/main/java/aiyh/utils/response_deal/state/NoHandleState.java +++ b/src/main/java/aiyh/utils/response_deal/state/NoHandleState.java @@ -1,8 +1,30 @@ -package aiyh.utils.response_deal.state;/** - *@ClassName NoHandleState - *@Author 肖博亢 - *@Date 2023/7/19 16:51 - *@Description

+package aiyh.utils.response_deal.state; + +import aiyh.utils.response_deal.constant.ResponseConfigConstant; +import aiyh.utils.response_deal.entity.TableDefinition; +import aiyh.utils.response_deal.util.ResponseUtil; + +import java.util.HashMap; +import java.util.Map; + +/** + * @ClassName NoHandleState + * @Author 肖博亢 + * @Date 2023/7/19 16:51 + * @Description

**/ -public class NoHandleState { +public class NoHandleState extends State{ + + @Override + public void handle() { + if(this.context.getMainOrDetail() == ResponseConfigConstant.MAIN_TABLE) { + Map detailTableMap = this.context.getDetailTableMap(); + if (ResponseUtil.parameterIsNotNull(detailTableMap)) { + detailTableMap.forEach((key, value) -> { + value.setDefaultState(null); + value.dataProcess(); + }); + } + } + } } diff --git a/src/main/java/com/api/bokang/xiao/sh_bigdata/mapper/ReportMapper.java b/src/main/java/com/api/bokang/xiao/sh_bigdata/mapper/ReportMapper.java index e1fd1d5..4cdc5df 100644 --- a/src/main/java/com/api/bokang/xiao/sh_bigdata/mapper/ReportMapper.java +++ b/src/main/java/com/api/bokang/xiao/sh_bigdata/mapper/ReportMapper.java @@ -37,13 +37,13 @@ public interface ReportMapper { @CaseConversion(value = false) List> queryReportData2(@ParamMapper("param") Map param,@ParamMapper("uid") int uid); - @Select("select main.* " + + @Select("select main.*," + " (select lastname from hrmresource where id = dyjbr) dyjbr_span," + " (select lastname from hrmresource where id = djr) djr_span," + " (select LISTAGG(concat(wb, ',', dw), '-') WITHIN GROUP (ORDER BY wb) from uf_zwfwdjjmb_dt1 where mainid = main.id) ysdx," + - " (select LISTAGG(concat(dwclwb,'(', dwcljsywb,')'), ',') WITHIN GROUP (ORDER BY wb) from uf_zwfwdjjmb_dt3 where mainid = main.id) car_people," + - " (select LISTAGG(concat(gzclwb,'(', gzcljsywb,')'), ',') WITHIN GROUP (ORDER BY wb) from uf_zwfwdjjmb_dt4 where mainid = main.id) work_people," + - " (select LISTAGG(concat(fjhwb,'(', ysdxwb,')'), ',') WITHIN GROUP (ORDER BY wb) from uf_zwfwdjjmb_dt2 where mainid = main.id) put_up" + + " (select LISTAGG(concat(dwclwb,'(', dwcljsywb,')'), ',') WITHIN GROUP (ORDER BY dwclwb) from uf_zwfwdjjmb_dt3 where mainid = main.id) car_people," + + " (select LISTAGG(concat(gzclwb,'(', gzcljsywb,')'), ',') WITHIN GROUP (ORDER BY gzclwb) from uf_zwfwdjjmb_dt4 where mainid = main.id) work_people," + + " (select LISTAGG(concat(fjhwb,'(', ysdxwb,')'), ',') WITHIN GROUP (ORDER BY fjhwb) from uf_zwfwdjjmb_dt2 where mainid = main.id) put_up " + "from uf_zwfwdjjmb main $t{param.whereSql} " + "order by dlsk1 ") @CaseConversion(value = false)