Commit 2ed268e1 authored by dahai's avatar dahai

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

修改创建任务单详情
parent b4d6aeaf
......@@ -254,21 +254,22 @@ public class TaskListApi {
JSONObject jsonObject = JSONObject.fromObject(str);
String date = jsonObject.getString("date");
String name = jsonObject.getString("name");
JSONArray jsonCounty = jsonObject.getJSONArray("countyList");
// JSONArray jsonCounty = jsonObject.getJSONArray("countyList");
JSONArray jsonGroup = jsonObject.getJSONArray("groupList");
List<Map<String, Object>> countyList = (List<Map<String, Object>>) jsonCounty;
if (countyList.size() > 0) {
//正常生成区县任务单
for (Map<String, Object> map : countyList) {
String typeCode = map.get("typeCode").toString();
String countyCode = map.get("countyCode").toString();
List<Map<String, Object>> objects = taskListService.selectGroupAtACCU(replaceDate(date), typeCode, countyCode);
boolean b = taskListService.saveTask(objects, name, 0 + "");
}
}
// List<Map<String, Object>> countyList = (List<Map<String, Object>>) jsonCounty;
// if (countyList.size() > 0) {
// //正常生成区县任务单
// for (Map<String, Object> map : countyList) {
// String typeCode = map.get("typeCode").toString();
// String countyCode = map.get("countyCode").toString();
// List<Map<String, Object>> objects = taskListService.selectGroupAtACCU(replaceDate(date), typeCode, countyCode);
// boolean b = taskListService.saveTask(objects, name, 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++) {
......@@ -281,6 +282,11 @@ public class TaskListApi {
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.put("msg", "成功生成任务单");
return map;
......
......@@ -46,13 +46,15 @@ public interface GroupNoMapper {
* @param groupNo 组号信息
* @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" +
"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 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" +
"where county_dic.COUNTY_CODE is not null and ACC_GROUP_T.deal_flag =3 and" +
// "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" +
" ACC_GROUP_T.group_no in (#{groupNo} ) ")
public List<Map<String,Object>> selectGroupAtACCUByGroupNo(@Param("groupNo") String groupNo);
......
......@@ -35,13 +35,15 @@ public interface TaskListMapper {
* @param submitDate
* @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_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 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" +
"and ACC_GROUP_T.group_no not in (select group_no from group_no)\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" +
// "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" +
"order by ACC_GROUP_T.group_no")
public List<Map<String,Object>> selectByCountyAtACCU(@Param("submitDate") String submitDate);
......
......@@ -130,6 +130,7 @@ public class TaskListServiceImpl implements TaskListService {
Map<String, Object> typeMap = new LinkedHashMap<>();
//将查询出结果 按制证类型分成 Map
for (Map o : maps) {
System.out.println(o.get("GROUP_NO")+"-----------");
// 组合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")+"");
......@@ -145,16 +146,34 @@ public class TaskListServiceImpl implements TaskListService {
for (String type : typeMap.keySet()) {
List<Map<String, Object>> mapList = (List<Map<String, Object>>) typeMap.get(type);
Map<String, Object> typemap = new LinkedHashMap<>();
int i =0;
for (Map<String, Object> o : mapList) {
if (typemap != null && typemap.containsKey(o.get("COUNTY_CODE") + "")) {
List<Map<String, Object>> maplist = (List<Map<String, Object>>) typemap.get(o.get("COUNTY_CODE"));
if (typemap.containsKey(i+"")){
List<Map<String, Object>> maplist = (List<Map<String, Object>>)typemap.get(i+"");
if (maplist.size()>=30){
System.out.println("===========");
i++;
List<Map<String, Object>> maplist1 = new ArrayList<>();
maplist1.add(o);
typemap.put(i+"", maplist1);
continue;
}else {
System.out.println("------------");
maplist.add(o);
typemap.put(o.get("COUNTY_CODE") + "", maplist);
} else {
typemap.put(i+"", maplist);
continue;
}
}else {
System.out.println("+++++++++++");
List<Map<String, Object>> maplist = new ArrayList<>();
maplist.add(o);
typemap.put(o.get("COUNTY_CODE") + "", maplist);
typemap.put(i+"", maplist);
continue;
}
// mapList.get(i);
}
typeMap.put(type, typemap);
}
......
......@@ -6,6 +6,6 @@ PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
<settings>
<setting name="mapUnderscoreToCamelCase" value="true"/>
<setting name="callSettersOnNulls" value="true"/>
<!--<setting name="logImpl" value="STDOUT_LOGGING" />-->
<setting name="logImpl" value="STDOUT_LOGGING" />
</settings>
</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