|
@@ -24,10 +24,12 @@ import com.zskk.shop.controller.AbstractController;
|
|
|
import com.zskk.shop.controller.bean.BuyOrderBean;
|
|
|
import com.zskk.shop.controller.bean.ControllerResult;
|
|
|
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;
|
|
|
import com.zskk.shop.dao.entry.FamilyPeopleAppointment;
|
|
|
+import com.zskk.shop.dao.entry.GoodBase;
|
|
|
import com.zskk.shop.exception.ErrorConstant;
|
|
|
import com.zskk.shop.exception.ZSKKException;
|
|
|
import com.zskk.shop.service.BuyOrderService;
|
|
@@ -62,10 +64,9 @@ public class AppointmentController extends AbstractController {
|
|
|
if (!item.getBid().equals(bid)){
|
|
|
throw new ZSKKException(ErrorConstant.PARAM_ERROR);
|
|
|
}
|
|
|
-
|
|
|
- List<String> tjCheckList = tjCenterService.getDJDetail("49");
|
|
|
+ GoodBase good = goodService.queryOneGoodBase(item.getGid());
|
|
|
+ List<String> tjCheckList = tjCenterService.getDJDetail(good.getPackageid());
|
|
|
List<FamilyPeople> peoples = familyPeopleService.queryMyPeoples(userBean.getUserid());
|
|
|
-
|
|
|
|
|
|
model.addAttribute("good", goodService.queryOneGoodBase(item.getGid()));
|
|
|
model.addAttribute("checklist", tjCheckList);
|
|
@@ -114,4 +115,53 @@ public class AppointmentController extends AbstractController {
|
|
|
return new ControllerResult(people);
|
|
|
}
|
|
|
|
|
|
+ @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 "/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("atime") String atime){
|
|
|
+ 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);
|
|
|
+
|
|
|
+ people.setIdcard(idcard);
|
|
|
+ people.setName(name);
|
|
|
+ people.setPhone(phone);
|
|
|
+ people.setSex(sex);
|
|
|
+
|
|
|
+ familyPeopleService.change(userBean, people, appointment);
|
|
|
+
|
|
|
+ return "redirect:/mypayedorders";
|
|
|
+ }
|
|
|
}
|