Compare commits

...

3 Commits

Author SHA1 Message Date
ic_excellent 0f620a7e22 Merge branch 'dev' of https://gitea.yeyaguitu.cn/ecology/ebu_ecology_dev1 into dev
处理冲突
2023-07-18 15:00:26 +08:00
ic_excellent 030e460c62 同步处理修改 2023-07-18 15:00:07 +08:00
ic_excellent a356e37bdb 上海大数据中心修改 2023-07-18 14:49:21 +08:00
4 changed files with 44 additions and 24 deletions

View File

@ -176,7 +176,7 @@ public class ResponseMappingDeal {
.mainOrDetail(tableMainOrDetail) .mainOrDetail(tableMainOrDetail)
.tableDefinitionCallback(this.tableCallback) .tableDefinitionCallback(this.tableCallback)
.assignType(mainDataAlias.getAssignType()).build(); .assignType(mainDataAlias.getAssignType()).build();
String dataPath = mainDataAlias.getDataPath(); String dataPath = mainDataAlias.getDataAlias();
List<RowDefinition> rowDefinitionList = new ArrayList<>(); List<RowDefinition> rowDefinitionList = new ArrayList<>();
Map<String, TableDefinition> detailTable = isMainTable ? new HashMap<>() : null; Map<String, TableDefinition> detailTable = isMainTable ? new HashMap<>() : null;
// 如果是json数组 // 如果是json数组

View File

@ -82,10 +82,10 @@ public class DataChangeProcess {
String cusText = responseConfigValueChange.getCusText(); String cusText = responseConfigValueChange.getCusText();
cusText = Util.dbc2sbcCase(cusText); cusText = Util.dbc2sbcCase(cusText);
if(StringUtils.isBlank(cusText)){ if(StringUtils.isBlank(cusText)){
throw new CustomerException("when selecting Custom sql, the sql string cannot be empty !!!"); throw new ResponseException("when selecting Custom sql, the sql string cannot be empty !!!");
} }
if(!cusText.startsWith("select ")){ if(!cusText.startsWith("select ")){
throw new CustomerException("When you select custom sql, you are not allowed to perform dangerous operations other than SELECT !!!"); throw new ResponseException("When you select custom sql, you are not allowed to perform dangerous operations other than SELECT !!!");
} }
String tempValue = CONFIG_MAPPER.executeCusQuerySql(cusText, param,new HashMap<>()); String tempValue = CONFIG_MAPPER.executeCusQuerySql(cusText, param,new HashMap<>());
responseConfigValueChange.setJsonData(tempValue); responseConfigValueChange.setJsonData(tempValue);

View File

@ -42,7 +42,7 @@ public interface ReportMapper {
" (select LISTAGG(concat(wb, ',', zw), '-') WITHIN GROUP (ORDER BY wb) from uf_zwfwdjjmb_dt1 where mainid = main.id) ysdx, " + " (select LISTAGG(concat(wb, ',', zw), '-') WITHIN GROUP (ORDER BY wb) from uf_zwfwdjjmb_dt1 where mainid = main.id) ysdx, " +
" dyjbr, (select lastname from hrmresource where id = dyjbr) dyjbr_span," + " dyjbr, (select lastname from hrmresource where id = dyjbr) dyjbr_span," +
" djr, (select lastname from hrmresource where id = djr) djr_span " + " djr, (select lastname from hrmresource where id = djr) djr_span " +
" from uf_zwfwdjjmb main $t{param.whereSql} order by dlsk ") " from uf_zwfwdjjmb main $t{param.whereSql} order by dlsk1 ")
@CaseConversion(value = false) @CaseConversion(value = false)
List<Map<String, Object>> queryReportData3(@ParamMapper("param") Map<String,Object> param,@ParamMapper("uid") int uid); List<Map<String, Object>> queryReportData3(@ParamMapper("param") Map<String,Object> param,@ParamMapper("uid") int uid);
@ -53,19 +53,21 @@ public interface ReportMapper {
*/ */
@Select("select xxhm from uf_bjxxjmbd_dt1 where xxrq = #{currentDate}") @Select("select xxhm from uf_bjxxjmbd_dt1 where xxrq = #{currentDate}")
@CaseConversion(value = false) @CaseConversion(value = false)
List<String> queryTrafficControl(@ParamMapper("param") Map<String,Object> param); List<String> queryTrafficControl(Map<String,Object> param);
/** /**
* *
* @param param * @param param
* @return * @return
*/ */
@Select("select hrm.lastname,ry.zblx,ry.zbry " + @Select("select hrm.lastname today_welcome,ry.zbry,hrm1.lastname organ_watch,ry.zbry1,hrm2.lastname head_watch,ry.zbry2 " +
" from uf_ryzbjlbzjb_dt1 ry " + " from uf_ryzbjlbzjb_dt1 ry " +
" inner join hrmresource hrm on ry.zbry = hrm.id" + " inner join hrmresource hrm on ry.zbry = hrm.id " +
" inner join hrmresource hrm1 on ry.zbry1 = hrm1.id " +
" inner join hrmresource hrm2 on ry.zbry2 = hrm2.id " +
" where #{currentDate} >= ry.zbksrq and #{currentDate} <= ry.zbjsrq }") " where #{currentDate} >= ry.zbksrq and #{currentDate} <= ry.zbjsrq }")
@CaseConversion(value = false) @CaseConversion(value = false)
List<Map<String, Object>> queryDutyData(@ParamMapper("param") Map<String,Object> param); List<Map<String, Object>> queryDutyData(Map<String,Object> param);
/** /**
* *
@ -74,9 +76,9 @@ public interface ReportMapper {
*/ */
@Select("select hrm.lastname " + @Select("select hrm.lastname " +
" from uf_jsyzbap_dt1 jsy " + " from uf_jsyzbap_dt1 jsy " +
" inner join hrmresource hrm on jsy.zbry = hrm.id" + " inner join hrmresource hrm on jsy.$t{field} = hrm.id" +
" where jsy.zblx = #{dutyType} and #{currentDate} >= jsy.zbksrq and #{currentDate} <= jsy.zbjsrq }") " where jsy.zblx = #{dutyType} and #{currentDate} >= jsy.zbksrq and #{currentDate} <= jsy.zbjsrq }")
@CaseConversion(value = false) @CaseConversion(value = false)
List<String> queryCarSchedule(@ParamMapper("param") Map<String,Object> param); List<String> queryCarSchedule(Map<String,Object> param);
} }

View File

@ -46,10 +46,10 @@ public class ReportService {
String flightAndTrain = Util.null2String(param.get("flightAndTrain")); String flightAndTrain = Util.null2String(param.get("flightAndTrain"));
String whereSql = ""; String whereSql = "";
if(!"".equals(beginDate) && !"".equals(endData)){ if(!"".equals(beginDate) && !"".equals(endData)){
whereSql += " and (dlsk between #{param.beginDate} and #{param.endData} )"; whereSql += " and (dlsk1 between #{param.beginDate} and #{param.endData} )";
}else { }else {
param.put("today", TimeUtil.getCurrentDateString()); param.put("today", TimeUtil.getCurrentDateString());
whereSql += " and dlsk >= #{param.today} "; whereSql += " and dlsk1 >= #{param.today} ";
} }
if(!"".equals(registrationPeople)){ if(!"".equals(registrationPeople)){
whereSql += " and dyjbr = #{param.registrationPeople} "; whereSql += " and dyjbr = #{param.registrationPeople} ";
@ -72,30 +72,30 @@ public class ReportService {
//查询值班信息 //查询值班信息
List<Map<String, Object>> dutyData = reportMapper.queryDutyData(param); List<Map<String, Object>> dutyData = reportMapper.queryDutyData(param);
if(Objects.nonNull(dutyData) && !dutyData.isEmpty()) { if(Objects.nonNull(dutyData) && !dutyData.isEmpty()) {
Map<String, List<Map<String, Object>>> dutyTypeMap = dutyData.stream().collect(Collectors.groupingBy(item -> Util.null2String(item.get("zblx"))));
//带班值班员 //带班值班员
filterAndPut(dutyTypeMap.get("0"),titleData,"headWatch"); String headWatch = convertToString(dutyData, "head_watch");
titleData.put("headWatch",headWatch);
//机关值班员 //机关值班员
filterAndPut(dutyTypeMap.get("1"),titleData,"organWatch"); String organWatch = convertToString(dutyData, "organ_watch");
titleData.put("organWatch",organWatch);
//今日迎送人员 //今日迎送人员
filterAndPut(dutyTypeMap.get("2"),titleData,"todayWelcome"); String todayWelcome = convertToString(dutyData, "today_welcome");
titleData.put("todayWelcome",todayWelcome);
} }
titleData.put("dutyData",dutyData);
//查询当日送报人员 //查询当日送报人员
param.put("dutyType",1); param.put("field","zbry1");
List<String> strings = reportMapper.queryCarSchedule(param); List<String> strings = reportMapper.queryCarSchedule(param);
judgeEmptyAndPut(strings,titleData,"currentNewsboy"); judgeEmptyAndPut(strings,titleData,"currentNewsboy");
//查询驾驶值班员
param.put("dutyType",0);
List<String> pilots = reportMapper.queryCarSchedule(param);
judgeEmptyAndPut(pilots,titleData,"pilot");
//查询明日送报人员 //查询明日送报人员
param.put("dutyType",1);
String currentDate = Util.null2String(param.get("currentDate")); String currentDate = Util.null2String(param.get("currentDate"));
currentDate = TimeUtil.dateAdd(currentDate,-1); currentDate = TimeUtil.dateAdd(currentDate,-1);
param.put("currentDate",currentDate); param.put("currentDate",currentDate);
List<String> tomorrowNewsboys = reportMapper.queryCarSchedule(param); List<String> tomorrowNewsboys = reportMapper.queryCarSchedule(param);
judgeEmptyAndPut(tomorrowNewsboys,titleData,"currentNewsboy"); judgeEmptyAndPut(tomorrowNewsboys,titleData,"tomorrowNewsboy");
//查询驾驶值班员
param.put("field","zbry");
List<String> pilots = reportMapper.queryCarSchedule(param);
judgeEmptyAndPut(pilots,titleData,"pilot");
return titleData; return titleData;
} }
@ -112,4 +112,22 @@ public class ReportService {
} }
} }
/**
*
*
* @param list
* @param key
* @return
*/
public String convertToString(List<Map<String, Object>> list, String key) {
if(Objects.isNull(list) || list.isEmpty()){
return "";
}
return list.stream()
.map(map -> map.get(key))
.filter(Objects::nonNull)
.map(Object::toString)
.collect(Collectors.joining(","));
}
} }