库管员绑定删除
This commit is contained in:
parent
699c505ed8
commit
5025fd65f9
|
|
@ -72,6 +72,18 @@ public class TypeKeeperController extends BaseController {
|
||||||
return success(typeKeeperService.selectTypeKeeperByID(ID));
|
return success(typeKeeperService.selectTypeKeeperByID(ID));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增库管员配置
|
||||||
|
*/
|
||||||
|
// @ApiOperation(value = "新增库管员配置")
|
||||||
|
// @PreventRepeatSubmit
|
||||||
|
// @RequiresPermissions("ma:keeper:add")
|
||||||
|
// @SysLog(title = "库管员配置", businessType = OperaType.INSERT, module = "物资管理->新增库管员配置")
|
||||||
|
// @PostMapping
|
||||||
|
// public AjaxResult add(@RequestBody TypeKeeper typeKeeper) {
|
||||||
|
// return toAjax(typeKeeperService.insertTypeKeeper(typeKeeper));
|
||||||
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增库管员配置
|
* 新增库管员配置
|
||||||
*/
|
*/
|
||||||
|
|
@ -80,8 +92,8 @@ public class TypeKeeperController extends BaseController {
|
||||||
@RequiresPermissions("ma:keeper:add")
|
@RequiresPermissions("ma:keeper:add")
|
||||||
@SysLog(title = "库管员配置", businessType = OperaType.INSERT, module = "物资管理->新增库管员配置")
|
@SysLog(title = "库管员配置", businessType = OperaType.INSERT, module = "物资管理->新增库管员配置")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody TypeKeeper typeKeeper) {
|
public AjaxResult add(@RequestBody List<TypeKeeper> typeKeepers) {
|
||||||
return toAjax(typeKeeperService.insertTypeKeeper(typeKeeper));
|
return toAjax(typeKeeperService.insertTypeKeeper(typeKeepers));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -112,13 +124,23 @@ public class TypeKeeperController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 删除单个库管员配置
|
* 删除单个库管员配置
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "删除单个库管员配置")
|
// @ApiOperation(value = "删除单个库管员配置")
|
||||||
|
// @PreventRepeatSubmit
|
||||||
|
// @RequiresPermissions("ma:keeper:remove")
|
||||||
|
// @SysLog(title = "库管员配置", businessType = OperaType.DELETE, logType = 1,module = "物资管理->删除单个库管员配置")
|
||||||
|
// @DeleteMapping
|
||||||
|
// public AjaxResult remove(@RequestBody TypeKeeper typeKeeper)
|
||||||
|
// {
|
||||||
|
// return toAjax(typeKeeperService.deleteTypeKeeperByUserIdAndTypeId(typeKeeper));
|
||||||
|
// }
|
||||||
|
|
||||||
|
@ApiOperation(value = "删除库管员配置")
|
||||||
@PreventRepeatSubmit
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("ma:keeper:remove")
|
@RequiresPermissions("ma:keeper:remove")
|
||||||
@SysLog(title = "库管员配置", businessType = OperaType.DELETE, logType = 1,module = "物资管理->删除单个库管员配置")
|
@SysLog(title = "库管员配置", businessType = OperaType.DELETE, logType = 1,module = "物资管理->删除单个库管员配置")
|
||||||
@DeleteMapping
|
@DeleteMapping
|
||||||
public AjaxResult remove(@RequestBody TypeKeeper typeKeeper)
|
public AjaxResult remove(@RequestBody List<TypeKeeper> typeKeepers)
|
||||||
{
|
{
|
||||||
return toAjax(typeKeeperService.deleteTypeKeeperByUserIdAndTypeId(typeKeeper));
|
return toAjax(typeKeeperService.deleteTypeKeeperByUserIdAndTypeId(typeKeepers));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -38,10 +38,10 @@ public interface TypeKeeperMapper {
|
||||||
/**
|
/**
|
||||||
* 新增库管员配置
|
* 新增库管员配置
|
||||||
*
|
*
|
||||||
* @param typeKeeper 库管员配置
|
* @param typeKeepers 库管员配置
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
int insertTypeKeeper(TypeKeeper typeKeeper);
|
int insertTypeKeeper(List<TypeKeeper> typeKeepers);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改库管员配置
|
* 修改库管员配置
|
||||||
|
|
@ -59,11 +59,6 @@ public interface TypeKeeperMapper {
|
||||||
*/
|
*/
|
||||||
int deleteTypeKeeperByID(Long ID);
|
int deleteTypeKeeperByID(Long ID);
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据用户ID和物资类型ID删除库管员配置
|
|
||||||
*/
|
|
||||||
int deleteTypeKeeperByUserIdAndTypeId(TypeKeeper typeKeeper);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除库管员配置
|
* 批量删除库管员配置
|
||||||
*
|
*
|
||||||
|
|
@ -71,4 +66,9 @@ public interface TypeKeeperMapper {
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
int deleteTypeKeeperByIDs(Long[] IDs);
|
int deleteTypeKeeperByIDs(Long[] IDs);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户ID和物资类型ID删除库管员配置
|
||||||
|
*/
|
||||||
|
int deleteTypeKeeperByUserIdAndTypeId(List<TypeKeeper> typeKeepers);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,10 +31,10 @@ public interface ITypeKeeperService {
|
||||||
/**
|
/**
|
||||||
* 新增库管员配置
|
* 新增库管员配置
|
||||||
*
|
*
|
||||||
* @param typeKeeper 库管员配置
|
* @param typeKeepers 库管员配置
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
int insertTypeKeeper(TypeKeeper typeKeeper);
|
int insertTypeKeeper(List<TypeKeeper> typeKeepers);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改库管员配置
|
* 修改库管员配置
|
||||||
|
|
@ -63,8 +63,8 @@ public interface ITypeKeeperService {
|
||||||
/**
|
/**
|
||||||
* 根据用户ID和物资类型ID删除库管员配置信息
|
* 根据用户ID和物资类型ID删除库管员配置信息
|
||||||
*
|
*
|
||||||
* @param typeKeeper
|
* @param typeKeepers
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int deleteTypeKeeperByUserIdAndTypeId(TypeKeeper typeKeeper);
|
int deleteTypeKeeperByUserIdAndTypeId(List<TypeKeeper> typeKeepers);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,13 +54,13 @@ public class TypeKeeperServiceImpl implements ITypeKeeperService {
|
||||||
/**
|
/**
|
||||||
* 新增库管员配置
|
* 新增库管员配置
|
||||||
*
|
*
|
||||||
* @param typeKeeper 库管员配置
|
* @param typeKeepers 库管员配置
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertTypeKeeper(TypeKeeper typeKeeper) {
|
public int insertTypeKeeper(List<TypeKeeper> typeKeepers) {
|
||||||
typeKeeper.setCreateTime(DateUtils.getNowDate());
|
typeKeepers.forEach(typeKeeper -> typeKeeper.setCreateTime(DateUtils.getNowDate()));
|
||||||
return typeKeeperMapper.insertTypeKeeper(typeKeeper);
|
return typeKeeperMapper.insertTypeKeeper(typeKeepers);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -101,11 +101,11 @@ public class TypeKeeperServiceImpl implements ITypeKeeperService {
|
||||||
/**
|
/**
|
||||||
* 根据用户ID和物资类型ID删除库管员配置信息
|
* 根据用户ID和物资类型ID删除库管员配置信息
|
||||||
*
|
*
|
||||||
* @param typeKeeper
|
* @param typeKeepers
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int deleteTypeKeeperByUserIdAndTypeId(TypeKeeper typeKeeper) {
|
public int deleteTypeKeeperByUserIdAndTypeId(List<TypeKeeper> typeKeepers) {
|
||||||
return typeKeeperMapper.deleteTypeKeeperByUserIdAndTypeId(typeKeeper);
|
return typeKeeperMapper.deleteTypeKeeperByUserIdAndTypeId(typeKeepers);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,21 +37,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertTypeKeeper" parameterType="com.bonus.material.ma.domain.TypeKeeper" useGeneratedKeys="true" keyProperty="ID">
|
<insert id="insertTypeKeeper" parameterType="com.bonus.material.ma.domain.TypeKeeper" useGeneratedKeys="true" keyProperty="ID">
|
||||||
insert into ma_type_keeper
|
insert into ma_type_keeper (type_id,user_id,create_time,update_time,company_id)
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
values
|
||||||
<if test="typeId != null">type_id,</if>
|
<foreach collection="typeKeepers" item="item" separator=",">
|
||||||
<if test="userId != null">user_id,</if>
|
(
|
||||||
<if test="createTime != null">create_time,</if>
|
#{item.typeId},
|
||||||
<if test="updateTime != null">update_time,</if>
|
#{item.userId},
|
||||||
<if test="companyId != null">company_id,</if>
|
#{item.createTime},
|
||||||
</trim>
|
#{item.updateTime},
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
#{item.companyId}
|
||||||
<if test="typeId != null">#{typeId},</if>
|
)
|
||||||
<if test="userId != null">#{userId},</if>
|
</foreach>
|
||||||
<if test="createTime != null">#{createTime},</if>
|
|
||||||
<if test="updateTime != null">#{updateTime},</if>
|
|
||||||
<if test="companyId != null">#{companyId},</if>
|
|
||||||
</trim>
|
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateTypeKeeper" parameterType="com.bonus.material.ma.domain.TypeKeeper">
|
<update id="updateTypeKeeper" parameterType="com.bonus.material.ma.domain.TypeKeeper">
|
||||||
|
|
@ -90,6 +86,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<delete id="deleteTypeKeeperByUserIdAndTypeId">
|
<delete id="deleteTypeKeeperByUserIdAndTypeId">
|
||||||
delete from ma_type_keeper where user_id = #{userId} and type_id = #{typeId}
|
delete from ma_type_keeper where
|
||||||
|
type_id in
|
||||||
|
<foreach collection="typeKeepers" item="item" separator=",">
|
||||||
|
(
|
||||||
|
#{item.typeId}
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
and
|
||||||
|
user_id in
|
||||||
|
<foreach collection="typeKeepers" item="item" separator=",">
|
||||||
|
(
|
||||||
|
#{item.userId}
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue