mirror of
https://gitee.com/y_project/RuoYi-Cloud.git
synced 2026-01-31 05:51:56 +08:00
完成序列号生成功能
This commit is contained in:
@@ -9,6 +9,7 @@ import com.ruoyi.common.core.utils.DateUtils;
|
||||
#end
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.mybatis.dynamic.sql.where.condition.IsEqualTo;
|
||||
import org.mybatis.dynamic.sql.where.condition.IsIn;
|
||||
import org.mybatis.dynamic.sql.SqlBuilder;
|
||||
@@ -18,7 +19,6 @@ import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider;
|
||||
#if($table.sub)
|
||||
import java.util.ArrayList;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import ${packageName}.domain.${subClassName};
|
||||
#end
|
||||
import com.ruoyi.common.core.web.domain.ExtBaseEntity;
|
||||
@@ -108,9 +108,7 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
||||
* @param ${className} ${functionName}
|
||||
* @return 结果
|
||||
*/
|
||||
#if($table.sub)
|
||||
@Transactional
|
||||
#end
|
||||
@Override
|
||||
public int insert${ClassName}(${ClassName} ${className})
|
||||
{
|
||||
@@ -134,9 +132,7 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
||||
* @param ${className} ${functionName}
|
||||
* @return 结果
|
||||
*/
|
||||
#if($table.sub)
|
||||
@Transactional
|
||||
#end
|
||||
@Override
|
||||
public int update${ClassName}(${ClassName} ${className})
|
||||
{
|
||||
@@ -158,9 +154,7 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
||||
* @param ${pkColumn.javaField}s 需要删除的${functionName}主键
|
||||
* @return 结果
|
||||
*/
|
||||
#if($table.sub)
|
||||
@Transactional
|
||||
#end
|
||||
@Override
|
||||
public int delete${ClassName}By${pkColumn.capJavaField}s(${pkColumn.javaType}[] ${pkColumn.javaField}s)
|
||||
{
|
||||
@@ -185,9 +179,7 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
|
||||
* @param ${pkColumn.javaField} ${functionName}主键
|
||||
* @return 结果
|
||||
*/
|
||||
#if($table.sub)
|
||||
@Transactional
|
||||
#end
|
||||
@Override
|
||||
public int delete${ClassName}By${pkColumn.capJavaField}(${pkColumn.javaType} ${pkColumn.javaField})
|
||||
{
|
||||
|
||||
@@ -82,6 +82,12 @@
|
||||
<artifactId>ruoyi-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Services -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-services</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RuoYi Common Swagger -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
|
||||
@@ -1,125 +1,125 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.ruoyi.system.domain.SysMenu;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 菜单表 数据层
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface SysMenuMapper
|
||||
{
|
||||
public interface SysMenuMapper {
|
||||
/**
|
||||
* 查询系统菜单列表
|
||||
*
|
||||
*
|
||||
* @param menu 菜单信息
|
||||
* @return 菜单列表
|
||||
*/
|
||||
public List<SysMenu> selectMenuList(SysMenu menu);
|
||||
List<SysMenu> selectMenuList(SysMenu menu);
|
||||
|
||||
/**
|
||||
* 根据用户所有权限
|
||||
*
|
||||
*
|
||||
* @return 权限列表
|
||||
*/
|
||||
public List<String> selectMenuPerms();
|
||||
List<String> selectMenuPerms();
|
||||
|
||||
/**
|
||||
* 根据用户查询系统菜单列表
|
||||
*
|
||||
*
|
||||
* @param menu 菜单信息
|
||||
* @return 菜单列表
|
||||
*/
|
||||
public List<SysMenu> selectMenuListByUserId(SysMenu menu);
|
||||
List<SysMenu> selectMenuListByUserId(SysMenu menu);
|
||||
|
||||
/**
|
||||
* 根据角色ID查询权限
|
||||
*
|
||||
*
|
||||
* @param roleId 角色ID
|
||||
* @return 权限列表
|
||||
*/
|
||||
public List<String> selectMenuPermsByRoleId(Long roleId);
|
||||
List<String> selectMenuPermsByRoleId(Long roleId);
|
||||
|
||||
/**
|
||||
* 根据用户ID查询权限
|
||||
*
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 权限列表
|
||||
*/
|
||||
public List<String> selectMenuPermsByUserId(Long userId);
|
||||
List<String> selectMenuPermsByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 根据用户ID查询菜单
|
||||
*
|
||||
*
|
||||
* @return 菜单列表
|
||||
*/
|
||||
public List<SysMenu> selectMenuTreeAll();
|
||||
List<SysMenu> selectMenuTreeAll();
|
||||
|
||||
/**
|
||||
* 根据用户ID查询菜单
|
||||
*
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 菜单列表
|
||||
*/
|
||||
public List<SysMenu> selectMenuTreeByUserId(Long userId);
|
||||
List<SysMenu> selectMenuTreeByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 根据角色ID查询菜单树信息
|
||||
*
|
||||
* @param roleId 角色ID
|
||||
*
|
||||
* @param roleId 角色ID
|
||||
* @param menuCheckStrictly 菜单树选择项是否关联显示
|
||||
* @return 选中菜单列表
|
||||
*/
|
||||
public List<Long> selectMenuListByRoleId(@Param("roleId") Long roleId, @Param("menuCheckStrictly") boolean menuCheckStrictly);
|
||||
List<Long> selectMenuListByRoleId(@Param("roleId") Long roleId, @Param("menuCheckStrictly") boolean menuCheckStrictly);
|
||||
|
||||
/**
|
||||
* 根据菜单ID查询信息
|
||||
*
|
||||
*
|
||||
* @param menuId 菜单ID
|
||||
* @return 菜单信息
|
||||
*/
|
||||
public SysMenu selectMenuById(Long menuId);
|
||||
SysMenu selectMenuById(Long menuId);
|
||||
|
||||
/**
|
||||
* 是否存在菜单子节点
|
||||
*
|
||||
*
|
||||
* @param menuId 菜单ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int hasChildByMenuId(Long menuId);
|
||||
int hasChildByMenuId(Long menuId);
|
||||
|
||||
/**
|
||||
* 新增菜单信息
|
||||
*
|
||||
*
|
||||
* @param menu 菜单信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMenu(SysMenu menu);
|
||||
int insertMenu(SysMenu menu);
|
||||
|
||||
/**
|
||||
* 修改菜单信息
|
||||
*
|
||||
*
|
||||
* @param menu 菜单信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMenu(SysMenu menu);
|
||||
int updateMenu(SysMenu menu);
|
||||
|
||||
/**
|
||||
* 删除菜单管理信息
|
||||
*
|
||||
*
|
||||
* @param menuId 菜单ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMenuById(Long menuId);
|
||||
int deleteMenuById(Long menuId);
|
||||
|
||||
/**
|
||||
* 校验菜单名称是否唯一
|
||||
*
|
||||
*
|
||||
* @param menuName 菜单名称
|
||||
* @param parentId 父菜单ID
|
||||
* @return 结果
|
||||
*/
|
||||
public SysMenu checkMenuNameUnique(@Param("menuName") String menuName, @Param("parentId") Long parentId);
|
||||
SysMenu checkMenuNameUnique(@Param("menuName") String menuName, @Param("parentId") Long parentId);
|
||||
}
|
||||
|
||||
@@ -1,60 +1,60 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysNotice;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 通知公告表 数据层
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface SysNoticeMapper
|
||||
{
|
||||
public interface SysNoticeMapper {
|
||||
/**
|
||||
* 查询公告信息
|
||||
*
|
||||
*
|
||||
* @param noticeId 公告ID
|
||||
* @return 公告信息
|
||||
*/
|
||||
public SysNotice selectNoticeById(Long noticeId);
|
||||
SysNotice selectNoticeById(Long noticeId);
|
||||
|
||||
/**
|
||||
* 查询公告列表
|
||||
*
|
||||
*
|
||||
* @param notice 公告信息
|
||||
* @return 公告集合
|
||||
*/
|
||||
public List<SysNotice> selectNoticeList(SysNotice notice);
|
||||
List<SysNotice> selectNoticeList(SysNotice notice);
|
||||
|
||||
/**
|
||||
* 新增公告
|
||||
*
|
||||
*
|
||||
* @param notice 公告信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertNotice(SysNotice notice);
|
||||
int insertNotice(SysNotice notice);
|
||||
|
||||
/**
|
||||
* 修改公告
|
||||
*
|
||||
*
|
||||
* @param notice 公告信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateNotice(SysNotice notice);
|
||||
int updateNotice(SysNotice notice);
|
||||
|
||||
/**
|
||||
* 批量删除公告
|
||||
*
|
||||
*
|
||||
* @param noticeId 公告ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteNoticeById(Long noticeId);
|
||||
int deleteNoticeById(Long noticeId);
|
||||
|
||||
/**
|
||||
* 批量删除公告信息
|
||||
*
|
||||
*
|
||||
* @param noticeIds 需要删除的公告ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteNoticeByIds(Long[] noticeIds);
|
||||
int deleteNoticeByIds(Long[] noticeIds);
|
||||
}
|
||||
@@ -1,48 +1,48 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.api.domain.SysOperLog;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 操作日志 数据层
|
||||
*
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface SysOperLogMapper
|
||||
{
|
||||
public interface SysOperLogMapper {
|
||||
/**
|
||||
* 新增操作日志
|
||||
*
|
||||
*
|
||||
* @param operLog 操作日志对象
|
||||
*/
|
||||
public int insertOperlog(SysOperLog operLog);
|
||||
int insertOperlog(SysOperLog operLog);
|
||||
|
||||
/**
|
||||
* 查询系统操作日志集合
|
||||
*
|
||||
*
|
||||
* @param operLog 操作日志对象
|
||||
* @return 操作日志集合
|
||||
*/
|
||||
public List<SysOperLog> selectOperLogList(SysOperLog operLog);
|
||||
List<SysOperLog> selectOperLogList(SysOperLog operLog);
|
||||
|
||||
/**
|
||||
* 批量删除系统操作日志
|
||||
*
|
||||
*
|
||||
* @param operIds 需要删除的操作日志ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteOperLogByIds(Long[] operIds);
|
||||
int deleteOperLogByIds(Long[] operIds);
|
||||
|
||||
/**
|
||||
* 查询操作日志详细
|
||||
*
|
||||
*
|
||||
* @param operId 操作ID
|
||||
* @return 操作日志对象
|
||||
*/
|
||||
public SysOperLog selectOperLogById(Long operId);
|
||||
SysOperLog selectOperLogById(Long operId);
|
||||
|
||||
/**
|
||||
* 清空操作日志
|
||||
*/
|
||||
public void cleanOperLog();
|
||||
void cleanOperLog();
|
||||
}
|
||||
|
||||
@@ -76,6 +76,12 @@
|
||||
<artifactId>ruoyi-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 共通业务 -->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-services</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Mybatis Generator -->
|
||||
<dependency>
|
||||
<groupId>org.mybatis.generator</groupId>
|
||||
|
||||
@@ -2,19 +2,21 @@ package com.ruoyi.wms.service.impl;
|
||||
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.ruoyi.common.core.utils.uuid.snowflake.SnowFlakeIdGenerator;
|
||||
import com.ruoyi.common.core.web.domain.ExtBaseEntity;
|
||||
import com.ruoyi.common.security.utils.SecurityUtilsExt;
|
||||
import com.ruoyi.common.services.ISysSequenceService;
|
||||
import com.ruoyi.common.services.constants.SeqType;
|
||||
import com.ruoyi.wms.domain.GoodsType;
|
||||
import com.ruoyi.wms.mapper.GoodsTypeDynamicSqlSupport;
|
||||
import com.ruoyi.wms.mapper.GoodsTypeMapper;
|
||||
import com.ruoyi.wms.service.IGoodsTypeService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.mybatis.dynamic.sql.SqlBuilder;
|
||||
import org.mybatis.dynamic.sql.render.RenderingStrategies;
|
||||
import org.mybatis.dynamic.sql.select.render.SelectStatementProvider;
|
||||
import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
@@ -27,8 +29,11 @@ import java.util.Optional;
|
||||
*/
|
||||
@Service
|
||||
public class GoodsTypeServiceImpl implements IGoodsTypeService {
|
||||
@Autowired
|
||||
|
||||
@Resource
|
||||
private GoodsTypeMapper goodsTypeMapper;
|
||||
@Resource
|
||||
private ISysSequenceService sequenceService;
|
||||
|
||||
/**
|
||||
* 查询物品类型管理
|
||||
@@ -67,10 +72,12 @@ public class GoodsTypeServiceImpl implements IGoodsTypeService {
|
||||
* @param goodsType 物品类型管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int insertGoodsType(GoodsType goodsType) {
|
||||
if (StringUtils.isBlank(goodsType.getGoodsTypeCd())) {
|
||||
goodsType.setGoodsTypeCd(SnowFlakeIdGenerator.nextId());
|
||||
String goodsTypeCd = sequenceService.getNextSequence(SeqType.GOODE_TYPE_CD);
|
||||
goodsType.setGoodsTypeCd(goodsTypeCd);
|
||||
}
|
||||
return goodsTypeMapper.insertSelective(goodsType);
|
||||
}
|
||||
@@ -81,6 +88,7 @@ public class GoodsTypeServiceImpl implements IGoodsTypeService {
|
||||
* @param goodsType 物品类型管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int updateGoodsType(GoodsType goodsType) {
|
||||
return goodsTypeMapper.updateByPrimaryKeySelective(goodsType);
|
||||
@@ -92,6 +100,7 @@ public class GoodsTypeServiceImpl implements IGoodsTypeService {
|
||||
* @param goodsTypeCds 需要删除的物品类型管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int deleteGoodsTypeByGoodsTypeCds(String[] goodsTypeCds) {
|
||||
String userId = SecurityUtilsExt.getUserIdStr();
|
||||
@@ -111,6 +120,7 @@ public class GoodsTypeServiceImpl implements IGoodsTypeService {
|
||||
* @param goodsTypeCd 物品类型管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int deleteGoodsTypeByGoodsTypeCd(String goodsTypeCd) {
|
||||
GoodsType record = new GoodsType();
|
||||
|
||||
@@ -2,18 +2,19 @@ package com.ruoyi.wms.service.impl;
|
||||
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.ruoyi.common.core.utils.uuid.snowflake.SnowFlakeIdGenerator;
|
||||
import com.ruoyi.common.core.web.domain.ExtBaseEntity;
|
||||
import com.ruoyi.common.security.utils.SecurityUtilsExt;
|
||||
import com.ruoyi.common.services.ISysSequenceService;
|
||||
import com.ruoyi.common.services.constants.SeqType;
|
||||
import com.ruoyi.wms.domain.UnitInfo;
|
||||
import com.ruoyi.wms.mapper.UnitInfoDynamicSqlSupport;
|
||||
import com.ruoyi.wms.mapper.UnitInfoMapper;
|
||||
import com.ruoyi.wms.service.IUnitInfoService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.mybatis.dynamic.sql.SqlBuilder;
|
||||
import org.mybatis.dynamic.sql.render.RenderingStrategies;
|
||||
import org.mybatis.dynamic.sql.select.render.SelectStatementProvider;
|
||||
import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
@@ -27,8 +28,11 @@ import java.util.Optional;
|
||||
*/
|
||||
@Service
|
||||
public class UnitInfoServiceImpl implements IUnitInfoService {
|
||||
@Autowired
|
||||
|
||||
@Resource
|
||||
private UnitInfoMapper unitInfoMapper;
|
||||
@Resource
|
||||
private ISysSequenceService sequenceService;
|
||||
|
||||
/**
|
||||
* 查询单位信息管理
|
||||
@@ -69,7 +73,8 @@ public class UnitInfoServiceImpl implements IUnitInfoService {
|
||||
@Override
|
||||
public int insertUnitInfo(UnitInfo unitInfo) {
|
||||
if (StringUtils.isBlank(unitInfo.getUnitCode())) {
|
||||
unitInfo.setUnitCode(SnowFlakeIdGenerator.nextId());
|
||||
String unitCode = sequenceService.getNextSequence(SeqType.UNIT_CD);
|
||||
unitInfo.setUnitCode(unitCode);
|
||||
}
|
||||
return unitInfoMapper.insertSelective(unitInfo);
|
||||
}
|
||||
|
||||
@@ -2,18 +2,19 @@ package com.ruoyi.wms.service.impl;
|
||||
|
||||
import com.ruoyi.common.core.utils.DateUtils;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.ruoyi.common.core.utils.uuid.snowflake.SnowFlakeIdGenerator;
|
||||
import com.ruoyi.common.core.web.domain.ExtBaseEntity;
|
||||
import com.ruoyi.common.security.utils.SecurityUtilsExt;
|
||||
import com.ruoyi.common.services.ISysSequenceService;
|
||||
import com.ruoyi.common.services.constants.SeqType;
|
||||
import com.ruoyi.wms.domain.WarehouseInfo;
|
||||
import com.ruoyi.wms.mapper.WarehouseInfoDynamicSqlSupport;
|
||||
import com.ruoyi.wms.mapper.WarehouseInfoMapper;
|
||||
import com.ruoyi.wms.service.IWarehouseInfoService;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.mybatis.dynamic.sql.SqlBuilder;
|
||||
import org.mybatis.dynamic.sql.render.RenderingStrategies;
|
||||
import org.mybatis.dynamic.sql.select.render.SelectStatementProvider;
|
||||
import org.mybatis.dynamic.sql.update.render.UpdateStatementProvider;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
@@ -27,8 +28,11 @@ import java.util.Optional;
|
||||
*/
|
||||
@Service
|
||||
public class WarehouseInfoServiceImpl implements IWarehouseInfoService {
|
||||
@Autowired
|
||||
|
||||
@Resource
|
||||
private WarehouseInfoMapper warehouseInfoMapper;
|
||||
@Resource
|
||||
private ISysSequenceService sequenceService;
|
||||
|
||||
/**
|
||||
* 查询仓库基础信息
|
||||
@@ -69,7 +73,8 @@ public class WarehouseInfoServiceImpl implements IWarehouseInfoService {
|
||||
@Override
|
||||
public int insertWarehouseInfo(WarehouseInfo warehouseInfo) {
|
||||
if (StringUtils.isBlank(warehouseInfo.getWhsCd())) {
|
||||
warehouseInfo.setWhsCd(SnowFlakeIdGenerator.nextId());
|
||||
String whsCd = sequenceService.getNextSequence(SeqType.WHS_CD);
|
||||
warehouseInfo.setWhsCd(whsCd);
|
||||
}
|
||||
return warehouseInfoMapper.insertSelective(warehouseInfo);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user