上海大数据中心修改
parent
0be6ca7e80
commit
a356e37bdb
|
@ -82,10 +82,10 @@ public class DataChangeProcess {
|
|||
String cusText = responseConfigValueChange.getCusText();
|
||||
cusText = Util.dbc2sbcCase(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 ")){
|
||||
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<>());
|
||||
responseConfigValueChange.setJsonData(tempValue);
|
||||
|
|
|
@ -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, " +
|
||||
" dyjbr, (select lastname from hrmresource where id = dyjbr) dyjbr_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)
|
||||
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}")
|
||||
@CaseConversion(value = false)
|
||||
List<String> queryTrafficControl(@ParamMapper("param") Map<String,Object> param);
|
||||
List<String> queryTrafficControl(Map<String,Object> param);
|
||||
|
||||
/**
|
||||
* 查询当日值班人员
|
||||
* @param param 查询参数
|
||||
* @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 " +
|
||||
" 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 }")
|
||||
@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 " +
|
||||
" 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 }")
|
||||
@CaseConversion(value = false)
|
||||
List<String> queryCarSchedule(@ParamMapper("param") Map<String,Object> param);
|
||||
List<String> queryCarSchedule(Map<String,Object> param);
|
||||
|
||||
}
|
||||
|
|
|
@ -46,10 +46,10 @@ public class ReportService {
|
|||
String flightAndTrain = Util.null2String(param.get("flightAndTrain"));
|
||||
String whereSql = "";
|
||||
if(!"".equals(beginDate) && !"".equals(endData)){
|
||||
whereSql += " and (dlsk between #{param.beginDate} and #{param.endData} )";
|
||||
whereSql += " and (dlsk1 between #{param.beginDate} and #{param.endData} )";
|
||||
}else {
|
||||
param.put("today", TimeUtil.getCurrentDateString());
|
||||
whereSql += " and dlsk >= #{param.today} ";
|
||||
whereSql += " and dlsk1 >= #{param.today} ";
|
||||
}
|
||||
if(!"".equals(registrationPeople)){
|
||||
whereSql += " and dyjbr = #{param.registrationPeople} ";
|
||||
|
@ -72,30 +72,30 @@ public class ReportService {
|
|||
//查询值班信息
|
||||
List<Map<String, Object>> dutyData = reportMapper.queryDutyData(param);
|
||||
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);
|
||||
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"));
|
||||
currentDate = TimeUtil.dateAdd(currentDate,-1);
|
||||
param.put("currentDate",currentDate);
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -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(","));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue