From 389d0c6d923532e3af63582e37946a5cda1fa90b Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期四, 06 十二月 2018 14:13:15 +0800
Subject: [PATCH] 浏览记录调整 邀请更改
---
fanli/src/main/java/com/yeshi/fanli/controller/client/LostOrderController.java | 55 +++++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 41 insertions(+), 14 deletions(-)
diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/client/LostOrderController.java b/fanli/src/main/java/com/yeshi/fanli/controller/client/LostOrderController.java
index 907bac5..1804bb9 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/client/LostOrderController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/client/LostOrderController.java
@@ -14,6 +14,7 @@
import com.google.gson.Gson;
import com.yeshi.fanli.entity.accept.AcceptData;
import com.yeshi.fanli.entity.bus.user.LostOrder;
+import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.order.LostOrderService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.TimeUtil;
@@ -35,6 +36,9 @@
@Resource
private LostOrderService lostOrderService;
+ @Resource
+ private ConfigService configService;
+
/**
* 鑾峰彇鍔ㄦ�佹帹鑽�
*
@@ -44,9 +48,14 @@
* @param out
*/
@RequestMapping(value = "getLostOrderList", method = RequestMethod.POST)
- public void getLostOrderList(AcceptData acceptData, Long uid, int page, PrintWriter out) {
+ public void getLostOrderList(AcceptData acceptData, Long uid, Integer page, PrintWriter out) {
if (uid == null || uid <= 0) {
out.print(JsonUtil.loadFalseResult(1, "鐢ㄦ埛鏈櫥褰�"));
+ return;
+ }
+
+ if (page == null || page <= 0) {
+ out.print(JsonUtil.loadFalseResult(1, "page鏍煎紡閿欒"));
return;
}
@@ -69,13 +78,14 @@
json.remove("remake");
json.remove("judge");
- json.put("createTime", TimeUtil.getGernalTime(order.getCreateTime(), "yyyy-MM-dd HH:mm"));
- if (order.getState() == 1 && order.getResultCode() == LostOrder.RESULT_CODE_SUCCESS) {
+ json.put("createTime", TimeUtil.getGernalTime(order.getCreateTime(), "yyyy.MM.dd HH:mm"));
+ if (order.getState() == 1 && order.getResultCode() != null
+ && order.getResultCode() == LostOrder.RESULT_CODE_SUCCESS) {
// 鐢宠瘔鎴愬姛
json.put("state", 1);
json.put("stateDesc", "鐢宠瘔鎴愬姛锛岃鍦ㄨ鍗曞垪琛ㄤ腑鏌ョ湅");
- } else if (order.getState() == 2
- || (order.getState() == 1 && order.getResultCode() == LostOrder.RESULT_CODE_FAIL)) {
+ } else if (order.getState() == 2 || (order.getState() == 1 && order.getResultCode() != null
+ && order.getResultCode() == LostOrder.RESULT_CODE_FAIL)) {
// 鐢宠瘔澶辫触
json.put("state", 2);
json.put("stateDesc", "鐢宠瘔澶辫触");
@@ -94,13 +104,19 @@
}
@RequestMapping(value = "deleteLostOrder", method = RequestMethod.POST)
- public void deleteLostOrder(AcceptData acceptData, Long uid, long id, PrintWriter out) {
+ public void deleteLostOrder(AcceptData acceptData, Long uid, Long id, PrintWriter out) {
+
+ if (id == null || id <= 0) {
+ out.print(JsonUtil.loadFalseResult(1, "璇烽�夋嫨鍒犻櫎椤�"));
+ return;
+ }
+
if (uid == null || uid <= 0) {
out.print(JsonUtil.loadFalseResult(1, "鐢ㄦ埛鏈櫥褰�"));
return;
}
LostOrder lostOrder = lostOrderService.getOne(id);
- if (lostOrder != null && lostOrder.getUserInfo().getId() == uid) {
+ if (lostOrder != null && lostOrder.getUserInfo().getId() == uid.longValue()) {
lostOrderService.deleteLostOrder(id);
out.print(JsonUtil.loadTrueResult(""));
} else {
@@ -131,25 +147,28 @@
if (lostOrder.getUserInfo() == null || lostOrder.getUserInfo().getId() == null
|| lostOrder.getUserInfo().getId() <= 0) {
- out.print(JsonUtil.loadFalseResult(1, "鐢ㄦ埛灏氭湭鐧诲綍"));
+ out.print(JsonUtil.loadFalseResult(1, "璇风櫥褰曡繑鍒╁埜璐﹀彿"));
return;
}
int state;
- String stateInfo = "鎻愪氦鎴愬姛锛岃绛夊緟瀹℃牳缁撴灉銆�";
+ String stateInfo = "鎻愪氦鎴愬姛锛岃绛夊緟瀹℃牳缁撴灉";
if (!orderNum) {
state = -4;
- stateInfo = "璇锋彁浜ゆ爣鍑嗙殑璁㈠崟鍙�";
+ stateInfo = "璇锋彁浜ゅ噯纭殑璁㈠崟鍙�";
} else {
+ lostOrder.setResultCode(LostOrder.RESULT_CODE_VERFING);
state = lostOrderService.addLostOrder(lostOrder);
if (state == -3) {
- stateInfo = "璇ヨ鍗曞凡鏄繑鍒╄鍗曘��";
+ stateInfo = "璇ヨ鍗曞凡琚粺璁★紝鏃犻渶鐢宠瘔";
} else if (state == -2) {
- stateInfo = "璇峰嬁閲嶅鎻愪氦,璇ヨ鍗曞凡鍦ㄥ鏍镐腑銆�";
+ stateInfo = "璇峰嬁閲嶅鎻愪氦,璇ヨ鍗曟鍦ㄥ鏍镐腑";
} else if (state == -1) {
- stateInfo = "璇ヨ鍗曠敵璇夊凡閫氳繃锛岃绋嶅悗鏌ョ湅銆�";
+ stateInfo = "璇ヨ鍗曠敵璇夊凡閫氳繃锛岃鍦ㄨ鍗曞垪琛ㄤ腑鏌ョ湅";
} else if (state == -5) {
- stateInfo = "璇ヨ鍗曚负鍒嗕韩濂栭噾璁㈠崟";
+ stateInfo = "鍒嗕韩濂栭噾璁㈠崟鏃犻渶鐢宠瘔";
+ } else if (state == -6) {
+ stateInfo = "璇ヨ鍗曠敵璇夊凡澶辫触锛岃鍦ㄨ鍗曞垪琛ㄤ腑鏌ョ湅";
}
}
JSONObject data = new JSONObject();
@@ -158,4 +177,12 @@
out.print(JsonUtil.loadTrueResult(data));
}
+ @RequestMapping("getConfig")
+ public void getConfig(AcceptData acceptData, PrintWriter out) {
+ JSONObject data = new JSONObject();
+ data.put("what", configService.get("lost_order_help_what"));
+ data.put("reason", configService.get("lost_order_help_reason"));
+ out.print(JsonUtil.loadTrueResult(data));
+ }
+
}
--
Gitblit v1.8.0