123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736 |
- package cn.hnthyy.thmz.controller;
- import cn.hnthyy.thmz.Utils.TokenUtil;
- import cn.hnthyy.thmz.entity.thmz.*;
- import cn.hnthyy.thmz.service.thmz.MenuService;
- import cn.hnthyy.thmz.service.thmz.RoleMenuRelationService;
- import cn.hnthyy.thmz.service.thmz.UserMenuRelationService;
- import cn.hnthyy.thmz.service.thmz.UserRoleRelationService;
- import lombok.extern.slf4j.Slf4j;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Controller;
- import org.springframework.web.bind.annotation.RequestMapping;
- import javax.servlet.http.HttpServletRequest;
- import java.util.ArrayList;
- import java.util.HashSet;
- import java.util.List;
- import java.util.Set;
- import java.util.stream.Collectors;
- /**
- * 导航控制层,负责路由功能
- */
- @Controller
- @Slf4j
- public class NavigationController {
- @Autowired
- private MenuService menuService;
- @Autowired
- private RoleMenuRelationService roleMenuRelationService;
- @Autowired
- private UserRoleRelationService userRoleRelationService;
- /**
- * 打开登录页面
- *
- * @return
- */
- @RequestMapping("/login/view")
- public String loginView() {
- return "login";
- }
- /**
- * 打开导航页面
- *
- * @return
- */
- @RequestMapping("/menu/view")
- public String menuView() {
- return "menu";
- }
- /**
- * 打开主页面
- *
- * @return
- */
- @RequestMapping("/index")
- public String index(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/index")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "index";
- }
- /**
- * 打开科室列表页面
- *
- * @return
- */
- @RequestMapping("/unit-code")
- public String unitCode(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/unit-code")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "mz/unit_code";
- }
- /**
- * 打开挂号管理页面
- *
- * @return
- */
- @RequestMapping("/registration")
- public String registration(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/registration")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "mz/registration";
- }
- /**
- * 打开挂号列表页面
- *
- * @return
- */
- @RequestMapping("/registration-list")
- public String registrationList(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/registration-list")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "mz/registration_list";
- }
- // private List<String> getUrls(HttpServletRequest httpServletRequest) throws Exception {
- // User tokenUser = TokenUtil.getUser(httpServletRequest);
- // List<UserMenuRelation> userMenuRelationList = userMenuRelationService.queryByUserId(tokenUser.getId());
- // List<Long> menuIds = userMenuRelationList.stream().map(UserMenuRelation::getMenuId).collect(Collectors.toList());
- // if (menuIds == null || menuIds.size() == 0) {
- // throw new Exception("您没有此模块的权限,请联系管理员开通!");
- // }
- // List<Menu> menuList = menuService.queryByIds(menuIds);
- // return menuList.stream().map(Menu::getMenuUrl).collect(Collectors.toList());
- // }
- private List<String> getRoleUrls(HttpServletRequest httpServletRequest) throws Exception {
- User tokenUser = TokenUtil.getUser(httpServletRequest);
- List<UserRoleRelation> userRoleRelations = userRoleRelationService.queryByUserId(tokenUser.getId());
- Set<RoleMenuRelation> roleMenuRelationSet = new HashSet<RoleMenuRelation>();
- for (UserRoleRelation userRoleRelation : userRoleRelations) {
- List<RoleMenuRelation> list = roleMenuRelationService.queryByRoleId(userRoleRelation.getRoleId());
- roleMenuRelationSet.addAll(list);
- }
- List<Long> menuIdsNew = roleMenuRelationSet.stream().map(RoleMenuRelation::getMenuId).collect(Collectors.toList());
- List<Long> menuIds=new ArrayList<>(new HashSet(menuIdsNew));//利用Set去重多个角色相同的菜单权限
- if (menuIds == null || menuIds.size() == 0) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- List<Menu> menuList = menuService.queryByIds(menuIds);
- return menuList.stream().map(Menu::getMenuUrl).collect(Collectors.toList());
- }
- /**
- * 打开收费管理页面
- *
- * @return
- */
- @RequestMapping({"/toll-administration"})
- public String tollAdministration(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/toll-administration")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "mz/toll_administration";
- }
- // /**
- // * 打开收费管理页面,带参数跳转
- // *
- // * @return
- // */
- // @RequestMapping({"/toll-administration/{patientId}"})
- // public String tollAdministration(@PathVariable String patientId, HttpServletRequest httpServletRequest) throws Exception {
- // List<String> urls = getUrls(httpServletRequest);
- // httpServletRequest.setAttribute("patientId",patientId);
- // if (!urls.contains("/thmz/toll-administration")) {
- // throw new Exception("您没有此模块的权限,请联系管理员开通!");
- // }
- // return "toll_administration";
- // }
- /**
- * 打开收费员基础设置页面
- *
- * @return
- */
- @RequestMapping("/sfy-config")
- public String sfyConfig(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/sfy-config")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "sfy_config";
- }
- /**
- * 打开发药员基础设置页面
- *
- * @return
- */
- @RequestMapping("/fy-config")
- public String fyConfig(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/fy-config")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "fy_config";
- }
- /**
- * 打印机设置页面
- *
- * @return
- */
- @RequestMapping("/print-config")
- public String printConfig(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/print-config")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "mz/print_config";
- }
- /**
- * 打开发票管理页面
- *
- * @return
- */
- @RequestMapping("/receipt")
- public String receipt(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/receipt")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "receipt";
- }
- /**
- * 打开日结处理页面
- *
- * @return
- */
- @RequestMapping("/daily")
- public String daily(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/daily")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "mz/daily";
- }
- /**
- * 打开重打日结报表页面
- *
- * @return
- */
- @RequestMapping("/daily-repeat-print")
- public String dailyRepeatPrint(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/daily-repeat-print")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "mz/daily_repeat_print";
- }
- /**
- * 日结汇总页面
- *
- * @return
- */
- @RequestMapping("/daily-collect")
- public String dailyCollect(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/daily-collect")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "mz/daily_collect";
- }
- /**
- * 病人费用清单
- *
- * @return
- */
- @RequestMapping("/charge-list")
- public String chargeList(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/charge-list")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "mz/charge_list";
- }
- /**
- * 退药申请
- *
- * @return
- */
- @RequestMapping("/refund-medicine")
- public String refundMedicine(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/refund-medicine")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "mz/refund_medicine";
- }
- /**
- * 门诊收入明细
- *
- * @return
- */
- @RequestMapping("/mzsrmx")
- public String mzsrmx(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/mzsrmx")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "mz/mzsrmx";
- }
- /**
- * 门诊号别统计
- *
- * @return
- */
- @RequestMapping("/mzhbtj")
- public String mzhbtj(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/mzhbtj")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "mz/mzhbtj";
- }
- /**
- * 门诊应收核算报表
- *
- * @return
- */
- @RequestMapping("/bissinessReport")
- public String bissinessReport(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/bissinessReport")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "mz/bissinessReport";
- }
- /**
- * 号表字典维护
- *
- * @return
- */
- @RequestMapping("/request")
- public String request(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/request")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "mz/request";
- }
- /**
- * 收费员工作量统计
- *
- * @return
- */
- @RequestMapping("/cash-work-count")
- public String cashWorkCount(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/cash-work-count")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "mz/cash_work_count";
- }
- /**
- * 菜单管理页面
- *
- * @return
- */
- @RequestMapping("/menu-manage")
- public String menuManage(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/menu-manage")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "menu_manage";
- }
- /**
- * 菜单权限设置管理页面
- *
- * @return
- */
- @RequestMapping("/user-menu-relation")
- public String userMenuRelation(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/user-menu-relation")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "user_menu_relation";
- }
- /**
- * 号表预警设置页面
- *
- * @return
- */
- @RequestMapping("/request-config")
- public String requestConfig(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/request-config")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "mz/request-config";
- }
- /**
- * 医技预约科室设置页面
- *
- * @return
- */
- @RequestMapping("/schedule-of-medical")
- public String scheduleOfMedical(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/schedule-of-medical")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "mz/schedule-of-medical";
- }
- /**
- * 医技预约科室预约页面
- *
- * @return
- */
- @RequestMapping("/schedule-of-medical-apply")
- public String scheduleOfMedicalApply(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/schedule-of-medical-apply")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "mz/schedule-of-medical-apply";
- }
- /**
- * 文件上传页面
- *
- * @return
- */
- @RequestMapping("/profile-common")
- public String profileCommon(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/profile-common")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "profile_common";
- }
- /**
- * 入院登记
- *
- * @return
- */
- @RequestMapping("/hospitalized")
- public String hospitalized(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/hospitalized")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "zy/hospitalized";
- }
- /**
- * 节假日配置挂号
- *
- * @return
- */
- @RequestMapping("/request-holidays-config")
- public String requestHolidaysConfig(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/request-holidays-config")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "mz/request_holidays_config";
- }
- /**
- * 预交金处理
- *
- * @return
- */
- @RequestMapping("/accepting")
- public String accepting(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/accepting")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "zy/accepting";
- }
- /**
- * 病人列表
- *
- * @return
- */
- @RequestMapping("/actpatient")
- public String actpatient(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/actpatient")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "zy/actpatient";
- }
- /**
- * 号别类型
- *
- * @return
- */
- @RequestMapping("/request-type")
- public String requestType(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/request-type")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "mz/request_type";
- }
- /**
- * 收费项目字典维护
- *
- * @return
- */
- @RequestMapping("/charge-detail")
- public String chargeDetail(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/charge-detail")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "mz/charge_detail";
- }
- /**
- * 发药提醒
- *
- * @return
- */
- @RequestMapping("/to-medicine")
- public String toMedicine(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/to-medicine")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "mz/to-medicine";
- }
- /**
- * 发药提醒测试
- *
- * @return
- */
- @RequestMapping("/pharmacy-cell-number")
- public String toMedicineTest(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/pharmacy-cell-number")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "mz/pharmacy-cell-number";
- }
- /**
- * 手机自助缴费查询
- *
- * @return
- */
- @RequestMapping("/paid-from-zz")
- public String paidFromZz(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/paid-from-zz")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "charge/paid_from_zz";
- }
- /**
- * 数据修复工具
- *
- * @return
- */
- @RequestMapping("/data-util")
- public String dataUtil(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/data-util")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "mz/data_util";
- }
- /**
- * 惠民活动
- *
- * @return
- */
- @RequestMapping("/discount")
- public String discount(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/discount")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "charge/discount";
- }
- /**
- * 角色管理
- * @param httpServletRequest
- * @return
- * @throws Exception
- */
- @RequestMapping("/role-manage")
- public String roleManage(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/role-manage")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "role_manage";
- }
- /**
- * 用户管理
- * @param httpServletRequest
- * @return
- * @throws Exception
- */
- @RequestMapping("/user-manage")
- public String userManage(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/user-manage")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "user_manage";
- }
- /**
- * 药房库字典管理
- * @param httpServletRequest
- * @return
- * @throws Exception
- */
- @RequestMapping("/group-name")
- public String groupName(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/group-name")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "mz/group_name";
- }
- /**
- * 发药窗口字典管理
- * @param httpServletRequest
- * @return
- * @throws Exception
- */
- @RequestMapping("/drug-win")
- public String drugWin(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/drug-win")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "mz/drug_win";
- }
- /**
- * 住院日结
- * @param httpServletRequest
- * @return
- * @throws Exception
- */
- @RequestMapping("/zy-daily")
- public String zyDaily(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/zy-daily")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "zy/zy_daily";
- }
- /**
- * 门诊西药房配药
- *
- * @return
- */
- @RequestMapping("/west-pharmacy-dispensing")
- public String westPharmacyDispensing(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/west-pharmacy-dispensing")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "mz/west_pharmacy_dispensing";
- }
- /**
- * 门诊西药房发退药
- *
- * @return
- */
- @RequestMapping("/west-pharmacy-send")
- public String westPharmacySend(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/west-pharmacy-send")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "mz/west_pharmacy_send";
- }
- /**
- * 门诊医生就诊
- *
- * @return
- */
- @RequestMapping("/clinic")
- public String clinic(HttpServletRequest httpServletRequest) throws Exception {
- List<String> urls = getRoleUrls(httpServletRequest);
- if (!urls.contains("/thmz/clinic")) {
- throw new Exception("您没有此模块的权限,请联系管理员开通!");
- }
- return "mz/clinic";
- }
- }
|