解决选入用户,移除用户系统繁忙问题

master
anthonywj 2 years ago
parent ff43204301
commit a4838a4459

@ -612,7 +612,7 @@ public class InvWarehouseController extends BaseController {
@AuthRuleAnnotation("") @AuthRuleAnnotation("")
@PostMapping("/warehouse/inout/delWarehouseUser") @PostMapping("/warehouse/inout/delWarehouseUser")
public BaseResponse deleteWarehouseUser(Integer id) { public BaseResponse deleteWarehouseUser(Long id) {
if (null == id) if (null == id)
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
WarehouseUserEntity warehouseUserEntity = warehouseUserService.selectById(id); WarehouseUserEntity warehouseUserEntity = warehouseUserService.selectById(id);

@ -10,8 +10,7 @@ import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@Mapper @Mapper
public interface WarehouseUserDao extends BaseMapperPlus<WarehouseUserDao,WarehouseUserEntity,WarehouseUserEntity> { public interface WarehouseUserDao extends BaseMapperPlus<WarehouseUserDao, WarehouseUserEntity, WarehouseUserEntity> {
int deleteByPrimaryKey(Integer id);
int deleteByCodeAndId(@Param("id") Long id, @Param("code") String code); int deleteByCodeAndId(@Param("id") Long id, @Param("code") String code);
@ -35,13 +34,13 @@ public interface WarehouseUserDao extends BaseMapperPlus<WarehouseUserDao,Wareho
int updateBatchSelective(List<WarehouseUserEntity> list); int updateBatchSelective(List<WarehouseUserEntity> list);
int batchInsert(@Param("list") List<WarehouseUserEntity> list);
List<WarehouseUserEntity> selectListByCode(@Param("code") String code); List<WarehouseUserEntity> selectListByCode(@Param("code") String code);
List<WarehouseUserEntity> selectListkey(FilterInvLinkDataRequest filterInvLinkDataRequest); List<WarehouseUserEntity> selectListkey(FilterInvLinkDataRequest filterInvLinkDataRequest);
List<WarehouseUserEntity> selectNotSelectUserid(@Param("userIds")List<Long> userIds ); List<WarehouseUserEntity> selectNotSelectUserid(@Param("userIds") List<Long> userIds);
List<String> selectCodeByUser(@Param("userId") String userId); List<String> selectCodeByUser(@Param("userId") String userId);
void deleteByCode(@Param("code") String code); void deleteByCode(@Param("code") String code);

@ -6,7 +6,7 @@ import lombok.Data;
@Data @Data
public class FilterInvUserRequest extends ListPageRequest { public class FilterInvUserRequest extends ListPageRequest {
private Integer id; private Long id;
private String code; private String code;
private Long userid; private Long userid;
private String username; private String username;

@ -18,7 +18,7 @@ public interface WarehouseUserService extends IService<WarehouseUserEntity> {
* @return * @return
*/ */
WarehouseUserEntity selectById(Integer id); WarehouseUserEntity selectById(Long id);
List<WarehouseUserEntity> getListByCode(String code); List<WarehouseUserEntity> getListByCode(String code);
@ -48,7 +48,7 @@ public interface WarehouseUserService extends IService<WarehouseUserEntity> {
* *
* @param id * @param id
*/ */
void deleteWarehouseUser(Integer id); void deleteWarehouseUser(Long id);
void deleteByCodeAndId(Long id, String code); void deleteByCodeAndId(Long id, String code);
@ -61,7 +61,8 @@ public interface WarehouseUserService extends IService<WarehouseUserEntity> {
* @return * @return
*/ */
List<WarehouseUserEntity> getWarehouseUserList(FilterInvLinkDataRequest filterInvLinkDataRequest); List<WarehouseUserEntity> getWarehouseUserList(FilterInvLinkDataRequest filterInvLinkDataRequest);
List<WarehouseUserEntity> selectNotSelectUserid(@Param("userIds")List<Long> userIds );
List<WarehouseUserEntity> selectNotSelectUserid(@Param("userIds") List<Long> userIds);
/** /**
* *
@ -70,5 +71,6 @@ public interface WarehouseUserService extends IService<WarehouseUserEntity> {
* @return * @return
*/ */
Integer countUserBySubInvCode(String subInvCode); Integer countUserBySubInvCode(String subInvCode);
boolean insert(WarehouseUserEntity warehouseUserEntity); boolean insert(WarehouseUserEntity warehouseUserEntity);
} }

@ -1,6 +1,7 @@
package com.glxp.api.service.auth.impl; package com.glxp.api.service.auth.impl;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.glxp.api.dao.auth.WarehouseUserDao; import com.glxp.api.dao.auth.WarehouseUserDao;
@ -28,7 +29,7 @@ public class WarehouseUserServiceImpl extends ServiceImpl<WarehouseUserDao, Ware
private WarehouseUserDao warehouseUserDao; private WarehouseUserDao warehouseUserDao;
@Override @Override
public WarehouseUserEntity selectById(Integer id) { public WarehouseUserEntity selectById(Long id) {
FilterInvUserRequest filterInvUserRequest = new FilterInvUserRequest(); FilterInvUserRequest filterInvUserRequest = new FilterInvUserRequest();
filterInvUserRequest.setId(id); filterInvUserRequest.setId(id);
List<WarehouseUserEntity> warehouseUserEntities = warehouseUserDao.filterList(filterInvUserRequest); List<WarehouseUserEntity> warehouseUserEntities = warehouseUserDao.filterList(filterInvUserRequest);
@ -75,9 +76,10 @@ public class WarehouseUserServiceImpl extends ServiceImpl<WarehouseUserDao, Ware
warehouseUserEntity.setCode(code); warehouseUserEntity.setCode(code);
warehouseUserEntity.setUsername(user.getUserName()); warehouseUserEntity.setUsername(user.getUserName());
warehouseUserEntity.setUserid(user.getId()); warehouseUserEntity.setUserid(user.getId());
warehouseUserEntity.setId(IdUtil.getSnowflakeNextId());
warehouseUserEntities.add(warehouseUserEntity); warehouseUserEntities.add(warehouseUserEntity);
}); });
warehouseUserDao.batchInsert(warehouseUserEntities); warehouseUserDao.insertBatch(warehouseUserEntities);
} }
} }
@ -100,9 +102,9 @@ public class WarehouseUserServiceImpl extends ServiceImpl<WarehouseUserDao, Ware
} }
@Override @Override
public void deleteWarehouseUser(Integer id) { public void deleteWarehouseUser(Long id) {
if (null != id) { if (null != id) {
warehouseUserDao.deleteByPrimaryKey(id); warehouseUserDao.deleteById(id);
} }
} }

@ -38,12 +38,6 @@
</if> </if>
</where> </where>
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--@mbg.generated-->
delete
from auth_warehouse_user
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByCodeAndId"> <delete id="deleteByCodeAndId">
<!--@mbg.generated--> <!--@mbg.generated-->
delete delete
@ -101,7 +95,7 @@
</if> </if>
</set> </set>
isDirector = #{isDirector} isDirector = #{isDirector}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
<update id="updateByPrimaryKey" parameterType="com.glxp.api.entity.auth.WarehouseUserEntity"> <update id="updateByPrimaryKey" parameterType="com.glxp.api.entity.auth.WarehouseUserEntity">
<!--@mbg.generated--> <!--@mbg.generated-->
@ -167,16 +161,6 @@
#{item.id,jdbcType=INTEGER} #{item.id,jdbcType=INTEGER}
</foreach> </foreach>
</update> </update>
<insert id="batchInsert" keyColumn="id" keyProperty="id" parameterType="map" useGeneratedKeys="true">
<!--@mbg.generated-->
insert into auth_warehouse_user
(code, userId, userName, isDirector)
values
<foreach collection="list" item="item" separator=",">
(#{item.code,jdbcType=VARCHAR}, #{item.userid,jdbcType=BIGINT}, #{item.username,jdbcType=VARCHAR},
#{item.isDirector})
</foreach>
</insert>
<insert id="insertOrUpdateEntity" keyColumn="id" keyProperty="id" <insert id="insertOrUpdateEntity" keyColumn="id" keyProperty="id"
parameterType="com.glxp.api.entity.auth.WarehouseUserEntity" useGeneratedKeys="true"> parameterType="com.glxp.api.entity.auth.WarehouseUserEntity" useGeneratedKeys="true">
<!--@mbg.generated--> <!--@mbg.generated-->
@ -205,9 +189,9 @@
<if test="id != null"> <if test="id != null">
id = #{id,jdbcType=INTEGER}, id = #{id,jdbcType=INTEGER},
</if> </if>
code = #{code,jdbcType=VARCHAR}, code = #{code,jdbcType=VARCHAR},
userId = #{userid,jdbcType=BIGINT}, userId = #{userid,jdbcType=BIGINT},
userName = #{username,jdbcType=VARCHAR}, userName = #{username,jdbcType=VARCHAR},
</trim> </trim>
</insert> </insert>
<insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id" <insert id="insertOrUpdateSelective" keyColumn="id" keyProperty="id"
@ -263,7 +247,7 @@
<select id="selectListByCode" resultMap="BaseResultMap"> <select id="selectListByCode" resultMap="BaseResultMap">
select auth_warehouse_user.*, auth_user.employeeName select auth_warehouse_user.*, auth_user.employeeName
from auth_warehouse_user from auth_warehouse_user
inner join auth_user on auth_user.id = auth_warehouse_user.userId inner join auth_user on auth_user.id = auth_warehouse_user.userId
where code = #{code} where code = #{code}
</select> </select>
@ -271,7 +255,7 @@
parameterType="com.glxp.api.req.auth.FilterInvLinkDataRequest"> parameterType="com.glxp.api.req.auth.FilterInvLinkDataRequest">
select auth_warehouse_user.*, auth_user.employeeName select auth_warehouse_user.*, auth_user.employeeName
from auth_warehouse_user from auth_warehouse_user
inner join auth_user on auth_user.id = auth_warehouse_user.userId inner join auth_user on auth_user.id = auth_warehouse_user.userId
<where> <where>
<if test="code != '' and code != null"> <if test="code != '' and code != null">
AND code = #{code} AND code = #{code}

@ -382,3 +382,8 @@ CALL Pro_Temp_ColumnWork('thr_dept', 'id', 'bigint', 2);
CALL Pro_Temp_ColumnWork('thr_inv_warehouse', 'id', 'bigint', 2); CALL Pro_Temp_ColumnWork('thr_inv_warehouse', 'id', 'bigint', 2);
CALL Pro_Temp_ColumnWork('thr_products', 'id', 'bigint', 2); CALL Pro_Temp_ColumnWork('thr_products', 'id', 'bigint', 2);
CALL Pro_Temp_ColumnWork('thr_corp', 'id', 'bigint', 2); CALL Pro_Temp_ColumnWork('thr_corp', 'id', 'bigint', 2);
CALL Pro_Temp_ColumnWork('auth_dept_user', 'userId', 'bigint', 2);
CALL Pro_Temp_ColumnWork('auth_dept_user', 'deptId', 'bigint', 2);

Loading…
Cancel
Save