Commit 2ed268e1 authored by dahai's avatar dahai

修改查询受理库任务单详情

修改创建任务单详情
parent b4d6aeaf
...@@ -254,32 +254,38 @@ public class TaskListApi { ...@@ -254,32 +254,38 @@ public class TaskListApi {
JSONObject jsonObject = JSONObject.fromObject(str); JSONObject jsonObject = JSONObject.fromObject(str);
String date = jsonObject.getString("date"); String date = jsonObject.getString("date");
String name = jsonObject.getString("name"); String name = jsonObject.getString("name");
JSONArray jsonCounty = jsonObject.getJSONArray("countyList"); // JSONArray jsonCounty = jsonObject.getJSONArray("countyList");
JSONArray jsonGroup = jsonObject.getJSONArray("groupList"); JSONArray jsonGroup = jsonObject.getJSONArray("groupList");
List<Map<String, Object>> countyList = (List<Map<String, Object>>) jsonCounty; // List<Map<String, Object>> countyList = (List<Map<String, Object>>) jsonCounty;
if (countyList.size() > 0) { // if (countyList.size() > 0) {
//正常生成区县任务单 // //正常生成区县任务单
for (Map<String, Object> map : countyList) { // for (Map<String, Object> map : countyList) {
String typeCode = map.get("typeCode").toString(); // String typeCode = map.get("typeCode").toString();
String countyCode = map.get("countyCode").toString(); // String countyCode = map.get("countyCode").toString();
List<Map<String, Object>> objects = taskListService.selectGroupAtACCU(replaceDate(date), typeCode, countyCode); // List<Map<String, Object>> objects = taskListService.selectGroupAtACCU(replaceDate(date), typeCode, countyCode);
boolean b = taskListService.saveTask(objects, name, 0 + ""); // boolean b = taskListService.saveTask(objects, name, 0 + "");
} // }
} // }
//生成某几个组的区县任务单 //生成某几个组的区县任务单
if (jsonGroup.size() > 0) { if (jsonGroup.size() > 0) {
List<String> groupList = (List<String>) jsonGroup; List<List<String>> listList = jsonGroup;
//查询组号详情 for (List<String> groupList :listList){
String groupNo = ""; //查询组号详情
for (int i = 0; i < groupList.size(); i++) { String groupNo = "";
if (i != groupList.size() - 1) { for (int i = 0; i < groupList.size(); i++) {
groupNo = "" + groupNo + groupList.get(i) + ","; if (i != groupList.size() - 1) {
} else { groupNo = "" + groupNo + groupList.get(i) + ",";
groupNo = "" + groupNo + groupList.get(i) + ""; } else {
groupNo = "" + groupNo + groupList.get(i) + "";
}
} }
List<Map<String, Object>> objects = taskListService.selectGroupAtACCU(groupNo);
boolean b = taskListService.saveTask(objects, name, 0 + "");
} }
List<Map<String, Object>> objects = taskListService.selectGroupAtACCU(groupNo);
boolean b = taskListService.saveTask(objects, name, 0 + ""); // List<String> groupList = (List<String>) jsonGroup;
} }
Map<String, Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
map.put("msg", "成功生成任务单"); map.put("msg", "成功生成任务单");
......
...@@ -46,13 +46,15 @@ public interface GroupNoMapper { ...@@ -46,13 +46,15 @@ public interface GroupNoMapper {
* @param groupNo 组号信息 * @param groupNo 组号信息
* @return * @return
*/ */
@Select("select DISTINCT CARD_TYPE_DIC.card_type_id, ACC_GROUP_T.group_no ,ACC_GROUP_T.valid_count,ACC_GROUP_T.invalid_count, county_dic.county_code\n" + @Select("select DISTINCT CARD_TYPE_DIC.card_type_id, ACC_GROUP_T.group_no ,ACC_GROUP_T.valid_count,ACC_GROUP_T.invalid_count, '000000' county_code\n" +
"from ACC_CARD_T@ACCU_LINK \n" + "from ACC_CARD_T@ACCU_LINK \n" +
"left join PREPRO_PERSON on PREPRO_PERSON.JMSFZSLH = acc_card_t.upload_no \n" + "left join PREPRO_PERSON on PREPRO_PERSON.JMSFZSLH = acc_card_t.upload_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 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 is not null and ACC_GROUP_T.deal_flag =3 and" + "where " +
// "county_dic.COUNTY_CODE is not null and " +
"ACC_GROUP_T.deal_flag =3 and" +
" ACC_GROUP_T.group_no in (#{groupNo} ) ") " ACC_GROUP_T.group_no in (#{groupNo} ) ")
public List<Map<String,Object>> selectGroupAtACCUByGroupNo(@Param("groupNo") String groupNo); public List<Map<String,Object>> selectGroupAtACCUByGroupNo(@Param("groupNo") String groupNo);
......
...@@ -35,13 +35,15 @@ public interface TaskListMapper { ...@@ -35,13 +35,15 @@ public interface TaskListMapper {
* @param submitDate * @param submitDate
* @return * @return
*/ */
@Select("select DISTINCT CARD_TYPE_DIC.*, ACC_GROUP_T.* ,county_dic.* from ACC_CARD_T@ACCU_LINK \n" + @Select("select DISTINCT CARD_TYPE_DIC.*, ACC_GROUP_T.* ,'000000' COUNTY_CODE,'0000' COUNTYNAME from ACC_CARD_T@ACCU_LINK \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 ACC_GROUP_T@ACCU_LINK on substr(acc_card_t.accept_no,0,8) = ACC_GROUP_T.group_no\n" +
"left join ACC_GROUP_RELATION_T@ACCU_LINK on ACC_GROUP_RELATION_T.group_no =ACC_GROUP_T.group_no\n" + "left join ACC_GROUP_RELATION_T@ACCU_LINK on ACC_GROUP_RELATION_T.group_no =ACC_GROUP_T.group_no\n" +
"left join CARD_TYPE_DIC on decode(substr(ORIGINAL_NO,3,2),'99',6,substr(ORIGINAL_NO,21,1)) = CARD_TYPE_DIC.CARD_TYPE_ID\n" + "left join CARD_TYPE_DIC on decode(substr(ORIGINAL_NO,3,2),'99',6,substr(ORIGINAL_NO,21,1)) = CARD_TYPE_DIC.CARD_TYPE_ID\n" +
"left join county_dic on substr(acc_card_t.upload_no,0,6)= county_dic.COUNTY_CODE\n" + // "left join county_dic on substr(acc_card_t.upload_no,0,6)= county_dic.COUNTY_CODE\n" +
"where county_dic.COUNTY_CODE is not null \n" + "where " +
"and ACC_GROUP_T.group_no not in (select group_no from group_no)\n" + // "county_dic.COUNTY_CODE is not null \n" +
// "and " +
"ACC_GROUP_T.group_no not in (select group_no from group_no)\n" +
"and to_char(ACC_GROUP_T.IMPORT_TIME,'yyyyMMdd')=#{submitDate} \n" + "and to_char(ACC_GROUP_T.IMPORT_TIME,'yyyyMMdd')=#{submitDate} \n" +
"order by ACC_GROUP_T.group_no") "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);
......
...@@ -130,6 +130,7 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -130,6 +130,7 @@ public class TaskListServiceImpl implements TaskListService {
Map<String, Object> typeMap = new LinkedHashMap<>(); Map<String, Object> typeMap = new LinkedHashMap<>();
//将查询出结果 按制证类型分成 Map //将查询出结果 按制证类型分成 Map
for (Map o : maps) { for (Map o : maps) {
System.out.println(o.get("GROUP_NO")+"-----------");
// 组合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")+"");
...@@ -145,16 +146,34 @@ public class TaskListServiceImpl implements TaskListService { ...@@ -145,16 +146,34 @@ public class TaskListServiceImpl implements TaskListService {
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<>();
int i =0;
for (Map<String, Object> o : mapList) { for (Map<String, Object> o : mapList) {
if (typemap != null && typemap.containsKey(o.get("COUNTY_CODE") + "")) { if (typemap.containsKey(i+"")){
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(i+"");
maplist.add(o); if (maplist.size()>=30){
typemap.put(o.get("COUNTY_CODE") + "", maplist); System.out.println("===========");
} else { i++;
List<Map<String, Object>> maplist = new ArrayList<>(); List<Map<String, Object>> maplist1 = new ArrayList<>();
maplist.add(o); maplist1.add(o);
typemap.put(o.get("COUNTY_CODE") + "", maplist); typemap.put(i+"", maplist1);
} continue;
}else {
System.out.println("------------");
maplist.add(o);
typemap.put(i+"", maplist);
continue;
}
}else {
System.out.println("+++++++++++");
List<Map<String, Object>> maplist = new ArrayList<>();
maplist.add(o);
typemap.put(i+"", maplist);
continue;
}
// mapList.get(i);
} }
typeMap.put(type, typemap); typeMap.put(type, typemap);
} }
......
...@@ -6,6 +6,6 @@ PUBLIC "-//mybatis.org//DTD Config 3.0//EN" ...@@ -6,6 +6,6 @@ PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
<settings> <settings>
<setting name="mapUnderscoreToCamelCase" value="true"/> <setting name="mapUnderscoreToCamelCase" value="true"/>
<setting name="callSettersOnNulls" value="true"/> <setting name="callSettersOnNulls" value="true"/>
<!--<setting name="logImpl" value="STDOUT_LOGGING" />--> <setting name="logImpl" value="STDOUT_LOGGING" />
</settings> </settings>
</configuration> </configuration>
\ No newline at end of file
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