同步处理明细
parent
6d9f347911
commit
fe37d194a3
|
@ -117,6 +117,7 @@ public class ResponseMappingDeal {
|
|||
.tableDefinitionCallback(this.tableCallback)
|
||||
.tableType(responseConfig.getTableType())
|
||||
.assignType(ResponseConfigConstant.NO_HANDLE)
|
||||
.tableDefinitionCallback(tableCallback)
|
||||
.assignTable(responseConfig.getModelTableName()).build();
|
||||
}
|
||||
// 做数据处理
|
||||
|
|
|
@ -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);
|
||||
}else {
|
||||
String insertSql = MapperBuilderSql.builderInsertSql(assignTable, tempRowDefinition.getUpdateParam(),"item");
|
||||
List<Map<String, Object>> 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();
|
||||
});
|
||||
}
|
||||
}else {
|
||||
String insertSql = MapperBuilderSql.builderInsertSql(assignTable, tempRowDefinition.getUpdateParam(),"item");
|
||||
List<Map<String, Object>> insertList = rowDefinitionList.stream().map(RowDefinition::getUpdateParam).collect(Collectors.toList());
|
||||
flag = this.configMapper.executeInsertBatchCusSql(insertSql, insertList);
|
||||
}
|
||||
if(ResponseUtil.parameterIsNotNull(this.context.getTableDefinitionCallback())){
|
||||
this.context.getTableDefinitionCallback().afterHandle(this.context,flag);
|
||||
}
|
||||
|
|
|
@ -1,8 +1,30 @@
|
|||
package aiyh.utils.response_deal.state;/**
|
||||
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 <h1></h1>
|
||||
**/
|
||||
public class NoHandleState {
|
||||
public class NoHandleState extends State{
|
||||
|
||||
@Override
|
||||
public void handle() {
|
||||
if(this.context.getMainOrDetail() == ResponseConfigConstant.MAIN_TABLE) {
|
||||
Map<String, TableDefinition> detailTableMap = this.context.getDetailTableMap();
|
||||
if (ResponseUtil.parameterIsNotNull(detailTableMap)) {
|
||||
detailTableMap.forEach((key, value) -> {
|
||||
value.setDefaultState(null);
|
||||
value.dataProcess();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,13 +37,13 @@ public interface ReportMapper {
|
|||
@CaseConversion(value = false)
|
||||
List<Map<String, Object>> queryReportData2(@ParamMapper("param") Map<String,Object> 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)
|
||||
|
|
Loading…
Reference in New Issue