文末获取源码
开发语言:Java
框架:springboot
JDK版本:JDK1.8
服务器:tomcat7
数据库:mysql 5.7/8.0
数据库工具:Navicat11
开发软件:eclipse/myeclipse/idea
Maven包:Maven3.3.9
浏览器:谷歌浏览器
自媒体社区平台采用java技术,基于springboot框架,mysql数据库进行开发,实现了以下功能:
本系统主要包括管理员,用户,商家和普通管理员四个角色组成,主要包括以下功能:
(1)前台:首页、需求通告、优质案例、帮助中心、意见反馈、个人中心、后台管理、在线咨询
(2)管理员:首页、个人中心、用户管理、商家管理、普通管理员管理、需求通告管理、接单信息管理、优质案例管理、申请信息管理、社区公告管理、领域类型管理、意见反馈、系统管理。
(3)用户:首页、个人中心、接单信息管理、申请信息管理。
(4)商家:首页、个人中心、需求通告管理、接单信息管理。
(5)普通管理员:首页、个人中心、需求通告管理、优质案例管理、申请信息管理、社区公告管理。
/**
* 接单信息
* 后端接口
* @author
* @email
* @date 2022-02-25 20:58:58
*/
@RestController
@RequestMapping("/jiedanxinxi")
public class JiedanxinxiController {
@Autowired
private JiedanxinxiService jiedanxinxiService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map params,JiedanxinxiEntity jiedanxinxi,
HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("shangjia")) {
jiedanxinxi.setShangjiabianhao((String)request.getSession().getAttribute("username"));
}
if(tableName.equals("yonghu")) {
jiedanxinxi.setBozhuzhanghao((String)request.getSession().getAttribute("username"));
}
EntityWrapper ew = new EntityWrapper();
PageUtils page = jiedanxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, jiedanxinxi), params), params));
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map params,JiedanxinxiEntity jiedanxinxi,
HttpServletRequest request){
EntityWrapper ew = new EntityWrapper();
PageUtils page = jiedanxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, jiedanxinxi), params), params));
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( JiedanxinxiEntity jiedanxinxi){
EntityWrapper ew = new EntityWrapper();
ew.allEq(MPUtil.allEQMapPre( jiedanxinxi, "jiedanxinxi"));
return R.ok().put("data", jiedanxinxiService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(JiedanxinxiEntity jiedanxinxi){
EntityWrapper< JiedanxinxiEntity> ew = new EntityWrapper< JiedanxinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( jiedanxinxi, "jiedanxinxi"));
JiedanxinxiView jiedanxinxiView = jiedanxinxiService.selectView(ew);
return R.ok("查询接单信息成功").put("data", jiedanxinxiView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
JiedanxinxiEntity jiedanxinxi = jiedanxinxiService.selectById(id);
return R.ok().put("data", jiedanxinxi);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
JiedanxinxiEntity jiedanxinxi = jiedanxinxiService.selectById(id);
return R.ok().put("data", jiedanxinxi);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody JiedanxinxiEntity jiedanxinxi, HttpServletRequest request){
jiedanxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(jiedanxinxi);
jiedanxinxiService.insert(jiedanxinxi);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody JiedanxinxiEntity jiedanxinxi, HttpServletRequest request){
jiedanxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(jiedanxinxi);
jiedanxinxiService.insert(jiedanxinxi);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody JiedanxinxiEntity jiedanxinxi, HttpServletRequest request){
//ValidatorUtils.validateEntity(jiedanxinxi);
jiedanxinxiService.updateById(jiedanxinxi);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
jiedanxinxiService.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 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 wrapper = new EntityWrapper();
if(map.get("remindstart")!=null) {
wrapper.ge(columnName, map.get("remindstart"));
}
if(map.get("remindend")!=null) {
wrapper.le(columnName, map.get("remindend"));
}
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("shangjia")) {
wrapper.eq("shangjiabianhao", (String)request.getSession().getAttribute("username"));
}
if(tableName.equals("yonghu")) {
wrapper.eq("bozhuzhanghao", (String)request.getSession().getAttribute("username"));
}
int count = jiedanxinxiService.selectCount(wrapper);
return R.ok().put("count", count);
}
}