package com.daowen.controller;
import java.text.MessageFormat;
import java.util.List;
import java.util.HashMap;
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.daowen.util.JsonResult;
import com.daowen.vo.LanmuVo;
import com.daowen.vo.XinxiVo;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import com.daowen.entity.*;
import com.daowen.service.*;
import com.daowen.ssm.simplecrud.SimpleController;
import com.daowen.webcontrol.PagerMetal;
import org.springframework.web.bind.annotation.ResponseBody;
/**************************
*
* 新闻控制
*
*/
@Controller
public class XinxiController extends SimpleController {
@Autowired
private XinxiService xinxiSrv = null;
@Autowired
private LanmuService lanmuSrv = null;
@Autowired
private AgreerecordService arSrv=null;
@Override
@RequestMapping("/admin/xinximanager.do")
public void mapping(HttpServletRequest request, HttpServletResponse response) {
mappingMethod(request, response);
}
@RequestMapping(value="/admin/xinxi/agree")
@ResponseBody
public JsonResult agree(HttpServletRequest request, HttpServletResponse response) {
String targetid = request.getParameter("targetid");
String commentator = request.getParameter("commentator");
if (targetid == null || commentator == null) {
return JsonResult.error(-1, "参数异常");
}
Boolean hasExist = arSrv.isExist(MessageFormat.format(
" where targetid={0} and typename=''xinxi'' and commentator=''{1}'' ", targetid, commentator));
if (hasExist) {
return JsonResult.error(-2, "你已经操作过");
}
Xinxi xinxi = xinxiSrv.load("where id=" + targetid);
if (xinxi == null) {
return JsonResult.error(-3, "数据异常");
}
Agreerecord ar = new Agreerecord();
ar.setCommentator(commentator);
ar.setTargetid(targetid);
ar.setTypename("xinxi");
arSrv.save(ar);
xinxi.setAgreecount(xinxi.getAgreecount() + 1);
xinxiSrv.update(xinxi);
JsonResult jsonResult =JsonResult.success(1,"你赞了他");
HashMap<String,Integer> data= new HashMap<String,Integer>();
data.put("agreecount", xinxi.getAgreecount());
jsonResult.setData(data);
return jsonResult;
}
@ResponseBody
@PostMapping("/admin/xinxi/pagelist")
public JsonResult pagelist(){
String lmid=request.getParameter("lmid");
String title = request.getParameter("title");
String pubren= request.getParameter("pubren");
String subtypeid= request.getParameter("subtypeid");
HashMap<String ,Object> map=new HashMap();
if (title != null)
map.put("title",title);
if(lmid!=null)
map.put("lmid",lmid);
if(subtypeid!=null)
map.put("subtypeid",subtypeid);
if(pubren!=null)
map.put("pubren",pubren);
map.put("order"," order by id desc ");
//
int pageindex = 1;
int pagesize = 10;
// 获取当前分页
String currentpageindex = request.getParameter("currentpageindex");
// 当前页面尺寸
String currentpagesize = request.getParameter("pagesize");
// 设置当前页
if (currentpageindex != null)
pageindex = new Integer(currentpageindex);
// 设置当前页尺寸
if (currentpagesize != null)
pagesize = new Integer(currentpagesize);
PageHelper.startPage(pageindex,pagesize);
List<XinxiVo> listXinxi = xinxiSrv.getEntityPlus(map);
request.setAttribute("listXinxi", listXinxi);
PageInfo<XinxiVo> pageInfo=new PageInfo<XinxiVo>(listXinxi);
return JsonResult.success(1,"获取会员信息",pageInfo);
}
@RequestMapping(value="/admin/xinxi/against")
@ResponseBody
public JsonResult against(HttpServletRequest request, HttpServletResponse response) {
String targetid = request.getParameter("targetid");
String commentator = request.getParameter("commentator");
if (targetid == null || commentator == null) {
return JsonResult.error(-1, "参数异常");
}
Boolean hasExist = arSrv.isExist(MessageFormat.format(
" where targetid={0} and typename=''xinxi'' and commentator=''{1}'' ", targetid, commentator));
if (hasExist) {
return JsonResult.error(-2, "你已经操作过");
}
Xinxi xinxi = xinxiSrv.load("where id=" + targetid);
if (xinxi == null) {
return JsonResult.error(-3, "数据异常");
}
Agreerecord ar = new Agreerecord();
ar.setCommentator(commentator);
ar.setTargetid(targetid);
ar.setTypename("xinxi");
arSrv.save(ar);
xinxi.setAgainstcount(xinxi.getAgainstcount()+1);
xinxiSrv.update(xinxi);
JsonResult<HashMap<String,Integer>> jsonResult = JsonResult.success(1, "你赞了它");
HashMap<String,Integer> data= new HashMap<String,Integer>();
data.put("againstcount", xinxi.getAgainstcount());
jsonResult.setData(data);
return jsonResult;
}
@ResponseBody
@PostMapping("/admin/xinxi/clickstat")
public JsonResult clickcounttongji(){
String sql=" select lm.name as name,sum(clickcount) as value from xinxi x,lanmu lm where lm.id=x.lmid group by lm.id ,lm.name ";
List<HashMap<String,Object>> listXinxi=xinxiSrv.queryToMap(sql);
return JsonResult.success(1,"",listXinxi);
}
@ResponseBody
@PostMapping("/admin/xinxi/count")
public JsonResult counttongji(){
String sql=" select lm.name as name,count(*) as value from xinxi x,lanmu lm where lm.id=x.lmid group by lm.id ,lm.name ";
List<HashMap<String,Object>> listXinxi=xinxiSrv.queryToMap(sql);
return JsonResult.success(1,"",listXinxi);
}
@ResponseBody
@PostMapping("/admin/xinxi/mylanmu")
public JsonResult list(){
List<LanmuVo> listLanmu=xinxiSrv.getMyLanmus();
return JsonResult.success(1,"获取栏目",listLanmu);
}
@ResponseBody
@PostMapping("/admin/xinxi/hot")
public JsonResult hotxinxi(){
HashMap<String,Object> map=new HashMap<>();
map.put("order","order by clickcount desc");
map.put("topcount",10);
List<XinxiVo> listXinxi=xinxiSrv.getEntityPlus(map);
return JsonResult.success(1,"获取信息",listXinxi);
}
@ResponseBody
@PostMapping("/admin/xinxi/info")
public JsonResult info(){
String id=request.getParameter("id");
if(id==null)
return JsonResult.error(-1,"参数异常");
XinxiVo xinxi=xinxiSrv.loadPlus(Integer.parseInt(id));
return JsonResult.success(1,"获取信息",xinxi);
}
public void shenpi() {
String id = request.getParameter("id");
String forwardurl = request.getParameter("forwardurl");
String status = request.getParameter("state");
String reply = request.getParameter("reply");
String shenpiren = request.getParameter("shenpiren");
int statuscode = 3;
// 验证错误url
String errorurl = request.getParameter("errorurl");
if (id == null)
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
随着计算机科学技术日渐成熟,人们已经深刻认识到计算机功能的强大,计算机已经进入到了人类社会发展的各个领域,并且发挥着十分重要的作用。在商品销售领域,相对于实体店销售额的不断下滑,网上商品销售的发展则非常的迅猛。与传统实体店相比,线上销售模式和实体销售理念上都有所不同,不仅克服了地域上的局限性,而且使得商品信息的传播变得更加方便,增强了用户在时间和空间上的体验,让会员用户能够随心随地随时的进行购物体验,而且会员用户对商品的开放式的评价也能够让会员用户对购买的产品更加有信。汽车销售系统就是这样一个在线汽车销售网站,该系统前端使用JQuery框架对DOM操作,后端代码使用Java语言编写的,高效快速。数据库管理系统使用开源软件MYSQL,节约成本。该网站页面简洁,能够让浏览网站的用户快速查询到自己想要获得的信息,并做出相应的处理。随着我国经济的快速发展,汽车越来越多的走进普通家庭的生活,从2011年到2020年这十年当中,汽车的保有量从开始的1493万辆到2.8亿辆,整体翻了大约20倍,如此巨大的增长可以说,汽车销售在这10年经历了非常风光的十年。然而,随着现在更多的家庭以及拥有了汽车,汽车
资源推荐
资源详情
资源评论
收起资源包目录
一个大汽车的销售管理系统 (2580个子文件)
XinxiController.class 13KB
HuiyuanController.class 13KB
PagesettingController.class 10KB
XinxiService.class 9KB
UsersController.class 9KB
CarController.class 8KB
BookcarController.class 8KB
CommentBuilder.class 7KB
LanmuController.class 7KB
LeavewordController.class 6KB
SysroleController.class 6KB
StagController.class 6KB
SysconfigitemController.class 6KB
UploadController.class 6KB
NoticeController.class 6KB
SysconfigController.class 6KB
ShoucangController.class 6KB
SubtypeController.class 6KB
JiaodiantuController.class 5KB
CarbrandController.class 5KB
SitenavController.class 5KB
FriendlinkController.class 5KB
SimpleStatistics.class 5KB
CommentController.class 5KB
LeavewordBuilder.class 4KB
FocusgraphicBuilder.class 4KB
Huiyuan.class 4KB
SingleFileUpload.class 4KB
HttpUtil.class 4KB
LanmuService.class 4KB
MailUtil.class 4KB
Shopcart.class 4KB
Xinxi.class 4KB
Users.class 3KB
AdminUserController.class 3KB
FileUtil.class 3KB
SitenavBuilder.class 3KB
Car.class 3KB
FileUploadBase.class 3KB
SitesearchController.class 3KB
Bookcar.class 3KB
ViewHistory.class 2KB
Comment.class 2KB
BeansUtil.class 2KB
LanmuContentVo.class 2KB
PagesettingService.class 2KB
SequenceUtil.class 2KB
JsonResult.class 2KB
Shoucang.class 2KB
Leaveword.class 2KB
SysroleService.class 2KB
CustomJsonDateConverter$2.class 2KB
MainApplication.class 2KB
NoticeBuilder.class 2KB
Notice.class 2KB
ShopcartItem.class 2KB
CustomJsonDateConverter$1.class 2KB
Jiaodiantu.class 2KB
HTMLUtil.class 2KB
XinxiVo.class 2KB
FriendlinkBuilder.class 2KB
ImageTextItem.class 2KB
HuiyuanService.class 2KB
StringUtil.class 2KB
Sitenav.class 2KB
Sysconfigitem.class 2KB
MainApplication$1.class 2KB
CustomJsonDateConverter.class 1KB
LeavewordService.class 1KB
StagService.class 1KB
Agreerecord.class 1KB
LeavewordVo.class 1KB
Lanmu.class 1KB
SearchVo.class 1KB
UploadController$UploadExpress.class 1KB
PageContentVo.class 1KB
LanmuVo.class 1KB
PageSettingVo.class 1KB
MimeMessageDescription.class 1KB
Friendlink.class 1KB
PsItemVo.class 1KB
Psitem.class 1KB
UsersService.class 1KB
DbConfig.class 1KB
Pagesetting.class 987B
Sysconfig.class 981B
Subtype.class 971B
PaperModule.class 926B
Sysrole.class 882B
Carbrand.class 769B
NameUtil.class 765B
Stag.class 757B
CarbrandService.class 653B
BookcarService.class 647B
SubtypeService.class 647B
JiaodiantuService.class 631B
CarService.class 623B
LeavewordMapper.class 619B
SysroleMapper.class 613B
StagMapper.class 598B
共 2580 条
- 1
- 2
- 3
- 4
- 5
- 6
- 26
资源评论
一叶再见知秋
- 粉丝: 3
- 资源: 172
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 2011-2024年各省数字普惠金融指数数据.zip
- 数据结构排序算法:插入排序、希尔排序、冒泡排序及快速排序算法
- Nosql期末复习资料
- Python新年庆典倒计时与节日活动智能管理助手
- 塑料、玻璃、金属、纸张、木材检测36-YOLO(v5至v11)、COCO、CreateML、Paligemma、TFRecord、VOC数据集合集.rar
- 系统DLL文件修复工具
- 数据结构之哈希查找方法
- Python圣诞节倒计时与节日活动管理系统
- 塑料检测23-YOLO(v5至v11)、COCO、CreateML、Paligemma、TFRecord、VOC数据集合集.rar
- PPT模板WHUT-博学之光-PPT模板
- C#上位机开发与工控通讯实战课程
- HCIA-Datacom教师笔记-数据通信基础知识及网络模型详解
- MobileNet V2 网络实现的计算机视觉大项目:8种常见茶叶病害种类识别
- 文件格式是一种撒很快的哈的东西
- Python之正则表达式基础知识
- JLINK-OB下载器的原理图和HEX文件
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功