SSM_jsp实现小区计费管理系统
作者:互联网
1.技术介绍
java+springmvc+spring+Mybatis+mysql+jsp
开发工具:eclipse或IDEA
2.主要功能说明:
网站前端:
首页、交流论坛、小区资讯、在线留言、个人中心
网站后台管理
普通用户
个人中心、资费信息管理、欠费提醒管理
财务管理账号
个人中心、用户管理、资费信息管理、欠费提醒管理、费用统计管理
管理员
个人中心、用户管理、账务管理、资费信息管理、资费类型管理、欠费提醒管理、费用统计管理、在线留言、交流论坛、系统管理
3.部分代码展示
```java
/**
* 资费信息
* 后端接口
* @author
* @email
* @date 2022-03-24 22:02:09
*/
@RestController
@RequestMapping("/zifeixinxi")
public class ZifeixinxiController {
@Autowired
private ZifeixinxiService zifeixinxiService;
/**
* 后端列表
*/
@RequestMapping("/page")
public R page(@RequestParam Map<String, Object> params,ZifeixinxiEntity zifeixinxi,
HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
zifeixinxi.setZhanghao((String)request.getSession().getAttribute("username"));
}
if(tableName.equals("zhangwuguanli")) {
zifeixinxi.setGuanlizhanghao((String)request.getSession().getAttribute("username"));
}
EntityWrapper<ZifeixinxiEntity> ew = new EntityWrapper<ZifeixinxiEntity>();
PageUtils page = zifeixinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, zifeixinxi), params), params));
request.setAttribute("data", page);
return R.ok().put("data", page);
}
/**
* 前端列表
*/
@IgnoreAuth
@RequestMapping("/list")
public R list(@RequestParam Map<String, Object> params,ZifeixinxiEntity zifeixinxi,
HttpServletRequest request){
EntityWrapper<ZifeixinxiEntity> ew = new EntityWrapper<ZifeixinxiEntity>();
PageUtils page = zifeixinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, zifeixinxi), params), params));
request.setAttribute("data", page);
return R.ok().put("data", page);
}
/**
* 列表
*/
@RequestMapping("/lists")
public R list( ZifeixinxiEntity zifeixinxi){
EntityWrapper<ZifeixinxiEntity> ew = new EntityWrapper<ZifeixinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( zifeixinxi, "zifeixinxi"));
return R.ok().put("data", zifeixinxiService.selectListView(ew));
}
/**
* 查询
*/
@RequestMapping("/query")
public R query(ZifeixinxiEntity zifeixinxi){
EntityWrapper< ZifeixinxiEntity> ew = new EntityWrapper< ZifeixinxiEntity>();
ew.allEq(MPUtil.allEQMapPre( zifeixinxi, "zifeixinxi"));
ZifeixinxiView zifeixinxiView = zifeixinxiService.selectView(ew);
return R.ok("查询资费信息成功").put("data", zifeixinxiView);
}
/**
* 后端详情
*/
@RequestMapping("/info/{id}")
public R info(@PathVariable("id") Long id){
ZifeixinxiEntity zifeixinxi = zifeixinxiService.selectById(id);
return R.ok().put("data", zifeixinxi);
}
/**
* 前端详情
*/
@IgnoreAuth
@RequestMapping("/detail/{id}")
public R detail(@PathVariable("id") Long id){
ZifeixinxiEntity zifeixinxi = zifeixinxiService.selectById(id);
return R.ok().put("data", zifeixinxi);
}
/**
* 后端保存
*/
@RequestMapping("/save")
public R save(@RequestBody ZifeixinxiEntity zifeixinxi, HttpServletRequest request){
zifeixinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(zifeixinxi);
zifeixinxiService.insert(zifeixinxi);
return R.ok();
}
/**
* 前端保存
*/
@RequestMapping("/add")
public R add(@RequestBody ZifeixinxiEntity zifeixinxi, HttpServletRequest request){
zifeixinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
//ValidatorUtils.validateEntity(zifeixinxi);
zifeixinxiService.insert(zifeixinxi);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
public R update(@RequestBody ZifeixinxiEntity zifeixinxi, HttpServletRequest request){
//ValidatorUtils.validateEntity(zifeixinxi);
zifeixinxiService.updateById(zifeixinxi);//全部更新
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
public R delete(@RequestBody Long[] ids){
zifeixinxiService.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<ZifeixinxiEntity> wrapper = new EntityWrapper<ZifeixinxiEntity>();
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("yonghu")) {
wrapper.eq("zhanghao", (String)request.getSession().getAttribute("username"));
}
if(tableName.equals("zhangwuguanli")) {
wrapper.eq("guanlizhanghao", (String)request.getSession().getAttribute("username"));
}
int count = zifeixinxiService.selectCount(wrapper);
return R.ok().put("count", count);
}
}
```
4.系统演示地址:
链接:https://pan.baidu.com/s/1E8AGXMDLHkt_wrjDD_GP0w
提取码:5lr1
标签:map,zifeixinxiService,request,SSM,jsp,new,计费,zifeixinxi,public 来源: https://www.cnblogs.com/xiao123456789/p/16463488.html