diff --git a/src/main/java/com/glxp/api/controller/auth/InvWarehouseController.java b/src/main/java/com/glxp/api/controller/auth/InvWarehouseController.java index 550c12ff..03483395 100644 --- a/src/main/java/com/glxp/api/controller/auth/InvWarehouseController.java +++ b/src/main/java/com/glxp/api/controller/auth/InvWarehouseController.java @@ -583,7 +583,7 @@ public class InvWarehouseController extends BaseController { @AuthRuleAnnotation("") @PostMapping("/warehouse/inout/delWarehouseUser") @Log(title = "用户管理", businessType = BusinessType.DELETE) - public BaseResponse deleteWarehouseUser(Integer id) { + public BaseResponse deleteWarehouseUser(Long id) { if (null == id) return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); WarehouseUserEntity warehouseUserEntity = warehouseUserService.selectById(id); diff --git a/src/main/java/com/glxp/api/controller/auth/SysUserController.java b/src/main/java/com/glxp/api/controller/auth/SysUserController.java index f064d3f4..bb3af2bf 100644 --- a/src/main/java/com/glxp/api/controller/auth/SysUserController.java +++ b/src/main/java/com/glxp/api/controller/auth/SysUserController.java @@ -228,6 +228,7 @@ public class SysUserController extends BaseController { DeptUserEntity deptUserEntity = new DeptUserEntity(); deptUserEntity.setUserId(authAdmin.getId()); deptUserEntity.setDeptId(authUserSaveRequest.getDepts().get(i)); + deptUserEntity.setUpdateTime(new Date()); list.add(deptUserEntity); } deptUserService.insertBatch(list); @@ -327,6 +328,7 @@ public class SysUserController extends BaseController { DeptUserEntity deptUserEntity = new DeptUserEntity(); deptUserEntity.setUserId(authUserSaveRequest.getId()); deptUserEntity.setDeptId(authUserSaveRequest.getDepts().get(i)); + deptUserEntity.setUpdateTime(new Date()); list.add(deptUserEntity); } deptUserService.insertBatch(list); diff --git a/src/main/java/com/glxp/api/controller/basic/BasicBusTypeChangeController.java b/src/main/java/com/glxp/api/controller/basic/BasicBusTypeChangeController.java index dcdd1952..942b217f 100644 --- a/src/main/java/com/glxp/api/controller/basic/BasicBusTypeChangeController.java +++ b/src/main/java/com/glxp/api/controller/basic/BasicBusTypeChangeController.java @@ -1,5 +1,6 @@ package com.glxp.api.controller.basic; +import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.StrUtil; import com.github.pagehelper.PageInfo; import com.glxp.api.annotation.Log; @@ -70,6 +71,7 @@ public class BasicBusTypeChangeController { return ResultVOUtils.error(ResultEnum.DATA_REPEAT, "重复添加"); } basicBusTypeChangeEntity.setUpdateTime(new Date()); + basicBusTypeChangeEntity.setId(IdUtil.getSnowflakeNextId()); basicBusTypeChangeService.insert(basicBusTypeChangeEntity); return ResultVOUtils.success("更新成功"); } diff --git a/src/main/java/com/glxp/api/controller/basic/BasicBusTypePreController.java b/src/main/java/com/glxp/api/controller/basic/BasicBusTypePreController.java index b9165de9..bc21f932 100644 --- a/src/main/java/com/glxp/api/controller/basic/BasicBusTypePreController.java +++ b/src/main/java/com/glxp/api/controller/basic/BasicBusTypePreController.java @@ -195,10 +195,10 @@ public class BasicBusTypePreController { } if (basicBusTypePreEntity != null) { //判断是否重复添加 - boolean result = basicBusTypePreService.verifyExists(basicBusTypePreEntity); - if (result) { + + BasicBusTypePreEntity exitEntity = basicBusTypePreService.findByOriginAction(basicBusTypePreEntity.getOriginAction()); + if (exitEntity != null) return ResultVOUtils.error(ResultEnum.DATA_REPEAT, "原单据类型已存在,不允许重复添加!"); - } if (StrUtil.isNotBlank(basicBusTypePreEntity.getDefaultInvCode())) { InvWarehouseEntity invWarehouse = invWarehouseService.findByInvSubByCode(basicBusTypePreEntity.getDefaultInvCode()); diff --git a/src/main/java/com/glxp/api/dao/auth/WarehouseBussinessTypeDao.java b/src/main/java/com/glxp/api/dao/auth/WarehouseBussinessTypeDao.java index c6fa891c..0222856d 100644 --- a/src/main/java/com/glxp/api/dao/auth/WarehouseBussinessTypeDao.java +++ b/src/main/java/com/glxp/api/dao/auth/WarehouseBussinessTypeDao.java @@ -11,9 +11,7 @@ import java.util.List; @Mapper public interface WarehouseBussinessTypeDao extends BaseMapperPlus { - WarehouseBussinessTypeEntity selectById(Integer id); - int deleteByPrimaryKey(Integer id); int insertSelective(WarehouseBussinessTypeEntity record); diff --git a/src/main/java/com/glxp/api/dao/auth/WarehouseUserDao.java b/src/main/java/com/glxp/api/dao/auth/WarehouseUserDao.java index 4fdb39b8..c096cba0 100644 --- a/src/main/java/com/glxp/api/dao/auth/WarehouseUserDao.java +++ b/src/main/java/com/glxp/api/dao/auth/WarehouseUserDao.java @@ -35,7 +35,6 @@ public interface WarehouseUserDao extends BaseMapperPlus list); - int batchInsert(@Param("list") List list); List selectListByCode(@Param("code") String code); diff --git a/src/main/java/com/glxp/api/req/auth/FilterInvUserRequest.java b/src/main/java/com/glxp/api/req/auth/FilterInvUserRequest.java index d231ad60..6fcb8d96 100644 --- a/src/main/java/com/glxp/api/req/auth/FilterInvUserRequest.java +++ b/src/main/java/com/glxp/api/req/auth/FilterInvUserRequest.java @@ -6,7 +6,7 @@ import lombok.Data; @Data public class FilterInvUserRequest extends ListPageRequest { - private Integer id; + private Long id; private String code; private Long userid; private String username; diff --git a/src/main/java/com/glxp/api/service/auth/WarehouseUserService.java b/src/main/java/com/glxp/api/service/auth/WarehouseUserService.java index 34c16733..7e216450 100644 --- a/src/main/java/com/glxp/api/service/auth/WarehouseUserService.java +++ b/src/main/java/com/glxp/api/service/auth/WarehouseUserService.java @@ -18,7 +18,7 @@ public interface WarehouseUserService { * @return */ - WarehouseUserEntity selectById(Integer id); + WarehouseUserEntity selectById(Long id); List getListByCode(String code); @@ -48,7 +48,7 @@ public interface WarehouseUserService { * * @param id */ - void deleteWarehouseUser(Integer id); + void deleteWarehouseUser(Long id); void deleteByCodeAndId(Long id, String code); @@ -61,7 +61,8 @@ public interface WarehouseUserService { * @return */ List getWarehouseUserList(FilterInvLinkDataRequest filterInvLinkDataRequest); - List selectNotSelectUserid(@Param("userIds")List userIds ); + + List selectNotSelectUserid(@Param("userIds") List userIds); /** * 根据分仓编码,统计用户数量 diff --git a/src/main/java/com/glxp/api/service/auth/impl/WarehouseBussinessTypeServiceImpl.java b/src/main/java/com/glxp/api/service/auth/impl/WarehouseBussinessTypeServiceImpl.java index 2a1624b4..d4b70b79 100644 --- a/src/main/java/com/glxp/api/service/auth/impl/WarehouseBussinessTypeServiceImpl.java +++ b/src/main/java/com/glxp/api/service/auth/impl/WarehouseBussinessTypeServiceImpl.java @@ -75,7 +75,7 @@ public class WarehouseBussinessTypeServiceImpl implements WarehouseBussinessType @Override public void deleteWarehouseByssuinessType(Integer id) { if (null != id) { - warehouseBussinessTypeDao.deleteByPrimaryKey(id); + warehouseBussinessTypeDao.deleteById(id); } } diff --git a/src/main/java/com/glxp/api/service/auth/impl/WarehouseUserServiceImpl.java b/src/main/java/com/glxp/api/service/auth/impl/WarehouseUserServiceImpl.java index c9d7559d..ac6c4387 100644 --- a/src/main/java/com/glxp/api/service/auth/impl/WarehouseUserServiceImpl.java +++ b/src/main/java/com/glxp/api/service/auth/impl/WarehouseUserServiceImpl.java @@ -1,6 +1,7 @@ package com.glxp.api.service.auth.impl; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.IdUtil; import com.github.pagehelper.PageHelper; import com.glxp.api.dao.auth.WarehouseUserDao; import com.glxp.api.entity.auth.AuthAdmin; @@ -27,7 +28,7 @@ public class WarehouseUserServiceImpl implements WarehouseUserService { private WarehouseUserDao warehouseUserDao; @Override - public WarehouseUserEntity selectById(Integer id) { + public WarehouseUserEntity selectById(Long id) { FilterInvUserRequest filterInvUserRequest = new FilterInvUserRequest(); filterInvUserRequest.setId(id); List warehouseUserEntities = warehouseUserDao.filterList(filterInvUserRequest); @@ -74,9 +75,10 @@ public class WarehouseUserServiceImpl implements WarehouseUserService { warehouseUserEntity.setCode(code); warehouseUserEntity.setUsername(user.getUserName()); warehouseUserEntity.setUserid(user.getId()); + warehouseUserEntity.setId(IdUtil.getSnowflakeNextId()); warehouseUserEntities.add(warehouseUserEntity); }); - warehouseUserDao.batchInsert(warehouseUserEntities); + warehouseUserDao.insertBatch(warehouseUserEntities); } } @@ -99,9 +101,9 @@ public class WarehouseUserServiceImpl implements WarehouseUserService { } @Override - public void deleteWarehouseUser(Integer id) { + public void deleteWarehouseUser(Long id) { if (null != id) { - warehouseUserDao.deleteByPrimaryKey(id); + warehouseUserDao.deleteById(id); } } @@ -141,6 +143,6 @@ public class WarehouseUserServiceImpl implements WarehouseUserService { @Override public boolean insert(WarehouseUserEntity warehouseUserEntity) { - return warehouseUserDao.insertEntity(warehouseUserEntity)>0; + return warehouseUserDao.insertEntity(warehouseUserEntity) > 0; } } diff --git a/src/main/java/com/glxp/api/service/basic/IBasicBusTypePreService.java b/src/main/java/com/glxp/api/service/basic/IBasicBusTypePreService.java index 3a506e7f..cbdf4cec 100644 --- a/src/main/java/com/glxp/api/service/basic/IBasicBusTypePreService.java +++ b/src/main/java/com/glxp/api/service/basic/IBasicBusTypePreService.java @@ -80,4 +80,6 @@ public interface IBasicBusTypePreService extends IService * @return */ boolean verifyExists(BasicBusTypePreEntity basicBusTypePreEntity); + + } diff --git a/src/main/resources/mybatis/mapper/auth/WarehouseBussinessTypeDao.xml b/src/main/resources/mybatis/mapper/auth/WarehouseBussinessTypeDao.xml index 54ee44bc..d84a6226 100644 --- a/src/main/resources/mybatis/mapper/auth/WarehouseBussinessTypeDao.xml +++ b/src/main/resources/mybatis/mapper/auth/WarehouseBussinessTypeDao.xml @@ -20,12 +20,6 @@ from auth_warehouse_bustype where id = #{id,jdbcType=INTEGER} - - - delete - from auth_warehouse_bustype - where id = #{id,jdbcType=INTEGER} - @@ -163,11 +157,6 @@ - @@ -271,7 +261,7 @@ parameterType="com.glxp.api.req.auth.FilterInvLinkDataRequest"> select auth_warehouse_user.*, auth_user.employeeName 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 AND code = #{code} diff --git a/src/main/resources/mybatis/mapper/basic/BasicBusTypeChangeDao.xml b/src/main/resources/mybatis/mapper/basic/BasicBusTypeChangeDao.xml index 6b68be71..55e11b58 100644 --- a/src/main/resources/mybatis/mapper/basic/BasicBusTypeChangeDao.xml +++ b/src/main/resources/mybatis/mapper/basic/BasicBusTypeChangeDao.xml @@ -2,13 +2,14 @@ - + insert into basic_bustype_change @@ -96,5 +98,4 @@ busBeforeTime = #{busBeforeTime,jdbcType=TINYINT}, - diff --git a/src/main/resources/schemas/schema_v2.1.sql b/src/main/resources/schemas/schema_v2.1.sql index f2ff9368..5895e147 100644 --- a/src/main/resources/schemas/schema_v2.1.sql +++ b/src/main/resources/schemas/schema_v2.1.sql @@ -337,7 +337,8 @@ CALL Pro_Temp_ColumnWork('auth_warehouse_bustype', 'id', 'bigint', 2); CALL Pro_Temp_ColumnWork('auth_warehouse_user', 'id', 'bigint', 2); CALL Pro_Temp_ColumnWork('auth_space', 'id', 'bigint', 2); - +CALL Pro_Temp_ColumnWork('auth_dept_user', 'userId', 'bigint', 2); +CALL Pro_Temp_ColumnWork('auth_dept_user', 'deptId', 'bigint', 2); CALL Pro_Temp_ColumnWork('thr_dept', 'id', 'bigint', 2); CALL Pro_Temp_ColumnWork('thr_inv_warehouse', 'id', 'bigint', 2);