119d9f5a6afa0d25c65778e8978fb349d97c2307.svn-base
3.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/**
* Copyright © 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
*/
package com.thinkgem.jeesite.modules.wechat.service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.google.common.collect.Maps;
import com.thinkgem.jeesite.common.persistence.Page;
import com.thinkgem.jeesite.common.service.CrudService;
import com.thinkgem.jeesite.modules.wechat.entity.WxOrder;
import com.thinkgem.jeesite.modules.wechat.dao.WxOrderDao;
/**
* 微信预约Service
* @author lzj
* @version 2020-03-06
*/
@Service
@Transactional(readOnly = true)
public class WxOrderService extends CrudService<WxOrderDao, WxOrder> {
public WxOrder get(String id) {
return super.get(id);
}
public List<WxOrder> findList(WxOrder wxOrder) {
return super.findList(wxOrder);
}
public Page<WxOrder> findPage(Page<WxOrder> page, WxOrder wxOrder) {
return super.findPage(page, wxOrder);
}
@Transactional(readOnly = false)
public void save(WxOrder wxOrder) {
super.save(wxOrder);
}
@Transactional(readOnly = false)
public void delete(WxOrder wxOrder) {
super.delete(wxOrder);
}
@Transactional(readOnly = false)
public Map rece_order(HttpServletRequest request) {
Map map = new HashMap();
String yyid = request.getParameter("yyid");
String userid = request.getParameter("userid");
String yydate = request.getParameter("yydate");
String ywdl = request.getParameter("yylx");
String ywxl = request.getParameter("yyxl");
String yysjd = request.getParameter("yysjd");
String yyrmc = request.getParameter("yyrmc");
String yyrcode = request.getParameter("yyrcode");
String yydh = request.getParameter("yydh");
WxOrder eorder = getYyid(yyid);//预约id查询是否存在,存在的话不再保存
if(eorder == null) {
WxOrder order = new WxOrder();
order.setUserid(userid);
order.setYyid(yyid);
order.setYydate(yydate);
order.setYwdl(ywdl);
order.setYwxl(ywxl);
order.setYysjd(yysjd);
order.setYyrmc(yyrmc);
order.setYyrcode(yyrcode);
order.setSign("0");
order.setYydh(yydh);
super.save(order);
map.put("resultMsg", "预约信息成功保存");
}else {
map.put("resultMsg", "已存在预约信息");
}
return map;
}
private WxOrder getYyid(String yyid) {
// TODO Auto-generated method stub
return dao.getYyid(yyid);
}
@Transactional(readOnly=false)
public Map unbindUser(HttpServletRequest request) {
Map map = Maps.newHashMap();
String userid = request.getParameter("userid");
WxOrder order = new WxOrder();
order.setUserid(userid);
dao.deleteWx(order);
return map;
}
@Transactional(readOnly=false)
public Map can_order(HttpServletRequest request) {
Map map = Maps.newHashMap();
String yyid = request.getParameter("yyid");
WxOrder order = dao.getYyid(yyid);
order.setSign("4");//取消
save(order);
return map;
}
public Map update_order() {
Map map = Maps.newHashMap();
dao.updateYyinfo();
return map;
}
}