提交 bcfc422c 编写于 作者: 刘兴
......@@ -16,7 +16,7 @@ public interface EnterDao {
//删除记录
int deleteEnter(int enter_id);
//更新房间号和客户号
int updateByHouseIdAndCustomerId(@Param("time") Date time, @Param("houseId") int houseId, @Param("customerId") int customerId);
int updateByHouseIdAndCustomerId(@Param("time") Date time, @Param("houseId") int houseId, @Param("customerId") int customerId,@Param("state") String state);
Enter selectByHouseIdAndCustomerId(@Param("houseId") int houseId,@Param("customerId") int customerId);
//根据住房id或者房间id查询住宿情况
List<Enter> queryOneById(int id);
......
......@@ -289,7 +289,7 @@ public class HouseServiceImpl implements HouseService {
int houseId = house.getHouseId();
if (house.getState().equals("入住")) {
Date date1 = new Date();
enterDao.updateByHouseIdAndCustomerId(date1, houseId, customerId);
enterDao.updateByHouseIdAndCustomerId(date1, houseId, customerId,"已结账");
Enter enter = enterDao.selectByHouseIdAndCustomerId(houseId, customerId);
Date date2 = enter.getEnd_time_estimate();
DecimalFormat df = new DecimalFormat("#.##");
......@@ -299,8 +299,10 @@ public class HouseServiceImpl implements HouseService {
Fee fee = feedao.queryByHouseIdAndCoustomerId(houseId, customerId);
int feeId = fee.getFeeId();
String feeddirect = fee.getDirect();
if (feeddirect.equals("未缴费"))
if (feeddirect.equals("未缴费")){
feedao.updateByFeeId(feeId);
enterDao.updateByHouseIdAndCustomerId(date1, houseId, customerId,"未结账");
}
houseDao.updateByHouseNameToCheckOut(name);
result.put("code", 200);
result.put("message", "退房成功");
......
......@@ -21,7 +21,7 @@
delete from enter where enter_id = #{enter_id}
</delete>
<update id="updateByHouseIdAndCustomerId" parameterType="com.hqyj.seven.pojo.Enter">
update enter set end_time_actual=#{time},state='待结账' where house_id=#{houseId} and customer_id=#{customerId}
update enter set end_time_actual=#{time},state=#{state} where house_id=#{houseId} and customer_id=#{customerId}
</update>
<select id="selectByHouseIdAndCustomerId" resultType="com.hqyj.seven.pojo.Enter">
select * from enter where house_id=#{houseId} and customer_id=#{customerId} order by enter_id DESC limit 1
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册