package com.ideabobo.action;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import javax.swing.*;
import org.springframework.stereotype.Controller;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.ideabobo.model.Bill;
import com.ideabobo.model.Good;
import com.ideabobo.model.Message;
import com.ideabobo.model.Posts;
import com.ideabobo.model.Replay;
import com.ideabobo.model.User;
import com.ideabobo.model.Yzmessage;
import com.ideabobo.service.BaseService;
import com.ideabobo.service.BillService;
import com.ideabobo.service.GoodService;
import com.ideabobo.service.PostsService;
import com.ideabobo.service.ReplayService;
import com.ideabobo.service.TypeService;
import com.ideabobo.service.UserService;
import com.ideabobo.util.GetNowTime;
import com.ideabobo.util.IdeaAction;
@Controller
public class WehallAction extends IdeaAction {
@Resource
private BaseService baseService;
@Resource
private BillService billService;
@Resource
private GoodService goodService;
@Resource
private TypeService typeService;
@Resource
private UserService userService;
@Resource
private PostsService postsService;
@Resource
private ReplayService replayService;
public Gson gson = new Gson();
private static final long serialVersionUID = -3218238026025256103L;
public String wehall(){
// String openid = request.getParameter("openid");
// session.put("openid", openid);
return SUCCESS;
}
public void login(){
String username = request.getParameter("username");
String passwd = request.getParameter("passwd");
User user = new User();
user.setPasswd(passwd);
user.setUsername(encodeGet(username));
User r = userService.find(user);
if(r!=null){
renderJsonpObj(r);
}else{
renderJsonpString("fail");
}
}
public void checkUser(){
User u = new User();
String username = request.getParameter("username");
u.setUsername(username);
User r = userService.find(u);
if(r!=null){
renderJsonpString("fail");
}else{
renderJsonpString("success");
}
}
public void updateUser(){
String tel = request.getParameter("tel");
String qq = request.getParameter("qq");
String wechat = request.getParameter("wechat");
String email = request.getParameter("email");
String birth = request.getParameter("birth");
String sex = request.getParameter("sex");
String id = request.getParameter("id");
String address = request.getParameter("address");
User user = userService.find(id);
user.setId(Integer.parseInt(id));
user.setTel(tel);
user.setWechat(wechat);
user.setQq(qq);
user.setEmail(email);
user.setBirth(birth);
user.setSex(encodeGet(sex));
user.setAddress(encodeGet(address));
userService.update(user);
renderJsonpString("success");
}
public void changePasswd(){
String passwd = request.getParameter("passwd");
String id = request.getParameter("id");
User user = userService.find(id);
user.setPasswd(passwd);
userService.update(user);
renderJsonpString("success");
}
public void register(){
User user = (User) getByRequest(new User(), true);
String roletype = "2";
user.setRoletype(roletype);
userService.save(user);
renderJsonpString("success");
}
public void listGood(){
String type = request.getParameter("stype");
String sid = request.getParameter("sid");
String uid = request.getParameter("uid");
String statecn = request.getParameter("statecn");
String sex = request.getParameter("sex");
String level = request.getParameter("level");
String hql = "from Good t where 1=1";
if (type != null&& !"".equals(type)) {
hql+=" and t.typeid='"+type+"'";
}
if(sid != null&& !"".equals(sid)){
hql+=" and t.sid='"+sid+"'";
}
if(uid != null&& !"".equals(uid)){
hql+=" and t.uid='"+uid+"'";
}
if(sex != null&& !"".equals(sex)){
sex = encodeGet(sex);
hql+=" and t.sex='"+sex+"'";
}
if(level != null&& !"".equals(level)){
hql+=" and t.level='"+level+"'";
}
if(statecn != null&& !"".equals(statecn)){
statecn = encodeGet(statecn);
hql+=" and t.statecn='"+statecn+"'";
}
renderJsonpObj(baseService.list(hql));
}
public void listType(){
renderJsonpObj(typeService.list());
}
public void saveBill(){
Bill bill = (Bill) getByRequest(new Bill(), true);
bill.setNdate(GetNowTime.getNowTimeNian());
billService.save(bill);
renderJsonpString("提交成功!");
}
public void updateGoodStatecn(){
String id = request.getParameter("id");
Good g = (Good) baseService.find(Integer.parseInt(id), Good.class);
String statecn = request.getParameter("statecn");
statecn = encodeGet(statecn);
g.setStatecn(statecn);
baseService.update(g);
renderJsonpString("0");
}
public void saveBills(){
String bills = request.getParameter("bills");
bills = encodeGet(bills);
JsonParser parser = new JsonParser();
JsonArray blist = parser.parse(bills).getAsJsonArray();
for(int i=0;i<blist.size();i++){
JsonElement jo = blist.get(i);
JsonObject obj = (JsonObject) parser.parse(jo.toString());
Bill bill = new Bill();
bill.setTotal(obj.get("total").getAsString());
bill.setSid(obj.get("sid").getAsString());
bill.setShop(obj.get("shop").getAsString());
bill.setUid(obj.get("uid").getAsString());
bill.setUser(obj.get("user").getAsString());
bill.setNdate(GetNowTime.getNowTimeNian());
bill.setGids(obj.get("gids").getAsString());
bill.setGnames(obj.get("gnames").getAsString());
bill.setAddress(obj.get("address").getAsString());
bill.setTel(obj.get("tel").getAsString());
bill.setNote(obj.get("note").getAsString());
bill.setWay(obj.get("way").getAsString());
bill.setStatecn("进行中");
billService.save(bill);
}
renderJsonpString("提交成功!");
}
public void listBillGoods(){
String gids = request.getParameter("gids");
String hql = "from Good u where u.id in ("+gids+")";
renderJsonpObj(baseService.list(hql));
}
public void mybills(){
String hql = "from Bill t where 1=1";
String uid = request.getParameter("uid");
String sid = request.getParameter("sid");
if(uid!=null && !uid.equals("")){
hql+=" and t.uid='"+uid+"'";
}
if(sid!=null && !sid.equals("")){
hql+=" and t.sid='"+sid+"'";
}
renderJsonpObj(baseService.list(hql));
}
public void myshopbills(){
String sid = request.getParameter("sid");
Bill b = new Bill();
b.setSid(sid);
renderJsonpObj(billService.list(b));
}
public Bill updateXiaoliang(Bill bill){
String billstr = bill.getBill();
JsonParser parser = new JsonParser();
JsonArray ja = parser.parse(billstr).getAsJsonArray();
String gnames = "";
for(int
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
功能说明: 该平台的主要使用者分为管理员和用户,用户端主要包括任务发布和任务接受两大模块,管理员端主要是对用户和发布的任务进行管理。 环境说明: 开发语言:Java JDK版本:JDK1.8 数据库:mysql 5.7及以上 数据库工具:Navicat11及以上 开发软件:eclipse/idea 安卓框架:uniapp 安卓开发软件:HBuilder X 开发模式:混合开发
资源推荐
资源详情
资源评论
收起资源包目录
【安卓毕业设计】基于移动端的校园代跑腿系统的设计与实现源码(完整前后端+mysql+说明文档+LW).zip (2000个子文件)
resources.ap_ 3.29MB
SecondShopFuwuChat1002Client.apk 3.88MB
gradlew.bat 2KB
jarlist.cache 120B
WehallAction.class 19KB
IdeaAction.class 18KB
MyObj.class 13KB
FileTool.class 11KB
BaseServiceImp.class 11KB
StringUtil.class 9KB
GoodAction.class 8KB
Plugs.class 7KB
NoticeAction.class 6KB
BillServiceImp.class 5KB
GoodServiceImp.class 5KB
NoticeServiceImp.class 5KB
ReplayServiceImp.class 5KB
PostsServiceImp.class 5KB
UserServiceImp.class 5KB
Good.class 5KB
TypeServiceImp.class 5KB
UserAction.class 4KB
User.class 4KB
Bill.class 4KB
GetNowTime.class 4KB
BillAction.class 4KB
ReplayAction.class 3KB
PostsAction.class 3KB
CopyFile.class 3KB
Message.class 3KB
BaiduLocation.class 3KB
IndexAction.class 2KB
BaiduLocation$MyLocationListener.class 2KB
Command.class 2KB
Pingfen.class 2KB
Posts.class 2KB
Yzmessage.class 2KB
DownloadAction.class 2KB
MainActivity.class 2KB
Replay.class 2KB
Tousu.class 2KB
Notice.class 2KB
Page.class 1KB
Type.class 1KB
MyObj$1.class 1017B
SessionStorage.class 950B
BaseService.class 870B
NoticeService.class 703B
ReplayService.class 703B
BillService.class 683B
GoodService.class 683B
Page2.class 574B
PostsService.class 555B
TypeService.class 548B
UserService.class 548B
UploadAction.class 521B
R.class 471B
R$string.class 466B
R$drawable.class 394B
R$xml.class 381B
BuildConfig.class 341B
R$attr.class 334B
.classpath 1KB
.classpath 475B
org.eclipse.wst.common.component 490B
org.eclipse.wst.jsdt.ui.superType.container 49B
nativedroid2.css 271KB
nativedroid2.css 271KB
nativedroid2.css 271KB
jquery.mobile-1.4.5.css 234KB
jquery.mobile-1.4.5.css 234KB
jquery.mobile-1.4.5.css 234KB
jquery.mobile.inline-svg-1.4.5.css 222KB
jquery.mobile.inline-svg-1.4.5.css 222KB
jquery.mobile.inline-svg-1.4.5.css 222KB
jquery.mobile.min.css 216KB
jquery.mobile.min.css 203KB
jquery.mobile.min.css 203KB
jquery.mobile.min.css 203KB
jquery.mobile-1.4.5.min.css 203KB
jquery.mobile-1.4.5.min.css 203KB
jquery.mobile-1.4.5.min.css 203KB
jquery.mobile-1.4.5.min.css 203KB
jquery.mobile-1.4.5.min.css 203KB
jquery.mobile-1.4.5.min.css 203KB
jquery.mobile-1.4.3.min.css 202KB
jquery.mobile-1.4.3.min.css 202KB
jquery.mobile-1.4.3.min.css 202KB
jquery.mobile.inline-svg-1.4.5.min.css 191KB
jquery.mobile.inline-svg-1.4.5.min.css 191KB
jquery.mobile.inline-svg-1.4.5.min.css 191KB
jquery.mobile.flatui.css 163KB
jquery.mobile.flatui.css 163KB
jquery.mobile.flatui.css 163KB
jquery.mobile.flatui.css 163KB
jquery.mobile.inline-png-1.4.5.css 146KB
jquery.mobile.inline-png-1.4.5.css 146KB
jquery.mobile.inline-png-1.4.5.css 146KB
bootstrap.css 143KB
jquery.mobile.icons-1.4.5.css 126KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
风月歌
- 粉丝: 1647
- 资源: 4119
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功