基于微信小程序的ssm电影交流平台源码和论文weixin318
随着信息化时代的到来,管理系统都趋向于智能化、系统化,电影交流平台小程序也不例外,但目前国内的市场仍都使用人工管理,市场规模越来越大,同时信息量也越来越庞大,人工管理显然已无法应对时代的变化,而电影交流平台小程序能很好地解决这一问题,轻松应对电影交流平时的工作,既能提高人力物力财力,又能加快工作的效率,取代人工管理是必然趋势。
本电影交流平台小程序以ssm作为框架,b/s模式以及MySql作为后台运行的数据库,同时使用Tomcat用为系统的服务器。本系统主要包括首页、个人中心、用户管理、电影类型管理、电影中心管理、留言反馈、系统管理等功能,通过这些功能的实现能够基本满足日常电影交流管理的操作。
本文着重阐述了电影交流平台小程序的分析、设计与实现,首先介绍开发系统和环境配置、数据库的设计,接着说明功能模块的详细实现,最后进行了总结。
关键词:电影交流平台小程序; ssm;MySql数据库;Tomcat
演示视频:
基于微信小程序的ssm电影交流平台源码和论文
Abstract
With the advent of the era of information technology, management systems tend to be intelligent, systematic, film communication platform applet is not exceptional also, but the current domestic market still use manual management, the size of the market is more and more big, at the same time, the amount of information is becoming more and more big, artificial management has clearly unable to cope with the changes of The Times, and a small program that film communication platform can well solve this problem, Easy to cope with the usual work of film exchange, can not only improve human, material and financial resources, but also speed up the efficiency of work, replacing manual management is an inevitable trend.
The small program of the film exchange platform takes SSM as the framework, B/S mode and MySql as the background database, and Tomcat is used as the server of the system. This system mainly includes home page, personal center, user management, film type management, film center management, message feedback, system management and other functions, through the realization of these functions can basically meet the daily film communication management operation.
This paper focuses on the analysis, design and implementation of the small program of the film communication platform. First, it introduces the development system and environment configuration, the design of the database, and then explains the detailed implementation of the functional module. Finally, it summarizes.
Key words: film communication platform applets; ssm; MySql database; Tomcat
package com.controller;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import com.utils.ValidatorUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.annotation.IgnoreAuth;
import com.entity.DianyingzhongxinEntity;
import com.entity.view.DianyingzhongxinView;
import com.service.DianyingzhongxinService;
import com.service.TokenService;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.CommonUtil;
import com.service.StoreupService;
import com.entity.StoreupEntity;
/**
* 电影中心
* 后端接口
* @author
* @email
* @date 2022-05-02 17:10:35
*/
@RestController
@RequestMapping("/dianyingzhongxin")
public class DianyingzhongxinController {
@Autowired
private DianyingzhongxinService dianyingzhongxinService;
@Autowired
private StoreupService storeupService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,DianyingzhongxinEntity dianyingzhongxin,
HttpServletRequest request){
if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
dianyingzhongxin.setUserid((Long)request.getSession().getAttribute("userId"));
}
EntityWrapper<DianyingzhongxinEntity> ew = new EntityWrapper<DianyingzhongxinEntity>();
PageUtils page = dianyingzhongxinService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, dianyingzhongxin), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,DianyingzhongxinEntity dianyingzhongxin,
HttpServletRequest request){
EntityWrapper<DianyingzhongxinEntity> ew = new EntityWrapper<DianyingzhongxinEntity>();
PageUtils page = dianyingzhongxinService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, dianyingzhongxin), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( DianyingzhongxinEntity dianyingzhongxin){
EntityWrapper<DianyingzhongxinEntity> ew = new EntityWrapper<DianyingzhongxinEntity>();
ew.allEq(MPUtil.allEQMapPre( dianyingzhongxin, "dianyingzhongxin"));
return R.ok().put("data", dianyingzhongxinService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(DianyingzhongxinEntity dianyingzhongxin){
EntityWrapper< DianyingzhongxinEntity> ew = new EntityWrapper< DianyingzhongxinEntity>();
ew.allEq(MPUtil.allEQMapPre( dianyingzhongxin, "dianyingzhongxin"));
DianyingzhongxinView dianyingzhongxinView = dianyingzhongxinService.selectView(ew);
return R.ok("查询电影中心成功").put("data", dianyingzhongxinView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
DianyingzhongxinEntity dianyingzhongxin = dianyingzhongxinService.selectById(id);
dianyingzhongxin.setClicknum(dianyingzhongxin.getClicknum()+1);
dianyingzhongxin.setClicktime(new Date());
dianyingzhongxinService.updateById(dianyingzhongxin);
return R.ok().put("data", dianyingzhongxin);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
DianyingzhongxinEntity dianyingzhongxin = dianyingzhongxinService.selectById(id);
dianyingzhongxin.setClicknum(dianyingzhongxin.getClicknum()+1);
dianyingzhongxin.setClicktime(new Date());
dianyingzhongxinService.updateById(dianyingzhongxin);
return R.ok().put("data", dianyingzhongxin);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody DianyingzhongxinEntity dianyingzhongxin, HttpServletRequest request){
dianyingzhongxin.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(dianyingzhongxin);
dianyingzhongxin.setUserid((Long)request.getSession().getAttribute("userId"));
dianyingzhongxinService.insert(dianyingzhongxin);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody DianyingzhongxinEntity dianyingzhongxin, HttpServletRequest request){
dianyingzhongxin.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(dianyingzhongxin);
dianyingzhongxinService.insert(dianyingzhongxin);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
@Transactional
public R update(@RequestBody DianyingzhongxinEntity dianyingzhongxin, HttpServletRequest request){
//ValidatorUtils.validateEntity(dianyingzhongxin);
dianyingzhongxinService.updateById(dianyingzhongxin);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
dianyingzhongxinService.deleteBatchIds(Arrays.asList(ids));
return R.ok();
}
/**
* 提醒接口
*/
@RequestMapping("/remind/{columnName}/{type}")
public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request,
@PathVariable("type") String type,@RequestParam Map<String, Object> map) {
map.put("column", columnName);
map.put("type", type);
if(type.equals("2")) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
Date remindStartDate = null;
Date remindEndDate = null;
if(map.get("remindstart")!=null) {
Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindStart);
remindStartDate = c.getTime();
map.put("remindstart", sdf.format(remindStartDate));
}
if(map.get("remindend")!=null) {
Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
c.setTime(new Date());
c.add(Calendar.DAY_OF_MONTH,remindEnd);
remindEndDate = c.getTime();
map.put("remindend", sdf.format(remindEndDate));
}
}
Wrapper<DianyingzhongxinEntity> wrapper = new EntityWrapper<DianyingzhongxinEntity>();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
if(!request.getSession().getAttribute("role").toString().equals("管理员")) {
wrapper.eq("userid", (Long)request.getSession().getAttribute("userId"));
}
int count = dianyingzhongxinService.selectCount(wrapper);
return R.ok().put("count", count);
}
/**
* 前端智能排序
*/
@IgnoreAuth
@RequestMapping("/autoSort")
public R autoSort(@RequestParam Map<String, Object> params,DianyingzhongxinEntity dianyingzhongxin, HttpServletRequest request,String pre){
EntityWrapper<DianyingzhongxinEntity> ew = new EntityWrapper<DianyingzhongxinEntity>();
Map<String, Object> newMap = new HashMap<String, Object>();
Map<String, Object> param = new HashMap<String, Object>();
Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
while (it.hasNext()) {
Map.Entry<String, Object> entry = it.next();
String key = entry.getKey();
String newKey = entry.getKey();
if (pre.endsWith(".")) {
newMap.put(pre + newKey, entry.getValue());
} else if (StringUtils.isEmpty(pre)) {
newMap.put(newKey, entry.getValue());
} else {
newMap.put(pre + "." + newKey, entry.getValue());
}
}
params.put("sort", "clicknum");
params.put("order", "desc");
PageUtils page = dianyingzhongxinService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, dianyingzhongxin), params), params));
return R.ok().put("data", page);
}
/**
* 协同算法(按收藏推荐)
*/
@RequestMapping("/autoSort2")
public R autoSort2(@RequestParam Map<String, Object> params,DianyingzhongxinEntity dianyingzhongxin, HttpServletRequest request){
String userId = request.getSession().getAttribute("userId").toString();
String inteltypeColumn = "dianyingleixing";
List<StoreupEntity> storeups = storeupService.selectList(new EntityWrapper<StoreupEntity>().eq("type", 1).eq("userid", userId).eq("tablename", "dianyingzhongxin").orderBy("addtime", false));
List<String> inteltypes = new ArrayList<String>();
Integer limit = params.get("limit")==null?10:Integer.parseInt(params.get("limit").toString());
List<DianyingzhongxinEntity> dianyingzhongxinList = new ArrayList<DianyingzhongxinEntity>();
//去重
if(storeups!=null && storeups.size()>0) {
for(StoreupEntity s : storeups) {
dianyingzhongxinList.addAll(dianyingzhongxinService.selectList(new EntityWrapper<DianyingzhongxinEntity>().eq(inteltypeColumn, s.getInteltype())));
}
}
EntityWrapper<DianyingzhongxinEntity> ew = new EntityWrapper<DianyingzhongxinEntity>();
params.put("sort", "id");
params.put("order", "desc");
PageUtils page = dianyingzhongxinService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, dianyingzhongxin), params), params));
List<DianyingzhongxinEntity> pageList = (List<DianyingzhongxinEntity>)page.getList();
if(dianyingzhongxinList.size()<limit) {
int toAddNum = (limit-dianyingzhongxinList.size())<=pageList.size()?(limit-dianyingzhongxinList.size()):pageList.size();
for(DianyingzhongxinEntity o1 : pageList) {
boolean addFlag = true;
for(DianyingzhongxinEntity o2 : dianyingzhongxinList) {
if(o1.getId().intValue()==o2.getId().intValue()) {
addFlag = false;
break;
}
}
if(addFlag) {
dianyingzhongxinList.add(o1);
if(--toAddNum==0) break;
}
}
} else if(dianyingzhongxinList.size()>limit) {
dianyingzhongxinList = dianyingzhongxinList.subList(0, limit);
}
page.setList(dianyingzhongxinList);
return R.ok().put("data", page);
}
}