main
黄海 9 months ago
parent d51f408e54
commit 2044f45c78

@ -14,6 +14,7 @@ import com.jfinal.core.Controller;
import com.jfinal.ext.interceptor.GET; import com.jfinal.ext.interceptor.GET;
import com.jfinal.ext.interceptor.POST; import com.jfinal.ext.interceptor.POST;
import com.jfinal.kit.Kv; import com.jfinal.kit.Kv;
import com.jfinal.kit.StrKit;
import com.jfinal.plugin.activerecord.Record; import com.jfinal.plugin.activerecord.Record;
import com.jfinal.upload.UploadFile; import com.jfinal.upload.UploadFile;
import io.github.yedaxia.apidocs.ApiDoc; import io.github.yedaxia.apidocs.ApiDoc;
@ -48,15 +49,19 @@ public class DataEaseController extends Controller {
//发布的地址 //发布的地址
String publish_url = BaseApplication.PropKit.get("dataEase.publish_url"); String publish_url = BaseApplication.PropKit.get("dataEase.publish_url");
//先更新一下数据表 //先更新一下数据表
dm.updateCity(dataVisualizationName, city_name); boolean success = dm.updateCity(dataVisualizationName, city_name);
//再拼接一下URL的最终地址 if (!success) {
renderJson(CommonUtil.returnMessageJson(false, dataVisualizationName + "名称的大屏不唯一,无法完成更新操作!"));
return;
}
//拼接一下URL的最终地址
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
jo.put("city_name", city_name); jo.put("city_name", city_name);
String base64Str = Base64.encode(jo.toString()); String base64Str = Base64.encode(jo.toString());
//记录最后一次操作的是哪个市或者县区 //记录最后一次操作的是哪个市或者县区
dm.writeLastArea(city_name); dm.writeLastArea(city_name);
//跳转 //跳转
redirect(publish_url + "/#/de-link/X4l1qGNH?attachParams=" + base64Str); redirect(publish_url + BaseApplication.PropKit.get("dataEase.ShiZhou_url") + "?attachParams=" + base64Str);
} }
/** /**
@ -78,13 +83,13 @@ public class DataEaseController extends Controller {
String base64Str = Base64.encode(jo.toString()); String base64Str = Base64.encode(jo.toString());
switch (type_id) { switch (type_id) {
case 1://左侧学前教育规模发展预测,义务教育规模发展预测,普通高中教育规模发展预测 case 1://左侧学前教育规模发展预测,义务教育规模发展预测,普通高中教育规模发展预测
publish_url = publish_url + "/#/de-link/TgShVA0z"; publish_url = publish_url + BaseApplication.PropKit.get("dataEase.ShiLeft_url");
break; break;
case 2://最底下,人口 case 2://最底下,人口
publish_url = publish_url + "/#/de-link/QZVOyXqD"; publish_url = publish_url + BaseApplication.PropKit.get("dataEase.ShiBottom_url");
break; break;
case 3://教育资源配置发展预测 case 3://教育资源配置发展预测
publish_url = publish_url + "/#/de-link/oitjXDlA"; publish_url = publish_url + BaseApplication.PropKit.get("dataEase.ShiRight_url");
break; break;
} }
//跳转 //跳转
@ -101,7 +106,11 @@ public class DataEaseController extends Controller {
// identity_id=1 省 // identity_id=1 省
// identity_id=2 市 // identity_id=2 市
// identity_id=3 县 // identity_id=3 县
int identity_id = Integer.parseInt(CookieUtil.getValue(getRequest(), "identity_id")); String identity_idStr = CookieUtil.getValue(getRequest(), "identity_id");
int identity_id = 1;
if (!StrKit.isBlank(identity_idStr)) {
identity_id = Integer.parseInt(identity_idStr);
}
List<com.jfinal.plugin.activerecord.Record> list = dm.getDataSetByIdentityId(identity_id); List<com.jfinal.plugin.activerecord.Record> list = dm.getDataSetByIdentityId(identity_id);
renderJson(CommonUtil.renderJsonForLayUI(list)); renderJson(CommonUtil.renderJsonForLayUI(list));
} }
@ -115,8 +124,12 @@ public class DataEaseController extends Controller {
@IsLoginInterface({}) @IsLoginInterface({})
@IsNumericInterface({"id"}) @IsNumericInterface({"id"})
public void downloadExcel(int id) throws IOException { public void downloadExcel(int id) throws IOException {
String identity_idStr = CookieUtil.getValue(getRequest(), "identity_id");
int identity_id = 1;
if (!StrKit.isBlank(identity_idStr)) {
identity_id = Integer.parseInt(identity_idStr);
}
//根据当前登录人员的身份,获取对应的数据集名称 //根据当前登录人员的身份,获取对应的数据集名称
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");
//获取他是哪个城市或者县区的管理员 //获取他是哪个城市或者县区的管理员
//行政区划码 //行政区划码
@ -142,8 +155,12 @@ public class DataEaseController extends Controller {
@Before(GET.class) @Before(GET.class)
@IsLoginInterface({}) @IsLoginInterface({})
public void downSampleExcel(int id) throws IOException { public void downSampleExcel(int id) throws IOException {
String identity_idStr = CookieUtil.getValue(getRequest(), "identity_id");
int identity_id = 1;
if (!StrKit.isBlank(identity_idStr)) {
identity_id = Integer.parseInt(identity_idStr);
}
//根据当前登录人员的身份,获取对应的数据集名称 //根据当前登录人员的身份,获取对应的数据集名称
int identity_id = Integer.parseInt(CookieUtil.getValue(getRequest(), "identity_id"));
if (identity_id == 1) { if (identity_id == 1) {
renderJson(CommonUtil.returnMessageJson(false, "省管理员不能下载模板!")); renderJson(CommonUtil.returnMessageJson(false, "省管理员不能下载模板!"));
return; return;
@ -173,7 +190,11 @@ public class DataEaseController extends Controller {
@IsLoginInterface({}) @IsLoginInterface({})
public void uploadExcel() { public void uploadExcel() {
//根据当前登录人员的身份,获取对应的数据集名称 //根据当前登录人员的身份,获取对应的数据集名称
int identity_id = Integer.parseInt(CookieUtil.getValue(getRequest(), "identity_id")); String identity_idStr = CookieUtil.getValue(getRequest(), "identity_id");
int identity_id = 1;
if (!StrKit.isBlank(identity_idStr)) {
identity_id = Integer.parseInt(identity_idStr);
}
String person_id = CookieUtil.getValue(getRequest(), "person_id"); String person_id = CookieUtil.getValue(getRequest(), "person_id");
//获取他是哪个城市或者县区的管理员 //获取他是哪个城市或者县区的管理员
//行政区划码 //行政区划码

@ -99,11 +99,15 @@ public class DataEaseModel {
* @param dataVisualizationName * @param dataVisualizationName
* @param cityName * @param cityName
*/ */
public void updateCity(String dataVisualizationName, String cityName) { public boolean updateCity(String dataVisualizationName, String cityName) {
//取出大屏的ID值 //取出大屏的ID值
//云南省教育决策支持系统 //云南省教育决策支持系统
String sql = "select * from data_visualization_info where name =?"; String sql = "select * from data_visualization_info where name =?";
Record dataVisualizationInfo = Db.use(DB_NAME).findFirst(sql, dataVisualizationName); List<Record> L1 = Db.use(DB_NAME).find(sql, dataVisualizationName);
if (L1.size() > 1) {
return false;
}
Record dataVisualizationInfo = L1.getFirst();
long bigScreenId = dataVisualizationInfo.getLong("id"); long bigScreenId = dataVisualizationInfo.getLong("id");
// 配置的内容 // 配置的内容
List<Record> list = getMap(bigScreenId); List<Record> list = getMap(bigScreenId);
@ -125,6 +129,7 @@ public class DataEaseModel {
String jsonString = jo.toString(); String jsonString = jo.toString();
Db.use(DB_NAME).update("update core_chart_view set custom_attr=? where id=?", jsonString, id); Db.use(DB_NAME).update("update core_chart_view set custom_attr=? where id=?", jsonString, id);
} }
return true;
} }

@ -25,6 +25,10 @@ redis:
dataEase: dataEase:
dataVisualizationName: 云南省教育决策支持系统【市州】 dataVisualizationName: 云南省教育决策支持系统【市州】
publish_url: http://10.10.14.203:8100 publish_url: http://10.10.14.203:8100
ShiZhou_url: /#/de-link/X4l1qGNH
ShiLeft_url: /#/de-link/TgShVA0z
ShiBottom_url: /#/de-link/QZVOyXqD
ShiRight_url: /#/de-link/oitjXDlA
# ============================================================== # ==============================================================
excel: excel:

Loading…
Cancel
Save