Commit 8919d477 by 吕明尚

删除房间是否是脏房字段

parent 730b9538
......@@ -271,7 +271,6 @@ public class RedisTask {
SRoom room = roomService.getById(sOrder.getRoomId());
if (ObjectUtil.isNotEmpty(room)) {
room.setStatus(RoomStatusEnum.FREE.getValue());
room.setIsDirtyRoom(YesNoEnum.yes.getIndex());
room.setUpdateTime(new Date());
roomService.updateById(room);
}
......
......@@ -3,10 +3,7 @@ package share.system.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import share.common.annotation.Excel;
import share.common.core.domain.BaseEntity;
......@@ -84,11 +81,6 @@ public class SRoom extends BaseEntity
@Excel(name = "其他可能硬件接入参数(备用2)")
private String params2;
/**
* 是否脏房
*/
@Excel(name = "是否脏房(0:否,1:是)")
private Integer isDirtyRoom;
/**
* 房间上下架(1-上架,2-下架,3-维护)
......
......@@ -129,11 +129,6 @@ public class SRoomVo extends BaseEntity
*/
private Long recordsUserId;
/**
* 是否脏房
*/
private Integer isDirtyRoom;
/**
* 订单时间
......
......@@ -337,7 +337,6 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
item.setUpdateTime(now);
rooms.add(new SRoom() {{
setId(item.getRoomId());
setIsDirtyRoom(YesNoEnum.no.getIndex());
}});
});
}
......@@ -359,16 +358,15 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
sRoomList.stream().forEach(room -> {
//循环房间
//判断当前房间是否是当前门店的房间,并且是未打扫的房间
if (item.getStoreId().equals(store.getId()) && room.getStoreId().equals(store.getId()) && room.getIsDirtyRoom().equals(YesNoEnum.no.getIndex())) {
// if (item.getStoreId().equals(store.getId()) && room.getStoreId().equals(store.getId()) && room.getIsDirtyRoom().equals(YesNoEnum.no.getIndex())) {
//发送短信
sConsumers.stream().forEach(consumer -> {
if (consumer.getId().equals(item.getConsumerId())) {
room.setIsDirtyRoom(YesNoEnum.yes.getIndex());
dirtyRoomList.add(room);
smsService.sendSmsCleanRecords(consumer.getPhone(), store, room);
}
});
}
// }
});
});
});
......@@ -458,7 +456,6 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
sCleanRecords.setEndDate(DateUtil.date());
sCleanRecords.setStatus(CleaningStatusEnum.CLEANED.getCode());
SRoom sRoom = new SRoom();
sRoom.setIsDirtyRoom(YesNoEnum.no.getIndex());
SCleanRecords records = baseMapper.selectSCleanRecordsById(sCleanRecords.getId());
if (records == null) {
throw new RuntimeException("当前保洁任务不存在!");
......
......@@ -1099,6 +1099,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
if (isRefund) {
// 删除redis 缓存信息,防止退款订单自动开始及给用户发送提示短信
redisUtil.delete(ReceiptRdeisEnum.ORDER_NO.getValue() + sOrder.getOrderNo());
redisUtil.delete(ReceiptRdeisEnum.ORDER_NO_KEY.getValue() + sOrder.getOrderNo());
//房间断电
deviceOpService.openOrCloseDevice(sOrder.getRoomId(), sOrder.getConsumerPhone(), OpTypeEnum.CUT_ELECTRIC.getCode(), true, 5);
}
......@@ -1109,6 +1110,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
}else {
// 删除redis 缓存信息,防止退款订单自动开始及给用户发送提示短信
redisUtil.delete(ReceiptRdeisEnum.ORDER_NO.getValue() + sOrder.getOrderNo());
redisUtil.delete(ReceiptRdeisEnum.ORDER_NO_KEY.getValue() + sOrder.getOrderNo());
//修改订单退款状态,退款成功
sOrder.setStatus(OrderStatusEnum.CANCEL.getCode());
sOrder.setRefundStatus(RefundStatusEnum.REFUNDED.getCode());
......@@ -1139,9 +1141,8 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
throw new BaseException("订单更新失败");
}
}
//判断房间是否是脏房,脏房新增保洁订单
SRoomVo sRoomVo = roomService.selectSRoomById(sOrder.getRoomId());
if (sRoomVo.getIsDirtyRoom().equals(YesNoEnum.yes.getIndex())) {
//判断订单状态
if (sOrder.getStatus().equals(OrderStatusEnum.INUSE.getCode()) | sOrder.getStatus().equals(OrderStatusEnum.USED.getCode())) {
//新增保洁任务
cleanRecordsService.addSCleanRecords(sOrder.getStoreId(), sOrder.getRoomId());
}
......
......@@ -15,7 +15,6 @@
<result property="info" column="info" />
<result property="status" column="status" />
<result property="price" column="price" />
<result property="isDirtyRoom" column="is_dirty_room"/>
<result property="doorLockCode" column="door_lock_code" />
<result property="electricControlCode" column="electric_control_code" />
<result property="password" column="password" />
......@@ -40,7 +39,6 @@
info,
status,
price,
is_dirty_room,
door_lock_code,
electric_control_code,
password,
......@@ -66,7 +64,6 @@
<if test="info != null and info != ''"> and info = #{info}</if>
<if test="status != null and status != '' or status ==0">and status = #{status}</if>
<if test="price != null "> and price = #{price}</if>
<if test="isDirtyRoom != null ">and is_dirty_room = #{isDirtyRoom}</if>
<if test="doorLockCode != null and doorLockCode != ''"> and door_lock_code = #{doorLockCode}</if>
<if test="electricControlCode != null and electricControlCode != ''"> and electric_control_code = #{electricControlCode}</if>
<if test="password != null and password != ''"> and password = #{password}</if>
......@@ -97,7 +94,6 @@
<if test="info != null">info,</if>
<if test="status != null">status,</if>
<if test="price != null">price,</if>
<if test="isDirtyRoom != null">is_dirty_room,</if>
<if test="doorLockCode != null">door_lock_code,</if>
<if test="electricControlCode != null">electric_control_code,</if>
<if test="password != null">password,</if>
......@@ -120,7 +116,6 @@
<if test="info != null">#{info},</if>
<if test="status != null">#{status},</if>
<if test="price != null">#{price},</if>
<if test="isDirtyRoom != null">#{isDirtyRoom},</if>
<if test="doorLockCode != null">#{doorLockCode},</if>
<if test="electricControlCode != null">#{electricControlCode},</if>
<if test="password != null">#{password},</if>
......@@ -147,7 +142,6 @@
<if test="info != null">info = #{info},</if>
<if test="status != null">status = #{status},</if>
<if test="price != null">price = #{price},</if>
<if test="isDirtyRoom != null">is_dirty_room = #{isDirtyRoom},</if>
<if test="doorLockCode != null">door_lock_code = #{doorLockCode},</if>
<if test="electricControlCode != null">electric_control_code = #{electricControlCode},</if>
<if test="password != null">password = #{password},</if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment