diff --git a/src/main/java/com/ydool/boot/modules/rddb/entity/bo/ShowContactBo.java b/src/main/java/com/ydool/boot/modules/rddb/entity/bo/ShowContactBo.java new file mode 100644 index 0000000..234c145 --- /dev/null +++ b/src/main/java/com/ydool/boot/modules/rddb/entity/bo/ShowContactBo.java @@ -0,0 +1,12 @@ +package com.ydool.boot.modules.rddb.entity.bo; + +import lombok.Data; + +@Data +public class ShowContactBo { + String channel; + String peopleCount; + String channelRate; + String cycleRate; + String sameRate; +} diff --git a/src/main/java/com/ydool/boot/modules/rddb/entity/bo/ShowOfficeBo.java b/src/main/java/com/ydool/boot/modules/rddb/entity/bo/ShowOfficeBo.java new file mode 100644 index 0000000..982f187 --- /dev/null +++ b/src/main/java/com/ydool/boot/modules/rddb/entity/bo/ShowOfficeBo.java @@ -0,0 +1,9 @@ +package com.ydool.boot.modules.rddb.entity.bo; + +import lombok.Data; + +@Data +public class ShowOfficeBo { + String region; + String regionNum; +} diff --git a/src/main/java/com/ydool/boot/modules/rddb/entity/bo/ShowVoterBo.java b/src/main/java/com/ydool/boot/modules/rddb/entity/bo/ShowVoterBo.java new file mode 100644 index 0000000..d8293f8 --- /dev/null +++ b/src/main/java/com/ydool/boot/modules/rddb/entity/bo/ShowVoterBo.java @@ -0,0 +1,14 @@ +package com.ydool.boot.modules.rddb.entity.bo; + +import lombok.Data; + +@Data +public class ShowVoterBo { + String averageTime; + String ontimeRate; + String satisfactionRate; + String category; + String categoryCondition; + String hotKey; + String handleAnalyze; +} diff --git a/src/main/java/com/ydool/boot/modules/rddb/web/ShowController.java b/src/main/java/com/ydool/boot/modules/rddb/web/ShowController.java new file mode 100644 index 0000000..7389356 --- /dev/null +++ b/src/main/java/com/ydool/boot/modules/rddb/web/ShowController.java @@ -0,0 +1,160 @@ +package com.ydool.boot.modules.rddb.web; + + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.ydool.boot.common.cache.SysCacheName; +import com.ydool.boot.common.result.Ret; +import com.ydool.boot.core.cache.CacheUtils; +import com.ydool.boot.modules.rddb.entity.bo.ShowContactBo; +import com.ydool.boot.modules.rddb.entity.bo.ShowOfficeBo; +import com.ydool.boot.modules.rddb.entity.bo.ShowVoterBo; +import com.ydool.boot.modules.sys.entity.Config; +import com.ydool.boot.modules.sys.service.ConfigService; +import com.ydool.boot.modules.sys.web.BaseAdminController; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +/** + *

+ * 文件审批 前端控制器 + *

+ * + * @author zhouyuan + * @since 2020-10-09 + */ +@Controller +@RequestMapping("${ydool.path}/rddb/show") +public class ShowController extends BaseAdminController { + + @Autowired + ConfigService configService; + + @GetMapping("contact") + public String contact(Model model) { + Config channelConfig = getConfigByCode("screen_activity_channel"); + Config peopleCountConfig = getConfigByCode("screen_activity_people_count"); + Config channelRateConfig = getConfigByCode("screen_activity_channel_rate"); + Config cycleRateConfig = getConfigByCode("screen_activity_cycle_rate"); + Config sameRateConfig = getConfigByCode("screen_activity_same_rate"); + + model.addAttribute("channel", channelConfig.getParamValue()); + model.addAttribute("peopleCount", peopleCountConfig.getParamValue()); + model.addAttribute("channelRate", channelRateConfig.getParamValue()); + model.addAttribute("cycleRate", cycleRateConfig.getParamValue()); + model.addAttribute("sameRate", sameRateConfig.getParamValue()); + + return "modules/rddb/show/contact.html"; + } + + @GetMapping("db") + public String db() { + return "modules/rddb/show/db.html"; + } + + @GetMapping("voter") + public String voter(Model model) { + Config averageTimeConfig = getConfigByCode("screen_vote_average_time"); + Config ontimeRateConfig = getConfigByCode("screen_vote_ontime_rate"); + Config satisfactionRateConfig = getConfigByCode("screen_vote_satisfaction_rate"); + Config categoryConfig = getConfigByCode("screen_vote_category"); + Config categoryConditionConfig = getConfigByCode("screen_vote_category_condition"); + Config hotKeyConfig = getConfigByCode("screen_vote_hot_key"); + Config handleAnalyzeConfig = getConfigByCode("screen_vote_handle_analyze"); + + model.addAttribute("averageTime", averageTimeConfig.getParamValue()); + model.addAttribute("ontimeRate", ontimeRateConfig.getParamValue()); + model.addAttribute("satisfactionRate", satisfactionRateConfig.getParamValue()); + model.addAttribute("category", categoryConfig.getParamValue()); + model.addAttribute("categoryCondition", categoryConditionConfig.getParamValue()); + model.addAttribute("hotKey", hotKeyConfig.getParamValue()); + model.addAttribute("handleAnalyze", handleAnalyzeConfig.getParamValue()); + return "modules/rddb/show/voter.html"; + } + + @GetMapping("office") + public String office(Model model) { + Config config = getConfigByCode("screen_office_country_rank"); + model.addAttribute("region", config.getParamValue()); + model.addAttribute("regionNum", config.getRemarks()); + return "modules/rddb/show/office.html"; + } + + @PostMapping("/contact/save") + @ResponseBody + public void contactSave(@Validated ShowContactBo showContactBo) { + Config channelConfig = getConfigByCode("screen_activity_channel"); + Config peopleCountConfig = getConfigByCode("screen_activity_people_count"); + Config channelRateConfig = getConfigByCode("screen_activity_channel_rate"); + Config cycleRateConfig = getConfigByCode("screen_activity_cycle_rate"); + Config sameRateConfig = getConfigByCode("screen_activity_same_rate"); + + channelConfig.setParamValue(showContactBo.getChannel()); + peopleCountConfig.setParamValue(showContactBo.getPeopleCount()); + channelRateConfig.setParamValue(showContactBo.getChannelRate()); + cycleRateConfig.setParamValue(showContactBo.getCycleRate()); + sameRateConfig.setParamValue(showContactBo.getSameRate()); + + boolean flag1 = configService.updateById(channelConfig); + boolean flag2 = configService.updateById(peopleCountConfig); + boolean flag3 = configService.updateById(channelRateConfig); + boolean flag4 = configService.updateById(cycleRateConfig); + boolean flag5 = configService.updateById(sameRateConfig); + + CacheUtils.clear(SysCacheName.SYS_DICT_CACHE); + render((flag1 && flag2 && flag3 && flag4 && flag5) ? Ret.ok() : Ret.fail("操作失败")); + } + + @PostMapping("/voter/save") + @ResponseBody + public void voterSave(@Validated ShowVoterBo bo) { + Config averageTimeConfig = getConfigByCode("screen_vote_average_time"); + Config ontimeRateConfig = getConfigByCode("screen_vote_ontime_rate"); + Config satisfactionRateConfig = getConfigByCode("screen_vote_satisfaction_rate"); + Config categoryConfig = getConfigByCode("screen_vote_category"); + Config categoryConditionConfig = getConfigByCode("screen_vote_category_condition"); + Config hotKeyConfig = getConfigByCode("screen_vote_hot_key"); + Config handleAnalyzeConfig = getConfigByCode("screen_vote_handle_analyze"); + + averageTimeConfig.setParamValue(bo.getAverageTime()); + ontimeRateConfig.setParamValue(bo.getOntimeRate()); + satisfactionRateConfig.setParamValue(bo.getSatisfactionRate()); + categoryConfig.setParamValue(bo.getCategory()); + categoryConditionConfig.setParamValue(bo.getCategoryCondition()); + hotKeyConfig.setParamValue(bo.getHotKey()); + handleAnalyzeConfig.setParamValue(bo.getHandleAnalyze()); + + boolean flag1 = configService.updateById(averageTimeConfig); + boolean flag2 = configService.updateById(ontimeRateConfig); + boolean flag3 = configService.updateById(satisfactionRateConfig); + boolean flag4 = configService.updateById(categoryConfig); + boolean flag5 = configService.updateById(categoryConditionConfig); + boolean flag6 = configService.updateById(hotKeyConfig); + boolean flag7 = configService.updateById(handleAnalyzeConfig); + + CacheUtils.clear(SysCacheName.SYS_DICT_CACHE); + render((flag1 && flag2 && flag3 && flag4 && flag5 && flag6 && flag7) ? Ret.ok() : Ret.fail("操作失败")); + } + + + @PostMapping("/office/save") + @ResponseBody + public void officeSave(@Validated ShowOfficeBo showOfficeBo) { + Config config = getConfigByCode("screen_office_country_rank"); + config.setParamValue(showOfficeBo.getRegion()); + config.setRemarks(showOfficeBo.getRegionNum()); + boolean flag = configService.updateById(config); + + CacheUtils.clear(SysCacheName.SYS_DICT_CACHE); + render(flag ? Ret.ok() : Ret.fail("操作失败")); + } + + public Config getConfigByCode(String code) { + return configService.getOne(new LambdaQueryWrapper().eq(Config::getParamKey, code)); + } +} diff --git a/src/main/resources/views/modules/rddb/show/contact.html b/src/main/resources/views/modules/rddb/show/contact.html new file mode 100644 index 0000000..8f4524c --- /dev/null +++ b/src/main/resources/views/modules/rddb/show/contact.html @@ -0,0 +1,68 @@ +<% layout('/layouts/default.html', {title: '联络站', libs: ['dataGrid','validate','date','summernote','fileupload']}){ %> +
+
+ +
+
+ 联络站参数 +
+
+ + + +
+
活动举办次数渠道
+ + + +
活动参与人数月度统计人数
+ + + +
活动举办次数渠道分布占比
+ + + +
联络站月使用情况分析-环比
+ + + +
联络站月使用情况分析-同比
+ + +
+ + +
+
+
+<% } %> + + + + + + + diff --git a/src/main/resources/views/modules/rddb/show/office.html b/src/main/resources/views/modules/rddb/show/office.html new file mode 100644 index 0000000..d993bcc --- /dev/null +++ b/src/main/resources/views/modules/rddb/show/office.html @@ -0,0 +1,50 @@ +<% layout('/layouts/default.html', {title: '人大办公', libs: ['dataGrid','validate','date','summernote','fileupload']}){ %> +
+
+ +
+
+ 人大办公参数 +
+
+ + +
+
区县信息报道
+ + + +
+ + +
+
+
+<% } %> + + + + + + diff --git a/src/main/resources/views/modules/rddb/show/voter.html b/src/main/resources/views/modules/rddb/show/voter.html new file mode 100644 index 0000000..bd5259a --- /dev/null +++ b/src/main/resources/views/modules/rddb/show/voter.html @@ -0,0 +1,68 @@ +<% layout('/layouts/default.html', {title: '民情', libs: ['dataGrid','validate','date','summernote','fileupload']}){ %> +
+
+ +
+
+ 民情参数 +
+
+ + +
+
统计信息
+ + + + + +
民情分类
+ + + +
民情分类情况
+ + + +
民情处理情况分析
+ + + +
民情反映热点关键词云
+ + +
+ + +
+
+
+<% } %> + + + + + + +