Commit af5cf0a5 authored by dahai's avatar dahai

添加查询分拣历史任务单API

parent a6c23473
...@@ -212,7 +212,7 @@ public class TaskListApi { ...@@ -212,7 +212,7 @@ public class TaskListApi {
*/ */
@RequestMapping("queryHistoryTaskAtAuxiliary") @RequestMapping("queryHistoryTaskAtAuxiliary")
public List<Object> queryHistoryTaskAtAuxiliary(@RequestParam("process") String process,@RequestParam("date") String date, HttpServletResponse resp) { public List<Object> queryHistoryTaskAtAuxiliary(@RequestParam("process") String process,@RequestParam("date") String date, HttpServletResponse resp) {
List<Object> objects = taskListService.selectHistoryTaskAtAuxiliary(Long.valueOf(process) ,date); List<Object> objects = taskListService.selectHistoryTaskAtAuxiliary(Long.valueOf(process) ,replaceDate(date));
return objects; return objects;
} }
...@@ -225,7 +225,7 @@ public class TaskListApi { ...@@ -225,7 +225,7 @@ public class TaskListApi {
*/ */
@RequestMapping("queryHistoryTaskAtAuxiliary2") @RequestMapping("queryHistoryTaskAtAuxiliary2")
public List<Object> queryHistoryTaskAtAuxiliary2(@RequestParam("date") String date, HttpServletResponse resp) { public List<Object> queryHistoryTaskAtAuxiliary2(@RequestParam("date") String date, HttpServletResponse resp) {
List<Object> objects = taskListService.selectHistoryTaskAtAuxiliary2(date); List<Object> objects = taskListService.selectHistoryTaskAtAuxiliary2(replaceDate(date));
return objects; return objects;
} }
......
...@@ -270,24 +270,30 @@ public interface TaskListMapper { ...@@ -270,24 +270,30 @@ public interface TaskListMapper {
"order by group_no.GROUP_NO") "order by group_no.GROUP_NO")
public List<Map<String,Object>> selectHistoryTaskAtAuxiliary_common5(@Param("date")String date ); public List<Map<String,Object>> selectHistoryTaskAtAuxiliary_common5(@Param("date")String date );
// /** /**
// * 任务单查询历史 * 任务单查询历史
// * 辅助库 大批证 * 辅助库 大批证
// * @param date 查询时间 * @param date 查询时间
// * @return * @return
// */ */
// @Select("select task.task_id,task.COUNTY_CODE,task.SUBMIT_DATE,task.SUBMIT_NAME," + @Select("select nvl(sum(FINISH_COUNT),0) FINISH_COUNT, SORTING_DATE,SORTING_NAME, task.task_id,task.COUNTY_CODE,task.SUBMIT_DATE,task.SUBMIT_NAME," +
//// "task.ISSUED_DATE,task.ISSUED_NAME,\n" + "task.ISSUED_DATE,task.ISSUED_NAME,\n" +
//// "task.PRINT_OUT_DATE,task.PRINT_OUT_NAME,task.POSITION_DATE,task.POSITION_NAME,task.CONCORA_CRUSH_DATE,\n" + "task.PRINT_OUT_DATE,task.PRINT_OUT_NAME,task.POSITION_DATE,task.POSITION_NAME,task.CONCORA_CRUSH_DATE,\n" +
//// "task.CONCORA_CRUSH_NAME,TASK.PUNCHING_DATE,TASK.PUNCHING_NAME," + "task.CONCORA_CRUSH_NAME,TASK.PUNCHING_DATE,TASK.PUNCHING_NAME," +
// "CARD_TYPE_DIC.CARD_TYPE ,\n" + "CARD_TYPE_DIC.CARD_TYPE ,\n" +
// "CARD_TYPE_DIC.CARD_TYPE_ID,COUNTY_DIC.COUNTYNAME, group_no.VALID_COUNT,group_no.INVALID_COUNT,\n" + "CARD_TYPE_DIC.CARD_TYPE_ID,COUNTY_DIC.COUNTYNAME, group_no.VALID_COUNT,group_no.INVALID_COUNT,\n" +
// "group_no.SPECIAL_CARD_COUNT,group_no.GROUP_NO from group_no left join task on group_no.task_id= task.TASK_ID\n" + "group_no.SPECIAL_CARD_COUNT,group_no.GROUP_NO from group_no left join task on group_no.task_id= task.TASK_ID\n" +
// "left join CARD_TYPE_DIC on CARD_TYPE_DIC.CARD_TYPE_ID = task.CARD_TYPE" + "left join CARD_TYPE_DIC on CARD_TYPE_DIC.CARD_TYPE_ID = task.CARD_TYPE" +
// " left join COUNTY_DIC on COUNTY_DIC.COUNTY_CODE = task.COUNTY_CODE\n" + " left join COUNTY_DIC on COUNTY_DIC.COUNTY_CODE = task.COUNTY_CODE\n" +
// "where 1= 1 and to_char(ISSUED_DATE,'yyyyMMdd')= #{date}\n" + " left join RECEIPT_LIST on RECEIPT_LIST.QR_CODE=GROUP_NO.GROUP_NO " +
// "order by group_no.GROUP_NO") "where 1= 1 and to_char(SORTING_DATE,'yyyyMMdd')= #{date} " +
// public List<Map<String,Object>> selectHistoryTaskAtAuxiliary_common6(@Param("date")String date ); " group by SORTING_DATE, SORTING_NAME, task.task_id, task.COUNTY_CODE, task.SUBMIT_DATE, \n" +
"task.SUBMIT_NAME, task.ISSUED_DATE, task.ISSUED_NAME, task.PRINT_OUT_DATE, task.PRINT_OUT_NAME, \n" +
"task.POSITION_DATE, task.POSITION_NAME, task.CONCORA_CRUSH_DATE, task.CONCORA_CRUSH_NAME, TASK.PUNCHING_DATE, \n" +
"TASK.PUNCHING_NAME, CARD_TYPE_DIC.CARD_TYPE, CARD_TYPE_DIC.CARD_TYPE_ID, COUNTY_DIC.COUNTYNAME, group_no.VALID_COUNT, \n" +
"group_no.INVALID_COUNT, group_no.SPECIAL_CARD_COUNT, group_no.GROUP_NO\n" +
"order by group_no.GROUP_NO")
public List<Map<String,Object>> selectHistoryTaskAtAuxiliary_common6(@Param("date")String date );
...@@ -440,21 +446,19 @@ public interface TaskListMapper { ...@@ -440,21 +446,19 @@ public interface TaskListMapper {
public List<Map<String,Object>> selectHistoryTaskAtAuxiliary_fast5(@Param("date") String date); public List<Map<String,Object>> selectHistoryTaskAtAuxiliary_fast5(@Param("date") String date);
// /** /**
// * 任务单查询历史 * 任务单查询历史
// * 辅助库 快证 * 辅助库 快证
// * @return * @return
// */ */
// @Select("select task.task_id,task.COUNTY_CODE,task.SUBMIT_DATE,task.SUBMIT_NAME,task.ISSUED_DATE,task.ISSUED_NAME,\n" + @Select("select nvl(sum(FINISH_COUNT),0) FINISH_COUNT, SORTING_DATE,SORTING_NAME, task.task_id,task.COUNTY_CODE,task.SUBMIT_DATE,task.SUBMIT_NAME,task.ISSUED_DATE,task.ISSUED_NAME, task.PRINT_OUT_DATE,task.PRINT_OUT_NAME,task.POSITION_DATE,task.POSITION_NAME,task.CONCORA_CRUSH_DATE, task.CONCORA_CRUSH_NAME,TASK.PUNCHING_DATE,TASK.PUNCHING_NAME, '快证' CARD_TYPE , '1' CARD_TYPE_ID,COUNTY_DIC.COUNTYNAME,1 VALID_COUNT,0 INVALID_COUNT, 0 SPECIAL_CARD_COUNT,SPECIAL_CARD.ACCEPT_NO GROUP_NO from SPECIAL_CARD left join task on special_card.task_id= task.TASK_ID left join CARD_TYPE_DIC on CARD_TYPE_DIC.CARD_TYPE_ID = task.CARD_TYPE left join COUNTY_DIC on COUNTY_DIC.COUNTY_CODE = task.COUNTY_CODE\n" +
// "task.PRINT_OUT_DATE,task.PRINT_OUT_NAME,task.POSITION_DATE,task.POSITION_NAME,task.CONCORA_CRUSH_DATE,\n" + "left join RECEIPT_LIST on RECEIPT_LIST.QR_CODE = SPECIAL_CARD.ACCEPT_NO\n" +
// "task.CONCORA_CRUSH_NAME,TASK.PUNCHING_DATE,TASK.PUNCHING_NAME, '快证' CARD_TYPE ,\n" + "where SPECIAL_CARD.SPECIAL_TYPE =2 and SORTING_DATE =#{date} group by SORTING_DATE, SORTING_NAME, task.task_id, task.COUNTY_CODE, task.SUBMIT_DATE, \n" +
// " '1' CARD_TYPE_ID,COUNTY_DIC.COUNTYNAME, group_no.VALID_COUNT,group_no.INVALID_COUNT,\n" + "task.SUBMIT_NAME, task.ISSUED_DATE, task.ISSUED_NAME, task.PRINT_OUT_DATE, task.PRINT_OUT_NAME, \n" +
// "group_no.SPECIAL_CARD_COUNT,group_no.GROUP_NO from group_no left join task on group_no.task_id= task.TASK_ID\n" + "task.POSITION_DATE, task.POSITION_NAME, task.CONCORA_CRUSH_DATE, task.CONCORA_CRUSH_NAME, TASK.PUNCHING_DATE, \n" +
// "left join CARD_TYPE_DIC on CARD_TYPE_DIC.CARD_TYPE_ID = task.CARD_TYPE " + "TASK.PUNCHING_NAME, '快证', '1', COUNTY_DIC.COUNTYNAME, 1, \n" +
// "left join COUNTY_DIC on COUNTY_DIC.COUNTY_CODE = task.COUNTY_CODE\n" + "0, 0, SPECIAL_CARD.ACCEPT_NO order by SPECIAL_CARD.ACCEPT_NO")
// "where SPECIAL_CARD.SPECIAL_TYPE =2" + public List<Map<String,Object>> selectHistoryTaskAtAuxiliary_fast6(@Param("date") String date);
// " and SUBMIT_DATE =#{date} order by SPECIAL_CARD.ACCEPT_NO")
// public List<Map<String,Object>> selectHistoryTaskAtAuxiliary_fast(@Param("date") String date);
...@@ -537,7 +541,6 @@ public interface TaskListMapper { ...@@ -537,7 +541,6 @@ public interface TaskListMapper {
/** /**
* 任务单查询历史 * 任务单查询历史
* 辅助库 余证 * 辅助库 余证
* @param process 工序
* @return * @return
*/ */
@Select("select task.task_id,task.COUNTY_CODE,task.SUBMIT_DATE,task.SUBMIT_NAME,task.ISSUED_DATE,task.ISSUED_NAME,\n" + @Select("select task.task_id,task.COUNTY_CODE,task.SUBMIT_DATE,task.SUBMIT_NAME,task.ISSUED_DATE,task.ISSUED_NAME,\n" +
...@@ -556,7 +559,6 @@ public interface TaskListMapper { ...@@ -556,7 +559,6 @@ public interface TaskListMapper {
/** /**
* 任务单查询历史 * 任务单查询历史
* 辅助库 余证 * 辅助库 余证
* @param process 工序
* @return * @return
*/ */
@Select("select task.task_id,task.COUNTY_CODE,task.SUBMIT_DATE,task.SUBMIT_NAME,task.ISSUED_DATE,task.ISSUED_NAME,\n" + @Select("select task.task_id,task.COUNTY_CODE,task.SUBMIT_DATE,task.SUBMIT_NAME,task.ISSUED_DATE,task.ISSUED_NAME,\n" +
...@@ -575,7 +577,6 @@ public interface TaskListMapper { ...@@ -575,7 +577,6 @@ public interface TaskListMapper {
/** /**
* 任务单查询历史 * 任务单查询历史
* 辅助库 余证 * 辅助库 余证
* @param process 工序
* @return * @return
*/ */
@Select("select task.task_id,task.COUNTY_CODE,task.SUBMIT_DATE,task.SUBMIT_NAME,task.ISSUED_DATE,task.ISSUED_NAME,\n" + @Select("select task.task_id,task.COUNTY_CODE,task.SUBMIT_DATE,task.SUBMIT_NAME,task.ISSUED_DATE,task.ISSUED_NAME,\n" +
...@@ -594,7 +595,6 @@ public interface TaskListMapper { ...@@ -594,7 +595,6 @@ public interface TaskListMapper {
/** /**
* 任务单查询历史 * 任务单查询历史
* 辅助库 余证 * 辅助库 余证
* @param process 工序
* @return * @return
*/ */
@Select("select task.task_id,task.COUNTY_CODE,task.SUBMIT_DATE,task.SUBMIT_NAME,task.ISSUED_DATE,task.ISSUED_NAME,\n" + @Select("select task.task_id,task.COUNTY_CODE,task.SUBMIT_DATE,task.SUBMIT_NAME,task.ISSUED_DATE,task.ISSUED_NAME,\n" +
...@@ -608,22 +608,22 @@ public interface TaskListMapper { ...@@ -608,22 +608,22 @@ public interface TaskListMapper {
" and PUNCHING_DATE =#{date} order by SPECIAL_CARD.ACCEPT_NO") " and PUNCHING_DATE =#{date} order by SPECIAL_CARD.ACCEPT_NO")
public List<Map<String,Object>> selectHistoryTaskAtAuxiliary_remaind5(@Param("date") String date); public List<Map<String,Object>> selectHistoryTaskAtAuxiliary_remaind5(@Param("date") String date);
// /** /**
// * 任务单查询历史 * 任务单查询历史
// * 辅助库 余证 * 辅助库 余证
// * @param process 工序 * @return
// * @return */
// */ @Select("select nvl(sum(FINISH_COUNT),0) FINISH_COUNT, SORTING_DATE,SORTING_NAME, task.task_id,task.COUNTY_CODE,task.SUBMIT_DATE,task.SUBMIT_NAME,task.ISSUED_DATE,task.ISSUED_NAME, task.PRINT_OUT_DATE,task.PRINT_OUT_NAME,task.POSITION_DATE,task.POSITION_NAME,task.CONCORA_CRUSH_DATE, task.CONCORA_CRUSH_NAME,TASK.PUNCHING_DATE,TASK.PUNCHING_NAME, '余证' CARD_TYPE , '99' CARD_TYPE_ID,COUNTY_DIC.COUNTYNAME,1 VALID_COUNT,0 INVALID_COUNT, 0 SPECIAL_CARD_COUNT,SPECIAL_CARD.ACCEPT_NO GROUP_NO \n" +
// @Select("select task.task_id,task.COUNTY_CODE,task.SUBMIT_DATE,task.SUBMIT_NAME,task.ISSUED_DATE,task.ISSUED_NAME,\n" + "from SPECIAL_CARD left join task on special_card.task_id= task.TASK_ID \n" +
// "task.PRINT_OUT_DATE,task.PRINT_OUT_NAME,task.POSITION_DATE,task.POSITION_NAME,task.CONCORA_CRUSH_DATE,\n" + "left join CARD_TYPE_DIC on CARD_TYPE_DIC.CARD_TYPE_ID = task.CARD_TYPE \n" +
// "task.CONCORA_CRUSH_NAME,TASK.PUNCHING_DATE,TASK.PUNCHING_NAME,'余证' CARD_TYPE ,\n" + "left join COUNTY_DIC on COUNTY_DIC.COUNTY_CODE = task.COUNTY_CODE \n" +
// "'99' CARD_TYPE_ID,COUNTY_DIC.COUNTYNAME, group_no.VALID_COUNT,group_no.INVALID_COUNT,\n" + "left join RECEIPT_LIST on SPECIAL_CARD.ACCEPT_NO = RECEIPT_LIST.QR_CODE\n" +
// "group_no.SPECIAL_CARD_COUNT,group_no.GROUP_NO from group_no left join task on group_no.task_id= task.TASK_ID\n" + "where SPECIAL_CARD.SPECIAL_TYPE =1 and SUBMIT_DATE =#{date} group by SORTING_DATE, SORTING_NAME, task.task_id, task.COUNTY_CODE, task.SUBMIT_DATE, \n" +
// "left join CARD_TYPE_DIC on CARD_TYPE_DIC.CARD_TYPE_ID = task.CARD_TYPE" + "task.SUBMIT_NAME, task.ISSUED_DATE, task.ISSUED_NAME, task.PRINT_OUT_DATE, task.PRINT_OUT_NAME, \n" +
// " left join COUNTY_DIC on COUNTY_DIC.COUNTY_CODE = task.COUNTY_CODE\n" + "task.POSITION_DATE, task.POSITION_NAME, task.CONCORA_CRUSH_DATE, task.CONCORA_CRUSH_NAME, TASK.PUNCHING_DATE, \n" +
// "where SPECIAL_CARD.SPECIAL_TYPE =1 " + "TASK.PUNCHING_NAME, '余证', '99', COUNTY_DIC.COUNTYNAME, 1, \n" +
// " and SUBMIT_DATE =#{date} order by SPECIAL_CARD.ACCEPT_NO") "0, 0, SPECIAL_CARD.ACCEPT_NO order by SPECIAL_CARD.ACCEPT_NO")
// public List<Map<String,Object>> selectHistoryTaskAtAuxiliary_remaind(@Param("process") long process ,@Param("date") String date); public List<Map<String,Object>> selectHistoryTaskAtAuxiliary_remaind6(@Param("date") String date);
/** /**
...@@ -632,7 +632,7 @@ public interface TaskListMapper { ...@@ -632,7 +632,7 @@ public interface TaskListMapper {
* @param process 工序 * @param process 工序
* @return * @return
*/ */
@Select("select DISTINCT sum(RECEIPT_LIST.FINISH_COUNT) finish_COUNT, count(substr(prod_card_t.upload_no,0,9)) police_Count,substr(prod_card_t.upload_no,0,9)police_code ,GAJG_DM.GAJG_MC,sum(decode(prod_trace_t.ELECTRIC_WRITER_NO,null,0,1)) e_writer_count,task.submit_date, SPECIAL_CARD.task_id,'余证' CARD_TYPE,'1' CARD_TYPE_ID,COUNTY_DIC.COUNTY_CODE,\n" + @Select("select DISTINCT sum(RECEIPT_LIST.FINISH_COUNT) finish_COUNT, count(substr(prod_card_t.upload_no,0,9)) police_Count,substr(prod_card_t.upload_no,0,9)police_code ,GAJG_DM.GAJG_MC,sum(decode(prod_trace_t.ELECTRIC_WRITER_NO,null,0,1)) e_writer_count,task.submit_date, SPECIAL_CARD.task_id,'余证' CARD_TYPE,'99' CARD_TYPE_ID,COUNTY_DIC.COUNTY_CODE,\n" +
"COUNTY_DIC.COUNTYNAME, 1 VALID_COUNT, 0 INVALID_COUNT,0 SPECIAL_CARD_COUNT,\n" + "COUNTY_DIC.COUNTYNAME, 1 VALID_COUNT, 0 INVALID_COUNT,0 SPECIAL_CARD_COUNT,\n" +
"SPECIAL_CARD.ACCEPT_NO group_No, nvl(fc.faileCount,0) faileCount\n" + "SPECIAL_CARD.ACCEPT_NO group_No, nvl(fc.faileCount,0) faileCount\n" +
"from SPECIAL_CARD left join task on SPECIAL_CARD.task_id= task.TASK_ID\n" + "from SPECIAL_CARD left join task on SPECIAL_CARD.task_id= task.TASK_ID\n" +
...@@ -645,7 +645,7 @@ public interface TaskListMapper { ...@@ -645,7 +645,7 @@ public interface TaskListMapper {
"left join GAJG_DM on GAJG_DM.GAJG_DM = substr(prod_card_t.upload_no,0,9)" + "left join GAJG_DM on GAJG_DM.GAJG_DM = substr(prod_card_t.upload_no,0,9)" +
" left join RECEIPT_LIST on RECEIPT_LIST.QR_CODE = special_card.accept_no " + " left join RECEIPT_LIST on RECEIPT_LIST.QR_CODE = special_card.accept_no " +
" where SPECIAL_CARD.SPECIAL_TYPE =2 and task.TASK_STATE_ID =#{process} " + " where SPECIAL_CARD.SPECIAL_TYPE =2 and task.TASK_STATE_ID =#{process} " +
"group by task.submit_date, SPECIAL_CARD.task_id, '余证', '1', COUNTY_DIC.COUNTY_CODE, \n" + "group by task.submit_date, SPECIAL_CARD.task_id, '余证', '99', COUNTY_DIC.COUNTY_CODE, \n" +
"COUNTY_DIC.COUNTYNAME, 1, 0, 0, SPECIAL_CARD.ACCEPT_NO, \n" + "COUNTY_DIC.COUNTYNAME, 1, 0, 0, SPECIAL_CARD.ACCEPT_NO, \n" +
"nvl(fc.faileCount,0),substr(prod_card_t.upload_no,0,9),GAJG_DM.GAJG_MC order by SPECIAL_CARD.ACCEPT_NO") "nvl(fc.faileCount,0),substr(prod_card_t.upload_no,0,9),GAJG_DM.GAJG_MC order by SPECIAL_CARD.ACCEPT_NO")
public List<Map<String,Object>> selectByCountyAtAuxiliary_remaind2(@Param("process") long process); public List<Map<String,Object>> selectByCountyAtAuxiliary_remaind2(@Param("process") long process);
......
...@@ -34,8 +34,6 @@ public class ImportXmlServiceImpl implements ImportXmlService { ...@@ -34,8 +34,6 @@ public class ImportXmlServiceImpl implements ImportXmlService {
long l = filesMapper.insertFiles(filesEntity); long l = filesMapper.insertFiles(filesEntity);
for (PreproPersonEntity preproPersonEntity : preproPersonEntities) { for (PreproPersonEntity preproPersonEntity : preproPersonEntities) {
preproPersonEntity.setFileId(filesEntity.getId()); preproPersonEntity.setFileId(filesEntity.getId());
System.out.println(preproPersonEntity.getFileId()+"----preproPersonEntity----");
preproPersonMapper.savePreproPersonEntity(preproPersonEntity); preproPersonMapper.savePreproPersonEntity(preproPersonEntity);
} }
return true; return true;
......
...@@ -22,7 +22,7 @@ import java.util.Map; ...@@ -22,7 +22,7 @@ import java.util.Map;
@Service @Service
public class TaskListServiceImpl implements TaskListService { public class TaskListServiceImpl implements TaskListService {
@Autowired @Autowired
private TaskListMapper taskListMapper; private TaskListMapper taskListMapper;
@Autowired @Autowired
private GroupNoMapper groupNoMapper; private GroupNoMapper groupNoMapper;
@Autowired @Autowired
...@@ -30,7 +30,7 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -30,7 +30,7 @@ public class TaskListServiceImpl implements TaskListService {
@Override @Override
public List<CountCountyEntity> selectByCounty(String submitDate) { public List<CountCountyEntity> selectByCounty(String submitDate) {
List <CountCountyEntity> resultList= taskListMapper.selectByCounty(submitDate); List<CountCountyEntity> resultList = taskListMapper.selectByCounty(submitDate);
return resultList; return resultList;
} }
...@@ -42,8 +42,8 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -42,8 +42,8 @@ public class TaskListServiceImpl implements TaskListService {
} }
@Override @Override
public List<TaskListEntity> selectACCU(String submitDate ,String countyCode,String Gajg ) { public List<TaskListEntity> selectACCU(String submitDate, String countyCode, String Gajg) {
List <TaskListEntity> resultList= taskListMapper.selectACCU(submitDate,countyCode,Gajg); List<TaskListEntity> resultList = taskListMapper.selectACCU(submitDate, countyCode, Gajg);
return resultList; return resultList;
} }
...@@ -55,26 +55,26 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -55,26 +55,26 @@ public class TaskListServiceImpl implements TaskListService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean updateState(List<String> list,String process,String name) { public boolean updateState(List<String> list, String process, String name) {
for (String taskId: list) { for (String taskId : list) {
switch (process){ switch (process) {
case "1": case "1":
taskListMapper.updateState1(taskId,process,name); taskListMapper.updateState1(taskId, process, name);
break; break;
case "3": case "3":
taskListMapper.updateState3(taskId,process,name); taskListMapper.updateState3(taskId, process, name);
break; break;
case "4": case "4":
taskListMapper.updateState4(taskId,process,name); taskListMapper.updateState4(taskId, process, name);
break; break;
case "5": case "5":
taskListMapper.updateState5(taskId,process,name); taskListMapper.updateState5(taskId, process, name);
break; break;
case "6": case "6":
taskListMapper.updateState6(taskId,process,name); taskListMapper.updateState6(taskId, process, name);
break; break;
case "7": case "7":
taskListMapper.updateState7(taskId,process,name); taskListMapper.updateState7(taskId, process, name);
break; break;
default: default:
break; break;
...@@ -86,9 +86,9 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -86,9 +86,9 @@ public class TaskListServiceImpl implements TaskListService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean updateState2(List<String> list,String process,String name,long printer) { public boolean updateState2(List<String> list, String process, String name, long printer) {
for (String taskId: list) { for (String taskId : list) {
taskListMapper.updateState2(taskId,process,name,printer); taskListMapper.updateState2(taskId, process, name, printer);
} }
return true; return true;
} }
...@@ -96,99 +96,100 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -96,99 +96,100 @@ public class TaskListServiceImpl implements TaskListService {
/** /**
* 查询任务单详情 * 查询任务单详情
* 受理库 * 受理库
*
* @param date * @param date
* @return * @return
*/ */
@Override @Override
public List selectByCountyAtACCU(String date) { public List selectByCountyAtACCU(String date) {
List<Map<String, Object>> maps = taskListMapper.selectByCountyAtACCU(date); List<Map<String, Object>> maps = taskListMapper.selectByCountyAtACCU(date);
Map<String,Object> typeMap = new LinkedHashMap<>(); Map<String, Object> typeMap = new LinkedHashMap<>();
//将查询出结果 按制证类型分成 Map //将查询出结果 按制证类型分成 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);
}else { } else {
List<Map<String,Object>> mapList = new ArrayList<>(); List<Map<String, Object>> mapList = new ArrayList<>();
mapList.add(o); mapList.add(o);
typeMap.put(o.get("CARD_TYPE")+"",mapList); typeMap.put(o.get("CARD_TYPE") + "", mapList);
} }
} }
//将已按制证分好的Map 再次细化分为区县Map //将已按制证分好的Map 再次细化分为区县Map
for (String type:typeMap.keySet()){ for (String type : typeMap.keySet()) {
List<Map<String,Object>> mapList = (List<Map<String,Object>>)typeMap.get(type); List<Map<String, Object>> mapList = (List<Map<String, Object>>) typeMap.get(type);
Map<String,Object> typemap = new LinkedHashMap<>(); Map<String, Object> typemap = new LinkedHashMap<>();
for (Map<String,Object> o:mapList){ for (Map<String, Object> o : mapList) {
if (typemap!=null&&typemap.containsKey(o.get("COUNTY_CODE")+"")){ if (typemap != null && typemap.containsKey(o.get("COUNTY_CODE") + "")) {
List<Map<String,Object>> maplist= (List<Map<String,Object>>)typemap.get(o.get("COUNTY_CODE")); List<Map<String, Object>> maplist = (List<Map<String, Object>>) typemap.get(o.get("COUNTY_CODE"));
maplist.add(o); maplist.add(o);
typemap.put(o.get("COUNTY_CODE")+"",maplist); typemap.put(o.get("COUNTY_CODE") + "", maplist);
}else { } else {
List<Map<String,Object>> maplist = new ArrayList<>(); List<Map<String, Object>> maplist = new ArrayList<>();
maplist.add(o); maplist.add(o);
typemap.put(o.get("COUNTY_CODE")+"",maplist); typemap.put(o.get("COUNTY_CODE") + "", maplist);
} }
} }
typeMap.put(type,typemap); typeMap.put(type, typemap);
} }
List<Map<String,Object>> typeList = new ArrayList<>(); List<Map<String, Object>> typeList = new ArrayList<>();
for (String type:typeMap.keySet()){ for (String type : typeMap.keySet()) {
Map<String,Object> mapType = new LinkedHashMap<>(); Map<String, Object> mapType = new LinkedHashMap<>();
int typeSum =0; int typeSum = 0;
String typeName=null; String typeName = null;
List<Map<String,Object>> countyList = new ArrayList<>(); List<Map<String, Object>> countyList = new ArrayList<>();
Map<String,List<Map<String, Object>>> mapList = (Map<String,List<Map<String, Object>>>)typeMap.get(type); Map<String, List<Map<String, Object>>> mapList = (Map<String, List<Map<String, Object>>>) typeMap.get(type);
for (String county:mapList.keySet()){ for (String county : mapList.keySet()) {
Map<String,Object> countyMapGroup= new LinkedHashMap<>(); Map<String, Object> countyMapGroup = new LinkedHashMap<>();
int validCount =0; int validCount = 0;
int invalidCount =0; int invalidCount = 0;
String countyName =null; String countyName = null;
Object submitDate = null; Object submitDate = null;
List<Map<String, Object>> countyMapList = mapList.get(county); List<Map<String, Object>> countyMapList = mapList.get(county);
for (Map<String,Object> countyMap:countyMapList){ for (Map<String, Object> countyMap : countyMapList) {
submitDate = countyMap.get("SUBMIT_DATE"); submitDate = countyMap.get("SUBMIT_DATE");
countyName = countyMap.get("COUNTYNAME")+""; countyName = countyMap.get("COUNTYNAME") + "";
typeName = countyMap.get("CARD_TYPE_ID") + ""; typeName = countyMap.get("CARD_TYPE_ID") + "";
typeSum+=Integer.valueOf(countyMap.get("VALID_COUNT") + ""); typeSum += Integer.valueOf(countyMap.get("VALID_COUNT") + "");
validCount+=Integer.valueOf(countyMap.get("VALID_COUNT") + ""); validCount += Integer.valueOf(countyMap.get("VALID_COUNT") + "");
invalidCount+=Integer.valueOf(countyMap.get("INVALID_COUNT") + ""); invalidCount += Integer.valueOf(countyMap.get("INVALID_COUNT") + "");
} }
if (countyMapList.size()==1){ if (countyMapList.size() == 1) {
countyMapGroup.put("groupNum",countyMapList.get(0).get("GROUP_NO")); 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 < countyMapList.size(); i++) { for (int i = 0; i < countyMapList.size(); i++) {
/** /**
* 判断组号中时候含有历史回迁组 * 判断组号中时候含有历史回迁组
*/ */
if (((( countyMapList.get(i)).get("GROUP_NO")) + "").contains("L")) { if ((((countyMapList.get(i)).get("GROUP_NO")) + "").contains("L")) {
if ((((countyMapList.get(i)).get("GROUP_NO")) + "").length() == 8) { 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()))); nsList.add(Integer.parseInt((((countyMapList.get(i)).get("GROUP_NO")) + "").substring(1, (((countyMapList.get(i)).get("GROUP_NO")) + "").length())));
} }
} else { } else {
if (((( countyMapList.get(i)).get("GROUP_NO")) + "").length() == 8) { if ((((countyMapList.get(i)).get("GROUP_NO")) + "").length() == 8) {
nsList.add(Integer.parseInt(((( countyMapList.get(i)).get("GROUP_NO")) + ""))); nsList.add(Integer.parseInt((((countyMapList.get(i)).get("GROUP_NO")) + "")));
} }
} }
} }
countyMapGroup.put("groupNum",createGroupNo(c, nsList)); countyMapGroup.put("groupNum", createGroupNo(c, nsList));
} }
countyMapGroup.put("countyCode",county); countyMapGroup.put("countyCode", county);
countyMapGroup.put("groupList",countyMapList); countyMapGroup.put("groupList", countyMapList);
countyMapGroup.put("saveDate",submitDate); countyMapGroup.put("saveDate", submitDate);
countyMapGroup.put("countyName",countyName); countyMapGroup.put("countyName", countyName);
countyMapGroup.put("countyValidCount",validCount); countyMapGroup.put("countyValidCount", validCount);
countyMapGroup.put("countyInvalidCount",invalidCount); countyMapGroup.put("countyInvalidCount", invalidCount);
countyList.add(countyMapGroup); countyList.add(countyMapGroup);
} }
mapType.put("typeCode",typeName); mapType.put("typeCode", typeName);
mapType.put("typeSum",typeSum ); mapType.put("typeSum", typeSum);
mapType.put("typeName", type); mapType.put("typeName", type);
mapType.put("countyList",countyList); mapType.put("countyList", countyList);
typeList.add(mapType); typeList.add(mapType);
} }
return typeList; return typeList;
...@@ -197,20 +198,21 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -197,20 +198,21 @@ public class TaskListServiceImpl implements TaskListService {
/** /**
* 查询组号列表详情 * 查询组号列表详情
* 受理库 * 受理库
* @param date 查询时间 *
* @param typeCode 制证类型 * @param date 查询时间
* @param countyCode 区县代码 * @param typeCode 制证类型
* @param currPage 当前页 * @param countyCode 区县代码
* @param pageSize 页面数量 * @param currPage 当前页
* @param pageSize 页面数量
* @return * @return
*/ */
@Override @Override
public Map<String ,Object> selectByGroupNoAtACCU(String date, String typeCode, String countyCode, long currPage, long pageSize) { public Map<String, Object> selectByGroupNoAtACCU(String date, String typeCode, String countyCode, long currPage, long pageSize) {
List<Map<String, Object>> mapList = taskListMapper.selectByGroupNoAtACCU(date, typeCode, countyCode, currPage * pageSize, (currPage - 1) * pageSize + 1); List<Map<String, Object>> mapList = taskListMapper.selectByGroupNoAtACCU(date, typeCode, countyCode, currPage * pageSize, (currPage - 1) * pageSize + 1);
List<Map<String, Object>> mapList1 = taskListMapper.selectByGroupNoAtACCUCount(date, typeCode, countyCode); List<Map<String, Object>> mapList1 = taskListMapper.selectByGroupNoAtACCUCount(date, typeCode, countyCode);
Map<String,Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
map.put("count",mapList1.size()); map.put("count", mapList1.size());
map.put("groupList",mapList); map.put("groupList", mapList);
return map; return map;
} }
...@@ -218,6 +220,7 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -218,6 +220,7 @@ public class TaskListServiceImpl implements TaskListService {
* 查询任务单详情 * 查询任务单详情
* 辅助库 * 辅助库
* (下发、数据核验) * (下发、数据核验)
*
* @param process 查询工序 * @param process 查询工序
* @return * @return
*/ */
...@@ -241,6 +244,7 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -241,6 +244,7 @@ public class TaskListServiceImpl implements TaskListService {
* 查询任务单详情 * 查询任务单详情
* 辅助库 * 辅助库
* (预订位、平压、冲切) * (预订位、平压、冲切)
*
* @param process 查询工序 * @param process 查询工序
* @return * @return
*/ */
...@@ -253,17 +257,17 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -253,17 +257,17 @@ public class TaskListServiceImpl implements TaskListService {
List<Map<String, Object>> mapList_fast = taskListMapper.selectByCountyAtAuxiliary_fast(process); List<Map<String, Object>> mapList_fast = taskListMapper.selectByCountyAtAuxiliary_fast(process);
//查询余证组号列表 在辅助库中 //查询余证组号列表 在辅助库中
List<Map<String, Object>> mapList_remaind = taskListMapper.selectByCountyAtAuxiliary_remaind(process); List<Map<String, Object>> mapList_remaind = taskListMapper.selectByCountyAtAuxiliary_remaind(process);
List<Map<String,Object>> list = new ArrayList<>(); List<Map<String, Object>> list = new ArrayList<>();
list = formateMap(mapList_common); list = formateMap(mapList_common);
list.addAll(formateMap(mapList_fast)); list.addAll(formateMap(mapList_fast));
list.addAll(formateMap(mapList_remaind)); list.addAll(formateMap(mapList_remaind));
int total =0; int total = 0;
for (Map<String,Object> map : list){ for (Map<String, Object> map : list) {
total+=Integer.valueOf(map.get("typeSum").toString()); total += Integer.valueOf(map.get("typeSum").toString());
} }
Map<String,Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
map.put("total",total); map.put("total", total);
map.put("typeList",list); map.put("typeList", list);
return map; return map;
} }
...@@ -272,6 +276,7 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -272,6 +276,7 @@ public class TaskListServiceImpl implements TaskListService {
* 查询任务单详情 * 查询任务单详情
* 辅助库、制证库 * 辅助库、制证库
* (分拣) * (分拣)
*
* @param process 查询工序 * @param process 查询工序
* @return * @return
*/ */
...@@ -284,7 +289,7 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -284,7 +289,7 @@ public class TaskListServiceImpl implements TaskListService {
List<Map<String, Object>> mapList_fast = taskListMapper.selectByCountyAtAuxiliary_fast2(process); List<Map<String, Object>> mapList_fast = taskListMapper.selectByCountyAtAuxiliary_fast2(process);
//查询余证组号列表 在辅助库、制证库中 //查询余证组号列表 在辅助库、制证库中
List<Map<String, Object>> mapList_remaind = taskListMapper.selectByCountyAtAuxiliary_remaind2(process); List<Map<String, Object>> mapList_remaind = taskListMapper.selectByCountyAtAuxiliary_remaind2(process);
List<Map<String,Object>> list = new ArrayList<>(); List<Map<String, Object>> list = new ArrayList<>();
list = formateMap2(mapList_common); list = formateMap2(mapList_common);
list.addAll(formateMap2(mapList_fast)); list.addAll(formateMap2(mapList_fast));
list.addAll(formateMap2(mapList_remaind)); list.addAll(formateMap2(mapList_remaind));
...@@ -296,18 +301,19 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -296,18 +301,19 @@ public class TaskListServiceImpl implements TaskListService {
* 查询历史任务单详情 * 查询历史任务单详情
* (辅助库) * (辅助库)
* (下发、数据核验、预订位、平压、冲切) * (下发、数据核验、预订位、平压、冲切)
*
* @param process 工序 * @param process 工序
* @param date 查询时间 * @param date 查询时间
* @return * @return
*/ */
@Override @Override
public List selectHistoryTaskAtAuxiliary(long process, String date) { public List selectHistoryTaskAtAuxiliary(long process, String date) {
int pro = (int)process; int pro = (int) process;
List<Map<String,Object>> mapList = new ArrayList<>(); List<Map<String, Object>> mapList = new ArrayList<>();
switch (pro){ switch (pro) {
case 0: case 0:
//查询历史任务单 大批证 //查询历史任务单 大批证
mapList = taskListMapper.selectHistoryTaskAtAuxiliary_common0( date); mapList = taskListMapper.selectHistoryTaskAtAuxiliary_common0(date);
//查询历史任务单 快证 //查询历史任务单 快证
mapList.addAll(taskListMapper.selectHistoryTaskAtAuxiliary_fast0(date)); mapList.addAll(taskListMapper.selectHistoryTaskAtAuxiliary_fast0(date));
//查询历史任务单 余证 //查询历史任务单 余证
...@@ -315,7 +321,7 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -315,7 +321,7 @@ public class TaskListServiceImpl implements TaskListService {
break; break;
case 1: case 1:
//查询历史任务单 大批证 //查询历史任务单 大批证
mapList = taskListMapper.selectHistoryTaskAtAuxiliary_common1( date); mapList = taskListMapper.selectHistoryTaskAtAuxiliary_common1(date);
//查询历史任务单 快证 //查询历史任务单 快证
mapList.addAll(taskListMapper.selectHistoryTaskAtAuxiliary_fast1(date)); mapList.addAll(taskListMapper.selectHistoryTaskAtAuxiliary_fast1(date));
//查询历史任务单 余证 //查询历史任务单 余证
...@@ -323,7 +329,7 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -323,7 +329,7 @@ public class TaskListServiceImpl implements TaskListService {
break; break;
case 2: case 2:
//查询历史任务单 大批证 //查询历史任务单 大批证
mapList = taskListMapper.selectHistoryTaskAtAuxiliary_common2( date); mapList = taskListMapper.selectHistoryTaskAtAuxiliary_common2(date);
//查询历史任务单 快证 //查询历史任务单 快证
mapList.addAll(taskListMapper.selectHistoryTaskAtAuxiliary_fast2(date)); mapList.addAll(taskListMapper.selectHistoryTaskAtAuxiliary_fast2(date));
//查询历史任务单 余证 //查询历史任务单 余证
...@@ -331,7 +337,7 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -331,7 +337,7 @@ public class TaskListServiceImpl implements TaskListService {
break; break;
case 3: case 3:
//查询历史任务单 大批证 //查询历史任务单 大批证
mapList = taskListMapper.selectHistoryTaskAtAuxiliary_common3( date); mapList = taskListMapper.selectHistoryTaskAtAuxiliary_common3(date);
//查询历史任务单 快证 //查询历史任务单 快证
mapList.addAll(taskListMapper.selectHistoryTaskAtAuxiliary_fast3(date)); mapList.addAll(taskListMapper.selectHistoryTaskAtAuxiliary_fast3(date));
//查询历史任务单 余证 //查询历史任务单 余证
...@@ -339,7 +345,7 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -339,7 +345,7 @@ public class TaskListServiceImpl implements TaskListService {
break; break;
case 4: case 4:
//查询历史任务单 大批证 //查询历史任务单 大批证
mapList = taskListMapper.selectHistoryTaskAtAuxiliary_common4( date); mapList = taskListMapper.selectHistoryTaskAtAuxiliary_common4(date);
//查询历史任务单 快证 //查询历史任务单 快证
mapList.addAll(taskListMapper.selectHistoryTaskAtAuxiliary_fast4(date)); mapList.addAll(taskListMapper.selectHistoryTaskAtAuxiliary_fast4(date));
//查询历史任务单 余证 //查询历史任务单 余证
...@@ -347,14 +353,14 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -347,14 +353,14 @@ public class TaskListServiceImpl implements TaskListService {
break; break;
case 5: case 5:
//查询历史任务单 大批证 //查询历史任务单 大批证
mapList = taskListMapper.selectHistoryTaskAtAuxiliary_common5( date); mapList = taskListMapper.selectHistoryTaskAtAuxiliary_common5(date);
//查询历史任务单 快证 //查询历史任务单 快证
mapList.addAll(taskListMapper.selectHistoryTaskAtAuxiliary_fast5(date)); mapList.addAll(taskListMapper.selectHistoryTaskAtAuxiliary_fast5(date));
//查询历史任务单 余证 //查询历史任务单 余证
mapList.addAll(taskListMapper.selectHistoryTaskAtAuxiliary_remaind5(date)); mapList.addAll(taskListMapper.selectHistoryTaskAtAuxiliary_remaind5(date));
break; break;
default: default:
break; break;
} }
List<Map<String, Object>> mapList1 = formateMap3(mapList); List<Map<String, Object>> mapList1 = formateMap3(mapList);
...@@ -366,50 +372,52 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -366,50 +372,52 @@ public class TaskListServiceImpl implements TaskListService {
* 查询历史任务单详情 * 查询历史任务单详情
* (辅助库) * (辅助库)
* (分拣) * (分拣)
*
* @param date 查询时间 * @param date 查询时间
* @return * @return
*/ */
@Override @Override
public List selectHistoryTaskAtAuxiliary2( String date) { public List selectHistoryTaskAtAuxiliary2(String date) {
List<Map<String,Object>> mapList = new ArrayList<>(); List<Map<String, Object>> mapList = new ArrayList<>();
//查询历史任务单 大批证 //查询历史任务单 大批证
mapList = taskListMapper.selectHistoryTaskAtAuxiliary_common5( date); mapList = taskListMapper.selectHistoryTaskAtAuxiliary_common6(date);
//查询历史任务单 快证 //查询历史任务单 快证
mapList.addAll(taskListMapper.selectHistoryTaskAtAuxiliary_fast5(date)); mapList.addAll(taskListMapper.selectHistoryTaskAtAuxiliary_fast6(date));
//查询历史任务单 余证 //查询历史任务单 余证
mapList.addAll(taskListMapper.selectHistoryTaskAtAuxiliary_remaind5(date)); mapList.addAll(taskListMapper.selectHistoryTaskAtAuxiliary_remaind6(date));
List<Map<String, Object>> mapList1 = formateMap3(mapList); List<Map<String, Object>> mapList1 = formateMap4(mapList);
return mapList1; return mapList1;
} }
/** /**
* 查询组号信息 * 查询组号信息
* 受理库 * 受理库
*
* @param date * @param date
* @param typeCode * @param typeCode
* @param countyCode * @param countyCode
* @return * @return
*/ */
@Override @Override
public List selectGroupAtACCU(String date,String typeCode,String countyCode) { public List selectGroupAtACCU(String date, String typeCode, String countyCode) {
return taskListMapper.selectGroupAtACCUByCountyCode(date,typeCode,countyCode); return taskListMapper.selectGroupAtACCUByCountyCode(date, typeCode, countyCode);
} }
/** /**
* 查询组号信息 * 查询组号信息
* 受理库 * 受理库
*
* @param groupNo 受理组号 * @param groupNo 受理组号
* @return * @return
*/ */
@Override @Override
public List selectGroupAtACCU(String groupNo) { public List selectGroupAtACCU(String groupNo) {
return taskListMapper.selectGroupAtACCUByGroupNo(groupNo); return taskListMapper.selectGroupAtACCUByGroupNo(groupNo);
} }
/** /**
* 保存任务单详情 * 保存任务单详情
*
* @param taskEntity * @param taskEntity
* @return * @return
*/ */
...@@ -421,26 +429,27 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -421,26 +429,27 @@ public class TaskListServiceImpl implements TaskListService {
/** /**
* 保存循环单 * 保存循环单
*
* @param list * @param list
* @return * @return
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean saveTask(List<Object> list,String submitName,String process) { public boolean saveTask(List<Object> list, String submitName, String process) {
Map<String,Object> stringObjectMap =(Map<String,Object>)list.get(0); Map<String, Object> stringObjectMap = (Map<String, Object>) list.get(0);
TaskEntity taskEntity = new TaskEntity(); TaskEntity taskEntity = new TaskEntity();
taskEntity.setCardType(Long.valueOf(stringObjectMap.get("CARD_TYPE_ID")+"")); taskEntity.setCardType(Long.valueOf(stringObjectMap.get("CARD_TYPE_ID") + ""));
taskEntity.setCountyCode(stringObjectMap.get("COUNTY_CODE")+""); taskEntity.setCountyCode(stringObjectMap.get("COUNTY_CODE") + "");
taskEntity.setSubmitName(submitName); taskEntity.setSubmitName(submitName);
taskEntity.setTaskStateId(Long.valueOf(process)); taskEntity.setTaskStateId(Long.valueOf(process));
saveTask(taskEntity); saveTask(taskEntity);
for (Object object :list){ for (Object object : list) {
Map<String,Object> map =(Map<String,Object>)object; Map<String, Object> map = (Map<String, Object>) object;
GroupNoEntity groupNoEntity = new GroupNoEntity(); GroupNoEntity groupNoEntity = new GroupNoEntity();
groupNoEntity.setGroupNo(map.get("GROUP_NO")+""); groupNoEntity.setGroupNo(map.get("GROUP_NO") + "");
groupNoEntity.setInvalidCount(Long.valueOf(map.get("INVALID_COUNT")+"")); groupNoEntity.setInvalidCount(Long.valueOf(map.get("INVALID_COUNT") + ""));
groupNoEntity.setValidCount(Long.valueOf(map.get("VALID_COUNT")+"")); groupNoEntity.setValidCount(Long.valueOf(map.get("VALID_COUNT") + ""));
groupNoEntity.setSpecialCardCount((long)0); groupNoEntity.setSpecialCardCount((long) 0);
groupNoEntity.setTaskId(taskEntity.getTaskId()); groupNoEntity.setTaskId(taskEntity.getTaskId());
groupNoMapper.saveGroupNo(groupNoEntity); groupNoMapper.saveGroupNo(groupNoEntity);
} }
...@@ -449,55 +458,57 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -449,55 +458,57 @@ public class TaskListServiceImpl implements TaskListService {
/** /**
* 查询快证在受理库信息 * 查询快证在受理库信息
*
* @param groupNo 组号 * @param groupNo 组号
* @return * @return
*/ */
@Override @Override
public List<Map<String,Object>> selectFastCardAtACCU(String groupNo) { public List<Map<String, Object>> selectFastCardAtACCU(String groupNo) {
return taskListMapper.selectFastCardAtACCU(groupNo); return taskListMapper.selectFastCardAtACCU(groupNo);
} }
/** /**
* 保存快证任务单 * 保存快证任务单
*
* @param list * @param list
* @param submitName * @param submitName
* @return * @return
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean saveFastTask(List<Map<String,Object>> list, String submitName,String acceptNo,long cardType) { public boolean saveFastTask(List<Map<String, Object>> list, String submitName, String acceptNo, long cardType) {
//保存普通证件信息 //保存普通证件信息
Map<String,Object> stringObjectMap =list.get(0); Map<String, Object> stringObjectMap = list.get(0);
TaskEntity taskEntity = new TaskEntity(); TaskEntity taskEntity = new TaskEntity();
taskEntity.setCardType(cardType); taskEntity.setCardType(cardType);
taskEntity.setCountyCode(stringObjectMap.get("COUNTY_CODE")+""); taskEntity.setCountyCode(stringObjectMap.get("COUNTY_CODE") + "");
taskEntity.setSubmitName(submitName); taskEntity.setSubmitName(submitName);
taskEntity.setTaskStateId((long)0); taskEntity.setTaskStateId((long) 0);
saveTask(taskEntity); saveTask(taskEntity);
for (Object object :list){ for (Object object : list) {
Map<String,Object> map =(Map<String,Object>)object; Map<String, Object> map = (Map<String, Object>) object;
GroupNoEntity groupNoEntity = new GroupNoEntity(); GroupNoEntity groupNoEntity = new GroupNoEntity();
groupNoEntity.setGroupNo(map.get("GROUP_NO")+""); groupNoEntity.setGroupNo(map.get("GROUP_NO") + "");
groupNoEntity.setInvalidCount(Long.valueOf(map.get("INVALID_COUNT")+"")); groupNoEntity.setInvalidCount(Long.valueOf(map.get("INVALID_COUNT") + ""));
groupNoEntity.setValidCount(Long.valueOf(map.get("VALID_COUNT")+"")); groupNoEntity.setValidCount(Long.valueOf(map.get("VALID_COUNT") + ""));
groupNoEntity.setSpecialCardCount((long)1); groupNoEntity.setSpecialCardCount((long) 1);
groupNoEntity.setTaskId(taskEntity.getTaskId()); groupNoEntity.setTaskId(taskEntity.getTaskId());
groupNoMapper.saveGroupNo(groupNoEntity); groupNoMapper.saveGroupNo(groupNoEntity);
} }
//保存快证件信息 //保存快证件信息
TaskEntity fastTaskEntity = new TaskEntity(); TaskEntity fastTaskEntity = new TaskEntity();
fastTaskEntity.setCardType((long)1); fastTaskEntity.setCardType((long) 1);
fastTaskEntity.setOldCardType(cardType); fastTaskEntity.setOldCardType(cardType);
fastTaskEntity.setCountyCode(stringObjectMap.get("COUNTY_CODE")+""); fastTaskEntity.setCountyCode(stringObjectMap.get("COUNTY_CODE") + "");
fastTaskEntity.setSubmitName(submitName); fastTaskEntity.setSubmitName(submitName);
fastTaskEntity.setTaskStateId((long)1); fastTaskEntity.setTaskStateId((long) 1);
taskListMapper.saveFastTask(fastTaskEntity); taskListMapper.saveFastTask(fastTaskEntity);
SpecialCardEntity specialCardEntity = new SpecialCardEntity(); SpecialCardEntity specialCardEntity = new SpecialCardEntity();
specialCardEntity.setAcceptNo(acceptNo); specialCardEntity.setAcceptNo(acceptNo);
specialCardEntity.setGroupNo(acceptNo.substring(0,8)); specialCardEntity.setGroupNo(acceptNo.substring(0, 8));
specialCardEntity.setTaskId(fastTaskEntity.getTaskId()); specialCardEntity.setTaskId(fastTaskEntity.getTaskId());
specialCardEntity.setSpecialType((long)2); specialCardEntity.setSpecialType((long) 2);
specialCardEntity.setInitiator(submitName); specialCardEntity.setInitiator(submitName);
specialCardMapper.saveSpecialCard(specialCardEntity); specialCardMapper.saveSpecialCard(specialCardEntity);
return true; return true;
...@@ -505,6 +516,7 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -505,6 +516,7 @@ public class TaskListServiceImpl implements TaskListService {
/** /**
* 查询任务单详情 * 查询任务单详情
*
* @param taskId 任务单流水号 * @param taskId 任务单流水号
* @return * @return
*/ */
...@@ -516,6 +528,7 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -516,6 +528,7 @@ public class TaskListServiceImpl implements TaskListService {
/** /**
* 保存快证任务单 * 保存快证任务单
* 辅助库 * 辅助库
*
* @param taskEntity * @param taskEntity
* @return * @return
*/ */
...@@ -560,307 +573,408 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -560,307 +573,408 @@ public class TaskListServiceImpl implements TaskListService {
} }
private List<Map<String,Object>> formateMap(List<Map<String, Object>> maplist){ private List<Map<String, Object>> formateMap(List<Map<String, Object>> maplist) {
Map<String,Object> typeMap = new LinkedHashMap<>(); Map<String, Object> typeMap = new LinkedHashMap<>();
for (Map o :maplist){ for (Map o : maplist) {
// 组合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);
}else { } else {
List<Map<String,Object>> mapList = new ArrayList<>(); List<Map<String, Object>> mapList = new ArrayList<>();
mapList.add(o); mapList.add(o);
typeMap.put(o.get("CARD_TYPE")+"",mapList); typeMap.put(o.get("CARD_TYPE") + "", mapList);
} }
} }
//将已按制证分好的Map 再次细化分为任务单Map //将已按制证分好的Map 再次细化分为任务单Map
for (String type:typeMap.keySet()){ for (String type : typeMap.keySet()) {
List<Map<String,Object>> mapList = (List<Map<String,Object>>)typeMap.get(type); List<Map<String, Object>> mapList = (List<Map<String, Object>>) typeMap.get(type);
Map<String,Object> typemap = new LinkedHashMap<>(); Map<String, Object> typemap = new LinkedHashMap<>();
for (Map<String,Object> o:mapList){ for (Map<String, Object> o : mapList) {
if (typemap!=null&&typemap.containsKey(o.get("TASK_ID")+"")){ 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")+""); List<Map<String, Object>> maplist_county = (List<Map<String, Object>>) typemap.get(o.get("TASK_ID") + "");
maplist_county.add(o); maplist_county.add(o);
typemap.put(o.get("TASK_ID")+"",maplist_county); typemap.put(o.get("TASK_ID") + "", maplist_county);
}else { } else {
List<Map<String,Object>> maplist_county = new ArrayList<>(); List<Map<String, Object>> maplist_county = new ArrayList<>();
maplist_county.add(o); maplist_county.add(o);
typemap.put(o.get("TASK_ID")+"",maplist_county); typemap.put(o.get("TASK_ID") + "", maplist_county);
} }
} }
typeMap.put(type,typemap); typeMap.put(type, typemap);
} }
List<Map<String,Object>> typeList = new ArrayList<>(); List<Map<String, Object>> typeList = new ArrayList<>();
for (String type:typeMap.keySet()){ for (String type : typeMap.keySet()) {
Map<String,Object> mapType = new LinkedHashMap<>(); Map<String, Object> mapType = new LinkedHashMap<>();
int typeSum =0; int typeSum = 0;
String typeName=null; String typeName = null;
List<Map<String,Object>> countyList = new ArrayList<>(); List<Map<String, Object>> countyList = new ArrayList<>();
Map<String,List<Map<String, Object>>> mapList = (Map<String,List<Map<String, Object>>>)typeMap.get(type); Map<String, List<Map<String, Object>>> mapList = (Map<String, List<Map<String, Object>>>) typeMap.get(type);
for (String taskId:mapList.keySet()){ for (String taskId : mapList.keySet()) {
Map<String,Object> countyMapGroup= new LinkedHashMap<>(); Map<String, Object> countyMapGroup = new LinkedHashMap<>();
int validCount =0; int validCount = 0;
int invalidCount =0; int invalidCount = 0;
int specialCount=0; int specialCount = 0;
int faileCount=0; int faileCount = 0;
String countyName =null; String countyName = null;
String countyCode =null; String countyCode = null;
Object submitDate = null; Object submitDate = null;
List<Map<String, Object>> countyMapList = mapList.get(taskId); List<Map<String, Object>> countyMapList = mapList.get(taskId);
for (Map<String,Object> countyMap:countyMapList){ for (Map<String, Object> countyMap : countyMapList) {
submitDate = countyMap.get("SUBMIT_DATE"); submitDate = countyMap.get("SUBMIT_DATE");
countyCode = countyMap.get("COUNTY_CODE")+""; countyCode = countyMap.get("COUNTY_CODE") + "";
countyName = countyMap.get("COUNTYNAME")+""; countyName = countyMap.get("COUNTYNAME") + "";
typeName = countyMap.get("CARD_TYPE_ID") + ""; typeName = countyMap.get("CARD_TYPE_ID") + "";
typeSum+=Integer.valueOf(countyMap.get("VALID_COUNT") + ""); typeSum += Integer.valueOf(countyMap.get("VALID_COUNT") + "");
typeSum-=Integer.valueOf(countyMap.get("SPECIAL_CARD_COUNT") + ""); typeSum -= Integer.valueOf(countyMap.get("SPECIAL_CARD_COUNT") + "");
validCount+=Integer.valueOf(countyMap.get("VALID_COUNT") + ""); validCount += Integer.valueOf(countyMap.get("VALID_COUNT") + "");
invalidCount+=Integer.valueOf(countyMap.get("INVALID_COUNT") + ""); invalidCount += Integer.valueOf(countyMap.get("INVALID_COUNT") + "");
specialCount+=Integer.valueOf(countyMap.get("SPECIAL_CARD_COUNT") + ""); specialCount += Integer.valueOf(countyMap.get("SPECIAL_CARD_COUNT") + "");
faileCount+=Integer.valueOf(countyMap.get("FAILECOUNT") + ""); faileCount += Integer.valueOf(countyMap.get("FAILECOUNT") + "");
} }
if (countyMapList.size()==1){ if (countyMapList.size() == 1) {
countyMapGroup.put("groupNum",countyMapList.get(0).get("GROUP_NO")); 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 < countyMapList.size(); i++) { for (int i = 0; i < countyMapList.size(); i++) {
/** /**
* 判断组号中时候含有历史回迁组 * 判断组号中时候含有历史回迁组
*/ */
if (((( countyMapList.get(i)).get("GROUP_NO")) + "").contains("L")) { if ((((countyMapList.get(i)).get("GROUP_NO")) + "").contains("L")) {
if ((((countyMapList.get(i)).get("GROUP_NO")) + "").length() == 8) { 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()))); nsList.add(Integer.parseInt((((countyMapList.get(i)).get("GROUP_NO")) + "").substring(1, (((countyMapList.get(i)).get("GROUP_NO")) + "").length())));
} }
} else { } else {
if (((( countyMapList.get(i)).get("GROUP_NO")) + "").length() == 8) { if ((((countyMapList.get(i)).get("GROUP_NO")) + "").length() == 8) {
nsList.add(Integer.parseInt(((( countyMapList.get(i)).get("GROUP_NO")) + ""))); nsList.add(Integer.parseInt((((countyMapList.get(i)).get("GROUP_NO")) + "")));
} }
} }
} }
countyMapGroup.put("groupNum",createGroupNo(c, nsList)); countyMapGroup.put("groupNum", createGroupNo(c, nsList));
} }
countyMapGroup.put("faileCount",faileCount); countyMapGroup.put("faileCount", faileCount);
countyMapGroup.put("specialCount",specialCount); countyMapGroup.put("specialCount", specialCount);
countyMapGroup.put("countyCode",countyCode); countyMapGroup.put("countyCode", countyCode);
countyMapGroup.put("taskId",taskId); countyMapGroup.put("taskId", taskId);
countyMapGroup.put("groupList",countyMapList); countyMapGroup.put("groupList", countyMapList);
countyMapGroup.put("saveDate",submitDate); countyMapGroup.put("saveDate", submitDate);
countyMapGroup.put("countyName",countyName); countyMapGroup.put("countyName", countyName);
countyMapGroup.put("countyValidCount",validCount); countyMapGroup.put("countyValidCount", validCount);
countyMapGroup.put("countyInvalidCount",invalidCount); countyMapGroup.put("countyInvalidCount", invalidCount);
countyList.add(countyMapGroup); countyList.add(countyMapGroup);
} }
mapType.put("typeCode",typeName); mapType.put("typeCode", typeName);
mapType.put("typeSum",typeSum ); mapType.put("typeSum", typeSum);
mapType.put("typeName", type); mapType.put("typeName", type);
mapType.put("countyList",countyList); mapType.put("countyList", countyList);
typeList.add(mapType); typeList.add(mapType);
} }
return typeList; return typeList;
} }
private List<Map<String,Object>> formateMap2(List<Map<String, Object>> maplist){ private List<Map<String, Object>> formateMap2(List<Map<String, Object>> maplist) {
Map<String,Object> typeMap = new LinkedHashMap<>(); Map<String, Object> typeMap = new LinkedHashMap<>();
for (Map o :maplist){ for (Map o : maplist) {
// 组合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);
}else { } else {
List<Map<String,Object>> mapList = new ArrayList<>(); List<Map<String, Object>> mapList = new ArrayList<>();
mapList.add(o); mapList.add(o);
typeMap.put(o.get("CARD_TYPE")+"",mapList); typeMap.put(o.get("CARD_TYPE") + "", mapList);
} }
} }
//将已按制证分好的Map 再次细化分为任务单Map //将已按制证分好的Map 再次细化分为任务单Map
for (String type:typeMap.keySet()){ for (String type : typeMap.keySet()) {
List<Map<String,Object>> mapList = (List<Map<String,Object>>)typeMap.get(type); List<Map<String, Object>> mapList = (List<Map<String, Object>>) typeMap.get(type);
Map<String,Object> typemap = new LinkedHashMap<>(); Map<String, Object> typemap = new LinkedHashMap<>();
for (Map<String,Object> o:mapList){ for (Map<String, Object> o : mapList) {
if (typemap!=null&&typemap.containsKey(o.get("TASK_ID")+"")){ 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")+""); List<Map<String, Object>> maplist_county = (List<Map<String, Object>>) typemap.get(o.get("TASK_ID") + "");
maplist_county.add(o); maplist_county.add(o);
typemap.put(o.get("TASK_ID")+"",maplist_county); typemap.put(o.get("TASK_ID") + "", maplist_county);
}else { } else {
List<Map<String,Object>> maplist_county = new ArrayList<>(); List<Map<String, Object>> maplist_county = new ArrayList<>();
maplist_county.add(o); maplist_county.add(o);
typemap.put(o.get("TASK_ID")+"",maplist_county); typemap.put(o.get("TASK_ID") + "", maplist_county);
} }
} }
typeMap.put(type,typemap); typeMap.put(type, typemap);
} }
List<Map<String,Object>> typeList = new ArrayList<>(); List<Map<String, Object>> typeList = new ArrayList<>();
for (String type:typeMap.keySet()){ for (String type : typeMap.keySet()) {
Map<String,Object> mapType = new LinkedHashMap<>(); Map<String, Object> mapType = new LinkedHashMap<>();
int typeSum =0; int typeSum = 0;
String typeName=null; String typeName = null;
List<Map<String,Object>> countyList = new ArrayList<>(); List<Map<String, Object>> countyList = new ArrayList<>();
Map<String,List<Map<String, Object>>> mapList = (Map<String,List<Map<String, Object>>>)typeMap.get(type); Map<String, List<Map<String, Object>>> mapList = (Map<String, List<Map<String, Object>>>) typeMap.get(type);
for (String taskId:mapList.keySet()){ for (String taskId : mapList.keySet()) {
Map<String,Object> countyMapGroup= new LinkedHashMap<>(); Map<String, Object> countyMapGroup = new LinkedHashMap<>();
int validCount =0; int validCount = 0;
int invalidCount =0; int invalidCount = 0;
int specialCount=0; int specialCount = 0;
int eWriteCount=0; int eWriteCount = 0;
int faileCount=0; int faileCount = 0;
int recheckCount=0; int recheckCount = 0;
String countyName =null; String countyName = null;
String countyCode =null; String countyCode = null;
Object submitDate = null; Object submitDate = null;
List<Map<String, Object>> countyMapList = mapList.get(taskId); List<Map<String, Object>> countyMapList = mapList.get(taskId);
for (Map<String,Object> countyMap:countyMapList){ for (Map<String, Object> countyMap : countyMapList) {
submitDate = countyMap.get("SUBMIT_DATE"); submitDate = countyMap.get("SUBMIT_DATE");
countyCode = countyMap.get("COUNTY_CODE")+""; countyCode = countyMap.get("COUNTY_CODE") + "";
countyName = countyMap.get("COUNTYNAME")+""; countyName = countyMap.get("COUNTYNAME") + "";
typeName = countyMap.get("CARD_TYPE_ID") + ""; typeName = countyMap.get("CARD_TYPE_ID") + "";
typeSum+=Integer.valueOf(countyMap.get("VALID_COUNT") + ""); typeSum += Integer.valueOf(countyMap.get("VALID_COUNT") + "");
typeSum-=Integer.valueOf(countyMap.get("SPECIAL_CARD_COUNT") + ""); typeSum -= Integer.valueOf(countyMap.get("SPECIAL_CARD_COUNT") + "");
validCount+=Integer.valueOf(countyMap.get("VALID_COUNT") + ""); validCount += Integer.valueOf(countyMap.get("VALID_COUNT") + "");
invalidCount+=Integer.valueOf(countyMap.get("INVALID_COUNT") + ""); invalidCount += Integer.valueOf(countyMap.get("INVALID_COUNT") + "");
specialCount+=Integer.valueOf(countyMap.get("SPECIAL_CARD_COUNT") + ""); specialCount += Integer.valueOf(countyMap.get("SPECIAL_CARD_COUNT") + "");
faileCount+=Integer.valueOf(countyMap.get("FAILECOUNT") + ""); faileCount += Integer.valueOf(countyMap.get("FAILECOUNT") + "");
eWriteCount+=Integer.valueOf(countyMap.get("E_WRITER_COUNT") + ""); eWriteCount += Integer.valueOf(countyMap.get("E_WRITER_COUNT") + "");
recheckCount+=Integer.valueOf(countyMap.get("FINISH_COUNT") + ""); recheckCount += Integer.valueOf(countyMap.get("FINISH_COUNT") + "");
} }
if (countyMapList.size()==1){ if (countyMapList.size() == 1) {
countyMapGroup.put("groupNum",countyMapList.get(0).get("GROUP_NO")); 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 < countyMapList.size(); i++) { for (int i = 0; i < countyMapList.size(); i++) {
/** /**
* 判断组号中时候含有历史回迁组 * 判断组号中时候含有历史回迁组
*/ */
if (((( countyMapList.get(i)).get("GROUP_NO")) + "").contains("L")) { if ((((countyMapList.get(i)).get("GROUP_NO")) + "").contains("L")) {
if ((((countyMapList.get(i)).get("GROUP_NO")) + "").length() == 8) { 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()))); nsList.add(Integer.parseInt((((countyMapList.get(i)).get("GROUP_NO")) + "").substring(1, (((countyMapList.get(i)).get("GROUP_NO")) + "").length())));
} }
} else { } else {
if (((( countyMapList.get(i)).get("GROUP_NO")) + "").length() == 8) { if ((((countyMapList.get(i)).get("GROUP_NO")) + "").length() == 8) {
nsList.add(Integer.parseInt(((( countyMapList.get(i)).get("GROUP_NO")) + ""))); nsList.add(Integer.parseInt((((countyMapList.get(i)).get("GROUP_NO")) + "")));
} }
} }
} }
countyMapGroup.put("groupNum",createGroupNo(c, nsList)); countyMapGroup.put("groupNum", createGroupNo(c, nsList));
} }
countyMapGroup.put("faileCount",faileCount); countyMapGroup.put("faileCount", faileCount);
countyMapGroup.put("specialCount",specialCount); countyMapGroup.put("specialCount", specialCount);
countyMapGroup.put("countyCode",countyCode); countyMapGroup.put("countyCode", countyCode);
countyMapGroup.put("taskId",taskId); countyMapGroup.put("taskId", taskId);
countyMapGroup.put("policeList",countyMapList); countyMapGroup.put("policeList", countyMapList);
countyMapGroup.put("saveDate",submitDate); countyMapGroup.put("saveDate", submitDate);
countyMapGroup.put("countyName",countyName); countyMapGroup.put("countyName", countyName);
countyMapGroup.put("eWriteCount",eWriteCount); countyMapGroup.put("eWriteCount", eWriteCount);
countyMapGroup.put("countyValidCount",validCount); countyMapGroup.put("countyValidCount", validCount);
countyMapGroup.put("countyInvalidCount",invalidCount); countyMapGroup.put("countyInvalidCount", invalidCount);
countyMapGroup.put("recheckCount",recheckCount); countyMapGroup.put("recheckCount", recheckCount);
countyList.add(countyMapGroup); countyList.add(countyMapGroup);
} }
mapType.put("typeCode",typeName); mapType.put("typeCode", typeName);
mapType.put("typeSum",typeSum ); mapType.put("typeSum", typeSum);
mapType.put("typeName", type); mapType.put("typeName", type);
mapType.put("countyList",countyList); mapType.put("countyList", countyList);
typeList.add(mapType); typeList.add(mapType);
} }
return typeList; return typeList;
} }
private List<Map<String,Object>> formateMap3(List<Map<String, Object>> maplist){ private List<Map<String, Object>> formateMap3(List<Map<String, Object>> maplist) {
Map<String,Object> typeMap = new LinkedHashMap<>(); Map<String, Object> typeMap = new LinkedHashMap<>();
for (Map o :maplist){ for (Map o : maplist) {
// 组合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);
}else { } else {
List<Map<String,Object>> mapList = new ArrayList<>(); List<Map<String, Object>> mapList = new ArrayList<>();
mapList.add(o); mapList.add(o);
typeMap.put(o.get("CARD_TYPE")+"",mapList); typeMap.put(o.get("CARD_TYPE") + "", mapList);
} }
} }
//将已按制证分好的Map 再次细化分为任务单Map //将已按制证分好的Map 再次细化分为任务单Map
for (String type:typeMap.keySet()){ for (String type : typeMap.keySet()) {
List<Map<String,Object>> mapList = (List<Map<String,Object>>)typeMap.get(type); List<Map<String, Object>> mapList = (List<Map<String, Object>>) typeMap.get(type);
Map<String,Object> typemap = new LinkedHashMap<>(); Map<String, Object> typemap = new LinkedHashMap<>();
for (Map<String,Object> o:mapList){ for (Map<String, Object> o : mapList) {
if (typemap!=null&&typemap.containsKey(o.get("TASK_ID")+"")){ 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")+""); List<Map<String, Object>> maplist_county = (List<Map<String, Object>>) typemap.get(o.get("TASK_ID") + "");
maplist_county.add(o); maplist_county.add(o);
typemap.put(o.get("TASK_ID")+"",maplist_county); typemap.put(o.get("TASK_ID") + "", maplist_county);
}else { } else {
List<Map<String,Object>> maplist_county = new ArrayList<>(); List<Map<String, Object>> maplist_county = new ArrayList<>();
maplist_county.add(o); maplist_county.add(o);
typemap.put(o.get("TASK_ID")+"",maplist_county); typemap.put(o.get("TASK_ID") + "", maplist_county);
} }
} }
typeMap.put(type,typemap); typeMap.put(type, typemap);
} }
List<Map<String,Object>> typeList = new ArrayList<>(); List<Map<String, Object>> typeList = new ArrayList<>();
for (String type:typeMap.keySet()){ for (String type : typeMap.keySet()) {
Map<String,Object> mapType = new LinkedHashMap<>(); Map<String, Object> mapType = new LinkedHashMap<>();
int typeSum =0; int typeSum = 0;
String typeName=null; String typeName = null;
List<Map<String,Object>> countyList = new ArrayList<>(); List<Map<String, Object>> countyList = new ArrayList<>();
Map<String,List<Map<String, Object>>> mapList = (Map<String,List<Map<String, Object>>>)typeMap.get(type); Map<String, List<Map<String, Object>>> mapList = (Map<String, List<Map<String, Object>>>) typeMap.get(type);
for (String taskId:mapList.keySet()){ for (String taskId : mapList.keySet()) {
Map<String,Object> countyMapGroup= new LinkedHashMap<>(); Map<String, Object> countyMapGroup = new LinkedHashMap<>();
int validCount =0; int validCount = 0;
int invalidCount =0; int invalidCount = 0;
int specialCount=0; int specialCount = 0;
String countyName =null; String countyName = null;
String countyCode =null; String countyCode = null;
Object submitDate = null; Object submitDate = null;
List<Map<String, Object>> countyMapList = mapList.get(taskId); List<Map<String, Object>> countyMapList = mapList.get(taskId);
for (Map<String,Object> countyMap:countyMapList){ for (Map<String, Object> countyMap : countyMapList) {
submitDate = countyMap.get("SUBMIT_DATE"); submitDate = countyMap.get("SUBMIT_DATE");
countyCode = countyMap.get("COUNTY_CODE")+""; countyCode = countyMap.get("COUNTY_CODE") + "";
countyName = countyMap.get("COUNTYNAME")+""; countyName = countyMap.get("COUNTYNAME") + "";
typeName = countyMap.get("CARD_TYPE_ID") + ""; typeName = countyMap.get("CARD_TYPE_ID") + "";
typeSum+=Integer.valueOf(countyMap.get("VALID_COUNT") + ""); typeSum += Integer.valueOf(countyMap.get("VALID_COUNT") + "");
typeSum-=Integer.valueOf(countyMap.get("SPECIAL_CARD_COUNT") + ""); typeSum -= Integer.valueOf(countyMap.get("SPECIAL_CARD_COUNT") + "");
validCount+=Integer.valueOf(countyMap.get("VALID_COUNT") + ""); validCount += Integer.valueOf(countyMap.get("VALID_COUNT") + "");
invalidCount+=Integer.valueOf(countyMap.get("INVALID_COUNT") + ""); invalidCount += Integer.valueOf(countyMap.get("INVALID_COUNT") + "");
specialCount+=Integer.valueOf(countyMap.get("SPECIAL_CARD_COUNT") + ""); specialCount += Integer.valueOf(countyMap.get("SPECIAL_CARD_COUNT") + "");
} }
if (countyMapList.size()==1){ if (countyMapList.size() == 1) {
countyMapGroup.put("groupNum",countyMapList.get(0).get("GROUP_NO")); 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 < countyMapList.size(); i++) { for (int i = 0; i < countyMapList.size(); i++) {
/** /**
* 判断组号中时候含有历史回迁组 * 判断组号中时候含有历史回迁组
*/ */
if (((( countyMapList.get(i)).get("GROUP_NO")) + "").contains("L")) { if ((((countyMapList.get(i)).get("GROUP_NO")) + "").contains("L")) {
if ((((countyMapList.get(i)).get("GROUP_NO")) + "").length() == 8) { 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()))); nsList.add(Integer.parseInt((((countyMapList.get(i)).get("GROUP_NO")) + "").substring(1, (((countyMapList.get(i)).get("GROUP_NO")) + "").length())));
} }
} else { } else {
if (((( countyMapList.get(i)).get("GROUP_NO")) + "").length() == 8) { if ((((countyMapList.get(i)).get("GROUP_NO")) + "").length() == 8) {
nsList.add(Integer.parseInt(((( countyMapList.get(i)).get("GROUP_NO")) + ""))); nsList.add(Integer.parseInt((((countyMapList.get(i)).get("GROUP_NO")) + "")));
} }
} }
} }
countyMapGroup.put("groupNum",createGroupNo(c, nsList)); countyMapGroup.put("groupNum", createGroupNo(c, nsList));
} }
countyMapGroup.put("specialCount",specialCount); countyMapGroup.put("specialCount", specialCount);
countyMapGroup.put("countyCode",countyCode); countyMapGroup.put("countyCode", countyCode);
countyMapGroup.put("taskId",taskId); countyMapGroup.put("taskId", taskId);
countyMapGroup.put("policeList",countyMapList); countyMapGroup.put("policeList", countyMapList);
countyMapGroup.put("saveDate",submitDate); countyMapGroup.put("saveDate", submitDate);
countyMapGroup.put("countyName",countyName); countyMapGroup.put("countyName", countyName);
countyMapGroup.put("countyValidCount",validCount); countyMapGroup.put("countyValidCount", validCount);
countyMapGroup.put("countyInvalidCount",invalidCount); 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;
}
private List<Map<String, Object>> formateMap4(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;
int recheckCount = 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") + "");
recheckCount += Integer.valueOf(countyMap.get("FINISH_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);
countyMapGroup.put("recheckCount",recheckCount);
countyList.add(countyMapGroup); countyList.add(countyMapGroup);
} }
mapType.put("typeCode",typeName); mapType.put("typeCode", typeName);
mapType.put("typeSum",typeSum ); mapType.put("typeSum", typeSum);
mapType.put("typeName", type); mapType.put("typeName", type);
mapType.put("countyList",countyList); mapType.put("countyList", countyList);
typeList.add(mapType); typeList.add(mapType);
} }
return typeList; 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