yuhaitao14 7 years ago
parent
commit
de1a727d73

+ 29 - 0
shop/src/main/java/com/zskk/shop/controller/api/ApiController.java

@@ -0,0 +1,29 @@
+/**
+* @版权信息 (@copyright Copyright 2017-XXXX JDJR.COM All Right Reserved);
+* @see
+* @author 于海涛 京东金融【技术研发部-证券及营销平台研发部-营销平台研发部】
+* @version 1.0
+* @date 2018年6月9日
+*/
+
+package com.zskk.shop.controller.api;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import com.zskk.shop.controller.bean.ControllerResult;
+import com.zskk.shop.service.BuyOrderService;
+
+@RequestMapping("/api")
+public class ApiController {
+	
+	@Autowired
+	private BuyOrderService buyOrderService;
+	
+	@RequestMapping("/refund")
+	public ControllerResult refund(@RequestParam("String") String key){
+		buyOrderService.refund(Long.parseLong(key));
+		return new ControllerResult(Boolean.TRUE);
+	}
+}

+ 5 - 3
shop/src/main/java/com/zskk/shop/controller/web/AppointmentController.java

@@ -82,7 +82,8 @@ public class AppointmentController extends AbstractController {
 	@ResponseBody
 	@ResponseBody
 	public ControllerResult save(Model model, @RequestParam("bid") Long bid, @RequestParam("itemid") Long itemid, 
 	public ControllerResult save(Model model, @RequestParam("bid") Long bid, @RequestParam("itemid") Long itemid, 
 			@RequestParam("fid") Integer fid, @RequestParam("idcard") String idcard, @RequestParam("name") String name, @RequestParam("sex") Integer sex,
 			@RequestParam("fid") Integer fid, @RequestParam("idcard") String idcard, @RequestParam("name") String name, @RequestParam("sex") Integer sex,
-			@RequestParam("phone") String phone, @RequestParam("atime") String atime, @Param("extend") String extend){
+			@RequestParam("phone") String phone, @RequestParam("birth") String birth,
+			@RequestParam("atime") String atime, @Param("extend") String extend){
 		UserBean userBean 	= this.getUser();
 		UserBean userBean 	= this.getUser();
 		BuyOrder buyOrder 	= buyOrderService.queryBuyOrder(bid);
 		BuyOrder buyOrder 	= buyOrderService.queryBuyOrder(bid);
 		if (buyOrder == null){
 		if (buyOrder == null){
@@ -96,7 +97,6 @@ public class AppointmentController extends AbstractController {
 			people = new FamilyPeople();
 			people = new FamilyPeople();
 			people.setId(0);
 			people.setId(0);
 			people.setAddress("");
 			people.setAddress("");
-			people.setBirth("");
 			people.setCtime(ToolsUtil.getNow());
 			people.setCtime(ToolsUtil.getNow());
 			people.setIsDel(0);
 			people.setIsDel(0);
 			people.setUid(userBean.getUserid());
 			people.setUid(userBean.getUserid());
@@ -110,6 +110,7 @@ public class AppointmentController extends AbstractController {
 		people.setSex(sex);
 		people.setSex(sex);
 		people.setIdcard(idcard);
 		people.setIdcard(idcard);
 		people.setPhone(phone);
 		people.setPhone(phone);
+		people.setBirth(birth);
 		BuyOrderItem item = buyOrderService.queryItem(itemid);
 		BuyOrderItem item = buyOrderService.queryItem(itemid);
 		familyPeopleService.addAppointment(userBean, people, buyOrder, item, atime, extend);
 		familyPeopleService.addAppointment(userBean, people, buyOrder, item, atime, extend);
 		
 		
@@ -141,7 +142,7 @@ public class AppointmentController extends AbstractController {
 	@RequestMapping("change")
 	@RequestMapping("change")
 	public String change(Model model, @RequestParam("id") Integer id,
 	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("fid") Integer fid, @RequestParam("idcard") String idcard, @RequestParam("name") String name, @RequestParam("sex") Integer sex,
-			@RequestParam("phone") String phone, @RequestParam("atime") String atime, @Param("extend") String extend){
+			@RequestParam("phone") String phone, @RequestParam("birth") String birth, @RequestParam("atime") String atime, @Param("extend") String extend){
 		UserBean userBean = this.getUser();
 		UserBean userBean = this.getUser();
 		Appointment appointment = familyPeopleService.queryAppointment(id);
 		Appointment appointment = familyPeopleService.queryAppointment(id);
 		if (appointment == null){
 		if (appointment == null){
@@ -161,6 +162,7 @@ public class AppointmentController extends AbstractController {
 		people.setName(name);
 		people.setName(name);
 		people.setPhone(phone);
 		people.setPhone(phone);
 		people.setSex(sex);
 		people.setSex(sex);
+		people.setBirth(birth);
 		
 		
 		familyPeopleService.change(userBean, people, appointment);
 		familyPeopleService.change(userBean, people, appointment);
 		
 		

+ 2 - 0
shop/src/main/java/com/zskk/shop/dao/BuyOrderMapper.java

@@ -33,4 +33,6 @@ public interface BuyOrderMapper {
 	void addItems(@Param("items") List<BuyOrderItem> items);
 	void addItems(@Param("items") List<BuyOrderItem> items);
 	public int setOrderid(BuyOrder order);
 	public int setOrderid(BuyOrder order);
 	public BuyOrder queryByOrderid(String orderid);
 	public BuyOrder queryByOrderid(String orderid);
+	
+	public int setItemRefund(BuyOrderItem item);
 }
 }

+ 3 - 0
shop/src/main/java/com/zskk/shop/dao/FamilyPeopleMapper.java

@@ -22,6 +22,7 @@ public interface FamilyPeopleMapper {
 	
 	
 	FamilyPeople queryMyPeople(Integer id);
 	FamilyPeople queryMyPeople(Integer id);
 	
 	
+	
 	void addMyPeople(FamilyPeople p);
 	void addMyPeople(FamilyPeople p);
 	
 	
 	int updateMyPeople(FamilyPeople p);
 	int updateMyPeople(FamilyPeople p);
@@ -31,7 +32,9 @@ public interface FamilyPeopleMapper {
 	void insertAppointment(Appointment appointment);
 	void insertAppointment(Appointment appointment);
 	FamilyPeopleAppointment queryAppointmentFamily(@Param("bid") Long bid, @Param("itemid") Long itemid);
 	FamilyPeopleAppointment queryAppointmentFamily(@Param("bid") Long bid, @Param("itemid") Long itemid);
 	Appointment queryAppointment(Integer id);
 	Appointment queryAppointment(Integer id);
+	Appointment queryAppointmentByItemid(Long itemid);
 	int updateAppointment(Appointment appointment);
 	int updateAppointment(Appointment appointment);
 	int updateAppointmentStatus(@Param("tjaid") String tjaid, @Param("tjstatus") Integer tjstatus, @Param("reportUrl") String reportUrl);
 	int updateAppointmentStatus(@Param("tjaid") String tjaid, @Param("tjstatus") Integer tjstatus, @Param("reportUrl") String reportUrl);
 	List<Long> queryCompletedBids(String uid);
 	List<Long> queryCompletedBids(String uid);
+	public int setAppointmentStatus(Appointment appointment);
 }
 }

+ 7 - 0
shop/src/main/java/com/zskk/shop/dao/entry/Appointment.java

@@ -17,6 +17,7 @@ public class Appointment {
 	private String atime;
 	private String atime;
 	private String extend;
 	private String extend;
 	private String tjaid;
 	private String tjaid;
+	private Integer tjstatus;
 	private Integer ctime;
 	private Integer ctime;
 	public Integer getId() {
 	public Integer getId() {
 		return id;
 		return id;
@@ -72,4 +73,10 @@ public class Appointment {
 	public void setUid(String uid) {
 	public void setUid(String uid) {
 		this.uid = uid;
 		this.uid = uid;
 	}
 	}
+	public Integer getTjstatus() {
+		return tjstatus;
+	}
+	public void setTjstatus(Integer tjstatus) {
+		this.tjstatus = tjstatus;
+	}
 }
 }

+ 21 - 0
shop/src/main/java/com/zskk/shop/dao/entry/BuyOrderItem.java

@@ -18,6 +18,9 @@ public class BuyOrderItem {
 	private BigDecimal price;
 	private BigDecimal price;
 	private BigDecimal totalPrice;
 	private BigDecimal totalPrice;
 	private Integer ctime;
 	private Integer ctime;
+	private Integer isRefund;
+	private String refundid;
+	private Integer refundTime;
 	public Long getId() {
 	public Long getId() {
 		return id;
 		return id;
 	}
 	}
@@ -60,4 +63,22 @@ public class BuyOrderItem {
 	public void setCtime(Integer ctime) {
 	public void setCtime(Integer ctime) {
 		this.ctime = ctime;
 		this.ctime = ctime;
 	}
 	}
+	public Integer getIsRefund() {
+		return isRefund;
+	}
+	public void setIsRefund(Integer isRefund) {
+		this.isRefund = isRefund;
+	}
+	public String getRefundid() {
+		return refundid;
+	}
+	public void setRefundid(String refundid) {
+		this.refundid = refundid;
+	}
+	public Integer getRefundTime() {
+		return refundTime;
+	}
+	public void setRefundTime(Integer refundTime) {
+		this.refundTime = refundTime;
+	}
 }
 }

+ 27 - 0
shop/src/main/java/com/zskk/shop/service/BuyOrderService.java

@@ -60,6 +60,9 @@ public class BuyOrderService {
 	@Autowired
 	@Autowired
 	private FamilyPeopleService familyPeopleService;
 	private FamilyPeopleService familyPeopleService;
 	
 	
+	@Autowired
+	private UserCenterService userCenterService;
+	
 	/**
 	/**
 	 * 查询自己的订单
 	 * 查询自己的订单
 	 * @param uid
 	 * @param uid
@@ -220,6 +223,30 @@ public class BuyOrderService {
 		return buyOrderMapper.setOrderid(buyOrder);
 		return buyOrderMapper.setOrderid(buyOrder);
 	}
 	}
 	
 	
+	/**
+	 * 退款
+	 * @param itemid
+	 * @return
+	 */
+	@Transactional
+	public Boolean refund(Long itemid){
+		BuyOrderItem item = buyOrderMapper.queryItem(itemid);
+		if (item == null){
+			throw new ZSKKException(ErrorConstant.PARAM_ERROR);
+		}
+		
+		BuyOrder order 	= this.queryBuyOrder(item.getBid());
+		String refundid = order.getOrderid() + "_" + item.getId();
+		userCenterService.refund(order, item, refundid);
+		
+		item.setIsRefund(1);
+		item.setRefundid(refundid);
+		item.setRefundTime(ToolsUtil.getNow());
+		buyOrderMapper.setItemRefund(item);
+		familyPeopleService.setItemRefund(item, -3);
+		return Boolean.TRUE;
+	}
+	
 	/**
 	/**
 	 * 对象转换
 	 * 对象转换
 	 * @param buyOrder
 	 * @param buyOrder

+ 22 - 6
shop/src/main/java/com/zskk/shop/service/FamilyPeopleService.java

@@ -70,7 +70,7 @@ public class FamilyPeopleService {
 	 * @param idcard
 	 * @param idcard
 	 * @return
 	 * @return
 	 */
 	 */
-	public FamilyPeople addMyPeople(String uid, String name, String phone, String idcard, Integer sex){
+	public FamilyPeople addMyPeople(String uid, String name, String phone, String idcard, Integer sex, String birth){
 		FamilyPeople p = new FamilyPeople();
 		FamilyPeople p = new FamilyPeople();
 		p.setCtime(ToolsUtil.getNow());
 		p.setCtime(ToolsUtil.getNow());
 		p.setIdcard(idcard);
 		p.setIdcard(idcard);
@@ -79,7 +79,7 @@ public class FamilyPeopleService {
 		p.setUid(uid);
 		p.setUid(uid);
 		p.setSex(sex);
 		p.setSex(sex);
 		p.setAddress("");
 		p.setAddress("");
-		p.setBirth("");
+		p.setBirth(birth);
 		p.setIsDel(0);
 		p.setIsDel(0);
 		familyPeopleMapper.addMyPeople(p);
 		familyPeopleMapper.addMyPeople(p);
 		return p;
 		return p;
@@ -94,7 +94,7 @@ public class FamilyPeopleService {
 	 * @param idcard
 	 * @param idcard
 	 * @return
 	 * @return
 	 */
 	 */
-	public FamilyPeople updateMyPeople(String uid, Integer id, String name, String phone, String idcard, Integer sex){
+	public FamilyPeople updateMyPeople(String uid, Integer id, String name, String phone, String idcard, Integer sex, String birth){
 		FamilyPeople people = this.queryMyPeople(id);
 		FamilyPeople people = this.queryMyPeople(id);
 		if (people == null){
 		if (people == null){
 			throw new ZSKKException(ErrorConstant.PARAM_ERROR);
 			throw new ZSKKException(ErrorConstant.PARAM_ERROR);
@@ -106,6 +106,7 @@ public class FamilyPeopleService {
 		people.setPhone(phone);
 		people.setPhone(phone);
 		people.setIdcard(idcard);
 		people.setIdcard(idcard);
 		people.setSex(sex);
 		people.setSex(sex);
+		people.setBirth(birth);
 		familyPeopleMapper.updateMyPeople(people);
 		familyPeopleMapper.updateMyPeople(people);
 		return people;
 		return people;
 	}
 	}
@@ -138,12 +139,11 @@ public class FamilyPeopleService {
 	 */
 	 */
 	@Transactional
 	@Transactional
 	public void addAppointment(UserBean userBean, FamilyPeople people, BuyOrder order, BuyOrderItem item, String atime, String extend){
 	public void addAppointment(UserBean userBean, FamilyPeople people, BuyOrder order, BuyOrderItem item, String atime, String extend){
-		
 		//维护家人 
 		//维护家人 
 		if (people.getId().equals(0)){
 		if (people.getId().equals(0)){
-			people = addMyPeople(userBean.getUserid(), people.getName(), people.getPhone(), people.getIdcard(), people.getSex());
+			people = addMyPeople(userBean.getUserid(), people.getName(), people.getPhone(), people.getIdcard(), people.getSex(), people.getBirth());
 		}else{
 		}else{
-			updateMyPeople(userBean.getUserid(), people.getId(), people.getName(), people.getPhone(), people.getIdcard(), people.getSex());
+			updateMyPeople(userBean.getUserid(), people.getId(), people.getName(), people.getPhone(), people.getIdcard(), people.getSex(),people.getBirth());
 		}
 		}
 		
 		
 		Appointment appointment = new Appointment();
 		Appointment appointment = new Appointment();
@@ -211,6 +211,22 @@ public class FamilyPeopleService {
 	public void updateAppointmentStatus(String tjid, Integer status, String reportUrl){
 	public void updateAppointmentStatus(String tjid, Integer status, String reportUrl){
 		familyPeopleMapper.updateAppointmentStatus(tjid, status, reportUrl);
 		familyPeopleMapper.updateAppointmentStatus(tjid, status, reportUrl);
 	}
 	}
+
+	/**
+	 * 设置状态
+	 * @param id
+	 * @param status
+	 * @return
+	 */
+	public int setItemRefund(BuyOrderItem item, Integer status){
+		Appointment bean = familyPeopleMapper.queryAppointmentByItemid(item.getId());
+		if (bean != null){
+			bean.setTjstatus(status);
+			return familyPeopleMapper.setAppointmentStatus(bean);
+		}else{
+			return 0;
+		}
+	}
 	
 	
 	public List<Long> queryCompletedBids(String uid){
 	public List<Long> queryCompletedBids(String uid){
 		return familyPeopleMapper.queryCompletedBids(uid);
 		return familyPeopleMapper.queryCompletedBids(uid);

+ 22 - 0
shop/src/main/java/com/zskk/shop/service/UserCenterService.java

@@ -18,6 +18,7 @@ import java.util.UUID;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
@@ -25,10 +26,12 @@ import com.zskk.shop.controller.bean.AccountBean;
 import com.zskk.shop.controller.bean.ControllerResult;
 import com.zskk.shop.controller.bean.ControllerResult;
 import com.zskk.shop.controller.bean.UserBean;
 import com.zskk.shop.controller.bean.UserBean;
 import com.zskk.shop.dao.entry.BuyOrder;
 import com.zskk.shop.dao.entry.BuyOrder;
+import com.zskk.shop.dao.entry.BuyOrderItem;
 import com.zskk.shop.dao.entry.GoodBase;
 import com.zskk.shop.dao.entry.GoodBase;
 import com.zskk.shop.exception.ErrorConstant;
 import com.zskk.shop.exception.ErrorConstant;
 import com.zskk.shop.utils.HttpClient;
 import com.zskk.shop.utils.HttpClient;
 import com.zskk.shop.utils.LogUtil;
 import com.zskk.shop.utils.LogUtil;
+import com.zskk.shop.utils.ToolsUtil;
 
 
 @Service
 @Service
 public class UserCenterService {
 public class UserCenterService {
@@ -72,6 +75,25 @@ public class UserCenterService {
 		}
 		}
 	}
 	}
 	
 	
+	public ControllerResult refund(BuyOrder order, BuyOrderItem item, String refundid){
+		
+		Map<String, String> params = new HashMap<>();
+		params.put("companyid", companyid);
+		params.put("apporderid", order.getOrderid());
+		params.put("refundid", refundid);
+		params.put("money", item.getTotalPrice().toString());
+		params.put("sign", this.sign(params));
+		
+		try{
+			String content = HttpClient.doPost(uccenter + "pay/refund", params);
+			return JSON.parseObject(content, ControllerResult.class);
+		}catch (Exception e) {
+			e.printStackTrace();
+			LogUtil.sysError(e.getMessage(), e);
+			return new ControllerResult(ErrorConstant.SERVER_ERROR);
+		}
+	}
+	
 	/**
 	/**
 	 * 查询用户
 	 * 查询用户
 	 * @param search
 	 * @param search

+ 5 - 0
shop/src/main/resource/mapper/BuyOrderMapper.xml

@@ -75,4 +75,9 @@
 		from buy_order
 		from buy_order
 		where orderid=#{orderid}
 		where orderid=#{orderid}
 	</select>
 	</select>
+	
+	<select id="setItemRefund" parameterType="com.zskk.shop.dao.entry.BuyOrderItem">
+		update buy_order_item set is_refund=#{isRefund}, refundid=#{refundid}, refund_time=#{refundTime}
+		where id=#{id}
+	</select>
 </mapper>
 </mapper>

+ 9 - 0
shop/src/main/resource/mapper/FamilyPeopleMapper.xml

@@ -42,6 +42,12 @@
 		from appointment
 		from appointment
 		where id=#{id}
 		where id=#{id}
 	</select>
 	</select>
+	<select id="queryAppointmentByItemid" resultType="com.zskk.shop.dao.entry.Appointment">
+		select id, uid, bid, itemid, fid,atime, extend, tjaid, ctime
+		from appointment
+		where itemid=#{itemid}
+		limit 1
+	</select>
 	<update id="updateAppointment" parameterType="com.zskk.shop.dao.entry.Appointment">
 	<update id="updateAppointment" parameterType="com.zskk.shop.dao.entry.Appointment">
 		update appointment set fid=#{fid},atime=#{atime},extend=#{extend},tjaid=#{tjaid}
 		update appointment set fid=#{fid},atime=#{atime},extend=#{extend},tjaid=#{tjaid}
 		where id=#{id}
 		where id=#{id}
@@ -54,4 +60,7 @@
 		from appointment
 		from appointment
 		where uid=#{id} and tjstatus = 2
 		where uid=#{id} and tjstatus = 2
 	</select>
 	</select>
+	<update id="setAppointmentStatus" parameterType="com.zskk.shop.dao.entry.Appointment">
+		update appointment set tjstatus=#{tjstatus} where id=#{id}
+	</update>
 </mapper>
 </mapper>

+ 12 - 2
shop/src/main/resource/templates/appointment.html

@@ -105,7 +105,7 @@
 	                    <dl>
 	                    <dl>
 	                    	<dt>性别:</dt>
 	                    	<dt>性别:</dt>
 	                    	<dd>
 	                    	<dd>
-	                            <label class="label"><input id="sex1" class="radio" type="radio" name="sex" value="1"/><span class="radioInput"></span>男</label>
+	                            <label class="label"><input id="sex1" class="radio" type="radio" name="sex" value="1" checked="checked"/><span class="radioInput"></span>男</label>
 	                        </dd>
 	                        </dd>
 	                    	<dd>
 	                    	<dd>
 	                        	<label class="label"><input id="sex0" class="radio" type="radio" name="sex" value="0"/><span class="radioInput"></span>女</label>
 	                        	<label class="label"><input id="sex0" class="radio" type="radio" name="sex" value="0"/><span class="radioInput"></span>女</label>
@@ -117,11 +117,17 @@
 	                    		<input id="phone" type="text" class="txt" style="width:300px; " placeholder="此手机号用于接收体检报告及预约信息" maxlength="32"/>
 	                    		<input id="phone" type="text" class="txt" style="width:300px; " placeholder="此手机号用于接收体检报告及预约信息" maxlength="32"/>
 	                    	</dd>
 	                    	</dd>
 	                    </dl>
 	                    </dl>
+	                    <dl>
+	                    	<dt>生日:</dt>
+	                    	<dd>
+	                    		<input id="birth" type="text" class="txt" style="width:300px; " onClick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd'})" placeholder="请选择生日" readonly="readonly"/>
+	                    	</dd>
+	                    </dl>
 	                    <div style="width:100%; height:1px; background-color:#EEE; font-size:0; "></div>
 	                    <div style="width:100%; height:1px; background-color:#EEE; font-size:0; "></div>
 	                    <dl>
 	                    <dl>
 	                    	<dt>预约体检日期:</dt>
 	                    	<dt>预约体检日期:</dt>
 	                    	<dd>
 	                    	<dd>
-	                    		<input id="atime" name="" type="text" class="txt" style="width:160px;" onClick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd'})" readonly="readonly"/>
+	                    		<input id="atime" name="" type="text" class="txt" style="width:160px;" onClick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd'})" readonly="readonly" placeholder="请选择体检日期"/>
 	                    		<select id="extend" name="extend" class="slt" style="width:130px; ">
 	                    		<select id="extend" name="extend" class="slt" style="width:130px; ">
 	                    			<option>预约时间</option>
 	                    			<option>预约时间</option>
 	                    			<option value="08:00">08:00</option>
 	                    			<option value="08:00">08:00</option>
@@ -167,6 +173,7 @@
 				$("#name").val("");
 				$("#name").val("");
 				$("#sex1").attr("checked","checked")
 				$("#sex1").attr("checked","checked")
 				$("#phone").val("")
 				$("#phone").val("")
+				$("#birth").val("")
 			}else{
 			}else{
 				for (var i = 0; i < peoples.length; ++i){
 				for (var i = 0; i < peoples.length; ++i){
 					var obj = peoples[i]
 					var obj = peoples[i]
@@ -175,6 +182,7 @@
 						$("#name").val(obj.name);
 						$("#name").val(obj.name);
 						$("#sex" + obj.sex).attr("checked","checked")
 						$("#sex" + obj.sex).attr("checked","checked")
 						$("#phone").val(obj.phone)
 						$("#phone").val(obj.phone)
+						$("#birth").val(obj.birth)
 					}
 					}
 				}
 				}
 			}
 			}
@@ -212,6 +220,7 @@
 			var phone 	= $("#phone").val();
 			var phone 	= $("#phone").val();
 			var atime	= $("#atime").val();
 			var atime	= $("#atime").val();
 			var extend	= $("#extend").val();
 			var extend	= $("#extend").val();
+			var birth 	= $("#birth").val();
 			$.post("/appointment/save", {
 			$.post("/appointment/save", {
 				"bid":bid, 
 				"bid":bid, 
 				"itemid":itemid, 
 				"itemid":itemid, 
@@ -220,6 +229,7 @@
 				"name":name,
 				"name":name,
 				"sex":sex,
 				"sex":sex,
 				"phone":phone,
 				"phone":phone,
+				'birth':birth,
 				"atime":atime,
 				"atime":atime,
 				"extend": extend,
 				"extend": extend,
 				},function(result){
 				},function(result){

+ 10 - 1
shop/src/main/resource/templates/changeappointment.html

@@ -96,6 +96,12 @@
 	                    		<input id="phone" name="phone" type="text" class="txt" style="width:300px; " placeholder="此手机号用于接收体检报告及预约信息" maxlength="32" th:attr="value=${people.phone}"/>
 	                    		<input id="phone" name="phone" type="text" class="txt" style="width:300px; " placeholder="此手机号用于接收体检报告及预约信息" maxlength="32" th:attr="value=${people.phone}"/>
 	                    	</dd>
 	                    	</dd>
 	                    </dl>
 	                    </dl>
+	                    <dl>
+	                    	<dt>生日:</dt>
+	                    	<dd>
+	                    		<input id="birth" name="birth" type="text" class="txt" style="width:300px; " onClick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd'})" placeholder="请选择生日" readonly="readonly" th:attr="value=${people.birth}"/>
+	                    	</dd>
+	                    </dl>
 	                    <div style="width:100%; height:1px; background-color:#EEE; font-size:0; "></div>
 	                    <div style="width:100%; height:1px; background-color:#EEE; font-size:0; "></div>
 	                    <dl>
 	                    <dl>
 	                    	<dt>预约体检日期:</dt>
 	                    	<dt>预约体检日期:</dt>
@@ -131,13 +137,15 @@
 		if (extend != ''){
 		if (extend != ''){
 			$("#extend").val(extend);
 			$("#extend").val(extend);
 		}
 		}
-		$("input[name=people]").click(function(){
+		$("input[name=fid]").click(function(){
 			var id = $(this).val();
 			var id = $(this).val();
+			console.log(id)
 			if (id == "0"){
 			if (id == "0"){
 				$("#idcard").val("");
 				$("#idcard").val("");
 				$("#name").val("");
 				$("#name").val("");
 				$("#sex1").attr("checked","checked")
 				$("#sex1").attr("checked","checked")
 				$("#phone").val("")
 				$("#phone").val("")
+				$("#birth").val("")
 			}else{
 			}else{
 				for (var i = 0; i < peoples.length; ++i){
 				for (var i = 0; i < peoples.length; ++i){
 					var obj = peoples[i]
 					var obj = peoples[i]
@@ -146,6 +154,7 @@
 						$("#name").val(obj.name);
 						$("#name").val(obj.name);
 						$("#sex" + obj.sex).attr("checked","checked")
 						$("#sex" + obj.sex).attr("checked","checked")
 						$("#phone").val(obj.phone)
 						$("#phone").val(obj.phone)
+						$("#birth").val(obj.birth)
 					}
 					}
 				}
 				}
 			}
 			}