当前位置: 首页 > 编程日记 > 正文

Java项目:在线婚纱摄影预定系统(java+javaweb+SSM+springboot+mysql)

源码获取:博客首页 "资源" 里下载!

一、项目简述

功能: 前后用户的登录注册,婚纱照片分类,查看,摄影师预 订,后台订单管理,图片管理等等。

二、项目运行

环境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持)

项目技术: Jdbc+ Servlert + html+ css + JavaScript + JQuery + Ajax + Fileupload

作品控制器:

/*** * 作品控制器**/
@Controller
@Scope("prototype")
public class WorksController {private static final Logger logger = LoggerFactory.getLogger(WorksController.class);private ReturnResult returnResult = new ReturnResult();@Resource(name = "worksService")private IWorksService worksService;@Resource(name = "attachmentService")private IAttachmentService attachmentService;/*** 添加作品* * @param works* @param HttpServletRequest* @return*/@RequestMapping(value = "addWorks", method = RequestMethod.POST)@ResponseBodypublic ReturnResult addWorks(TWorks works, HttpServletRequest request) {returnResult.setStatus(ReturnCodeType.FAILURE);try {Map<String, String> map = OperationFileUtil.multiFileUpload(request,request.getServletContext().getRealPath("/") + "uploads\\images\\");works.setCreatetime(new Date());worksService.insert(works);//插入附件int worksId = works.getId();for (Map.Entry<String, String> entry : map.entrySet()) {TAttachment attachment = new TAttachment();attachment.setWorksid(worksId);attachment.setPath(entry.getValue().replace(request.getServletContext().getRealPath("/"), "/"));attachment.setStatus("0");attachment.setCreatetime(new Date());attachmentService.insert(attachment);}returnResult.setStatus(ReturnCodeType.SUCCESS);} catch (Exception e) {logger.error("新增works失败" + e);e.printStackTrace();}return returnResult;}/*** 修改works状态* @param works* @return*/@RequestMapping(value = "updateWorksStatus", method = RequestMethod.GET)@ResponseBodypublic ReturnResult updateWorksStatus(TWorks works) {returnResult.setStatus(ReturnCodeType.FAILURE);try {worksService.updateBySQL("UPDATE t_works SET status=" + works.getStatus() + " WHERE id=" + works.getId());returnResult.setStatus(ReturnCodeType.SUCCESS);} catch (Exception e) {logger.error("更新works状态失败" + e);}return returnResult;}/*** 修改works封面* @param works* @return*/@RequestMapping(value = "updateWorksPath", method = RequestMethod.POST)@ResponseBodypublic ReturnResult updateWorksPath(TWorks works,HttpServletRequest request) {returnResult.setStatus(ReturnCodeType.FAILURE);try {Map<String, String> map = OperationFileUtil.multiFileUpload(request,request.getServletContext().getRealPath("/") + "uploads\\images\\");String filePath = "";for (Map.Entry<String, String> entry : map.entrySet()) {filePath = entry.getValue();}filePath = filePath.replace(request.getServletContext().getRealPath("/"), "/").replace("\\", "/");worksService.updateBySQL("UPDATE t_works SET path='" + filePath + "' WHERE id=" + works.getId());returnResult.setStatus(ReturnCodeType.SUCCESS);} catch (Exception e) {logger.error(" 修改works封面失败" + e);}return returnResult;}/*** 修改works的title和content* @param works* @return*/@RequestMapping(value = "updateWorks", method = RequestMethod.POST)@ResponseBodypublic ReturnResult updateWorks(TWorks works) {returnResult.setStatus(ReturnCodeType.FAILURE);try {worksService.updateBySQL("UPDATE t_works SET title='" + works.getTitle() + "',content='"+works.getContent()+"' WHERE id=" + works.getId());returnResult.setStatus(ReturnCodeType.SUCCESS);} catch (Exception e) {logger.error("修改works失败" + e);}return returnResult;}/*** 根据id获取Works 的照片* @param Works* @return*/@RequestMapping(value = "getWorksImgById", method = RequestMethod.POST)@ResponseBodypublic ReturnResult getWorksImgById(Integer id) {returnResult.setStatus(ReturnCodeType.FAILURE);try {returnResult.setStatus(ReturnCodeType.SUCCESS).setData(worksService.selectBySQL("SELECT path FROM t_attachment WHERE worksId="+id));} catch (Exception e) {logger.error("根据id获取Works 的照片 失败" + e);}return returnResult;}/*** 根据id获取Works * @param Works* @return*/@RequestMapping(value = "getWorksById")@ResponseBodypublic ReturnResult getWorksById(Integer id) {returnResult.setStatus(ReturnCodeType.FAILURE);try {returnResult.setStatus(ReturnCodeType.SUCCESS).setData(worksService.selectByPrimaryKey(id));} catch (Exception e) {logger.error("根据id获取Works失败" + e);}return returnResult;}/*** 根据id获取Works 用户视图* @param Works* @return*/@RequestMapping(value = "getWorks")@ResponseBodypublic ReturnResult getWorks(Integer id) {returnResult.setStatus(ReturnCodeType.FAILURE);try {returnResult.setStatus(ReturnCodeType.SUCCESS).setData(worksService.getWorks(id));} catch (Exception e) {logger.error("根据id获取Works失败" + e);}return returnResult;}/*** 根据photographerid获取Works * @param Works* @return*/@RequestMapping(value = "getWorksByPhotographerId", method = RequestMethod.GET)@ResponseBodypublic ReturnResult getWorksByPhotographerId(Integer id) {returnResult.setStatus(ReturnCodeType.FAILURE);try {returnResult.setStatus(ReturnCodeType.SUCCESS).setData(worksService.getWorksByPhotographerId(id));} catch (Exception e) {logger.error("根据photographerid获取Works失败" + e);}return returnResult;}/*** 分页获取works* @return*/@RequestMapping(value = "getWorksListByPage", method = RequestMethod.POST)@ResponseBodypublic ReturnResult getWorksListByPage(PageVO page,String photographerId,String spotsId,String status) {returnResult.setStatus(ReturnCodeType.FAILURE);try {Map<String, Object> resultMap = new HashMap<String, Object>();StringBuffer sql = new StringBuffer("SELECT a.*,b.`name` AS photographer,c.`name` AS spots FROM t_works a,t_photographer b,t_spots c WHERE a.photographerId=b.id AND a.spotsId=c.id");StringBuffer countSql = new StringBuffer("SELECT COUNT(*) AS total FROM t_works a,t_photographer b,t_spots c WHERE a.photographerId=b.id AND a.spotsId=c.id");if(StringUtils.isNotBlank(photographerId)){sql.append(" AND b.id="+photographerId);countSql.append(" AND b.id="+photographerId);}if(StringUtils.isNotBlank(spotsId)){sql.append(" AND c.id="+spotsId);countSql.append(" AND c.id="+spotsId);}if(StringUtils.isNotBlank(status)){sql.append(" AND a.status="+status);countSql.append(" AND a.status="+status);}List<Map<String, Object>> results = worksService.selectPageBySQL(sql.toString(), page.getPage() - 1,page.getRows());if (!results.isEmpty() && results != null) {int total = Integer.valueOf(worksService.selectBySQL(countSql.toString()).get(0).get("total").toString());int rows = page.getRows();rows = rows == 0 ? 10 : rows;resultMap.put("total", (total % rows != 0 ? (total / rows + 1) : (total / rows)));resultMap.put("page", page.getPage());resultMap.put("records", total);resultMap.put("rows", results);returnResult.setStatus(ReturnCodeType.SUCCESS).setData(resultMap);}}catch (Exception e) {logger.error("分页获取works失败" + e);}return returnResult;}/*** 分页获取启用的works* @return*/@RequestMapping(value = "getWorksListByPageStatus", method = RequestMethod.POST)@ResponseBodypublic ReturnResult getWorksListByPageStatus(String sord,String spotsId) {returnResult.setStatus(ReturnCodeType.FAILURE);try {String sql = "SELECT * FROM t_works WHERE status=0";if(StringUtils.isNotBlank(sord)){sql="SELECT * FROM t_works WHERE status=0 ORDER BY id DESC";}if(StringUtils.isNotBlank(spotsId)){sql = "SELECT * FROM t_works WHERE status=0 AND spotsId="+spotsId;}returnResult.setStatus(ReturnCodeType.SUCCESS).setData(worksService.selectBySQL(sql));}catch (Exception e) {logger.error("分页获取启用的works失败" + e);}return returnResult;}
}

摄影师控制器:

/*** * 摄影师控制器**/
@Controller
@Scope("prototype")
public class PhotographerController {private static final Logger logger = LoggerFactory.getLogger(PhotographerController.class);private ReturnResult returnResult = new ReturnResult();@Resource(name = "photographerService")private IPhotographerService photographerService;@Resource(name = "photographerLabelService")IPhotographerLabelService photographerLabelService;@Resource(name = "photographerLevelService")IPhotographerLevelService photographerLevelService;@Resource(name = "photographerSpotsService")IPhotographerSpotsService photographerSpotsService;/*** 添加摄影师* * @param photographer* @param HttpServletRequest* @return*/@RequestMapping(value = "addPhotographer", method = RequestMethod.POST)@ResponseBodypublic ReturnResult addPhotographer(TPhotographer photographer, HttpServletRequest request, Integer labelId,Integer levelId, Integer spotsId) {returnResult.setStatus(ReturnCodeType.FAILURE);try {Map<String, String> map = OperationFileUtil.multiFileUpload(request,request.getServletContext().getRealPath("/") + "uploads\\photographer\\");String filePath = "";for (Map.Entry<String, String> entry : map.entrySet()) {filePath = entry.getValue();}filePath = filePath.replace(request.getServletContext().getRealPath("/"), "/");photographer.setHead(filePath);photographer.setCreatetime(new Date());photographerService.insert(photographer);int id = photographer.getId();TPhotographerLabel label = new TPhotographerLabel(labelId, id, new Date(), "0");photographerLabelService.insert(label);TPhotographerLevel level = new TPhotographerLevel(levelId, id, new Date(), "0");photographerLevelService.insert(level);TPhotographerSpots spots = new TPhotographerSpots(spotsId, id, new Date(), "0");photographerSpotsService.insert(spots);returnResult.setStatus(ReturnCodeType.SUCCESS);} catch (Exception e) {logger.error("新增photographer失败" + e);}return returnResult;}/*** 修改photographer状态* * @param photographer* @return*/@RequestMapping(value = "updatePhotographerStatus", method = RequestMethod.GET)@ResponseBodypublic ReturnResult updatePhotographerStatus(TPhotographer photographer) {returnResult.setStatus(ReturnCodeType.FAILURE);try {photographerService.updateBySQL("UPDATE t_photographer SET status=" + photographer.getStatus()+ " WHERE id=" + photographer.getId());returnResult.setStatus(ReturnCodeType.SUCCESS);} catch (Exception e) {logger.error("更新photographer状态失败" + e);}return returnResult;}/*** 修改photographer的name和summary* * @param photographer* @return*/@RequestMapping(value = "updatePhotographer", method = RequestMethod.POST)@ResponseBodypublic ReturnResult updatePhotographer(TPhotographer photographer, Integer labelId, Integer levelId,Integer spotsId) {returnResult.setStatus(ReturnCodeType.FAILURE);try {photographerService.updateBySQL("UPDATE t_photographer SET name='" + photographer.getName() + "',summary='"+ photographer.getSummary() + "',status=" + photographer.getStatus() + " WHERE id="+ photographer.getId());photographerLabelService.updateBySQL("UPDATE t_photographer_label SET labelId=" + labelId+ " WHERE photographerId=" + photographer.getId());photographerLevelService.updateBySQL("UPDATE t_photographer_level SET levelId=" + levelId+ " WHERE photographer=" + photographer.getId());photographerSpotsService.updateBySQL("UPDATE t_photographer_spots SET spotsId=" + spotsId+ " WHERE photographerId=" + photographer.getId());returnResult.setStatus(ReturnCodeType.SUCCESS);} catch (Exception e) {logger.error("修改photographer失败" + e);e.printStackTrace();}return returnResult;}/*** 根据id获取Photographer* admin* @param Photographer* @return*/@RequestMapping(value = "getPhotographerById", method = RequestMethod.POST)@ResponseBodypublic ReturnResult getPhotographerById(Integer id) {returnResult.setStatus(ReturnCodeType.FAILURE);try {returnResult.setStatus(ReturnCodeType.SUCCESS).setData(photographerService.selectBySQL("SELECT a.*,b.labelId,c.levelId,d.spotsId FROM t_photographer a,t_photographer_label b,t_photographer_level c,t_photographer_spots d WHERE a.id ="+ id + " AND b.photographerId=" + id + " AND c.photographer=" + id+ " AND d.photographerId=" + id + "").get(0));} catch (Exception e) {logger.error("根据id获取Photographer失败" + e);}return returnResult;}/*** 根据id获取Photographer* user* @param Photographer* @return*/@RequestMapping(value = "getPhotographer")@ResponseBodypublic ReturnResult getPhotographer(Integer id) {returnResult.setStatus(ReturnCodeType.FAILURE);try {returnResult.setStatus(ReturnCodeType.SUCCESS).setData(photographerService.selectBySQL("SELECT a.name,a.head,a.summary,d.`name` AS level,e.`name` AS spots FROM t_photographer a,t_photographer_level b,t_photographer_spots c,t_level d,t_spots e WHERE a.id="+id+" AND b.photographer="+id+" AND c.photographerId="+id+" AND d.id=b.levelId AND e.id = c.spotsId AND a.`status`=0").get(0));} catch (Exception e) {logger.error("根据id获取Photographer失败" + e);}return returnResult;}/*** 分页获取photographer* * @return*/@RequestMapping(value = "getPhotographerListByPage", method = RequestMethod.POST)@ResponseBodypublic ReturnResult getPhotographerListByPage(PageVO page, String labelId, String levelId, String spotsId,String beforeTime, String afterTime, String status, String name) {returnResult.setStatus(ReturnCodeType.FAILURE);try {Map<String, Object> resultMap = new HashMap<String, Object>();StringBuffer sql = new StringBuffer("SELECT a.*,f.`name` AS label,g.`name` AS level,h.`name` AS spots FROM t_photographer a,t_photographer_label b,t_photographer_level c ,t_photographer_spots d,t_label f,t_level g,t_spots h WHERE a.id=b.photographerId AND a.id = c.photographer AND a.id = d.photographerId AND f.id=b.labelId AND g.id=c.levelId AND h.id= d.spotsId");if (StringUtils.isNotBlank(labelId)) {sql.append(" AND b.labelId=" + labelId);sql.append(" AND f.id=" + labelId);}if (StringUtils.isNotBlank(levelId)) {sql.append(" AND c.levelId=" + levelId);sql.append(" AND g.id=" + levelId);}if (StringUtils.isNotBlank(spotsId)) {sql.append(" AND d.spotsId=" + spotsId);sql.append(" AND h.id=" + spotsId);}if (StringUtils.isNotBlank(status)) {sql.append(" AND a.status=" + status);}if (StringUtils.isNotBlank(name)) {sql.append(" AND a.name=" + name);}List<Map<String, Object>> results = photographerService.selectPageBySQL(sql.toString(), page.getPage() - 1,page.getRows());if (!results.isEmpty() && results != null) {int total = photographerService.selectCount(new TPhotographer());int rows = page.getRows();rows = rows == 0 ? 10 : rows;resultMap.put("total", (total % rows != 0 ? (total / rows + 1) : (total / rows)));resultMap.put("page", page.getPage());resultMap.put("records", total);resultMap.put("rows", results);returnResult.setStatus(ReturnCodeType.SUCCESS).setData(resultMap);}} catch (Exception e) {logger.error("分页获取photographer失败" + e);}return returnResult;}/*** 分页获取启用的photographer* * @return*/@RequestMapping(value = "getPhotographerListByPageStatus", method = RequestMethod.POST)@ResponseBodypublic ReturnResult getPhotographerListByPageStatus(PageVO page, String labelId, String levelId, String spotsId,String start, String end) {returnResult.setStatus(ReturnCodeType.FAILURE);try {Map<String, Object> resultMap = new HashMap<String, Object>();StringBuffer sql = new StringBuffer("SELECT a.*,f.`name` AS label,g.`name` AS level,h.`name` AS spots FROM t_photographer a,t_photographer_label b,t_photographer_level c ,t_photographer_spots d,t_label f,t_level g,t_spots h WHERE a.id=b.photographerId AND a.id = c.photographer AND a.id = d.photographerId AND f.id=b.labelId AND g.id=c.levelId AND h.id= d.spotsId AND a.status=0");StringBuffer countSql = new StringBuffer("SELECT COUNT(*) AS total FROM t_photographer a,t_photographer_label b,t_photographer_level c ,t_photographer_spots d,t_label f,t_level g,t_spots h WHERE a.id=b.photographerId AND a.id = c.photographer AND a.id = d.photographerId AND f.id=b.labelId AND g.id=c.levelId AND h.id= d.spotsId AND a.status=0");if (StringUtils.isNotBlank(start) && StringUtils.isNotBlank(end)) {List<String> list = photographerService.selectByStartEnd(start,end);for(String id : list){sql.append(" AND a.id!="+id);countSql.append(" AND a.id!="+id);}}if (StringUtils.isNotBlank(labelId)) {sql.append(" AND b.labelId=" + labelId);sql.append(" AND f.id=" + labelId);countSql.append(" AND b.labelId=" + labelId);countSql.append(" AND f.id=" + labelId);}if (StringUtils.isNotBlank(levelId)) {sql.append(" AND c.levelId=" + levelId);sql.append(" AND g.id=" + levelId);countSql.append(" AND c.levelId=" + levelId);countSql.append(" AND g.id=" + levelId);}if (StringUtils.isNotBlank(spotsId)) {sql.append(" AND d.spotsId=" + spotsId);sql.append(" AND h.id=" + spotsId);countSql.append(" AND d.spotsId=" + spotsId);countSql.append(" AND h.id=" + spotsId);}List<Map<String, Object>> results = photographerService.selectPageBySQL(sql.toString(), page.getPage() - 1,page.getRows());if (!results.isEmpty() && results != null) {int total = Integer.valueOf( photographerService.selectBySQL(countSql.toString()).get(0).get("total").toString());int rows = page.getRows();rows = rows == 0 ? 10 : rows;resultMap.put("total", (total % rows != 0 ? (total / rows + 1) : (total / rows)));resultMap.put("page", page.getPage());resultMap.put("records", total);resultMap.put("rows", results);returnResult.setStatus(ReturnCodeType.SUCCESS).setData(resultMap);}} catch (Exception e) {logger.error("分页获取启用的photographer失败" + e);}return returnResult;}/*** 获取所有启用的Photographer* * @param Photographer* @return*/@RequestMapping(value = "getAllPhotographer", method = RequestMethod.POST)@ResponseBodypublic ReturnResult getAllPhotographer() {returnResult.setStatus(ReturnCodeType.FAILURE);try {returnResult.setStatus(ReturnCodeType.SUCCESS).setData(photographerService.selectBySQL("SELECT a.id,a.name FROM t_photographer a,t_photographer_label b,t_photographer_level c ,t_photographer_spots d,t_label f,t_level g,t_spots h WHERE a.id=b.photographerId AND a.id = c.photographer AND a.id = d.photographerId AND f.id=b.labelId AND g.id=c.levelId AND h.id= d.spotsId AND a.status=0"));} catch (Exception e) {logger.error("获取所有启用的Photographer失败" + e);}return returnResult;}}

预约控制器:

/*** * 预约控制器*/
@Controller
@Scope("prototype")
public class ScheduleController {private static final Logger logger = LoggerFactory.getLogger(ScheduleController.class);private ReturnResult returnResult = new ReturnResult();@Resource(name = "scheduleService")private IScheduleService scheduleService;/*** 添加预约* * @param schedule* @param session* @return*/@RequestMapping(value = "addSchedule", method = RequestMethod.POST)@ResponseBodypublic ReturnResult addSchedule(TSchedule schedule, HttpSession session,String startdate,String enddate) {returnResult.setStatus(ReturnCodeType.FAILURE);try {schedule.setStart(DateFormater.stringToDate(startdate));schedule.setEnd(DateFormater.stringToDate(enddate));schedule.setCreatetime(new Date());TUser user = (TUser)session.getAttribute("user");schedule.setUserid(user.getId());if(scheduleService.insert(schedule)>0){returnResult.setStatus(ReturnCodeType.SUCCESS);}} catch (Exception e) {logger.error("新增schedule失败" + e);}return returnResult;}/*** 修改schedule状态* @param schedule* @return*/@RequestMapping(value = "updateScheduleStatus", method = RequestMethod.POST)@ResponseBodypublic ReturnResult updateScheduleStatus(TSchedule schedule,HttpSession session) {returnResult.setStatus(ReturnCodeType.FAILURE);try {session.getAttribute("admin");scheduleService.updateBySQL("UPDATE t_schedule SET status=" + schedule.getStatus() + " WHERE id=" + schedule.getId());returnResult.setStatus(ReturnCodeType.SUCCESS);} catch (Exception e) {logger.error("更新schedule状态失败" + e);}return returnResult;}/*** 设置摄影师无档期或有预约* @param schedule* @return*/@RequestMapping(value = "setSchedule", method = RequestMethod.POST)@ResponseBodypublic ReturnResult setSchedule(Integer photographerId,String createTimeRange,HttpSession session,String status) {returnResult.setStatus(ReturnCodeType.FAILURE);try {if(photographerId!=null&&StringUtils.isNotBlank(createTimeRange)){String start = createTimeRange.split(" - ")[0];String end = createTimeRange.split(" - ")[1];session.getAttribute("admin");TSchedule schedule = new TSchedule();schedule.setUserid(1);schedule.setCreatetime(new Date());schedule.setStatus(status);schedule.setStart(DateFormater.stringToDate("yyyy/MM/dd",start));schedule.setEnd(DateFormater.stringToDate("yyyy/MM/dd",end));schedule.setPhotographerid(photographerId);scheduleService.insert(schedule);returnResult.setStatus(ReturnCodeType.SUCCESS);}} catch (Exception e) {logger.error("更新schedule状态失败" + e);}return returnResult;}/*** 根据id获取schedule* @param schedule* @return*/@RequestMapping(value = "getScheduleById", method = RequestMethod.POST)@ResponseBodypublic ReturnResult getScheduleById(Integer id) {returnResult.setStatus(ReturnCodeType.FAILURE);try {returnResult.setStatus(ReturnCodeType.SUCCESS).setData(scheduleService.selectByPrimaryKey(id));} catch (Exception e) {logger.error("根据id获取schedule失败" + e);}return returnResult;}/*** 根据摄影师id获取schedule* @param schedule* @return*/@RequestMapping(value = "getScheduleByPhotographerId", method = RequestMethod.GET)@ResponseBodypublic ScheduleVO getScheduleByPhotographerId(Integer photoer_id,String year,String month) {return scheduleService.getScheduleByPhotographerId( photoer_id, year, month);}/*** 分页获取schedule* @return*/@RequestMapping(value = "getScheduleListByPage", method = RequestMethod.POST)@ResponseBodypublic ReturnResult getScheduleListByPage(PageVO page,String photographerId,String start,String end) {returnResult.setStatus(ReturnCodeType.FAILURE);try {Map<String, Object> resultMap = new HashMap<String, Object>();StringBuffer sql = new StringBuffer("SELECT a.createTime,a.`status`,a.id,a.`start`,a.`end`,b.`name`,b.tel,c.`name` AS photographer FROM t_schedule a, t_user b ,t_photographer c WHERE a.userId = b.id AND a.photographerId =c.id");if(StringUtils.isNotBlank(photographerId)){sql.append(" AND a.photographerId="+photographerId);}if(StringUtils.isNotBlank(start)&&StringUtils.isNotBlank(end)){sql.append(" AND a.`start` BETWEEN '"+start+"' AND '"+end+"' OR a.`end` BETWEEN '"+start+"' AND '"+end+"'");}sql.append(" GROUP BY a.id ORDER BY a.createTime DESC");List<Map<String, Object>> results = scheduleService.selectPageBySQL(sql.toString(), page.getPage() - 1,page.getRows());if (!results.isEmpty() && results != null) {int total = scheduleService.selectCount(new TSchedule());int rows = page.getRows();rows = rows == 0 ? 10 : rows;resultMap.put("total", (total % rows != 0 ? (total / rows + 1) : (total / rows)));resultMap.put("page", page.getPage());resultMap.put("records", total);resultMap.put("rows", results);returnResult.setStatus(ReturnCodeType.SUCCESS).setData(resultMap);}}catch (Exception e) {logger.error("分页获取schedule失败" + e);}return returnResult;}/*** 根据用户获取schedule* @param schedule* @return*/@RequestMapping(value = "getSchedule", method = RequestMethod.GET)@ResponseBodypublic ReturnResult getSchedule(HttpSession session) {returnResult.setStatus(ReturnCodeType.FAILURE);TUser user = (TUser) session.getAttribute("user");return returnResult.setStatus(ReturnCodeType.SUCCESS).setData(scheduleService.selectBySQL("SELECT DATE_FORMAT(a.`start`,'%Y-%m-%d') AS start,DATE_FORMAT(a.`end`,'%Y-%m-%d') AS end,b.name,a.`status`,a.id,a.photographerId FROM t_schedule a,t_photographer b WHERE a.photographerId = b.id AND a.userId="+user.getId()));}/***删除* @param schedule* @return*/@RequestMapping(value = "deleteSchedule", method = RequestMethod.GET)@ResponseBodypublic ReturnResult deleteSchedule(HttpSession session,Integer id) {returnResult.setStatus(ReturnCodeType.FAILURE);try {session.getAttribute("user");return returnResult.setStatus(ReturnCodeType.SUCCESS).setData(scheduleService.deleteByPrimaryKey(id));} catch (Exception e) {e.printStackTrace();}return returnResult;}
}

源码获取:博客首页 "资源" 里下载!

相关文章:

Linux Terminal 控制终端的使用

1. Open new Terminal&#xff1a;Ctrl Alt T 或者 Ctrl Shift N 2. Open Tab&#xff1a;Ctrl Shift T 3. Close Tab&#xff1a;Ctrl Shift W 4. Close Window&#xff1a;Ctrl Shift Q 5. Copy : Ctrl Shift C 6. Paste: Ctrl Shift V 7. Full Screen: F11 8.…

如何防止代码腐烂

http://blog.jobbole.com/5643/ 很多团队都有这个问题&#xff0c;一个项目的代码本来开始设计得好好的&#xff0c;一段时间以后&#xff0c;代码就会变得难以理解&#xff0c;难以维护&#xff0c;难以修改。为什么&#xff1f;我一直在思考这个问题。 让我们先看一个人的情况…

CORS在Spring中的实现

CORS: 通常情况下浏览器禁止AJAX从外部获取资源&#xff0c;因此就衍生了CORS这一标准体系&#xff0c;来实现跨域请求。 CORS是一个W3C标准&#xff0c;全称是"跨域资源共享"&#xff08;Cross-origin resource sharing&#xff09;。它允许浏览器向跨源(协议 域名…

从BloomFilter到Counter BloomFilter

文章目录前言1. Traditional BloomFilter2. Counter BloomFilter本文traditional bloomfilter 和 counter bloomfilter的C实现 均已上传至&#xff1a; https://github.com/BaronStack/BloomFilter 前言 Bloomfilter 是一个老生常谈的数据结构&#xff0c;应用在存储领域的各…

进程、线程、多线程相关总结

进程、线程、多线程相关总结 一、说说概念 1、进程&#xff08;process&#xff09; 狭义定义&#xff1a;进程就是一段程序的执行过程。 广义定义&#xff1a;进程是一个程序关于某个数据集合的一次运行。它是操作系统动态执行的基本单元&#xff0c;在传统的操作系统中&#…

Java项目:在线蛋糕商城系统(java+jsp+jdbc+mysql)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 一、项目简述 功能&#xff1a; 主页显示热销商品&#xff1b;所有蛋糕商品展示&#xff0c;可进行商品搜 索&#xff1b;点击商品进入商品详情页&#xff0c;具有立即购买和加入购物 车功能&#xff0c;可…

业界对生成图片缩略图的做法归纳

网站如果有很多用户上传图片(相册&#xff0c;商品图片)&#xff0c;一般的做法是将用户图片保存在磁盘上面(数据库中记录图片的地址)。用户上传的时候按照原图、中图、小图等各个尺寸都生成一份保存在磁盘上。比如php的网店系统echsop就是这么做的&#xff0c;而shopex之类也大…

thinkPHP5.0 URL路由优化

在tp中访问页面的时候URL地址是 域名/模块/控制器/方法&#xff0c;在点击首页的时候URL是 域名/index/index/index 而不是只显示域名&#xff0c;这样不利于SEO&#xff0c;而且强迫症的我看着很不爽&#xff0c;这个时候我们需要优化路由 Route::rule(路由表达式,路由地址,请…

Rocksdb 获取当前db内部的有效key个数 (估值)

文章目录1. 基本接口2. Memtable key个数统计3. Immutable Memtable key个数统计4. Sstables key个数统计5. 疑问Rocksdb因为是AppendOnly 方式写入&#xff0c;所以没有办法提供db内部唯一key个数的接口&#xff08;可能存在多版本的key&#xff0c;对用户来说只有一个userkey…

Java项目:网上花店商城系统(java+jsp+servlert+mysql+ajax)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 一、项目简述 功能&#xff1a; 一套完整的网上花店商场系统&#xff0c;系统支持前台会员的注册 登陆系统留言&#xff0c;花朵的品种选择&#xff0c;详情浏览&#xff0c;加入购物 车&#xff0c;购买花…

使用Uboot启动内核并挂载NFS根文件系统

配置编译好内核之后&#xff0c;将生成的内核文件uImage拷贝到/tftpboot/下&#xff0c;通过tftp服务器将内核下载到开发板&#xff0c;使用命令&#xff1a;tftp 31000000 uImage.下载完成之后配置bootargs环境变量&#xff1a;setenv bootargs noinitrd consolettySAC0,11520…

Centos系统上安装php遇到的错误解决方法集锦

Centos系统上安装php遇到的错误解决方法集锦1.configure: error: xml2-config not found. Please check your libxml2 installationyum install libxml2 libxml2-devel2.configure: error: Cannot find OpenSSL’s yum install openssl openssl-devel3.configure: error: Pleas…

2.27 MapReduce Shuffle过程如何在Job中进行设置

一、shuffle过程 总的来说&#xff1a; *分区 partitioner*排序 sort*copy (用户无法干涉) 拷贝*分组 group可设置 *压缩 compress*combiner map task端的Reduce二、示例 package com.ibeifeng.hadoop.senior.mapreduce;import java.io.IOException; import java.util.StringTo…

Rocksdb Slice使用中的一个小坑

本文记录一下使用Rocksdb Slice过程中的一个小小坑&#xff0c;差点没一口老血吐出来。 rocksdb的Slice 数据结构是一个小型得不可变类string数据结构&#xff0c;设计出来的目的是为了保证rocksdb内部处理用户输入的key在从内存到持久化磁盘的整个处理链路是不会被修改的&…

Java项目:仿天猫网上商城项目(java+jsp+servlet+mysql+ajax)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 一、项目简述 功能&#xff1a; 前台&#xff1a; * 用户模块 * 分类模块 * 商品模块 * 购物车模块 * 订单模块 后台&#xff1a; * 管理员模块 * 分类管理模块 * 商品管理模块 * 订单模块…

转--Android如何在java代码中设置margin

3 在Java代码里设置button的margin(外边距)&#xff1f; 1、获取按钮的LayoutParams LinearLayout.LayoutParams layoutParams (LinearLayout.LayoutParams)button.getLayoutParams(); 2、在LayoutParams中设置margin layoutParams.setMargins(100,20,10,5);//4个参数按顺序分…

poj12月其他题解(未完)

最近编程的时间比较少啊…… poj3253 就是个合并果子&#xff0c;各种优先队列即可&#xff08;显然单调队列最优&#xff09; poj3263 线段树统计每个点被覆盖了多少次即可&#xff0c;注意要去重 poj3625 最小生成树 poj3626 bfs poj3624 01背包 poj3615 floyd即可 poj3278 简…

0409-0416的笔记

1 获取前几天&#xff0c;近几个月的时间 function getDay(day) {var today new Date();var targetday_milliseconds today.getTime() 1000 * 60 * 60 * 24 * day;today.setTime(targetday_milliseconds); //注意&#xff0c;这行是关键代码var tYear today.getFullYear();…

Linux NUMA 架构 :基础软件工程师需要知道一些知识

文章目录前言从物理CPU、core到HT(hyper-threading)UMA&#xff08;Uniform memory access&#xff09;NUMA架构NUMA下的内存分配策略1. MPOL_DEFAULT2. MPOL_BIND3. MPOL_INTERLEAVE4. MPOL_PREFERRED5. 一些NUMA架构下的内核配置总结参考前言 NUMA&#xff08;Non-Uniform m…

Java项目:网上书城+后台管理系统(java+jsp+servlert+mysql+ajax)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 一、项目简述(附带IW文档) 功能&#xff1a; 前台&#xff1a; * 用户模块 * 分类模块 * 图书模块 * 购物车模块 * 订单模块 后台&#xff1a; * 管理员模块 * 分类管理模块 * 图书管理模块 * 订单模块 …

java.util.concurrent包API学习笔记

newFixedThreadPool 创建一个固定大小的线程池。 shutdown()&#xff1a;用于关闭启动线程&#xff0c;如果不调用该语句&#xff0c;jvm不会关闭。 awaitTermination()&#xff1a;用于等待子线程结束&#xff0c;再继续执行下面的代码。该例中我设置一直等着子线程结束。Java…

oracle读书记录

很久没有关注自己怕博客了&#xff0c;差不多有两年了。虽然这两年来一直关注51CTO,每天上班打开电脑或者周末在家开启电脑的时候都会浏览一下&#xff0c;这已经是习惯了&#xff0c;但是把自己的blog给忘了。今天&#xff0c;周末&#xff0c;2013年12月21日&#xff0c;同往…

输入、方法的运用

/ /猜数游戏,编写一个功能,完成猜数游戏,产生一个1~10之间的随机数 //与输入的数对对比,返回结果 猜中和没猜中 import java.util.Scanner; //引入&#xff08;输入&#xff09;的util包Scanner public class HelloWorld { public static void main(String[] args) {System…

Rocksdb 利用recycle_log_file_num 重用wal-log文件

recycle_log_file_num 复用wal文件信息&#xff0c; 优化wal文件的空间分配&#xff0c;减少pagecache中文件元信息的更新开销。 为同事提供了一组rocksdb写优化参数之后有一个疑惑的现象被问到&#xff0c;发现之前的一些代码细节有遗忘情况&#xff0c;同时也发现了这个参数…

Java项目:网上商城系统(java+jsp+servlert+mysql+ajax)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 一、项目简述&#xff08;需求文档PPT&#xff09; 功能&#xff1a; 主页显示热销商品&#xff1b;所有商品展示&#xff0c;可进行商品搜索&#xff1b;点 击商品进入商品详情页&#xff0c;显示库存&…

clock函数返回负值~ (转)

使用clock() 函数来进行计时&#xff0c;时不时的返回一个很大的负数&#xff0c;怎么检查也检查不出错误&#xff0c;现在找出错误原因&#xff0c;给大家分享一下。 来源网页&#xff1a;http://kebe-jea.blogbus.com/logs/33603387.html 跑实验的时候&#xff0c;结果时不时…

c实现面向对象编程(3)

http://blog.csdn.net/kennyrose/article/details/7564105转载于:https://www.cnblogs.com/pengkunfan/p/3486612.html

echarts - 条形图grid设置距离绘图区域的距离

在一些数据量过大的情况下&#xff0c;在一个固定的区域绘图往往需要对图表绘制区域的大小进行动态改变。这时候设置条形图距离绘图区域上下左右的距离可使用如下方式&#xff1a;表示条形图的柱子距离绘图区左边30%&#xff0c;距离右边40%&#xff0c;而距离顶部和底部分别为…

TitanDB 中使用Compaction Filter ,产生了预期之外几十倍的读I/O

Compaction过程中 产生大量读I/O 的背景 项目中因大value 需求&#xff0c;引入了PingCap 参考Wisckey 思想实现的key-value分离存储 titan&#xff0c; 使用过程中因为有用到Rocksdb本身的 CompactionFilter功能&#xff0c;所以就直接用TitanDB的option 传入了compaction fi…

Java项目:前台+后台精品图书管理系统(java+SSM+jsp+mysql+maven)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 一、项目简述 功能包括&#xff1a; 登录注册&#xff0c;办理借阅。借阅记录&#xff0c;预约借阅&#xff0c;借出未还, 借阅逾期&#xff0c;学生管理&#xff0c;图书管理&#xff0c;书库分类查询搜索…