Commit c437a914 by 吕明尚

修改批量分配保洁,管理入参

parent b2113574
...@@ -26,6 +26,7 @@ import share.system.domain.SStore; ...@@ -26,6 +26,7 @@ import share.system.domain.SStore;
import share.system.domain.SStoreConsumer; import share.system.domain.SStoreConsumer;
import share.system.domain.SysUserRole; import share.system.domain.SysUserRole;
import share.system.domain.vo.SConsumerVo; import share.system.domain.vo.SConsumerVo;
import share.system.domain.vo.SStoreConsumerVo;
import share.system.service.ISStoreService; import share.system.service.ISStoreService;
import share.common.utils.poi.ExcelUtil; import share.common.utils.poi.ExcelUtil;
import share.common.core.page.TableDataInfo; import share.common.core.page.TableDataInfo;
...@@ -175,9 +176,9 @@ public class SStoreController extends BaseController ...@@ -175,9 +176,9 @@ public class SStoreController extends BaseController
@PreAuthorize("@ss.hasPermi('system:store:edit')") @PreAuthorize("@ss.hasPermi('system:store:edit')")
@Log(title = "门店", businessType = BusinessType.GRANT) @Log(title = "门店", businessType = BusinessType.GRANT)
@PutMapping("/consumer/cancelAll") @PutMapping("/consumer/cancelAll")
public AjaxResult cancelAuthUserAll(Long storeId, Long[] consumerIds) public AjaxResult cancelAuthUserAll(SStoreConsumerVo storeConsumer)
{ {
return toAjax(sStoreService.deleteStoreConsumers(storeId, consumerIds)); return toAjax(sStoreService.deleteStoreConsumers(storeConsumer));
} }
/** /**
...@@ -186,9 +187,9 @@ public class SStoreController extends BaseController ...@@ -186,9 +187,9 @@ public class SStoreController extends BaseController
@PreAuthorize("@ss.hasPermi('system:store:edit')") @PreAuthorize("@ss.hasPermi('system:store:edit')")
@Log(title = "门店", businessType = BusinessType.GRANT) @Log(title = "门店", businessType = BusinessType.GRANT)
@PutMapping("/consumer/selectAll") @PutMapping("/consumer/selectAll")
public AjaxResult selectAuthUserAll(Long storeId, Long[] consumerIds, Integer position) public AjaxResult selectAuthUserAll(SStoreConsumerVo storeConsumer)
{ {
return toAjax(sStoreService.insertStoreConsumers(storeId, consumerIds, position)); return toAjax(sStoreService.insertStoreConsumers(storeConsumer));
} }
......
...@@ -81,6 +81,12 @@ public class SRoom extends BaseEntity ...@@ -81,6 +81,12 @@ public class SRoom extends BaseEntity
private String params2; private String params2;
/** /**
* 是否脏房
*/
@Excel(name = "是否脏房(0:否,1:是)")
private Integer isDirtyRoom;
/**
* 套餐ID * 套餐ID
*/ */
@TableField(exist = false) @TableField(exist = false)
......
package share.system.domain.vo;
import lombok.Data;
import share.system.domain.SStoreConsumer;
@Data
public class SStoreConsumerVo {
/**
* 门店ID
*/
private Long storeId;
/**
* 保洁员ID
*/
private Long consumerId;
private Integer position;
private Long[] consumerIds;
}
...@@ -31,7 +31,7 @@ public interface SStoreConsumerMapper extends BaseMapper<SStoreConsumer> { ...@@ -31,7 +31,7 @@ public interface SStoreConsumerMapper extends BaseMapper<SStoreConsumer> {
public int deleteInfo(SStoreConsumer storeConsumer); public int deleteInfo(SStoreConsumer storeConsumer);
public int deleteInfos(@Param("storeId") Long storeId, @Param("consumerIds") Long[] consumerIds); public int deleteInfos(@Param("storeId") Long storeId, @Param("consumerIds") Long[] consumerIds, @Param("position") Integer position);
List<Long> selectByConsumerId(@Param("consumerId") Long consumerId, @Param("position") Integer position); List<Long> selectByConsumerId(@Param("consumerId") Long consumerId, @Param("position") Integer position);
......
...@@ -5,6 +5,7 @@ import java.util.Map; ...@@ -5,6 +5,7 @@ import java.util.Map;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import share.system.domain.SStore; import share.system.domain.SStore;
import share.system.domain.vo.SStoreConsumerVo;
import share.system.domain.vo.SStoreVo; import share.system.domain.vo.SStoreVo;
import share.system.request.SStoreRequest; import share.system.request.SStoreRequest;
import share.system.domain.SStoreConsumer; import share.system.domain.SStoreConsumer;
...@@ -90,9 +91,9 @@ public interface ISStoreService extends IService<SStore> ...@@ -90,9 +91,9 @@ public interface ISStoreService extends IService<SStore>
int deleteStoreConsumer(SStoreConsumer storeConsumer); int deleteStoreConsumer(SStoreConsumer storeConsumer);
int deleteStoreConsumers(Long storeId, Long[] consumerIds); int deleteStoreConsumers(SStoreConsumerVo storeConsumer);
int insertStoreConsumers(Long storeId, Long[] consumerIds, Integer position); int insertStoreConsumers(SStoreConsumerVo storeConsumer);
List<SStore> listVoByCleaner(); List<SStore> listVoByCleaner();
......
...@@ -23,6 +23,7 @@ import org.springframework.stereotype.Service; ...@@ -23,6 +23,7 @@ import org.springframework.stereotype.Service;
import share.system.domain.*; import share.system.domain.*;
import share.system.domain.vo.FrontTokenComponent; import share.system.domain.vo.FrontTokenComponent;
import share.system.domain.vo.SRoomVo; import share.system.domain.vo.SRoomVo;
import share.system.domain.vo.SStoreConsumerVo;
import share.system.domain.vo.SStoreVo; import share.system.domain.vo.SStoreVo;
import share.system.mapper.*; import share.system.mapper.*;
import share.system.request.SStoreRequest; import share.system.request.SStoreRequest;
...@@ -346,19 +347,19 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme ...@@ -346,19 +347,19 @@ public class SStoreServiceImpl extends ServiceImpl<SStoreMapper, SStore> impleme
} }
@Override @Override
public int deleteStoreConsumers(Long storeId, Long[] consumerIds) { public int deleteStoreConsumers(SStoreConsumerVo storeConsumer) {
return storeConsumerMapper.deleteInfos(storeId, consumerIds); return storeConsumerMapper.deleteInfos(storeConsumer.getStoreId(), storeConsumer.getConsumerIds(), storeConsumer.getPosition());
} }
@Override @Override
public int insertStoreConsumers(Long storeId, Long[] consumerIds, Integer position) { public int insertStoreConsumers(SStoreConsumerVo storeConsumer) {
// 新增保洁与门店关系 // 新增保洁与门店关系
List<SStoreConsumer> list = new ArrayList<SStoreConsumer>(); List<SStoreConsumer> list = new ArrayList<SStoreConsumer>();
for (Long consumerId : consumerIds) { for (Long consumerId : storeConsumer.getConsumerIds()) {
SStoreConsumer sc = new SStoreConsumer(); SStoreConsumer sc = new SStoreConsumer();
sc.setStoreId(storeId); sc.setStoreId(storeConsumer.getStoreId());
sc.setConsumerId(consumerId); sc.setConsumerId(consumerId);
sc.setPosition(position); sc.setPosition(storeConsumer.getPosition());
list.add(sc); list.add(sc);
} }
return storeConsumerMapper.batchSStoreConsumer(list); return storeConsumerMapper.batchSStoreConsumer(list);
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
<result property="info" column="info" /> <result property="info" column="info" />
<result property="status" column="status" /> <result property="status" column="status" />
<result property="price" column="price" /> <result property="price" column="price" />
<result property="isDirtyRoom" column="is_dirty_room"/>
<result property="doorLockCode" column="door_lock_code" /> <result property="doorLockCode" column="door_lock_code" />
<result property="electricControlCode" column="electric_control_code" /> <result property="electricControlCode" column="electric_control_code" />
<result property="password" column="password" /> <result property="password" column="password" />
...@@ -27,7 +28,27 @@ ...@@ -27,7 +28,27 @@
</resultMap> </resultMap>
<sql id="selectSRoomVo"> <sql id="selectSRoomVo">
select id, store_id, name, room_type, images, facilities, info, status, price, door_lock_code, electric_control_code, password, params1, params2, create_by, create_time, update_by, update_time, remark from s_room select id,
store_id,
name,
room_type,
images,
facilities,
info,
status,
price,
is_dirty_room,
door_lock_code,
electric_control_code,
password,
params1,
params2,
create_by,
create_time,
update_by,
update_time,
remark
from s_room
</sql> </sql>
<select id="selectSRoomList" parameterType="SRoom" resultMap="SRoomResult"> <select id="selectSRoomList" parameterType="SRoom" resultMap="SRoomResult">
...@@ -41,6 +62,7 @@ ...@@ -41,6 +62,7 @@
<if test="info != null and info != ''"> and info = #{info}</if> <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="status != null and status != '' or status ==0">and status = #{status}</if>
<if test="price != null "> and price = #{price}</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="doorLockCode != null and doorLockCode != ''"> and door_lock_code = #{doorLockCode}</if>
<if test="electricControlCode != null and electricControlCode != ''"> and electric_control_code = #{electricControlCode}</if> <if test="electricControlCode != null and electricControlCode != ''"> and electric_control_code = #{electricControlCode}</if>
<if test="password != null and password != ''"> and password = #{password}</if> <if test="password != null and password != ''"> and password = #{password}</if>
...@@ -65,6 +87,7 @@ ...@@ -65,6 +87,7 @@
<if test="info != null">info,</if> <if test="info != null">info,</if>
<if test="status != null">status,</if> <if test="status != null">status,</if>
<if test="price != null">price,</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="doorLockCode != null">door_lock_code,</if>
<if test="electricControlCode != null">electric_control_code,</if> <if test="electricControlCode != null">electric_control_code,</if>
<if test="password != null">password,</if> <if test="password != null">password,</if>
...@@ -85,6 +108,7 @@ ...@@ -85,6 +108,7 @@
<if test="info != null">#{info},</if> <if test="info != null">#{info},</if>
<if test="status != null">#{status},</if> <if test="status != null">#{status},</if>
<if test="price != null">#{price},</if> <if test="price != null">#{price},</if>
<if test="isDirtyRoom != null">#{isDirtyRoom},</if>
<if test="doorLockCode != null">#{doorLockCode},</if> <if test="doorLockCode != null">#{doorLockCode},</if>
<if test="electricControlCode != null">#{electricControlCode},</if> <if test="electricControlCode != null">#{electricControlCode},</if>
<if test="password != null">#{password},</if> <if test="password != null">#{password},</if>
...@@ -109,6 +133,7 @@ ...@@ -109,6 +133,7 @@
<if test="info != null">info = #{info},</if> <if test="info != null">info = #{info},</if>
<if test="status != null">status = #{status},</if> <if test="status != null">status = #{status},</if>
<if test="price != null">price = #{price},</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="doorLockCode != null">door_lock_code = #{doorLockCode},</if>
<if test="electricControlCode != null">electric_control_code = #{electricControlCode},</if> <if test="electricControlCode != null">electric_control_code = #{electricControlCode},</if>
<if test="password != null">password = #{password},</if> <if test="password != null">password = #{password},</if>
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</delete> </delete>
<delete id="deleteInfos"> <delete id="deleteInfos">
delete from s_store_consumer where store_id=#{storeId} and position = '1' and consumer_id in delete from s_store_consumer where store_id=#{storeId} and position = #{position} and consumer_id in
<foreach collection="consumerIds" item="consumerId" open="(" separator="," close=")"> <foreach collection="consumerIds" item="consumerId" open="(" separator="," close=")">
#{consumerId} #{consumerId}
</foreach> </foreach>
......
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