|
@@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.zskk.shop.controller.AbstractController;
|
|
|
import com.zskk.shop.controller.bean.UserBean;
|
|
|
+import com.zskk.shop.dao.entry.Appointment;
|
|
|
import com.zskk.shop.dao.entry.BuyOrder;
|
|
|
import com.zskk.shop.dao.entry.BuyOrderItem;
|
|
|
import com.zskk.shop.dao.entry.FamilyPeople;
|
|
@@ -100,4 +101,56 @@ public class H5AppointmentController extends AbstractController {
|
|
|
familyPeopleService.addAppointment(userBean, people, buyOrder, item, atime, extend);
|
|
|
return "/h5/appointment_success";
|
|
|
}
|
|
|
+
|
|
|
+ @RequestMapping("/gochangeappointment/{id}")
|
|
|
+ public String gochangeappointment(Model model, @PathVariable("id") Integer id){
|
|
|
+ UserBean userBean = this.getUser();
|
|
|
+ Appointment appointment = familyPeopleService.queryAppointment(id);
|
|
|
+ if (appointment == null){
|
|
|
+ throw new ZSKKException(ErrorConstant.PARAM_ERROR);
|
|
|
+ }
|
|
|
+ BuyOrderItem item = buyOrderService.queryItem(appointment.getItemid());
|
|
|
+ List<FamilyPeople> peoples = familyPeopleService.queryMyPeoples(userBean.getUserid());
|
|
|
+ FamilyPeople people = familyPeopleService.queryMyPeople(appointment.getFid());
|
|
|
+
|
|
|
+ model.addAttribute("good", goodService.queryOneGoodBase(item.getGid()));
|
|
|
+ model.addAttribute("appointment", appointment);
|
|
|
+ model.addAttribute("item", item);
|
|
|
+ model.addAttribute("peoples", peoples);
|
|
|
+ model.addAttribute("peoplesJSON", JSON.toJSONString(peoples));
|
|
|
+ model.addAttribute("people", people);
|
|
|
+
|
|
|
+ this.initUser(model);
|
|
|
+ return "/h5/changeappointment";
|
|
|
+ }
|
|
|
+
|
|
|
+ @RequestMapping("change")
|
|
|
+ public String change(Model model, @RequestParam("id") Integer id,
|
|
|
+ @RequestParam("fid") Integer fid, @RequestParam("idcard") String idcard, @RequestParam("name") String name, @RequestParam("sex") Integer sex,
|
|
|
+ @RequestParam("phone") String phone, @RequestParam("birth") String birth, @RequestParam("atime") String atime, @Param("extend") String extend){
|
|
|
+ UserBean userBean = this.getUser();
|
|
|
+ Appointment appointment = familyPeopleService.queryAppointment(id);
|
|
|
+ if (appointment == null){
|
|
|
+ throw new ZSKKException(ErrorConstant.PARAM_ERROR);
|
|
|
+ }
|
|
|
+
|
|
|
+ FamilyPeople people = this.familyPeopleService.queryMyPeople(fid);
|
|
|
+ if (people == null){
|
|
|
+ throw new ZSKKException(ErrorConstant.PARAM_ERROR);
|
|
|
+ }
|
|
|
+
|
|
|
+ appointment.setFid(fid);
|
|
|
+ appointment.setAtime(atime);
|
|
|
+ appointment.setExtend(extend);
|
|
|
+
|
|
|
+ people.setIdcard(idcard);
|
|
|
+ people.setName(name);
|
|
|
+ people.setPhone(phone);
|
|
|
+ people.setSex(sex);
|
|
|
+ people.setBirth(birth);
|
|
|
+
|
|
|
+ familyPeopleService.change(userBean, people, appointment);
|
|
|
+
|
|
|
+ return "redirect:/h5/buy/mypayedorders";
|
|
|
+ }
|
|
|
}
|