|
|
@ -343,14 +343,14 @@ public class DataEaseController extends Controller {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 保存数据集下的数据表
|
|
|
|
* 保存数据集下的数据表
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param dataset_id 数据集id
|
|
|
|
* @param dataset_id 数据集id
|
|
|
|
* @param id 数据集下的数据表的id
|
|
|
|
* @param id 数据集下的数据表的id
|
|
|
|
* @param field 字段名
|
|
|
|
* @param field 字段名
|
|
|
|
* @param value 值
|
|
|
|
* @param value 值
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Before(POST.class)
|
|
|
|
@Before(POST.class)
|
|
|
|
@IsLoginInterface({})
|
|
|
|
@IsLoginInterface({})
|
|
|
|
public void saveDataSet(int dataset_id, int id,String field,String value) {
|
|
|
|
public void saveDataSet(int dataset_id, int id, String field, String value) {
|
|
|
|
dm.saveDataSet(dataset_id, id, field, value);
|
|
|
|
dm.saveDataSet(dataset_id, id, field, value);
|
|
|
|
renderJson(CommonUtil.returnMessageJson(true, "保存成功"));
|
|
|
|
renderJson(CommonUtil.returnMessageJson(true, "保存成功"));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -385,12 +385,16 @@ public class DataEaseController extends Controller {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 市州管理员,帮助县区管理员填报数据,需要获取指定数据集的数据
|
|
|
|
* 市州管理员,帮助县区管理员填报数据,需要获取指定数据集的数据
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param id 数据集id
|
|
|
|
* @param id 数据集id
|
|
|
|
|
|
|
|
* @param pageNumber 第几页
|
|
|
|
|
|
|
|
* @param pageSize 每页多少条数据
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Before(GET.class)
|
|
|
|
@Before(GET.class)
|
|
|
|
@IsLoginInterface({})
|
|
|
|
@IsLoginInterface({})
|
|
|
|
@IsNumericInterface({"id"})
|
|
|
|
@IsNumericInterface({"id"})
|
|
|
|
public void getDataSetContentByCity(int id) {
|
|
|
|
public void getDataSetContentByCity(int id, int pageNumber, int pageSize) {
|
|
|
|
|
|
|
|
if (pageNumber == 0) pageNumber = 1;
|
|
|
|
|
|
|
|
if (pageSize == 0) pageSize = 20;
|
|
|
|
//登录的人员
|
|
|
|
//登录的人员
|
|
|
|
int identity_id = Integer.parseInt(CookieUtil.getValue(getRequest(), "identity_id"));
|
|
|
|
int identity_id = Integer.parseInt(CookieUtil.getValue(getRequest(), "identity_id"));
|
|
|
|
String person_id = CookieUtil.getValue(getRequest(), "person_id");
|
|
|
|
String person_id = CookieUtil.getValue(getRequest(), "person_id");
|
|
|
@ -400,52 +404,10 @@ public class DataEaseController extends Controller {
|
|
|
|
//根据区域码,获取区域名称
|
|
|
|
//根据区域码,获取区域名称
|
|
|
|
String area_name = rm.getAreaName(area_code);
|
|
|
|
String area_name = rm.getAreaName(area_code);
|
|
|
|
|
|
|
|
|
|
|
|
List<Record> list = dm.getDataSetContentByCity(id, area_name);
|
|
|
|
Page<Record> list = dm.getDataSetContentByCity(id, area_name, pageNumber, pageSize);
|
|
|
|
renderJson(CommonUtil.renderJsonForLayUI(list));
|
|
|
|
renderJson(CommonUtil.renderJsonForLayUI(list));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 市州管理员,帮助县区管理员填报数据,保存数据集下的数据表
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param id 数据集id
|
|
|
|
|
|
|
|
* @param data 保存的数据
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@Before(POST.class)
|
|
|
|
|
|
|
|
@IsLoginInterface({})
|
|
|
|
|
|
|
|
public void saveDataSetByCity(int id, String data) {
|
|
|
|
|
|
|
|
//登录的人员
|
|
|
|
|
|
|
|
int identity_id = Integer.parseInt(CookieUtil.getValue(getRequest(), "identity_id"));
|
|
|
|
|
|
|
|
String person_id = CookieUtil.getValue(getRequest(), "person_id");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取他是哪个城市或者县区的管理员
|
|
|
|
|
|
|
|
//行政区划码
|
|
|
|
|
|
|
|
String area_code = rm.getAreaCode(identity_id, person_id);
|
|
|
|
|
|
|
|
//根据区域码,获取区域名称
|
|
|
|
|
|
|
|
String area_name = rm.getAreaName(area_code);
|
|
|
|
|
|
|
|
//行政区划
|
|
|
|
|
|
|
|
Record rArea = rm.getAreaRecordByName(area_name);
|
|
|
|
|
|
|
|
String area_id = rArea.getStr("id");
|
|
|
|
|
|
|
|
//此市州下有哪些县区
|
|
|
|
|
|
|
|
List<Record> list = dm.getAreaList(area_id);
|
|
|
|
|
|
|
|
Set<String> set = new HashSet<>();
|
|
|
|
|
|
|
|
for (Record record : list) {
|
|
|
|
|
|
|
|
set.add(record.getStr("area_name"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JSONArray jsonArray = JSONArray.fromObject(data);
|
|
|
|
|
|
|
|
for (Object o : jsonArray) {
|
|
|
|
|
|
|
|
JSONObject jo = (JSONObject) o;
|
|
|
|
|
|
|
|
if (!set.contains(jo.get("行政区划").toString())) {
|
|
|
|
|
|
|
|
renderJson(CommonUtil.returnMessageJson(false, jo.get("行政区划").toString() + "并不隶属于" + area_name + ",请检查后重新填报!"));
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
jo.put("上级行政区划", area_name);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//保存
|
|
|
|
|
|
|
|
dm.saveDataSetByCity(id, area_name, jsonArray);
|
|
|
|
|
|
|
|
renderJson(CommonUtil.returnMessageJson(true, "保存成功"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 市管理员辅助县区录入:下载指定数据集的Excel文件
|
|
|
|
* 市管理员辅助县区录入:下载指定数据集的Excel文件
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -552,25 +514,13 @@ public class DataEaseController extends Controller {
|
|
|
|
@Before(GET.class)
|
|
|
|
@Before(GET.class)
|
|
|
|
@IsLoginInterface({})
|
|
|
|
@IsLoginInterface({})
|
|
|
|
@IsNumericInterface({"id"})
|
|
|
|
@IsNumericInterface({"id"})
|
|
|
|
public void getDataSetContentByProvince(int id) {
|
|
|
|
public void getDataSetContentByProvince(int id, int pageNumber, int pageSize) {
|
|
|
|
List<Record> list = dm.getDataSetContentByProvince(id);
|
|
|
|
if (pageNumber == 0) pageNumber = 1;
|
|
|
|
|
|
|
|
if (pageSize == 0) pageSize = 20;
|
|
|
|
|
|
|
|
Page<Record> list = dm.getDataSetContentByProvince(id, pageNumber, pageSize);
|
|
|
|
renderJson(CommonUtil.renderJsonForLayUI(list));
|
|
|
|
renderJson(CommonUtil.renderJsonForLayUI(list));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 省管理员,帮助市州、县区填报数据,保存数据集下的数据表
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @param id 数据集id
|
|
|
|
|
|
|
|
* @param data 保存的数据
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
@Before(POST.class)
|
|
|
|
|
|
|
|
@IsLoginInterface({})
|
|
|
|
|
|
|
|
public void saveDataSetByProvince(int id, String data) {
|
|
|
|
|
|
|
|
JSONArray jsonArray = JSONArray.fromObject(data);
|
|
|
|
|
|
|
|
//保存
|
|
|
|
|
|
|
|
dm.saveDataSetByCity(id, "云南省", jsonArray);
|
|
|
|
|
|
|
|
renderJson(CommonUtil.returnMessageJson(true, "保存成功"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 省管理员辅助市州、县区录入:下载指定数据集的Excel文件
|
|
|
|
* 省管理员辅助市州、县区录入:下载指定数据集的Excel文件
|
|
|
|