| | |
| | | import com.ruoyi.common.exception.base.BaseException; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.WxMpUtils; |
| | | import com.ruoyi.framework.web.service.SysLoginService; |
| | | import com.ruoyi.framework.web.service.SysPermissionService; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import com.ruoyi.system.service.ISysDeptService; |
| | | import com.ruoyi.system.service.ISysMenuService; |
| | | import com.smartor.mapper.SysUserDeptMapper; |
| | | import com.ruoyi.system.mapper.SysUserDeptMapper; |
| | | import com.smartor.service.IServiceSLTDHealthcareRecordService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import me.chanjar.weixin.mp.bean.template.WxMpTemplateData; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Qualifier; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.view.RedirectView; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Set; |
| | |
| | | |
| | | @Autowired |
| | | private ISysConfigService sysConfigService; |
| | | @Autowired |
| | | private IServiceSLTDHealthcareRecordService iServiceSLTDHealthcareRecordService; |
| | | |
| | | |
| | | @Autowired |
| | | @Qualifier("sysUserDeptSystemMapper") |
| | | private SysUserDeptMapper sysUserDeptMapper; |
| | | |
| | | // @Value("${wx_appid}") |
| | | // private String wxAppid; |
| | | // |
| | | // @Value("${wx_appSecret}") |
| | | // private String wxAppSecret; |
| | | |
| | | /** |
| | | * 登录方法 |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 登录方法 |
| | | * |
| | | * @param map 登录信息 |
| | | * @return 结果 |
| | | */ |
| | | @PostMapping("/test") |
| | | public void test(@RequestBody Map<String, Object> map) { |
| | | iServiceSLTDHealthcareRecordService.aa(map); |
| | | } |
| | | // /** |
| | | // * 登录方法 |
| | | // * |
| | | // * @param map 登录信息 |
| | | // * @return 结果 |
| | | // */ |
| | | // @PostMapping("/test") |
| | | // public void test(@RequestBody Map<String, Object> map) { |
| | | // WxMpUtils wxMpUtils = new WxMpUtils(wxAppid, wxAppSecret); |
| | | // |
| | | // Map<String, WxMpTemplateData> dataMap = new HashMap(); |
| | | // |
| | | // dataMap.put("thing2", new WxMpTemplateData("thing2", "康复报告通知", "#FFB6C1")); |
| | | // dataMap.put("thing4", new WxMpTemplateData("thing4", "xx市xx县xx路xx号", "#173177")); |
| | | // dataMap.put("time7", new WxMpTemplateData("time7", "2023-05-15 00:00:00", "#B95EA6")); |
| | | // dataMap.put("thing8", new WxMpTemplateData("thing8", "张三", "#87cefa")); |
| | | // |
| | | // |
| | | // String s = wxMpUtils.sendTemplateMessage("oK3-Z59miSE_ebKdXP4IZuXilEvE", "TDF0WB3hndi1gtQybzcHCXeZWm_Q7HjtjVLNG4MOX8Q", "", dataMap); |
| | | // |
| | | // System.out.println("s的值为:" + s); |
| | | // } |
| | | |
| | | /** |
| | | * 单点登录方法(需要配置IP白名单) |
| | |
| | | */ |
| | | // @IpWhitelist |
| | | @GetMapping("/SSOLogin") |
| | | public RedirectView SSOLogin(@RequestParam(required = false) String campusid, |
| | | @RequestParam(required = false) String deptId, |
| | | String orgid, |
| | | String userName, |
| | | String token) { |
| | | public RedirectView SSOLogin(@RequestParam(required = false) String campusid, @RequestParam(required = false) String deptId, String orgid, String userName, String token) { |
| | | if (StringUtils.isEmpty(userName) && StringUtils.isEmpty(token) && StringUtils.isEmpty(orgid)) { |
| | | throw new BaseException("参数不能为空"); |
| | | } |
| | |
| | | private RedirectView buildRedirect(String url) { |
| | | RedirectView redirectView = new RedirectView(); |
| | | redirectView.setUrl(url); |
| | | redirectView.setStatusCode(HttpStatus.MOVED_PERMANENTLY); |
| | | redirectView.setStatusCode(HttpStatus.FOUND); // 302 临时重定向,避免浏览器缓存 |
| | | redirectView.setExposeModelAttributes(false); // 避免模型属性暴露 |
| | | return redirectView; |
| | | } |
| | | |
| | |
| | | sysUserDept.setUserId(user.getUserId()); |
| | | sysUserDept.setDeptType("1"); |
| | | sysUserDept.setOrgid(user.getOrgid()); |
| | | sysUserDept.setCampusid(user.getCampusid()); |
| | | sysUserDeptKSs = sysUserDeptMapper.selectSysUserDeptList(sysUserDept); |
| | | ajax.put("belongDepts", sysUserDeptKSs); |
| | | sysUserDept.setDeptType("2"); |