Commit 14ace7f2 authored by suichenguang's avatar suichenguang

测试接口更新

parent dc3bf79a
...@@ -11,7 +11,10 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -11,7 +11,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @author Administrator * @author Administrator
...@@ -78,68 +81,6 @@ public class TaskListApi { ...@@ -78,68 +81,6 @@ public class TaskListApi {
return true; return true;
} }
/**
* 根据上传时间查询数据(用于生成任务单)
* @param date
* @return
*/
@RequestMapping("selectByDate")
public String selectByDate(@Param("date") String date){
String result = "[\n" +
" {\n" +
" typeCode: '1',\n" +
" typeName: '普通证',\n" +
" typeSum: 360,\n" +
" isActive: 'true',\n" +
" countyList: [\n" +
" {\n" +
" taskId: '20190228001',\n" +
" county: '西城区',\n" +
" groupNo: '00234653-03687587',\n" +
" valid: 240,\n" +
" invalid: 0\n" +
" },\n" +
" {\n" +
" taskId: '20190228001',\n" +
" county: '东城区',\n" +
" groupNo: '00234653-03687587',\n" +
" valid: 240,\n" +
" invalid: 0\n" +
" },\n" +
" {\n" +
" taskId: '20190228001',\n" +
" county: '海淀区',\n" +
" groupNo: '00234653-03687587',\n" +
" valid: 240,\n" +
" invalid: 0\n" +
" }\n" +
" ]\n" +
" },\n" +
" {\n" +
" typeCode: '9',\n" +
" typeName: '邮寄证',\n" +
" typeSum: 460,\n" +
" isActive: 'false',\n" +
" countyList: [\n" +
" {\n" +
" taskId: '20190228001',\n" +
" county: '朝阳区',\n" +
" groupNo: '00234653-03687587',\n" +
" valid: 240,\n" +
" invalid: 0\n" +
" },\n" +
" {\n" +
" taskId: '20190228001',\n" +
" county: '昌平区',\n" +
" groupNo: '00234653-03687587',\n" +
" valid: 240,\n" +
" invalid: 0\n" +
" }\n" +
" ]\n" +
" }\n" +
"]";
return result;
}
} }
...@@ -32,43 +32,43 @@ public class CreatePackageApi { ...@@ -32,43 +32,43 @@ public class CreatePackageApi {
countyList.add(jsonStr1); countyList.add(jsonStr1);
JSONObject jsonStr2 = new JSONObject(); JSONObject jsonStr2 = new JSONObject();
jsonStr1.put("newPackageName","123420190302023"); jsonStr2.put("newPackageName","123420190302023");
jsonStr1.put("createDate","20190302"); jsonStr2.put("createDate","20190302");
jsonStr1.put("cardCount",260); jsonStr2.put("cardCount",260);
jsonStr1.put("readCountyCode","110013"); jsonStr2.put("readCountyCode","110013");
jsonStr1.put("readCountyName","海淀区"); jsonStr2.put("readCountyName","海淀区");
countyList.add(jsonStr2); countyList.add(jsonStr2);
JSONObject jsonStr3 = new JSONObject(); JSONObject jsonStr3 = new JSONObject();
jsonStr1.put("newPackageName","123420190302003"); jsonStr3.put("newPackageName","123420190302003");
jsonStr1.put("createDate","20190302"); jsonStr3.put("createDate","20190302");
jsonStr1.put("cardCount",410); jsonStr3.put("cardCount",410);
jsonStr1.put("readCountyCode","110022"); jsonStr3.put("readCountyCode","110022");
jsonStr1.put("readCountyName","东城区"); jsonStr3.put("readCountyName","东城区");
countyList.add(jsonStr3); countyList.add(jsonStr3);
JSONObject jsonStr4 = new JSONObject(); JSONObject jsonStr4 = new JSONObject();
jsonStr1.put("newPackageName","123420190302007"); jsonStr4.put("newPackageName","123420190302007");
jsonStr1.put("createDate","20190302"); jsonStr4.put("createDate","20190302");
jsonStr1.put("cardCount",270); jsonStr4.put("cardCount",270);
jsonStr1.put("readCountyCode","110012"); jsonStr4.put("readCountyCode","110012");
jsonStr1.put("readCountyName","朝阳区"); jsonStr4.put("readCountyName","朝阳区");
countyList.add(jsonStr4); countyList.add(jsonStr4);
JSONObject jsonStr5 = new JSONObject(); JSONObject jsonStr5 = new JSONObject();
jsonStr1.put("newPackageName","123420190302016"); jsonStr5.put("newPackageName","123420190302016");
jsonStr1.put("createDate","20190302"); jsonStr5.put("createDate","20190302");
jsonStr1.put("cardCount",280); jsonStr5.put("cardCount",280);
jsonStr1.put("readCountyCode","110018"); jsonStr5.put("readCountyCode","110018");
jsonStr1.put("readCountyName","大兴区"); jsonStr5.put("readCountyName","大兴区");
countyList.add(jsonStr5); countyList.add(jsonStr5);
JSONObject jsonStr6 = new JSONObject(); JSONObject jsonStr6 = new JSONObject();
jsonStr1.put("newPackageName","123420190302031"); jsonStr6.put("newPackageName","123420190302031");
jsonStr1.put("createDate","20190302"); jsonStr6.put("createDate","20190302");
jsonStr1.put("cardCount",600); jsonStr6.put("cardCount",600);
jsonStr1.put("readCountyCode","110011"); jsonStr6.put("readCountyCode","110011");
jsonStr1.put("readCountyName","西城区"); jsonStr6.put("readCountyName","西城区");
countyList.add(jsonStr6); countyList.add(jsonStr6);
return countyList.toString(); return countyList.toString();
......
package com.yxproject.start.api.fakeApi; package com.yxproject.start.api.fakeApi;
import net.sf.json.JSONObject;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController @RestController
@RequestMapping("FilmPrintingApi") @RequestMapping("FilmPrintingApi")
public class FilmPrintingApi { public class FilmPrintingApi {
...@@ -14,89 +20,103 @@ public class FilmPrintingApi { ...@@ -14,89 +20,103 @@ public class FilmPrintingApi {
* @return result * @return result
*/ */
@RequestMapping("selectFilmPrinting") @RequestMapping("selectFilmPrinting")
public String selectFilmPrinting(@Param("date")String date,@Param("gongxu")String gongxu){ public List<String> selectFilmPrinting(@Param("date")String date, @Param("gongxu")String gongxu){
String result = "[\n" +
" {\n" + List<String> result = new ArrayList<>();
" typeCode: '1',\n" + Map<String,Object> map1 = new HashMap<>();
" typeName: '普通证',\n" + Map<String,Object> map2 = new HashMap<>();
" typeSum: 360,\n" +
" isActive: 'true',\n" + List<JSONObject> list1 = new ArrayList();
" totalCount: 'true',\n" + List<JSONObject> list2 = new ArrayList();
" remaining: 3,\n" +
" countyList: [\n" + JSONObject jsonStr1 = new JSONObject();
" {\n" + jsonStr1.put("taskId","20190228001");
" taskId: '20190228001',\n" + jsonStr1.put("verificationDate","20190301");
" verificationDate: '20190301',\n" + jsonStr1.put("county","西城区");
" county: '西城区',\n" + jsonStr1.put("listCount ","160");
" listCount: 160,\n" + jsonStr1.put("groupNo","03687576-03687587");
" groupNo: '03687576-03687587',\n" + jsonStr1.put("verificationCount ","160");
" verificationCount: 160,\n" + jsonStr1.put("readCount","160");
" readCount: 160,\n" + jsonStr1.put("invalid ","0");
" invalid: 0\n" + list1.add(jsonStr1);
" },\n" +
" {\n" + JSONObject jsonStr2 = new JSONObject();
" taskId: '20190228001',\n" + jsonStr2.put("taskId","20190228001");
" verificationDate: '20190301',\n" + jsonStr2.put("verificationDate","20190301");
" county: '东城区',\n" + jsonStr2.put("county","东城区");
" listCount: 270,\n" + jsonStr2.put("listCount ","270");
" groupNo: '00234653-00234658',\n" + jsonStr2.put("groupNo","03687576-03687587");
" verificationCount: 270,\n" + jsonStr2.put("verificationCount ","270");
" readCount: 270,\n" + jsonStr2.put("readCount","270");
" invalid: 0\n" + jsonStr2.put("invalid ","0");
" },\n" + list1.add(jsonStr2);
" {\n" +
" taskId: '20190228001',\n" + JSONObject jsonStr3 = new JSONObject();
" verificationDate: '20190301',\n" + jsonStr3.put("taskId","20190228001");
" county: '海淀区',\n" + jsonStr3.put("verificationDate","20190301");
" listCount: 140,\n" + jsonStr3.put("county","海淀区");
" groupNo: '00234653-00234658',\n" + jsonStr3.put("listCount ","140");
" verificationCount: 140,\n" + jsonStr3.put("groupNo","03687576-03687587");
" readCount: 140,\n" + jsonStr3.put("verificationCount ","140");
" invalid: 0\n" + jsonStr3.put("readCount","140");
" }\n" + jsonStr3.put("invalid ","0");
" ]\n" + list1.add(jsonStr3);
" },\n" +
" {\n" +
" typeCode: '9',\n" + JSONObject jsonStr4 = new JSONObject();
" typeName: '邮寄证',\n" + jsonStr4.put("taskId","20190228001");
" typeSum: 420,\n" + jsonStr4.put("verificationDate","20190301");
" isActive: 'true',\n" + jsonStr4.put("county","西城区");
" totalCount: 'true',\n" + jsonStr4.put("listCount ","160");
" remaining: 3,\n" + jsonStr4.put("groupNo","03687576-03687587");
" countyList: [\n" + jsonStr4.put("verificationCount ","160");
" {\n" + jsonStr4.put("readCount","160");
" taskId: '20190228001',\n" + jsonStr4.put("invalid ","0");
" verificationDate: '20190301',\n" + list2.add(jsonStr4);
" county: '西城区',\n" +
" listCount: 140,\n" + JSONObject jsonStr5 = new JSONObject();
" groupNo: '03687576-03687587',\n" + jsonStr5.put("taskId","20190228001");
" verificationCount: 140,\n" + jsonStr5.put("verificationDate","20190301");
" readCount: 140,\n" + jsonStr5.put("county","东城区");
" invalid: 1\n" + jsonStr5.put("listCount ","270");
" },\n" + jsonStr5.put("groupNo","03687576-03687587");
" {\n" + jsonStr5.put("verificationCount ","270");
" taskId: '20190228001',\n" + jsonStr5.put("readCount","270");
" verificationDate: '20190301',\n" + jsonStr5.put("invalid ","0");
" county: '东城区',\n" + list2.add(jsonStr5);
" listCount: 270,\n" +
" groupNo: '00234653-00234658',\n" + JSONObject jsonStr6 = new JSONObject();
" verificationCount: 270,\n" + jsonStr6.put("taskId","20190228001");
" readCount: 270,\n" + jsonStr6.put("verificationDate","20190301");
" invalid: 0\n" + jsonStr6.put("county","海淀区");
" },\n" + jsonStr6.put("listCount ","140");
" {\n" + jsonStr6.put("groupNo","03687576-03687587");
" taskId: '20190228001',\n" + jsonStr6.put("verificationCount ","140");
" verificationDate: '20190301',\n" + jsonStr6.put("readCount","140");
" county: '海淀区',\n" + jsonStr6.put("invalid ","0");
" listCount: 140,\n" + list2.add(jsonStr6);
" groupNo: '00234653-00234658',\n" +
" verificationCount: 140,\n" + map1.put("typeCode",1);
" readCount: 140,\n" + map1.put("typeName","普通证");
" invalid: 0\n" + map1.put("typeSum",360);
" }\n" + map1.put("isActive","true");
" ]\n" + map1.put("totalCount","true");
" }\n" + map1.put("remaining",3);
"]"; map1.put("list",list1);
map2.put("typeCode",9);
map2.put("typeName","邮寄证");
map2.put("typeSum",420);
map2.put("isActive","true");
map2.put("totalCount","true");
map2.put("remaining",3);
map2.put("list",list2);
result.add(map1.toString());
result.add(map2.toString());
return result; return result;
} }
} }
package com.yxproject.start.api.fakeApi;
import net.sf.json.JSONObject;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("TaskListFakeApi")
public class TaskListFakeApi {
/**
* 根据上传时间查询数据(用于生成任务单)
* @param date
* @return
*/
@RequestMapping("selectByDate")
public String selectByDate(@Param("date") String date){
List<String> result = new ArrayList<>();
Map<String,Object> map1 = new HashMap<>();
Map<String,Object> map2 = new HashMap<>();
List<JSONObject> list1 = new ArrayList();
List<JSONObject> list2 = new ArrayList();
JSONObject jsonStr1 = new JSONObject();
jsonStr1.put("taskId","20190228001");
jsonStr1.put("county","西城区");
jsonStr1.put("groupNo","03687576-03687587");
jsonStr1.put("valid","160");
jsonStr1.put("invalid ","0");
list1.add(jsonStr1);
JSONObject jsonStr2 = new JSONObject();
jsonStr2.put("taskId","20190228001");
jsonStr2.put("county","东城区");
jsonStr2.put("groupNo","03687576-03687587");
jsonStr2.put("valid","270");
jsonStr2.put("invalid ","0");
list1.add(jsonStr2);
JSONObject jsonStr3 = new JSONObject();
jsonStr3.put("taskId","20190228001");
jsonStr3.put("county","海淀区");
jsonStr3.put("groupNo","03687576-03687587");
jsonStr3.put("valid","140");
jsonStr3.put("invalid ","0");
list1.add(jsonStr3);
JSONObject jsonStr4 = new JSONObject();
jsonStr4.put("taskId","20190228001");
jsonStr4.put("county","西城区");
jsonStr4.put("groupNo","03687576-03687587");
jsonStr4.put("valid","160");
jsonStr4.put("invalid ","0");
list2.add(jsonStr4);
JSONObject jsonStr5 = new JSONObject();
jsonStr5.put("taskId","20190228001");
jsonStr5.put("county","东城区");
jsonStr5.put("groupNo","03687576-03687587");
jsonStr5.put("valid","270");
jsonStr5.put("invalid ","0");
list2.add(jsonStr5);
JSONObject jsonStr6 = new JSONObject();
jsonStr6.put("taskId","20190228001");
jsonStr6.put("county","海淀区");
jsonStr6.put("groupNo","03687576-03687587");
jsonStr6.put("valid","140");
jsonStr6.put("invalid ","0");
list2.add(jsonStr6);
map1.put("typeCode",1);
map1.put("typeName","普通证");
map1.put("typeSum",360);
map1.put("isActive","true");
map1.put("list",list1);
map2.put("typeCode",9);
map2.put("typeName","邮寄证");
map2.put("typeSum",420);
map2.put("isActive","false");
map2.put("list",list2);
result.add(map1.toString());
result.add(map2.toString());
return result.toString();
}
}
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