Commit b7bdb95c authored by dahai's avatar dahai

修改查询任务单详情API(受理库、制证库)

parent ba70812b
...@@ -42,7 +42,7 @@ public interface TaskListMapper { ...@@ -42,7 +42,7 @@ public interface TaskListMapper {
"left join county_dic on substr(PREPRO_PERSON.JMSFZSLH,0,6)= county_dic.COUNTY_CODE\n" + "left join county_dic on substr(PREPRO_PERSON.JMSFZSLH,0,6)= county_dic.COUNTY_CODE\n" +
"where county_dic.COUNTY_CODE is not null " + "where county_dic.COUNTY_CODE is not null " +
"and ACC_GROUP_T.group_no not in (select group_no from group_no)" + "and ACC_GROUP_T.group_no not in (select group_no from group_no)" +
" and to_char(ACC_GROUP_T.IMPORT_TIME,'yyyyMMdd')=#{submitDate}") " and to_char(ACC_GROUP_T.IMPORT_TIME,'yyyyMMdd')=#{submitDate} order by ACC_GROUP_T.group_no")
public List<Map<String,Object>> selectByCountyAtACCU(@Param("submitDate") String submitDate); public List<Map<String,Object>> selectByCountyAtACCU(@Param("submitDate") String submitDate);
/** /**
...@@ -60,9 +60,9 @@ public interface TaskListMapper { ...@@ -60,9 +60,9 @@ public interface TaskListMapper {
"left join ACC_GROUP_T@ACCU_LINK on substr(acc_card_t.accept_no,0,8) = ACC_GROUP_T.group_no\n" + "left join ACC_GROUP_T@ACCU_LINK on substr(acc_card_t.accept_no,0,8) = ACC_GROUP_T.group_no\n" +
"left join CARD_TYPE_DIC on PREPRO_PERSON.card_type_id = CARD_TYPE_DIC.CARD_TYPE_ID\n" + "left join CARD_TYPE_DIC on PREPRO_PERSON.card_type_id = CARD_TYPE_DIC.CARD_TYPE_ID\n" +
"left join county_dic on substr(PREPRO_PERSON.JMSFZSLH,0,6)= county_dic.COUNTY_CODE\n" + "left join county_dic on substr(PREPRO_PERSON.JMSFZSLH,0,6)= county_dic.COUNTY_CODE\n" +
"where county_dic.COUNTY_CODE = #{countyCode} and " + "where county_dic.COUNTY_CODE = #{countyCode} " +
" and ACC_GROUP_T.group_no not in (select group_no from group_no) " + " and ACC_GROUP_T.group_no not in (select group_no from group_no) " +
"to_char(ACC_GROUP_T.IMPORT_TIME,'yyyyMMdd')=#{date}" + " and to_char(ACC_GROUP_T.IMPORT_TIME,'yyyyMMdd')=#{date}" +
" and PREPRO_PERSON.card_type_id = #{typeCode}" + " and PREPRO_PERSON.card_type_id = #{typeCode}" +
") a ) where rn BETWEEN #{minNum} and #{maxNum}") ") a ) where rn BETWEEN #{minNum} and #{maxNum}")
public List<Map<String,Object>> selectByGroupNoAtACCU(@Param("date") String date,@Param("typeCode")String typeCode,@Param("countyCode")String countyCode,@Param("maxNum")long maxNum,@Param("minNum")long minNum ); public List<Map<String,Object>> selectByGroupNoAtACCU(@Param("date") String date,@Param("typeCode")String typeCode,@Param("countyCode")String countyCode,@Param("maxNum")long maxNum,@Param("minNum")long minNum );
......
package com.yxproject.start.service.impl; package com.yxproject.start.service.impl;
import com.sun.org.apache.xerces.internal.xs.datatypes.ObjectList;
import com.yxproject.start.entity.GroupNoEntity; import com.yxproject.start.entity.GroupNoEntity;
import com.yxproject.start.entity.TaskEntity; import com.yxproject.start.entity.TaskEntity;
import com.yxproject.start.entity.TaskList.CountCountyEntity; import com.yxproject.start.entity.TaskList.CountCountyEntity;
...@@ -63,13 +64,13 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -63,13 +64,13 @@ public class TaskListServiceImpl implements TaskListService {
* @return * @return
*/ */
@Override @Override
public List<Object> selectByCountyAtACCU(String date) { public List selectByCountyAtACCU(String date) {
List<Map<String, Object>> maps = taskListMapper.selectByCountyAtACCU(date); List<Map<String, Object>> maps = taskListMapper.selectByCountyAtACCU(date);
List list = new ArrayList();
Map<String,Object> typeMap = new LinkedHashMap<>(); Map<String,Object> typeMap = new LinkedHashMap<>();
//将查询出结果 按制证类型分成 Map
for (Map o :maps){ for (Map o :maps){
// 组合JSON // 组合JSON
if (typeMap!=null&typeMap.containsKey(o.get("CARD_TYPE")+"")){ if (typeMap!=null&&typeMap.containsKey(o.get("CARD_TYPE")+"")){
List<Map<String,Object>> mapList= (List<Map<String,Object>>)typeMap.get(o.get("CARD_TYPE")); List<Map<String,Object>> mapList= (List<Map<String,Object>>)typeMap.get(o.get("CARD_TYPE"));
mapList.add(o); mapList.add(o);
typeMap.put(o.get("CARD_TYPE")+"",mapList); typeMap.put(o.get("CARD_TYPE")+"",mapList);
...@@ -79,76 +80,82 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -79,76 +80,82 @@ public class TaskListServiceImpl implements TaskListService {
typeMap.put(o.get("CARD_TYPE")+"",mapList); typeMap.put(o.get("CARD_TYPE")+"",mapList);
} }
} }
//将已按制证分好的Map 再次细化分为区县Map
for (String type:typeMap.keySet()){ for (String type:typeMap.keySet()){
Map<String,Object> typeMapList = new LinkedHashMap<>();
List<Map<String,Object>> typeList = new ArrayList<>();
List<Map<String,Object>> mapList = (List<Map<String,Object>>)typeMap.get(type); List<Map<String,Object>> mapList = (List<Map<String,Object>>)typeMap.get(type);
int typeSum =0; Map<String,Object> typemap = new LinkedHashMap<>();
String typeCode = null; for (Map<String,Object> o:mapList){
for (Map o:mapList) { if (typemap!=null&&typemap.containsKey(o.get("COUNTY_CODE")+"")){
typeCode=o.get("CARD_TYPE_ID").toString(); List<Map<String,Object>> maplist= (List<Map<String,Object>>)typemap.get(o.get("COUNTY_CODE"));
typeSum+=Integer.valueOf(o.get("VALID_COUNT") + ""); maplist.add(o);
Map<String,Object> countyMap = new LinkedHashMap<>(); typemap.put(o.get("COUNTY_CODE")+"",maplist);
if (countyMap !=null&countyMap.containsKey(o.get("COUNTYNAME")+"")){
List<Map<String,Object>> countyList= (List<Map<String,Object>>)countyMap.get(o.get("CARD_TYPE"));
countyList.add(o);
Integer valid_count = Integer.valueOf(o.get("VALID_COUNT") + "");
valid_count+=Integer.valueOf(countyMap.get("countyValidCount").toString());
Integer invalid_count = Integer.valueOf(o.get("INVALID_COUNT") + "");
invalid_count+=Integer.valueOf(countyMap.get("countyInvalidCount").toString());
countyMap.put(o.get("COUNTYNAME")+"",countyList);
countyMap.put("countyCode",o.get("COUNTY_CODE"));
countyMap.put("groupCount",countyList.size());
countyMap.put("typeCode",typeCode);
countyMap.put("countyValidCount",valid_count);
countyMap.put("countyInvalidCount",invalid_count);
}else { }else {
List<Map<String,Object>> countyList = new ArrayList<>(); List<Map<String,Object>> maplist = new ArrayList<>();
countyList.add(o); maplist.add(o);
countyMap.put(o.get("COUNTYNAME")+"",countyList); typemap.put(o.get("COUNTY_CODE")+"",maplist);
countyMap.put("groupList",countyList);
countyMap.put("countyCode",o.get("COUNTY_CODE"));
countyMap.put("groupCount",countyList.size());
countyMap.put("typeCode",typeCode);
countyMap.put("countyValidCount",Integer.valueOf(o.get("VALID_COUNT")+""));
countyMap.put("countyInvalidCount",Integer.valueOf(o.get("INVALID_COUNT")+""));
} }
countyMap.put("countyName",o.get("COUNTYNAME")); }
countyMap.put("saveDate",o.get("SUBMIT_DATE")); typeMap.put(type,typemap);
countyMap.remove(o.get("COUNTYNAME")); }
List<Map<String,Object>> mapList1 = (List<Map<String,Object>>)countyMap.get("groupList"); List<Map<String,Object>> typeList = new ArrayList<>();
if (mapList1.size()==1){ for (String type:typeMap.keySet()){
countyMap.put("groupNum",mapList1.get(0).get("GROUP_NO")); 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 county:mapList.keySet()){
Map<String,Object> countyMapGroup= new LinkedHashMap<>();
int validCount =0;
int invalidCount =0;
String countyName =null;
Object submitDate = null;
List<Map<String, Object>> countyMapList = mapList.get(county);
for (Map<String,Object> countyMap:countyMapList){
submitDate = countyMap.get("SUBMIT_DATE");
countyName = countyMap.get("COUNTYNAME")+"";
typeName = countyMap.get("CARD_TYPE_ID") + "";
typeSum+=Integer.valueOf(countyMap.get("VALID_COUNT") + "");
validCount+=Integer.valueOf(countyMap.get("VALID_COUNT") + "");
invalidCount+=Integer.valueOf(countyMap.get("INVALID_COUNT") + "");
}
if (countyMapList.size()==1){
countyMapGroup.put("groupNum",countyMapList.get(0).get("GROUP_NO"));
}else { }else {
List<Integer> c = new ArrayList<>(); List<Integer> c = new ArrayList<>();
List<Integer> nsList = new ArrayList<>(); List<Integer> nsList = new ArrayList<>();
for (int i = 0; i < mapList1.size(); i++) { for (int i = 0; i < countyMapList.size(); i++) {
/** /**
* 判断组号中时候含有历史回迁组 * 判断组号中时候含有历史回迁组
*/ */
if (((( mapList1.get(i)).get("GROUP_NO")) + "").contains("L")) { if (((( countyMapList.get(i)).get("GROUP_NO")) + "").contains("L")) {
if ((((mapList1.get(i)).get("GROUP_NO")) + "").length() == 8) { if ((((countyMapList.get(i)).get("GROUP_NO")) + "").length() == 8) {
nsList.add(Integer.parseInt(((( mapList1.get(i)).get("GROUP_NO")) + "").substring(1, ((( mapList1.get(i)).get("GROUP_NO")) + "").length()))); nsList.add(Integer.parseInt(((( countyMapList.get(i)).get("GROUP_NO")) + "").substring(1, ((( countyMapList.get(i)).get("GROUP_NO")) + "").length())));
} }
} else { } else {
if (((( mapList1.get(i)).get("GROUP_NO")) + "").length() == 8) { if (((( countyMapList.get(i)).get("GROUP_NO")) + "").length() == 8) {
nsList.add(Integer.parseInt(((( mapList1.get(i)).get("GROUP_NO")) + ""))); nsList.add(Integer.parseInt(((( countyMapList.get(i)).get("GROUP_NO")) + "")));
} }
} }
} }
countyMap.put("groupNum",createGroupNo(c, nsList)); countyMapGroup.put("groupNum",createGroupNo(c, nsList));
} }
countyMap.remove("groupList"); countyMapGroup.put("countyCode",county);
typeList.add(countyMap); countyMapGroup.put("groupList",countyMapList);
countyMapGroup.put("saveDate",submitDate);
countyMapGroup.put("countyName",countyName);
countyMapGroup.put("countyValidCount",validCount);
countyMapGroup.put("countyInvalidCount",invalidCount);
countyList.add(countyMapGroup);
} }
typeMapList.put("typeName",type); mapType.put("typeCode",typeName);
typeMapList.put("typeCode",typeCode); mapType.put("typeSum",typeSum );
typeMapList.put("typeSum",typeSum); mapType.put("typeName", type);
typeMapList.put("countyList",typeList); mapType.put("countyList",countyList);
list.add(typeMapList); typeList.add(mapType);
} }
return list; return typeList;
} }
/** /**
...@@ -292,7 +299,6 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -292,7 +299,6 @@ public class TaskListServiceImpl implements TaskListService {
private List formateMap(List<Map<String, Object>> maplist){ private List formateMap(List<Map<String, Object>> maplist){
List list = new ArrayList();
Map<String,Object> typeMap = new LinkedHashMap<>(); Map<String,Object> typeMap = new LinkedHashMap<>();
for (Map o :maplist){ for (Map o :maplist){
// 组合JSON // 组合JSON
...@@ -306,82 +312,86 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -306,82 +312,86 @@ public class TaskListServiceImpl implements TaskListService {
typeMap.put(o.get("CARD_TYPE")+"",mapList); typeMap.put(o.get("CARD_TYPE")+"",mapList);
} }
} }
//将已按制证分好的Map 再次细化分为区县Map
for (String type:typeMap.keySet()){ for (String type:typeMap.keySet()){
Map<String,Object> typeMapList = new LinkedHashMap<>();
List<Map<String,Object>> typeList = new ArrayList<>();
List<Map<String,Object>> mapList = (List<Map<String,Object>>)typeMap.get(type); List<Map<String,Object>> mapList = (List<Map<String,Object>>)typeMap.get(type);
int typeSum =0; Map<String,Object> typemap = new LinkedHashMap<>();
String typeCode = null; for (Map<String,Object> o:mapList){
for (Map o:mapList) { if (typemap!=null&&typemap.containsKey(o.get("COUNTY_CODE")+"")){
typeCode=o.get("CARD_TYPE_ID").toString(); List<Map<String,Object>> maplist_county= (List<Map<String,Object>>)typemap.get(o.get("COUNTY_CODE"));
typeSum+=Integer.valueOf(o.get("VALID_COUNT") + ""); maplist_county.add(o);
Map<String,Object> countyMap = new LinkedHashMap<>(); typemap.put(o.get("COUNTY_CODE")+"",maplist_county);
if (countyMap !=null&countyMap.containsKey(o.get("COUNTYNAME")+"")){
List<Map<String,Object>> countyList= (List<Map<String,Object>>)countyMap.get(o.get("CARD_TYPE"));
countyList.add(o);
Integer valid_count = Integer.valueOf(o.get("VALID_COUNT") + "");
valid_count+=Integer.valueOf(countyMap.get("countyValidCount").toString());
Integer invalid_count = Integer.valueOf(o.get("INVALID_COUNT") + "");
invalid_count+=Integer.valueOf(countyMap.get("countyInvalidCount").toString());
Integer FAILECOUNT = Integer.valueOf(o.get("FAILECOUNT") + "");
FAILECOUNT+=Integer.valueOf(countyMap.get("faileCount").toString());
countyMap.put("faileCount",FAILECOUNT);
Integer SPECIAL_CARD_COUNT = Integer.valueOf(o.get("SPECIAL_CARD_COUNT") + "");
SPECIAL_CARD_COUNT+=Integer.valueOf(countyMap.get("specialCount").toString());
countyMap.put("specialCount",SPECIAL_CARD_COUNT);
countyMap.put(o.get("COUNTYNAME")+"",countyList);
countyMap.put("countyCode",o.get("COUNTY_CODE"));
countyMap.put("groupCount",countyList.size());
countyMap.put("typeCode",typeCode);
countyMap.put("countyValidCount",valid_count);
countyMap.put("countyInvalidCount",invalid_count);
}else { }else {
List<Map<String,Object>> countyList = new ArrayList<>(); List<Map<String,Object>> maplist_county = new ArrayList<>();
countyList.add(o); maplist_county.add(o);
countyMap.put(o.get("COUNTYNAME")+"",countyList); typemap.put(o.get("COUNTY_CODE")+"",maplist_county);
countyMap.put("groupList",countyList);
countyMap.put("countyCode",o.get("COUNTY_CODE"));
countyMap.put("groupCount",countyList.size());
countyMap.put("typeCode",typeCode);
countyMap.put("faileCount",o.get("FAILECOUNT"));
countyMap.put("specialCount",o.get("SPECIAL_CARD_COUNT"));
countyMap.put("countyValidCount",Integer.valueOf(o.get("VALID_COUNT")+""));
countyMap.put("countyInvalidCount",Integer.valueOf(o.get("INVALID_COUNT")+""));
} }
countyMap.put("countyName",o.get("COUNTYNAME")); }
countyMap.remove(o.get("COUNTYNAME")); typeMap.put(type,typemap);
List<Map<String,Object>> mapList1 = (List<Map<String,Object>>)countyMap.get("groupList"); }
if (mapList1.size()==1){ List<Map<String,Object>> typeList = new ArrayList<>();
countyMap.put("groupNum",mapList1.get(0).get("GROUP_NO")); 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 county:mapList.keySet()){
Map<String,Object> countyMapGroup= new LinkedHashMap<>();
int validCount =0;
int invalidCount =0;
int specialCount=0;
int faileCount=0;
String countyName =null;
Object submitDate = null;
List<Map<String, Object>> countyMapList = mapList.get(county);
for (Map<String,Object> countyMap:countyMapList){
submitDate = countyMap.get("SUBMIT_DATE");
countyName = countyMap.get("COUNTYNAME")+"";
typeName = countyMap.get("CARD_TYPE_ID") + "";
typeSum+=Integer.valueOf(countyMap.get("VALID_COUNT") + "");
validCount+=Integer.valueOf(countyMap.get("VALID_COUNT") + "");
invalidCount+=Integer.valueOf(countyMap.get("INVALID_COUNT") + "");
specialCount+=Integer.valueOf(countyMap.get("SPECIAL_CARD_COUNT") + "");
faileCount+=Integer.valueOf(countyMap.get("FAILECOUNT") + "");
}
if (countyMapList.size()==1){
countyMapGroup.put("groupNum",countyMapList.get(0).get("GROUP_NO"));
}else { }else {
List<Integer> c = new ArrayList<>(); List<Integer> c = new ArrayList<>();
List<Integer> nsList = new ArrayList<>(); List<Integer> nsList = new ArrayList<>();
for (int i = 0; i < mapList1.size(); i++) { for (int i = 0; i < countyMapList.size(); i++) {
/** /**
* 判断组号中时候含有历史回迁组 * 判断组号中时候含有历史回迁组
*/ */
if (((( mapList1.get(i)).get("GROUP_NO")) + "").contains("L")) { if (((( countyMapList.get(i)).get("GROUP_NO")) + "").contains("L")) {
if ((((mapList1.get(i)).get("GROUP_NO")) + "").length() == 8) { if ((((countyMapList.get(i)).get("GROUP_NO")) + "").length() == 8) {
nsList.add(Integer.parseInt(((( mapList1.get(i)).get("GROUP_NO")) + "").substring(1, ((( mapList1.get(i)).get("GROUP_NO")) + "").length()))); nsList.add(Integer.parseInt(((( countyMapList.get(i)).get("GROUP_NO")) + "").substring(1, ((( countyMapList.get(i)).get("GROUP_NO")) + "").length())));
} }
} else { } else {
if (((( mapList1.get(i)).get("GROUP_NO")) + "").length() == 8) { if (((( countyMapList.get(i)).get("GROUP_NO")) + "").length() == 8) {
nsList.add(Integer.parseInt(((( mapList1.get(i)).get("GROUP_NO")) + ""))); nsList.add(Integer.parseInt(((( countyMapList.get(i)).get("GROUP_NO")) + "")));
} }
} }
} }
countyMap.put("groupNum",createGroupNo(c, nsList)); countyMapGroup.put("groupNum",createGroupNo(c, nsList));
} }
countyMap.remove("groupList"); countyMapGroup.put("faileCount",faileCount);
typeList.add(countyMap); countyMapGroup.put("specialCount",specialCount);
countyMapGroup.put("countyCode",county);
countyMapGroup.put("groupList",countyMapList);
countyMapGroup.put("saveDate",submitDate);
countyMapGroup.put("countyName",countyName);
countyMapGroup.put("countyValidCount",validCount);
countyMapGroup.put("countyInvalidCount",invalidCount);
countyList.add(countyMapGroup);
} }
typeMapList.put("typeName",type); mapType.put("typeCode",typeName);
typeMapList.put("typeCode",typeCode); mapType.put("typeSum",typeSum );
typeMapList.put("typeSum",typeSum); mapType.put("typeName", type);
typeMapList.put("countyList",typeList); mapType.put("countyList",countyList);
list.add(typeMapList); typeList.add(mapType);
} }
return list; 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