Commit 14ace7f2 authored by suichenguang's avatar suichenguang

测试接口更新

parent dc3bf79a
......@@ -11,7 +11,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author Administrator
......@@ -78,68 +81,6 @@ public class TaskListApi {
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 {
countyList.add(jsonStr1);
JSONObject jsonStr2 = new JSONObject();
jsonStr1.put("newPackageName","123420190302023");
jsonStr1.put("createDate","20190302");
jsonStr1.put("cardCount",260);
jsonStr1.put("readCountyCode","110013");
jsonStr1.put("readCountyName","海淀区");
jsonStr2.put("newPackageName","123420190302023");
jsonStr2.put("createDate","20190302");
jsonStr2.put("cardCount",260);
jsonStr2.put("readCountyCode","110013");
jsonStr2.put("readCountyName","海淀区");
countyList.add(jsonStr2);
JSONObject jsonStr3 = new JSONObject();
jsonStr1.put("newPackageName","123420190302003");
jsonStr1.put("createDate","20190302");
jsonStr1.put("cardCount",410);
jsonStr1.put("readCountyCode","110022");
jsonStr1.put("readCountyName","东城区");
jsonStr3.put("newPackageName","123420190302003");
jsonStr3.put("createDate","20190302");
jsonStr3.put("cardCount",410);
jsonStr3.put("readCountyCode","110022");
jsonStr3.put("readCountyName","东城区");
countyList.add(jsonStr3);
JSONObject jsonStr4 = new JSONObject();
jsonStr1.put("newPackageName","123420190302007");
jsonStr1.put("createDate","20190302");
jsonStr1.put("cardCount",270);
jsonStr1.put("readCountyCode","110012");
jsonStr1.put("readCountyName","朝阳区");
jsonStr4.put("newPackageName","123420190302007");
jsonStr4.put("createDate","20190302");
jsonStr4.put("cardCount",270);
jsonStr4.put("readCountyCode","110012");
jsonStr4.put("readCountyName","朝阳区");
countyList.add(jsonStr4);
JSONObject jsonStr5 = new JSONObject();
jsonStr1.put("newPackageName","123420190302016");
jsonStr1.put("createDate","20190302");
jsonStr1.put("cardCount",280);
jsonStr1.put("readCountyCode","110018");
jsonStr1.put("readCountyName","大兴区");
jsonStr5.put("newPackageName","123420190302016");
jsonStr5.put("createDate","20190302");
jsonStr5.put("cardCount",280);
jsonStr5.put("readCountyCode","110018");
jsonStr5.put("readCountyName","大兴区");
countyList.add(jsonStr5);
JSONObject jsonStr6 = new JSONObject();
jsonStr1.put("newPackageName","123420190302031");
jsonStr1.put("createDate","20190302");
jsonStr1.put("cardCount",600);
jsonStr1.put("readCountyCode","110011");
jsonStr1.put("readCountyName","西城区");
jsonStr6.put("newPackageName","123420190302031");
jsonStr6.put("createDate","20190302");
jsonStr6.put("cardCount",600);
jsonStr6.put("readCountyCode","110011");
jsonStr6.put("readCountyName","西城区");
countyList.add(jsonStr6);
return countyList.toString();
......
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("FilmPrintingApi")
public class FilmPrintingApi {
......@@ -14,89 +20,103 @@ public class FilmPrintingApi {
* @return result
*/
@RequestMapping("selectFilmPrinting")
public String selectFilmPrinting(@Param("date")String date,@Param("gongxu")String gongxu){
String result = "[\n" +
" {\n" +
" typeCode: '1',\n" +
" typeName: '普通证',\n" +
" typeSum: 360,\n" +
" isActive: 'true',\n" +
" totalCount: 'true',\n" +
" remaining: 3,\n" +
" countyList: [\n" +
" {\n" +
" taskId: '20190228001',\n" +
" verificationDate: '20190301',\n" +
" county: '西城区',\n" +
" listCount: 160,\n" +
" groupNo: '03687576-03687587',\n" +
" verificationCount: 160,\n" +
" readCount: 160,\n" +
" invalid: 0\n" +
" },\n" +
" {\n" +
" taskId: '20190228001',\n" +
" verificationDate: '20190301',\n" +
" county: '东城区',\n" +
" listCount: 270,\n" +
" groupNo: '00234653-00234658',\n" +
" verificationCount: 270,\n" +
" readCount: 270,\n" +
" invalid: 0\n" +
" },\n" +
" {\n" +
" taskId: '20190228001',\n" +
" verificationDate: '20190301',\n" +
" county: '海淀区',\n" +
" listCount: 140,\n" +
" groupNo: '00234653-00234658',\n" +
" verificationCount: 140,\n" +
" readCount: 140,\n" +
" invalid: 0\n" +
" }\n" +
" ]\n" +
" },\n" +
" {\n" +
" typeCode: '9',\n" +
" typeName: '邮寄证',\n" +
" typeSum: 420,\n" +
" isActive: 'true',\n" +
" totalCount: 'true',\n" +
" remaining: 3,\n" +
" countyList: [\n" +
" {\n" +
" taskId: '20190228001',\n" +
" verificationDate: '20190301',\n" +
" county: '西城区',\n" +
" listCount: 140,\n" +
" groupNo: '03687576-03687587',\n" +
" verificationCount: 140,\n" +
" readCount: 140,\n" +
" invalid: 1\n" +
" },\n" +
" {\n" +
" taskId: '20190228001',\n" +
" verificationDate: '20190301',\n" +
" county: '东城区',\n" +
" listCount: 270,\n" +
" groupNo: '00234653-00234658',\n" +
" verificationCount: 270,\n" +
" readCount: 270,\n" +
" invalid: 0\n" +
" },\n" +
" {\n" +
" taskId: '20190228001',\n" +
" verificationDate: '20190301',\n" +
" county: '海淀区',\n" +
" listCount: 140,\n" +
" groupNo: '00234653-00234658',\n" +
" verificationCount: 140,\n" +
" readCount: 140,\n" +
" invalid: 0\n" +
" }\n" +
" ]\n" +
" }\n" +
"]";
public List<String> selectFilmPrinting(@Param("date")String date, @Param("gongxu")String gongxu){
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("verificationDate","20190301");
jsonStr1.put("county","西城区");
jsonStr1.put("listCount ","160");
jsonStr1.put("groupNo","03687576-03687587");
jsonStr1.put("verificationCount ","160");
jsonStr1.put("readCount","160");
jsonStr1.put("invalid ","0");
list1.add(jsonStr1);
JSONObject jsonStr2 = new JSONObject();
jsonStr2.put("taskId","20190228001");
jsonStr2.put("verificationDate","20190301");
jsonStr2.put("county","东城区");
jsonStr2.put("listCount ","270");
jsonStr2.put("groupNo","03687576-03687587");
jsonStr2.put("verificationCount ","270");
jsonStr2.put("readCount","270");
jsonStr2.put("invalid ","0");
list1.add(jsonStr2);
JSONObject jsonStr3 = new JSONObject();
jsonStr3.put("taskId","20190228001");
jsonStr3.put("verificationDate","20190301");
jsonStr3.put("county","海淀区");
jsonStr3.put("listCount ","140");
jsonStr3.put("groupNo","03687576-03687587");
jsonStr3.put("verificationCount ","140");
jsonStr3.put("readCount","140");
jsonStr3.put("invalid ","0");
list1.add(jsonStr3);
JSONObject jsonStr4 = new JSONObject();
jsonStr4.put("taskId","20190228001");
jsonStr4.put("verificationDate","20190301");
jsonStr4.put("county","西城区");
jsonStr4.put("listCount ","160");
jsonStr4.put("groupNo","03687576-03687587");
jsonStr4.put("verificationCount ","160");
jsonStr4.put("readCount","160");
jsonStr4.put("invalid ","0");
list2.add(jsonStr4);
JSONObject jsonStr5 = new JSONObject();
jsonStr5.put("taskId","20190228001");
jsonStr5.put("verificationDate","20190301");
jsonStr5.put("county","东城区");
jsonStr5.put("listCount ","270");
jsonStr5.put("groupNo","03687576-03687587");
jsonStr5.put("verificationCount ","270");
jsonStr5.put("readCount","270");
jsonStr5.put("invalid ","0");
list2.add(jsonStr5);
JSONObject jsonStr6 = new JSONObject();
jsonStr6.put("taskId","20190228001");
jsonStr6.put("verificationDate","20190301");
jsonStr6.put("county","海淀区");
jsonStr6.put("listCount ","140");
jsonStr6.put("groupNo","03687576-03687587");
jsonStr6.put("verificationCount ","140");
jsonStr6.put("readCount","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("totalCount","true");
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;
}
}
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