gqx 2 年之前
父节点
当前提交
f67097f352

+ 65 - 39
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/BusOrderFee.java

@@ -4,10 +4,9 @@ import java.io.Serializable;
 import java.io.UnsupportedEncodingException;
 import java.util.Date;
 import java.math.BigDecimal;
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.baomidou.mybatisplus.annotation.TableLogic;
+import java.util.List;
+
+import com.baomidou.mybatisplus.annotation.*;
 import lombok.Data;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import org.springframework.format.annotation.DateTimeFormat;
@@ -32,67 +31,93 @@ import lombok.experimental.Accessors;
 public class BusOrderFee implements Serializable {
     private static final long serialVersionUID = 1L;
 
-	/**key*/
-	@TableId(type = IdType.ASSIGN_ID)
+    /**
+     * key
+     */
+    @TableId(type = IdType.ASSIGN_ID)
     @ApiModelProperty(value = "key")
     private String id;
-	/**入住订单id*/
-	@Excel(name = "入住订单id", width = 15)
+    /**
+     * 入住订单id
+     */
+    @Excel(name = "入住订单id", width = 15)
     @ApiModelProperty(value = "入住订单id")
     private String livingOrderId;
-	/**房间id*/
-	@Excel(name = "房间id", width = 15)
+    /**
+     * 房间id
+     */
+    @Excel(name = "房间id", width = 15)
     @ApiModelProperty(value = "房间id")
     private String roomId;
-	/**消费金额*/
-	@Excel(name = "消费金额", width = 15)
+    /**
+     * 消费金额
+     */
+    @Excel(name = "消费金额", width = 15)
     @ApiModelProperty(value = "消费金额")
     private BigDecimal money;
-	/**账单类型1消费。2收款*/
-	@Excel(name = "账单类型1消费。2收款", width = 15)
+    /**
+     * 账单类型1消费。2收款
+     */
+    @Excel(name = "账单类型1消费。2收款", width = 15)
     @ApiModelProperty(value = "账单类型1消费。2收款")
     private Integer feeType;
-	/**收费项目说明*/
-	@Excel(name = "收费项目说明", width = 15)
+    /**
+     * 收费项目说明
+     */
+    @Excel(name = "收费项目说明", width = 15)
     @ApiModelProperty(value = "收费项目说明")
     private Integer subjectType;
-	/**付款方式*/
-	@Excel(name = "付款方式", width = 15)
+    /**
+     * 付款方式
+     */
+    @Excel(name = "付款方式", width = 15)
     @ApiModelProperty(value = "付款方式")
     private String payType;
-	/**备注*/
-	@Excel(name = "备注", width = 15)
+    /**
+     * 备注
+     */
+    @Excel(name = "备注", width = 15)
     @ApiModelProperty(value = "备注")
     private String remark;
-	/**客单备注*/
-	@Excel(name = "客单备注", width = 15)
+    /**
+     * 客单备注
+     */
+    @Excel(name = "客单备注", width = 15)
     @ApiModelProperty(value = "客单备注")
     private String custorerOrderRemark;
-	/**创建时间*/
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
-    @DateTimeFormat(pattern="yyyy-MM-dd")
+    /**
+     * 创建时间
+     */
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
     @ApiModelProperty(value = "创建时间")
     private Date createTime;
-	/**营业日*/
-	@Excel(name = "营业日", width = 15, format = "yyyy-MM-dd")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
-    @DateTimeFormat(pattern="yyyy-MM-dd")
+    /**
+     * 营业日
+     */
+    @Excel(name = "营业日", width = 15, format = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
     @ApiModelProperty(value = "营业日")
     private Date dayTime;
-	/**收款账单有该记录,id为消费账单id*/
-	@Excel(name = "收款账单有该记录,id为消费账单id", width = 15)
+    /**
+     * 收款账单有该记录,id为消费账单id
+     */
+    @Excel(name = "收款账单有该记录,id为消费账单id", width = 15)
     @ApiModelProperty(value = "收款账单有该记录,id为消费账单id")
     private String consumeFeeId;
-	/**收款时间*/
-	@Excel(name = "收款时间", width = 15, format = "yyyy-MM-dd")
-	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
-    @DateTimeFormat(pattern="yyyy-MM-dd")
+    /**
+     * 收款时间
+     */
+    @Excel(name = "收款时间", width = 15, format = "yyyy-MM-dd")
+    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
     @ApiModelProperty(value = "收款时间")
     private Date payTime;
 
-	// 以下的内容只会出现在优惠的账单里面
+    // 以下的内容只会出现在优惠的账单里面
     @ApiModelProperty(value = "是否优惠")
-	private Boolean isPreferential;
+    private Boolean isPreferential;
     @ApiModelProperty(value = "优惠类型:1抹零2减现3打折  折扣率自动根据优惠金额计算")
     private Integer preferentialType;
     @ApiModelProperty(value = "优惠金额")
@@ -112,6 +137,7 @@ public class BusOrderFee implements Serializable {
     @ApiModelProperty(value = "协议单位ID")
     private String agreementUnitId;
 
-
-
+    @ApiModelProperty(value = "每天价格")
+    @TableField(exist = false)
+    private List<BusLivingLayoutDayPrice> prices;
 }

+ 16 - 6
jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/BusRoomBookingOrdersServiceImpl.java

@@ -1244,15 +1244,16 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Boolean continueLiving(BusOrderFee settleFee, Date dueOutTime,String livingOrderId,String hotelId) {
-
         BusRoomsLivingOrder order = roomsLivingOrderService.getById(livingOrderId);
-        if(order == null) throw new JeecgBootException("订单错误");
+        if (order == null) throw new JeecgBootException("订单错误");
         BusBookingRooms bkRoom = bookingRoomsService.getById(order.getBookingRoomId());
-        if(bkRoom == null) throw new JeecgBootException("订单房间不存在");
-        if(order.getArrivalTime().getTime() >= dueOutTime.getTime()) throw new JeecgBootException("预离时间不能小于预抵时间");
+        if (bkRoom == null) throw new JeecgBootException("订单房间不存在");
+        if (settleFee.getPrices() == null || settleFee.getPrices().size() == 0)
+            throw new JeecgBootException("每天价格不能为空");
+        if (order.getArrivalTime().getTime() >= dueOutTime.getTime()) throw new JeecgBootException("预离时间不能小于预抵时间");
         order.setDueOutTime(dueOutTime);
         roomsLivingOrderService.updateById(order);
-        if(settleFee != null && settleFee.getMoney() != null && !settleFee.getMoney().equals(new BigDecimal(0))) {
+        if (settleFee != null && settleFee.getMoney() != null && !settleFee.getMoney().equals(new BigDecimal(0))) {
             settleFee.setLivingOrderId(livingOrderId);
             settleFee.setFeeType(2);
             settleFee.setSubjectType(FeeSubjectType.YU_SHOU.getKey());
@@ -1260,10 +1261,19 @@ public class BusRoomBookingOrdersServiceImpl extends ServiceImpl<BusRoomBookingO
             settleFee.setRoomId(bkRoom.getRoomId());
             settleFee.setPreferentialStatus(1); // 未结账
             feeService.save(settleFee);
-            return  true;
+            return true;
         }
+        CesRooms room =  roomsService.getById(bkRoom.getRoomId());
+        settleFee.getPrices().forEach(s -> {
+            s.setRoomLayoutId(room.getLayoutId());
+            s.setRoomId(bkRoom.getRoomId());
+            s.setLivingType(1);
+            s.setLivingOrderId(livingOrderId);
+        });
+        livingLayoutDayPriceService.saveBatch(settleFee.getPrices());
         throw new JeecgBootException("设置失败");
     }
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Boolean settleBillCheckOut(List<BusOrderFee> settleFees, String bookingOrderId) {