Commit 389638fd authored by dahai's avatar dahai

添加创建、下发、预订位、平压冲切查询历史任务单API

parent bdbc8f36
......@@ -29,7 +29,7 @@ public interface TaskListService {
public List<Object> selectByCountyAtAuxiliary(long process);
public List<Object> selectHistoryTaskAtAuxiliary(long process,String date);
public List selectHistoryTaskAtAuxiliary(long process,String date);
public Map selectByCountyAtAuxiliary2(long process);
......
......@@ -301,36 +301,66 @@ public class TaskListServiceImpl implements TaskListService {
* @return
*/
@Override
public List<Object> selectHistoryTaskAtAuxiliary(long process, String date) {
String str = "and ";
public List selectHistoryTaskAtAuxiliary(long process, String date) {
String str = "";
int pro = (int)process;
List<Map<String,Object>> mapList = new ArrayList<>();
switch (pro){
case 0:
//查询历史任务单 大批证
mapList = taskListMapper.selectHistoryTaskAtAuxiliary_common0( date);
//查询历史任务单 快证
mapList.addAll(taskListMapper.selectHistoryTaskAtAuxiliary_fast0(str));
//查询历史任务单 余证
mapList.addAll(taskListMapper.selectHistoryTaskAtAuxiliary_remaind0(str));
break;
case 1:
str =str +" to_char(ISSUED_DATE,'yyyyMMdd')= '"+date+"'";
//查询历史任务单 大批证
mapList = taskListMapper.selectHistoryTaskAtAuxiliary_common1( date);
//查询历史任务单 快证
mapList.addAll(taskListMapper.selectHistoryTaskAtAuxiliary_fast1(str));
//查询历史任务单 余证
mapList.addAll(taskListMapper.selectHistoryTaskAtAuxiliary_remaind1(str));
break;
case 2:
str =str +" to_char(PRINT_OUT_DATE,'yyyyMMdd')= '"+date+"'";
//查询历史任务单 大批证
mapList = taskListMapper.selectHistoryTaskAtAuxiliary_common2( date);
//查询历史任务单 快证
mapList.addAll(taskListMapper.selectHistoryTaskAtAuxiliary_fast2(str));
//查询历史任务单 余证
mapList.addAll(taskListMapper.selectHistoryTaskAtAuxiliary_remaind2(str));
break;
case 3:
str =str +" to_char(POSITION_DATE,'yyyyMMdd')= '"+date+"'";
//查询历史任务单 大批证
mapList = taskListMapper.selectHistoryTaskAtAuxiliary_common3( date);
//查询历史任务单 快证
mapList.addAll(taskListMapper.selectHistoryTaskAtAuxiliary_fast3(str));
//查询历史任务单 余证
mapList.addAll(taskListMapper.selectHistoryTaskAtAuxiliary_remaind3(str));
break;
case 4:
str =str +" to_char(CONCORA_CRUSH_DATE,'yyyyMMdd')= '"+date+"'";
//查询历史任务单 大批证
mapList = taskListMapper.selectHistoryTaskAtAuxiliary_common4( date);
//查询历史任务单 快证
mapList.addAll(taskListMapper.selectHistoryTaskAtAuxiliary_fast4(str));
//查询历史任务单 余证
mapList.addAll(taskListMapper.selectHistoryTaskAtAuxiliary_remaind4(str));
break;
case 5:
str =str +" to_char(PUNCHING_DATE,'yyyyMMdd')= '"+date+"'";
//查询历史任务单 大批证
mapList = taskListMapper.selectHistoryTaskAtAuxiliary_common5( date);
//查询历史任务单 快证
mapList.addAll(taskListMapper.selectHistoryTaskAtAuxiliary_fast5(str));
//查询历史任务单 余证
mapList.addAll(taskListMapper.selectHistoryTaskAtAuxiliary_remaind5(str));
break;
default:
break;
}
List<Map<String, Object>> mapList1 = formateMap3(mapList);
//查询历史任务单 大批证
List<Map<String, Object>> mapList = taskListMapper.selectHistoryTaskAtAuxiliary_common(process, str);
//查询历史任务单 快证
mapList.addAll(taskListMapper.selectHistoryTaskAtAuxiliary_fast(process,str));
//查询历史任务单 余证
mapList.addAll(taskListMapper.selectHistoryTaskAtAuxiliary_remaind(process,str));
return null;
return mapList1;
}
/**
......@@ -717,4 +747,102 @@ public class TaskListServiceImpl implements TaskListService {
return typeList;
}
private List<Map<String,Object>> formateMap3(List<Map<String, Object>> maplist){
Map<String,Object> typeMap = new LinkedHashMap<>();
for (Map o :maplist){
// 组合JSON
if (typeMap!=null&typeMap.containsKey(o.get("CARD_TYPE")+"")){
List<Map<String,Object>> mapList= (List<Map<String,Object>>)typeMap.get(o.get("CARD_TYPE"));
mapList.add(o);
typeMap.put(o.get("CARD_TYPE")+"",mapList);
}else {
List<Map<String,Object>> mapList = new ArrayList<>();
mapList.add(o);
typeMap.put(o.get("CARD_TYPE")+"",mapList);
}
}
//将已按制证分好的Map 再次细化分为任务单Map
for (String type:typeMap.keySet()){
List<Map<String,Object>> mapList = (List<Map<String,Object>>)typeMap.get(type);
Map<String,Object> typemap = new LinkedHashMap<>();
for (Map<String,Object> o:mapList){
if (typemap!=null&&typemap.containsKey(o.get("TASK_ID")+"")){
List<Map<String,Object>> maplist_county= (List<Map<String,Object>>)typemap.get(o.get("TASK_ID")+"");
maplist_county.add(o);
typemap.put(o.get("TASK_ID")+"",maplist_county);
}else {
List<Map<String,Object>> maplist_county = new ArrayList<>();
maplist_county.add(o);
typemap.put(o.get("TASK_ID")+"",maplist_county);
}
}
typeMap.put(type,typemap);
}
List<Map<String,Object>> typeList = new ArrayList<>();
for (String type:typeMap.keySet()){
Map<String,Object> mapType = new LinkedHashMap<>();
int typeSum =0;
String typeName=null;
List<Map<String,Object>> countyList = new ArrayList<>();
Map<String,List<Map<String, Object>>> mapList = (Map<String,List<Map<String, Object>>>)typeMap.get(type);
for (String taskId:mapList.keySet()){
Map<String,Object> countyMapGroup= new LinkedHashMap<>();
int validCount =0;
int invalidCount =0;
int specialCount=0;
String countyName =null;
String countyCode =null;
Object submitDate = null;
List<Map<String, Object>> countyMapList = mapList.get(taskId);
for (Map<String,Object> countyMap:countyMapList){
submitDate = countyMap.get("SUBMIT_DATE");
countyCode = countyMap.get("COUNTY_CODE")+"";
countyName = countyMap.get("COUNTYNAME")+"";
typeName = countyMap.get("CARD_TYPE_ID") + "";
typeSum+=Integer.valueOf(countyMap.get("VALID_COUNT") + "");
typeSum-=Integer.valueOf(countyMap.get("SPECIAL_CARD_COUNT") + "");
validCount+=Integer.valueOf(countyMap.get("VALID_COUNT") + "");
invalidCount+=Integer.valueOf(countyMap.get("INVALID_COUNT") + "");
specialCount+=Integer.valueOf(countyMap.get("SPECIAL_CARD_COUNT") + "");
}
if (countyMapList.size()==1){
countyMapGroup.put("groupNum",countyMapList.get(0).get("GROUP_NO"));
}else {
List<Integer> c = new ArrayList<>();
List<Integer> nsList = new ArrayList<>();
for (int i = 0; i < countyMapList.size(); i++) {
/**
* 判断组号中时候含有历史回迁组
*/
if (((( countyMapList.get(i)).get("GROUP_NO")) + "").contains("L")) {
if ((((countyMapList.get(i)).get("GROUP_NO")) + "").length() == 8) {
nsList.add(Integer.parseInt(((( countyMapList.get(i)).get("GROUP_NO")) + "").substring(1, ((( countyMapList.get(i)).get("GROUP_NO")) + "").length())));
}
} else {
if (((( countyMapList.get(i)).get("GROUP_NO")) + "").length() == 8) {
nsList.add(Integer.parseInt(((( countyMapList.get(i)).get("GROUP_NO")) + "")));
}
}
}
countyMapGroup.put("groupNum",createGroupNo(c, nsList));
}
countyMapGroup.put("specialCount",specialCount);
countyMapGroup.put("countyCode",countyCode);
countyMapGroup.put("taskId",taskId);
countyMapGroup.put("policeList",countyMapList);
countyMapGroup.put("saveDate",submitDate);
countyMapGroup.put("countyName",countyName);
countyMapGroup.put("countyValidCount",validCount);
countyMapGroup.put("countyInvalidCount",invalidCount);
countyList.add(countyMapGroup);
}
mapType.put("typeCode",typeName);
mapType.put("typeSum",typeSum );
mapType.put("typeName", type);
mapType.put("countyList",countyList);
typeList.add(mapType);
}
return typeList;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment