|
|
@@ -1,26 +1,26 @@
|
|
|
-/* */
|
|
|
package com.suyuan.web;
|
|
|
-/* */
|
|
|
-/* */
|
|
|
+
|
|
|
|
|
|
import com.suyuan.dto.Page;
|
|
|
-/* */ import com.suyuan.dto.Result;
|
|
|
-/* */ import com.suyuan.model.RentInfo;
|
|
|
-/* */ import com.suyuan.model.UserInfo;
|
|
|
-/* */ import com.suyuan.service.RentInfoService;
|
|
|
-/* */ import com.suyuan.util.EncodingTool;
|
|
|
-/* */ import java.util.HashMap;
|
|
|
-/* */ import java.util.List;
|
|
|
-/* */ import java.util.Map;
|
|
|
-/* */ import javax.servlet.http.HttpServletRequest;
|
|
|
-/* */ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-/* */ import org.springframework.stereotype.Controller;
|
|
|
-/* */ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-/* */ import org.springframework.web.bind.annotation.RequestParam;
|
|
|
-/* */ import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
-
|
|
|
-/* */
|
|
|
-/* */
|
|
|
+import com.suyuan.dto.Result;
|
|
|
+import com.suyuan.model.RentInfo;
|
|
|
+import com.suyuan.model.UserInfo;
|
|
|
+import com.suyuan.service.RentInfoService;
|
|
|
+import com.suyuan.util.EncodingTool;
|
|
|
+
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.stereotype.Controller;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
+import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
+
|
|
|
+
|
|
|
@Controller
|
|
|
@RequestMapping({"/rentInfo"})
|
|
|
public class RentInfoController extends BaseController {
|
|
|
@@ -28,46 +28,30 @@ public class RentInfoController extends BaseController {
|
|
|
@Autowired
|
|
|
private RentInfoService rentInfoService;
|
|
|
|
|
|
- @RequestMapping(value = {"/all"}, method = {org.springframework.web.bind.annotation.RequestMethod.GET})
|
|
|
+ @RequestMapping(value = {"/all"}, method = {RequestMethod.GET})
|
|
|
@ResponseBody
|
|
|
- /* */ public Result all(RentInfo record)
|
|
|
- /* */ {
|
|
|
- /* 44 */
|
|
|
+ public Result all(RentInfo record) {
|
|
|
List pp = this.rentInfoService.getRentInfoList(record);
|
|
|
- /* 45 */
|
|
|
return new Result(true, pp);
|
|
|
- /* */
|
|
|
}
|
|
|
|
|
|
- /* */
|
|
|
- /* */
|
|
|
- @RequestMapping(value = {"/getRentInfo"}, method = {org.springframework.web.bind.annotation.RequestMethod.GET})
|
|
|
- /* */
|
|
|
+ @RequestMapping(value = {"/getRentInfo"}, method = {RequestMethod.GET})
|
|
|
@ResponseBody
|
|
|
- /* */ public Result getRentInfo(@RequestParam(required = false, value = "id") String id)
|
|
|
- /* */ {
|
|
|
- /* 55 */
|
|
|
+ public Result getRentInfo(@RequestParam(required = false, value = "id") String id) {
|
|
|
+
|
|
|
RentInfo data = this.rentInfoService.getRentInfoById(id);
|
|
|
- /* 56 */
|
|
|
return new Result(true, data);
|
|
|
- /* */
|
|
|
}
|
|
|
|
|
|
- /* */
|
|
|
- /* */
|
|
|
- @RequestMapping(value = {"/getOne"}, method = {org.springframework.web.bind.annotation.RequestMethod.GET})
|
|
|
- /* */
|
|
|
+ @RequestMapping(value = {"/getOne"}, method = {RequestMethod.GET})
|
|
|
@ResponseBody
|
|
|
- /* */ public Result getOne(RentInfo record)
|
|
|
- /* */ {
|
|
|
+ public Result getOne(RentInfo record) {
|
|
|
record.setAddress(EncodingTool.encodeStr(record.getAddress()));
|
|
|
RentInfo data = this.rentInfoService.getRentInfo(record);
|
|
|
- /* 67 */
|
|
|
return new Result(true, data);
|
|
|
- /* */
|
|
|
}
|
|
|
|
|
|
- @RequestMapping(value = {"/postOne"}, method = {org.springframework.web.bind.annotation.RequestMethod.POST})
|
|
|
+ @RequestMapping(value = {"/postOne"}, method = {RequestMethod.POST})
|
|
|
@ResponseBody
|
|
|
public Result postOne(RentInfo record) {
|
|
|
RentInfo data = this.rentInfoService.getRentInfo(record);
|
|
|
@@ -76,9 +60,7 @@ public class RentInfoController extends BaseController {
|
|
|
|
|
|
}
|
|
|
|
|
|
- /* */
|
|
|
- /* */
|
|
|
- @RequestMapping(value = {"/page"}, method = {org.springframework.web.bind.annotation.RequestMethod.GET})
|
|
|
+ @RequestMapping(value = {"/page"}, method = {RequestMethod.GET})
|
|
|
@ResponseBody
|
|
|
public Result page(HttpServletRequest req, Page page, RentInfo record) {
|
|
|
|
|
|
@@ -98,117 +80,74 @@ public class RentInfoController extends BaseController {
|
|
|
|
|
|
}
|
|
|
|
|
|
- /* */
|
|
|
- /* */
|
|
|
- @RequestMapping(value = {"/save"}, method = {org.springframework.web.bind.annotation.RequestMethod.POST})
|
|
|
- /* */
|
|
|
+ @RequestMapping(value = {"/save"}, method = {RequestMethod.POST})
|
|
|
@ResponseBody
|
|
|
- /* */ public Result save(RentInfo record)
|
|
|
- /* */ {
|
|
|
- /* 96 */
|
|
|
+ public Result save(RentInfo record) {
|
|
|
boolean num = this.rentInfoService.createRentInfo(record);
|
|
|
- /* 97 */
|
|
|
if (num) {
|
|
|
- /* 98 */
|
|
|
return new Result(true, record.getId());
|
|
|
- /* */
|
|
|
}
|
|
|
- /* 100 */
|
|
|
- return new Result(false, "淇濆瓨寮傚父");
|
|
|
- /* */
|
|
|
+ return new Result(false, "保存异常");
|
|
|
}
|
|
|
|
|
|
- /* */
|
|
|
- /* */
|
|
|
- @RequestMapping(value = {"/update"}, method = {org.springframework.web.bind.annotation.RequestMethod.POST})
|
|
|
- /* */
|
|
|
+ @RequestMapping(value = {"/update"}, method = {RequestMethod.POST})
|
|
|
@ResponseBody
|
|
|
- /* */ public Result updateRentInfo(RentInfo record)
|
|
|
- /* */ {
|
|
|
- /* 110 */
|
|
|
+ public Result updateRentInfo(RentInfo record) {
|
|
|
boolean num = this.rentInfoService.updateRentInfo(record);
|
|
|
- /* 111 */
|
|
|
if (num) {
|
|
|
- /* 112 */
|
|
|
- return new Result(true, "淇濆瓨鎴愬姛");
|
|
|
- /* */
|
|
|
+ return new Result(true, "更新成功");
|
|
|
}
|
|
|
- /* 114 */
|
|
|
- return new Result(false, "淇濆瓨寮傚父");
|
|
|
- /* */
|
|
|
+ return new Result(false, "保存异常");
|
|
|
}
|
|
|
|
|
|
- /* */
|
|
|
- /* */
|
|
|
- @RequestMapping(value = {"/del"}, method = {org.springframework.web.bind.annotation.RequestMethod.POST})
|
|
|
- /* */
|
|
|
+ @RequestMapping(value = {"/del"}, method = {RequestMethod.POST})
|
|
|
@ResponseBody
|
|
|
- /* */ public Result deleteRentInfo(@RequestParam(required = true, value = "id") String id)
|
|
|
- /* */ {
|
|
|
- /* 124 */
|
|
|
+ public Result deleteRentInfo(@RequestParam(required = true, value = "id") String id) {
|
|
|
boolean num = this.rentInfoService.deleteRentInfo(id);
|
|
|
- /* 125 */
|
|
|
if (num) {
|
|
|
- /* 126 */
|
|
|
- return new Result(true, "鍒犻櫎鎴愬姛");
|
|
|
- /* */
|
|
|
+ return new Result(true, "删除成功");
|
|
|
}
|
|
|
- /* 128 */
|
|
|
- return new Result(false, "鍒犻櫎寮傚父");
|
|
|
- /* */
|
|
|
+ return new Result(false, "删除异常");
|
|
|
}
|
|
|
|
|
|
- /* */
|
|
|
- @RequestMapping(value = {"/rentLike"}, method = {org.springframework.web.bind.annotation.RequestMethod.GET})
|
|
|
- /* */
|
|
|
+ @RequestMapping(value = {"/rentLike"}, method = {RequestMethod.GET})
|
|
|
@ResponseBody
|
|
|
- /* */ public Result rentInfoLike(HttpServletRequest req, Page page, RentInfo record) {
|
|
|
- /* 134 */
|
|
|
+ public Result rentInfoLike(HttpServletRequest req, Page page, RentInfo record) {
|
|
|
record.setAddress(EncodingTool.encodeStr(record.getAddress()));
|
|
|
record.setName(EncodingTool.encodeStr(record.getName()));
|
|
|
record.setNote(EncodingTool.encodeStr(record.getNote()));
|
|
|
record.setSubmitter(EncodingTool.encodeStr(record.getSubmitter()));
|
|
|
System.out.println("一阶段 " + record);
|
|
|
- /* 139 */
|
|
|
UserInfo user = (UserInfo) req.getSession().getAttribute("userInfo");
|
|
|
- /* 140 */
|
|
|
String address = user.getAddress();
|
|
|
- /* 141 */
|
|
|
if (address == null) address = "";
|
|
|
- /* */
|
|
|
- /* 154 */
|
|
|
if ((record.getAddress() == null) || (record.getAddress().equals(""))) {
|
|
|
- /* 155 */
|
|
|
record.setAddress(user.getAddress());
|
|
|
- /* */
|
|
|
}
|
|
|
- /* 157 */
|
|
|
System.out.println("二阶段 " + user);
|
|
|
- /* 158 */
|
|
|
System.out.println("三阶段 " + record);
|
|
|
- /* 159 */
|
|
|
Map result = new HashMap();
|
|
|
- /* */
|
|
|
- /* 161 */
|
|
|
List<RentInfo> pp = this.rentInfoService.getRentInfoByLike(page, record);
|
|
|
- /* 162 */
|
|
|
for (RentInfo rent : pp) {
|
|
|
- /* 163 */
|
|
|
System.out.println(rent);
|
|
|
- /* */
|
|
|
}
|
|
|
- /* 165 */
|
|
|
result.put("page", page);
|
|
|
- /* 166 */
|
|
|
result.put("pp", pp);
|
|
|
- /* 167 */
|
|
|
return new Result(true, result);
|
|
|
- /* */
|
|
|
}
|
|
|
- /* */
|
|
|
-}
|
|
|
|
|
|
-/* Location: C:\Users\Administrator\Desktop\新建文件夹\WEB-INF\classes\
|
|
|
- * Qualified Name: com.suyuan.web.RentInfoController
|
|
|
- * JD-Core Version: 0.6.2
|
|
|
- */
|
|
|
+
|
|
|
+ @RequestMapping(value = {"/notice"}, method = {RequestMethod.POST})
|
|
|
+ @ResponseBody
|
|
|
+ public Result notice(@RequestParam(required = true, value = "id") String id) {
|
|
|
+ return rentInfoService.notice(id);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @RequestMapping(value = {"/autoNotice"}, method = {RequestMethod.POST})
|
|
|
+ @ResponseBody
|
|
|
+ public Result autoNotice() {
|
|
|
+ return rentInfoService.autoNotice();
|
|
|
+
|
|
|
+ }
|
|
|
+}
|