——————————DescriptionStart——————————
运行环境 Java≥8、MySQL≥5.7、Tomcat≥8
开发工具 eclipse/idea/myeclipse/sts等均可配置运行
适用 课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SSM微信小程序医生挂号预约平台(java+ssm+jsp+javascript+msql+tomcat+wechat)
/hospital
web管理端:http://localhost:8080/hospital/media/login.jsp admin 123456
小程序端: user 123456
项目分为三种用户: 小程序端:前台用户 WEB管理端:管理员、医生
功能: 小程序端:用户注册 小程序端:用户登录 小程序端:用户查看或搜索医生列表 小程序端:用户查看医生详情 小程序端:用户预约医生(填写预约人、手机号、支付方式:微信/支付宝) 小程序端:用户评价医生(填写评价内容)或取消预约
WEB管理端:医生查看订单(即预约记录,可以取消预约) WEB管理端:医生查看评价(用户对本医生的评价)
WEB管理端:管理员管理评价 WEB管理端:管理员管理医生(增删改查) WEB管理端:管理员管理科室(增删改查) WEB管理端:管理员管理订单 WEB管理端:管理员管理登录日志 WEB管理端:管理员管理登录用户 WEB管理端:管理员管理角色及菜单权限
——————————CodeStart——————————
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 map.put("msg" , "修改失败" ); } return map; } @RequestMapping(params = "addUser") @ResponseBody public Map addUser (PowerUser paramT,HttpSession session,HttpServletRequest request) { Map<Object, Object> map = new HashMap<Object, Object>(); String[] roleId=request.getParameterValues("roleId" ); try { PowerUser u=(PowerUser)session.getAttribute("users" ); paramT.setUpdateUserId(u.getId()); paramT.setUpdateUserName(u.getUserName()); paramT.setUpdateTime(Time.nowDateToString()); paramT.setState(1 ); paramT.setMobilePowerState(1 ); paramT.setPassword(MD5.pass("111111" )); if (paramT.getId()!=null && !"" .equals(paramT.getId())){ powerUserDao.updateByPrimaryKeySelective(paramT); }else { paramT.setId(IDGenerator.getID()); powerUserDao.insertSelective(paramT); } roleUserDao.deleteByPrimaryUserId(paramT.getId()); for (int i=0 ;i<roleId.length;i++) { PowerRoleUser roleUser=new PowerRoleUser(); roleUser.setId(IDGenerator.getID()); roleUser.setRoleId(roleId[i]); roleUser.setPowId("0" ); roleUser.setUserId(paramT.getId()); roleUserDao.insertSelective(roleUser); } map.put("msg" , "保存成功" ); map.put("success" , true ); } catch (Exception e) { e.printStackTrace();
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 HttpClient client = new HttpClient(); HttpSession session = request.getSession(); String token = (String)session.getAttribute("token" ); String cookie = (String)session.getAttribute("cookie" ); String url = "https://mp.weixin.qq.com/advanced/callbackprofile" ; PostMethod post = new PostMethod(url); client.getParams().setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY); post.setRequestHeader("Referer" ,"https://mp.weixin.qq.com/" ); post.setRequestHeader("Host" , "mp.weixin.qq.com" ); System.out.println(cookie); NameValuePair[] params = new NameValuePair[]{ new NameValuePair("t" ,"ajax-response" ), new NameValuePair("token" ,token), new NameValuePair("lang" ,"zh_CN" ), new NameValuePair("url" ,callback_url), new NameValuePair("callback_token" ,callback_token) }; Protocol myhttps = new Protocol("https" , new MySSLProtocolSocketFactory(), 443 ); Protocol.registerProtocol("https" , myhttps); post.setQueryString(params); post.setRequestHeader("cookie" , cookie); int status; status = client.executeMethod(post); if (status == HttpStatus.SC_OK) { String text = post.getResponseBodyAsString(); System.out.println(text); Map map = (Map)JSONObject.parse(text); String ret = (String) map.get("ret" ); if (Integer.parseInt(ret) == 0 ){ returnMap.put("success" ,true ); returnMap.put("msg" ,"设置成功" ); }else { returnMap.put("success" ,false ); returnMap.put("msg" ,"参数错误" ); } } return returnMap; }catch (Exception e){ e.printStackTrace(); return returnMap; } } public static void main (String args[]) {
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 * 类描述: * 作者单位: * 联系方式: * @version */ @Controller @RequestMapping("/code") public class SecCodeController { @RequestMapping public void generate (HttpServletResponse response) { ByteArrayOutputStream output = new ByteArrayOutputStream(); String code = drawImg(output); Subject currentUser = SecurityUtils.getSubject(); Session session = currentUser.getSession(); session.setAttribute(Const.SESSION_SECURITY_CODE, code); try { ServletOutputStream out = response.getOutputStream(); output.writeTo(out); } catch (IOException e) { e.printStackTrace(); } } private String drawImg (ByteArrayOutputStream output) { String code = "" ; for (int i=0 ; i<4 ; i++){ code += randomChar(); } int width = 70 ; int height = 25 ; BufferedImage bi = new BufferedImage(width,height,BufferedImage.TYPE_3BYTE_BGR); Font font = new Font("Times New Roman" ,Font.PLAIN,20 ); Graphics2D g = bi.createGraphics(); g.setFont(font); Color color = new Color(66 ,2 ,82 ); g.setColor(color); g.setBackground(new Color(226 ,226 ,240 )); g.clearRect(0 , 0 , width, height); FontRenderContext context = g.getFontRenderContext(); Rectangle2D bounds = font.getStringBounds(code, context); double x = (width - bounds.getWidth()) / 2 ; double y = (height - bounds.getHeight()) / 2 ; double ascent = bounds.getY(); double baseY = y - ascent; g.drawString(code, (int )x, (int )baseY); g.dispose(); try { ImageIO.write(bi, "jpg" , output);
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 queryMap.put("rows" , (Integer.parseInt(rows))); } Map<Object, Object> map = new HashMap<Object, Object>(); try { List<MobileUser> list = mobileUserDao.get(queryMap); map.put("rows" , list); map.put("total" , mobileUserDao.getCount(queryMap)); map.put("success" ,true ); map.put("page" , page); map.put("msg" ,"查询成功" ); } catch (Exception e) { map.put("success" ,false ); map.put("msg" ,"查询失败" ); return map; } return map; } @RequestMapping(params = "delMoreEvent") @ResponseBody public Map<Object, Object> deleteMore (String id,HttpServletRequest request) { Map<Object, Object> map = new HashMap<Object, Object>(); try { List<String> listId = new ArrayList<String>(); String[] arrId = id.split("," ); for (int i = 0 ; i < arrId.length ; i ++ ){ listId.add(arrId[i]); Map<Object, Object> queryMap = new HashMap<Object, Object>(); queryMap.put("id" , arrId[i]); } if ( listId.size() > 0 ){ mobileUserDao.deleteMoreByPK(listId); map.put("msg" , "删除成功" ); map.put("success" , true ); }else { map.put("msg" , "缺少删除条件" ); map.put("success" , false ); } return map; } catch (Exception e) { e.printStackTrace(); map.put("msg" , "删除失败" ); map.put("success" , false ); return map; } } }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 public class ToolUtil { private static final Log log = LogFactory.getLog(ToolUtil.class); private static final String DEBUG = "1" ; private static final long DISPLAY_ORDER_TOP = 630720000000L ; public static void sleep (long millis) { try { Thread.sleep(millis); } catch (Exception ex) { ex.printStackTrace(); } } public static boolean unless (String str) { if (str == null || "" .equals(str)){ return false ; }else { return true ; } } public static void sleepMilliSeconds (long millis) { try { Thread.sleep(millis); } catch (InterruptedException e) { } }
——————————PayStart——————————
项目链接: https://javayms.github.io?id=192324021803201lh https://javayms.pages.dev?id=192324021803201lh