Skip to content

Commit 89c4fc6

Browse files
author
xiaowei
committed
loginfilter passwordmd5
1 parent cf9e761 commit 89c4fc6

File tree

15 files changed

+89
-83
lines changed

15 files changed

+89
-83
lines changed

src/main/java/com/changyu/foryou/controller/CampusController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ public void setCampusService(CampusService campusService) {
311311
paramMap.put("campusId", campusService.getIdByName(tempMap));
312312
paramMap.put("campusName", campusName);
313313
paramMap.put("campusAdmin", campusAdminName);
314-
paramMap.put("password", password);
314+
paramMap.put("password", Md5.GetMD5Code(password));
315315
paramMap.put("type", 0); //只能添加校区管理员,总校区管理员只能从数据库添加,更符合逻辑
316316

317317
Integer result = campusService.addCampusAdmin(paramMap);
@@ -396,7 +396,7 @@ public Map<String, Object> updateCampus(@RequestParam String campusId,@RequestPa
396396
String password=campusService.getOldPassword(paramMap);
397397

398398
if(password.equals(Md5.GetMD5Code(oldPassword))){
399-
paramMap.put("newPassword",newPassword);
399+
paramMap.put("newPassword",Md5.GetMD5Code(newPassword));
400400

401401
int flag=campusService.updateCampusAdminPassword(paramMap);
402402
if(flag!=-1){

src/main/java/com/changyu/foryou/controller/OrderController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,11 +1456,11 @@ public String getIpAddr(HttpServletRequest request){
14561456
resultMap.put(Constants.STATUS,Constants.SUCCESS);
14571457
resultMap.put(Constants.MESSAGE,"操作成功");
14581458
}else{
1459-
resultMap.put(Constants.STATUS,Constants.SUCCESS);
1459+
resultMap.put(Constants.STATUS,Constants.FAILURE);
14601460
resultMap.put(Constants.MESSAGE,"操作失败");
14611461
}
14621462
}else{
1463-
resultMap.put(Constants.STATUS,Constants.SUCCESS);
1463+
resultMap.put(Constants.STATUS,Constants.FAILURE);
14641464
resultMap.put(Constants.MESSAGE,"操作失败");
14651465
}
14661466
}

src/main/java/com/changyu/foryou/controller/SellerController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ public void setSellerService(SellerService sellerService) {
5151
&& !password.trim().equals("")) {
5252
Sellers sellers = sellerService.selectByCampusAdmin(campusAdmin);
5353
if (sellers != null) {
54-
//if (sellers.getPassword().equals(Md5.GetMD5Code(password))) {
55-
if (sellers.getPassword().equals(password)) {
54+
if (sellers.getPassword().equals(Md5.GetMD5Code(password))) {
55+
//if (sellers.getPassword().equals(password)) {
5656
map.put(Constants.STATUS, Constants.SUCCESS);
5757
map.put(Constants.MESSAGE, "登陆成功");
5858
map.put("type", sellers.getType());
@@ -77,7 +77,7 @@ public void setSellerService(SellerService sellerService) {
7777

7878
/**
7979
* 根据商家id查找商家数据
80-
80+
*
8181
* */
8282

8383
@RequestMapping("/getSellerById")

src/main/java/com/changyu/foryou/controller/UserController.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ Map<String, Object> getAllUser(Integer limit,Integer offset,String sort,String o
124124
search="%"+search+"%";
125125
}
126126

127-
JSONArray json=JSONArray.parseArray(JSON.toJSONStringWithDateFormat(userService.getAllUser(limit,offset,sort,order,search), "yyyy-MM-dd"));
127+
List<Users> userlist=userService.getAllUser(limit,offset,sort,order,search);
128+
JSONArray json=JSONArray.parseArray(JSON.toJSONStringWithDateFormat(userlist,"yyyy-MM-dd"));
128129
map.put("total", userService.getUserCount(search));
129130
map.put("rows", json);
130131
return map;

src/main/java/com/changyu/foryou/filter/IsLoginFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha
5555
return;
5656
}
5757

58-
String user = ( String ) hrequest.getSession().getAttribute("phone");
58+
String user = ( String ) hrequest.getSession().getAttribute("campusAdmin");
5959
if (user == null) {
6060
wrapper.sendRedirect(redirectPath);
6161
return;

src/main/java/com/changyu/foryou/mapping/OrderMapper.xml

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103
<result column="reserve_time" property="reserveTime" jdbcType="VARCHAR" />
104104
<result column="message" property="message" jdbcType="VARCHAR" />
105105
<result column="total_price" property="price" jdbcType="REAL" />
106+
<result column="charge_id" property="chargeId" jdbcType="REAL" />
106107
</resultMap>
107108

108109
<!-- web管理单显示订单 -->
@@ -882,7 +883,7 @@
882883
set total_price=#{totalPrice}
883884
where order_id=#{orderId}
884885
</update>
885-
886+
886887
<!-- 根据togetherId获取该笔大订单总价 -->
887888
<select id="selectTotalPriceByTogetherId" resultType="FLOAT">
888889
select
@@ -930,11 +931,11 @@
930931
where
931932
together_id=#{togetherId,jdbcType=VARCHAR}
932933
</update>
933-
934+
934935
<!--获取客户端订单 -->
935936
<select id="getPCOrdersNew" resultMap="SuperAdminOrderMap">
936937
select
937-
together_id,custome_phone as phone,together_date,total_price as price,address
938+
together_id,custome_phone as phone,together_date,total_price as price,address,charge_id
938939
from together_order
939940
where tag=1 and status=#{status}
940941
<if test="campusId != null">
@@ -1013,33 +1014,33 @@
10131014
</if>
10141015
10151016
1016-
</select> -->
1017-
1018-
<!-- 获取指定时间段和指定校区的订单总数 -->
1019-
<select id="getSalesInfoByCampusId" resultType="Integer">
1020-
select COUNT(DISTINCT together_id) from orders
1021-
where campus_id=#{campusId}
1022-
and together_date BETWEEN #{dateStart,jdbcType=TIMESTAMP}
1023-
and #{dateEnd,jdbcType=TIMESTAMP}
1024-
and tag=1
1025-
</select>
1026-
1027-
<!-- 获取指定时间段和指定校区的订单交易额 -->
1028-
<select id="getTradeVolumeByCampusId" resultType="Float">
1029-
SELECT sum(total_price)
1030-
from together_order
1031-
<where>
1032-
campus_id=#{campusId,jdbcType=INTEGER}
1033-
<if test="dateStart!=null and dateEnd!=null">
1034-
and together_date BETWEEN #{dateStart,jdbcType=TIMESTAMP}
1035-
AND #{dateEnd,jdbcType=TIMESTAMP}
1036-
</if>
1037-
<if test="dateToday!=null">
1038-
and together_date>=#{dateToday,jdbcType=TIMESTAMP}
1039-
</if>
1040-
<if test="payWay!=null">
1041-
AND pay_way=#{payWay,jdbcType=SMALLINT}
1042-
</if>
1043-
</where>
1044-
</select>
1017+
</select> -->
1018+
1019+
<!-- 获取指定时间段和指定校区的订单总数 -->
1020+
<select id="getSalesInfoByCampusId" resultType="Integer">
1021+
select COUNT(DISTINCT together_id) from orders
1022+
where campus_id=#{campusId}
1023+
and together_date BETWEEN #{dateStart,jdbcType=TIMESTAMP}
1024+
and #{dateEnd,jdbcType=TIMESTAMP}
1025+
and tag=1
1026+
</select>
1027+
1028+
<!-- 获取指定时间段和指定校区的订单交易额 -->
1029+
<select id="getTradeVolumeByCampusId" resultType="Float">
1030+
SELECT sum(total_price)
1031+
from together_order
1032+
<where>
1033+
campus_id=#{campusId,jdbcType=INTEGER}
1034+
<if test="dateStart!=null and dateEnd!=null">
1035+
and together_date BETWEEN #{dateStart,jdbcType=TIMESTAMP}
1036+
AND #{dateEnd,jdbcType=TIMESTAMP}
1037+
</if>
1038+
<if test="dateToday!=null">
1039+
and together_date>=#{dateToday,jdbcType=TIMESTAMP}
1040+
</if>
1041+
<if test="payWay!=null">
1042+
AND pay_way=#{payWay,jdbcType=SMALLINT}
1043+
</if>
1044+
</where>
1045+
</select>
10451046
</mapper>

src/main/java/com/changyu/foryou/mapping/UsersMapper.xml

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -187,27 +187,27 @@
187187
users.phone, type, nickname, img_url,
188188
last_login_date,create_time,address as default_address,token
189189
from users
190-
<if test="search == null or search =='' ">
191-
left
192-
</if>
193-
join receiver
190+
left join receiver
194191
on
195192
users.phone = receiver.phone_id and receiver.tag=0
196-
<if test="search != null and search !='' ">
197-
and (nickname like #{search,jdbcType=VARCHAR} or users.phone like
198-
#{search,jdbcType=VARCHAR})
199-
</if>
200-
201-
<if test="sort != null">
202-
order by ${sort}
203-
</if>
204-
<if test="sort != null and order != null">
205-
${order}
206-
</if>
207-
<if test="offset != null and limit != null">
208-
limit #{offset,jdbcType=INTEGER} ,
209-
#{limit,jdbcType=INTEGER}
210-
</if>
193+
<where>
194+
1=1
195+
<if test="search != null and search !='' ">
196+
and (nickname like #{search,jdbcType=VARCHAR} or users.phone like
197+
#{search,jdbcType=VARCHAR})
198+
</if>
199+
<if test="sort != null">
200+
order by ${sort}
201+
</if>
202+
<if test="sort != null and order != null">
203+
${order}
204+
</if>
205+
<if test="offset != null and limit != null">
206+
limit #{offset,jdbcType=INTEGER} ,
207+
#{limit,jdbcType=INTEGER}
208+
</if>
209+
</where>
210+
211211
</select>
212212

213213
<select id="getUserCount" resultType="Integer">

src/main/java/com/changyu/foryou/model/SuperAdminOrder.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ public class SuperAdminOrder {
1212
private Float price;
1313
private String reserveTime;
1414
private String message;
15+
private String chargeId;
1516

1617
public Date getTogetherDate() {
1718
return togetherDate;
@@ -68,5 +69,11 @@ public String getMessage() {
6869
public void setMessage(String message) {
6970
this.message = message;
7071
}
72+
public String getChargeId() {
73+
return chargeId;
74+
}
75+
public void setChargeId(String chargeId) {
76+
this.chargeId = chargeId;
77+
}
7178

7279
}

src/main/java/com/changyu/foryou/payment/ChargeInterface.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
import java.util.HashMap;
44
import java.util.Map;
55

6-
import org.apache.ibatis.annotations.ResultMap;
7-
86
import com.alibaba.fastjson.JSON;
97
import com.changyu.foryou.tools.Constants;
108
import com.pingplusplus.Pingpp;
@@ -16,7 +14,6 @@
1614
import com.pingplusplus.exception.PingppException;
1715
import com.pingplusplus.model.Charge;
1816
import com.pingplusplus.model.Refund;
19-
import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIConversion.Static;
2017

2118
public class ChargeInterface {
2219
/**

src/main/java/com/changyu/foryou/tools/CalendarTool.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.changyu.foryou.tools;
22

3-
import java.text.SimpleDateFormat;
43
import java.util.Calendar;
54
import java.util.Date;
65

0 commit comments

Comments
 (0)