|
|
|
@ -2,6 +2,7 @@ package com.softegg.freetogo.Demand.controller;
|
|
|
|
|
|
|
|
|
|
import com.softegg.freetogo.Demand.bean.Demands;
|
|
|
|
|
import com.softegg.freetogo.Demand.service.DemandsService;
|
|
|
|
|
import com.softegg.freetogo.User.bean.Users;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
@ -35,9 +36,10 @@ public class DemandsController {
|
|
|
|
|
String eDate,
|
|
|
|
|
String sDay,
|
|
|
|
|
String city,
|
|
|
|
|
String message) {
|
|
|
|
|
String message,
|
|
|
|
|
Integer status) {
|
|
|
|
|
Demands demand = new Demands();
|
|
|
|
|
setDemands(phone, tGender, nkn, ct, dDate, eDate, sDay, city, message, demand);
|
|
|
|
|
setDemands(phone, tGender, nkn, ct, dDate, eDate, sDay, city, message,status , demand);
|
|
|
|
|
demandsService.add(demand);
|
|
|
|
|
return "添加成功";
|
|
|
|
|
}
|
|
|
|
@ -63,14 +65,21 @@ public class DemandsController {
|
|
|
|
|
String eDate,
|
|
|
|
|
String sDay,
|
|
|
|
|
String city,
|
|
|
|
|
String message) {
|
|
|
|
|
String message,
|
|
|
|
|
Integer status) {
|
|
|
|
|
Demands demand = demandsService.getDemandById(id);
|
|
|
|
|
setDemands(phone, tGender, nkn, ct, dDate, eDate, sDay, city, message, demand);
|
|
|
|
|
setDemands(phone, tGender, nkn, ct, dDate, eDate, sDay, city, message, status, demand);
|
|
|
|
|
demandsService.update(demand);
|
|
|
|
|
return "更新成功";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void setDemands(String phone, boolean tGender, String nkn, String ct, String dDate, String eDate, String sDay, String city, String message, Demands demand) {
|
|
|
|
|
@GetMapping("getByPhone")
|
|
|
|
|
public Demands getByPhone(String phone) {
|
|
|
|
|
System.out.println("根据手机号获取游客需求信息:" + phone);
|
|
|
|
|
return demandsService.getDemandsByPhone(phone);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void setDemands(String phone, boolean tGender, String nkn, String ct, String dDate, String eDate, String sDay, String city, String message, Integer status, Demands demand) {
|
|
|
|
|
demand.setPhone(phone);
|
|
|
|
|
demand.setTouristGender(tGender);
|
|
|
|
|
demand.setNickname(nkn);
|
|
|
|
@ -80,6 +89,7 @@ public class DemandsController {
|
|
|
|
|
demand.setSumDay(sDay);
|
|
|
|
|
demand.setCity(city);
|
|
|
|
|
demand.setMessage(message);
|
|
|
|
|
demand.setStatus(status);
|
|
|
|
|
// demand.setGuideGender(gGender);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|