mirror of
https://gitcode.com/ageerle/ruoyi-ai.git
synced 2026-03-13 20:53:42 +08:00
@@ -16,7 +16,7 @@ spring:
|
||||
master:
|
||||
type: ${spring.datasource.type}
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://127.0.0.1:3306/ruoyi-ai?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||
url: jdbc:mysql://127.0.0.1:3306/ruoyistore?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true&rewriteBatchedStatements=true
|
||||
username: root
|
||||
password: root
|
||||
|
||||
|
||||
@@ -16,6 +16,15 @@ import java.util.List;
|
||||
public interface ISysDictTypeService {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Select all dictionary types based on the specified conditions
|
||||
*
|
||||
* @param dictType The business object containing query conditions for dictionary types
|
||||
* @return TableDataInfo containing a list of SysDictTypeVo objects that match the query criteria
|
||||
*/
|
||||
TableDataInfo<SysDictTypeVo> selectAll(SysDictTypeBo dictType);
|
||||
|
||||
TableDataInfo<SysDictTypeVo> selectPageDictTypeList(SysDictTypeBo dictType, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.ruoyi.common.core.constant.CacheConstants;
|
||||
import org.ruoyi.common.core.constant.CacheNames;
|
||||
import org.ruoyi.common.core.constant.HttpStatus;
|
||||
import org.ruoyi.common.core.exception.ServiceException;
|
||||
import org.ruoyi.common.core.service.DictService;
|
||||
import org.ruoyi.common.core.utils.MapstructUtils;
|
||||
@@ -50,6 +51,18 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService, DictService
|
||||
private final SysDictTypeMapper baseMapper;
|
||||
private final SysDictDataMapper dictDataMapper;
|
||||
|
||||
@Override
|
||||
public TableDataInfo<SysDictTypeVo> selectAll(SysDictTypeBo dictType) {
|
||||
LambdaQueryWrapper<SysDictType> lqw = buildQueryWrapper(dictType);
|
||||
// 2. 查询所有数据(不分页)
|
||||
List<SysDictTypeVo> list = baseMapper.selectVoList(lqw);
|
||||
TableDataInfo<SysDictTypeVo> rspData = new TableDataInfo<>();
|
||||
rspData.setCode(HttpStatus.SUCCESS); // 200
|
||||
rspData.setMsg("查询成功");
|
||||
rspData.setRows(list);
|
||||
rspData.setTotal(list.size()); // 总数为列表大小
|
||||
return rspData;
|
||||
}
|
||||
@Override
|
||||
public TableDataInfo<SysDictTypeVo> selectPageDictTypeList(SysDictTypeBo dictType, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<SysDictType> lqw = buildQueryWrapper(dictType);
|
||||
|
||||
@@ -48,6 +48,10 @@
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
<artifactId>velocity-engine-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common-excel</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
@@ -43,6 +43,11 @@ public class SchemaVo implements Serializable {
|
||||
* 表名
|
||||
*/
|
||||
private String tableName;
|
||||
/**
|
||||
* 字典
|
||||
*/
|
||||
private String dictType;
|
||||
|
||||
|
||||
/**
|
||||
* 表注释
|
||||
|
||||
@@ -249,7 +249,7 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||
column.put("javaField", javaField);
|
||||
column.put("capJavaField", toCamelCase(field.getCode(), true));
|
||||
|
||||
// 布尔值属性(兼容两种格式)
|
||||
// 布尔值dictType属性(兼容两种格式)
|
||||
boolean isPk = "1".equals(field.getIsPk());
|
||||
boolean isRequired = "1".equals(field.getIsRequired());
|
||||
boolean isInsert = "1".equals(field.getIsInsert());
|
||||
|
||||
@@ -207,6 +207,7 @@ public class SchemaFieldServiceImpl implements SchemaFieldService {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("schemaGroupCode", schemaGroupVo.getCode());
|
||||
result.put("tableName", schema.getTableName());
|
||||
result.put("dictType",schema.getDictType());
|
||||
result.put("tableComment", schema.getComment());
|
||||
result.put("className", toCamelCase(schema.getTableName(), true));
|
||||
result.put("tableCamelName", StrUtil.toCamelCase(schema.getTableName()));
|
||||
@@ -222,6 +223,8 @@ public class SchemaFieldServiceImpl implements SchemaFieldService {
|
||||
if (pkField != null) {
|
||||
Map<String, Object> pkColumn = new HashMap<>();
|
||||
pkColumn.put("columnName", pkField.getCode());
|
||||
pkColumn.put("dictType", pkField.getDictType());
|
||||
|
||||
pkColumn.put("columnComment", pkField.getName());
|
||||
pkColumn.put("javaField", StrUtil.toCamelCase(pkField.getCode()));
|
||||
pkColumn.put("javaType", getJavaType(pkField.getType()));
|
||||
@@ -233,6 +236,7 @@ public class SchemaFieldServiceImpl implements SchemaFieldService {
|
||||
for (SchemaFieldVo field : fields) {
|
||||
Map<String, Object> column = new HashMap<>();
|
||||
column.put("columnName", field.getCode());
|
||||
column.put("dictType", field.getDictType());
|
||||
column.put("columnComment", field.getName());
|
||||
column.put("javaField", StrUtil.toCamelCase(field.getCode()));
|
||||
column.put("javaType", getJavaType(field.getType()));
|
||||
@@ -279,6 +283,7 @@ public class SchemaFieldServiceImpl implements SchemaFieldService {
|
||||
field.setDefaultValue((String) columnInfo.get("columnDefault"));
|
||||
field.setComment((String) columnInfo.get("columnComment"));
|
||||
field.setName((String) columnInfo.get("columnComment"));
|
||||
field.setDictType(StrUtil.toCamelCase((String) columnInfo.get("dictType")));
|
||||
field.setCode(StrUtil.toCamelCase((String) columnInfo.get("columnName")));
|
||||
field.setType((String) columnInfo.get("dataType"));
|
||||
field.setLength(Integer.valueOf(String.valueOf(columnInfo.get("columnSize"))));
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
package org.ruoyi.system.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.ruoyi.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.ruoyi.common.log.annotation.Log;
|
||||
import org.ruoyi.common.web.core.BaseController;
|
||||
import org.ruoyi.core.page.PageQuery;
|
||||
import org.ruoyi.common.core.domain.R;
|
||||
import org.ruoyi.common.core.validate.AddGroup;
|
||||
import org.ruoyi.common.core.validate.EditGroup;
|
||||
import org.ruoyi.common.log.enums.BusinessType;
|
||||
import org.ruoyi.common.excel.utils.ExcelUtil;
|
||||
import org.ruoyi.system.domain.vo.StoreEmployeeVo;
|
||||
import org.ruoyi.system.domain.bo.StoreEmployeeBo;
|
||||
import org.ruoyi.system.service.StoreEmployeeService;
|
||||
import org.ruoyi.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 员工分配
|
||||
*
|
||||
* @author ageerle
|
||||
* @date Mon Aug 18 21:33:27 CST 2025
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/store/storeEmployee")
|
||||
public class StoreEmployeeController extends BaseController {
|
||||
|
||||
private final StoreEmployeeService storeEmployeeService;
|
||||
|
||||
/**
|
||||
* 查询员工分配列表
|
||||
*/
|
||||
@SaCheckPermission("store:storeEmployee:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<StoreEmployeeVo> list(StoreEmployeeBo bo, PageQuery pageQuery) {
|
||||
return storeEmployeeService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出员工分配列表
|
||||
*/
|
||||
@SaCheckPermission("store:storeEmployee:export")
|
||||
@Log(title = "员工分配", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(StoreEmployeeBo bo, HttpServletResponse response) {
|
||||
List<StoreEmployeeVo> list = storeEmployeeService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "员工分配", StoreEmployeeVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取员工分配详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("store:storeEmployee:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<StoreEmployeeVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(storeEmployeeService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增员工分配
|
||||
*/
|
||||
@SaCheckPermission("store:storeEmployee:add")
|
||||
@Log(title = "员工分配", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody StoreEmployeeBo bo) {
|
||||
return toAjax(storeEmployeeService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改员工分配
|
||||
*/
|
||||
@SaCheckPermission("store:storeEmployee:edit")
|
||||
@Log(title = "员工分配", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody StoreEmployeeBo bo) {
|
||||
return toAjax(storeEmployeeService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除员工分配
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("store:storeEmployee:remove")
|
||||
@Log(title = "员工分配", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(storeEmployeeService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package org.ruoyi.system.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 员工分配对象 store_employee
|
||||
*
|
||||
* @author ageerle
|
||||
* @date Mon Aug 18 21:33:27 CST 2025
|
||||
*/
|
||||
@Data
|
||||
@TableName("store_employee")
|
||||
public class StoreEmployee implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 门店ID
|
||||
*/
|
||||
private Long storeId;
|
||||
|
||||
/**
|
||||
* 员工ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 职位
|
||||
*/
|
||||
private String roleInStore;
|
||||
|
||||
/**
|
||||
* 分配时间
|
||||
*/
|
||||
private LocalDateTime assignTime;
|
||||
|
||||
/**
|
||||
* 门店类型
|
||||
*/
|
||||
private String isPrimary;
|
||||
|
||||
/**
|
||||
* 分配到期时间
|
||||
*/
|
||||
private LocalDateTime expireTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package org.ruoyi.system.domain.bo;
|
||||
|
||||
import org.ruoyi.system.domain.StoreEmployee;
|
||||
import org.ruoyi.core.domain.BaseEntity;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import org.ruoyi.common.core.validate.AddGroup;
|
||||
import org.ruoyi.common.core.validate.EditGroup;
|
||||
import java.io.Serializable;
|
||||
import java.io.Serializable;
|
||||
import org.ruoyi.common.core.validate.AddGroup;
|
||||
import org.ruoyi.common.core.validate.EditGroup;
|
||||
|
||||
/**
|
||||
* 员工分配业务对象 store_employee
|
||||
*
|
||||
* @author ageerle
|
||||
* @date Mon Aug 18 21:33:27 CST 2025
|
||||
*/
|
||||
@Data
|
||||
|
||||
@AutoMapper(target = StoreEmployee.class, reverseConvertGenerate = false)
|
||||
public class StoreEmployeeBo implements Serializable {
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 门店ID
|
||||
*/
|
||||
@NotNull(message = "门店ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long storeId;
|
||||
/**
|
||||
* 员工ID
|
||||
*/
|
||||
@NotNull(message = "员工ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long userId;
|
||||
/**
|
||||
* 职位
|
||||
*/
|
||||
private String roleInStore;
|
||||
/**
|
||||
* 分配时间
|
||||
*/
|
||||
@NotNull(message = "分配时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private LocalDateTime assignTime;
|
||||
/**
|
||||
* 门店类型
|
||||
*/
|
||||
private String isPrimary;
|
||||
/**
|
||||
* 分配到期时间
|
||||
*/
|
||||
private LocalDateTime expireTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package org.ruoyi.system.domain.vo;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.io.Serializable;
|
||||
import org.ruoyi.common.excel.annotation.ExcelDictFormat;
|
||||
import org.ruoyi.common.excel.convert.ExcelDictConvert;
|
||||
import org.ruoyi.system.domain.StoreEmployee;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* 员工分配视图对象 store_employee
|
||||
*
|
||||
* @author ageerle
|
||||
* @date Mon Aug 18 21:33:27 CST 2025
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = StoreEmployee.class)
|
||||
public class StoreEmployeeVo implements Serializable {
|
||||
|
||||
private Long id;
|
||||
/**
|
||||
* 门店ID
|
||||
*/
|
||||
@ExcelProperty(value = "门店ID")
|
||||
private Long storeId;
|
||||
/**
|
||||
* 员工ID
|
||||
*/
|
||||
@ExcelProperty(value = "员工ID")
|
||||
private Long userId;
|
||||
/**
|
||||
* 职位
|
||||
*/
|
||||
@ExcelProperty(value = "职位", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "title_name")
|
||||
private String roleInStore;
|
||||
/**
|
||||
* 分配时间
|
||||
*/
|
||||
@ExcelProperty(value = "分配时间")
|
||||
private LocalDateTime assignTime;
|
||||
/**
|
||||
* 门店类型
|
||||
*/
|
||||
@ExcelProperty(value = "门店类型", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "store_type")
|
||||
private String isPrimary;
|
||||
/**
|
||||
* 分配到期时间
|
||||
*/
|
||||
@ExcelProperty(value = "分配到期时间")
|
||||
private LocalDateTime expireTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package org.ruoyi.system.mapper;
|
||||
|
||||
import org.ruoyi.system.domain.StoreEmployee;
|
||||
import org.ruoyi.system.domain.vo.StoreEmployeeVo;
|
||||
import org.ruoyi.core.mapper.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 员工分配Mapper接口
|
||||
*
|
||||
* @author ageerle
|
||||
* @date Mon Aug 18 21:33:27 CST 2025
|
||||
*/
|
||||
@Mapper
|
||||
public interface StoreEmployeeMapper extends BaseMapperPlus<StoreEmployee, StoreEmployeeVo> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package org.ruoyi.system.service;
|
||||
|
||||
import org.ruoyi.system.domain.vo.StoreEmployeeVo;
|
||||
import org.ruoyi.system.domain.bo.StoreEmployeeBo;
|
||||
import org.ruoyi.core.page.TableDataInfo;
|
||||
import org.ruoyi.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 员工分配Service接口
|
||||
*
|
||||
* @author ageerle
|
||||
* @date Mon Aug 18 21:33:27 CST 2025
|
||||
*/
|
||||
public interface StoreEmployeeService {
|
||||
|
||||
/**
|
||||
* 查询员工分配
|
||||
*/
|
||||
StoreEmployeeVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询员工分配列表
|
||||
*/
|
||||
TableDataInfo<StoreEmployeeVo> queryPageList(StoreEmployeeBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询员工分配列表
|
||||
*/
|
||||
List<StoreEmployeeVo> queryList(StoreEmployeeBo bo);
|
||||
|
||||
/**
|
||||
* 新增员工分配
|
||||
*/
|
||||
Boolean insertByBo(StoreEmployeeBo bo);
|
||||
|
||||
/**
|
||||
* 修改员工分配
|
||||
*/
|
||||
Boolean updateByBo(StoreEmployeeBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除员工分配信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
package org.ruoyi.system.service.impl;
|
||||
|
||||
import org.ruoyi.common.core.utils.MapstructUtils;
|
||||
import org.ruoyi.core.page.TableDataInfo;
|
||||
import org.ruoyi.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.ruoyi.system.domain.bo.StoreEmployeeBo;
|
||||
import org.ruoyi.system.domain.vo.StoreEmployeeVo;
|
||||
import org.ruoyi.system.domain.StoreEmployee;
|
||||
import org.ruoyi.system.mapper.StoreEmployeeMapper;
|
||||
import org.ruoyi.system.service.StoreEmployeeService;
|
||||
import org.ruoyi.common.core.utils.StringUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 员工分配Service业务层处理
|
||||
*
|
||||
* @author ageerle
|
||||
* @date Mon Aug 18 21:33:27 CST 2025
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class StoreEmployeeServiceImpl implements StoreEmployeeService {
|
||||
|
||||
private final StoreEmployeeMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询员工分配
|
||||
*/
|
||||
@Override
|
||||
public StoreEmployeeVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询员工分配列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<StoreEmployeeVo> queryPageList(StoreEmployeeBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<StoreEmployee> lqw = buildQueryWrapper(bo);
|
||||
Page<StoreEmployeeVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询员工分配列表
|
||||
*/
|
||||
@Override
|
||||
public List<StoreEmployeeVo> queryList(StoreEmployeeBo bo) {
|
||||
LambdaQueryWrapper<StoreEmployee> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<StoreEmployee> buildQueryWrapper(StoreEmployeeBo bo) {
|
||||
LambdaQueryWrapper<StoreEmployee> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getStoreId() != null, StoreEmployee::getStoreId, bo.getStoreId());
|
||||
lqw.eq(bo.getUserId() != null, StoreEmployee::getUserId, bo.getUserId());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增员工分配
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(StoreEmployeeBo bo) {
|
||||
StoreEmployee add = MapstructUtils.convert(bo, StoreEmployee. class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改员工分配
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(StoreEmployeeBo bo) {
|
||||
StoreEmployee update = MapstructUtils.convert(bo, StoreEmployee. class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(StoreEmployee entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除员工分配
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
-- 菜单 SQL
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1957435675864506368, '员工分配', '2000', '1', 'storeEmployee', 'store/storeEmployee/index', 1, 0, 'C', '0', '0', 'store:storeEmployee:list', '#', 103, 1, sysdate(), null, null, '员工分配菜单');
|
||||
|
||||
-- 按钮 SQL
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1957435675864506369, '员工分配查询', 1957435675864506368, '1', '#', '', 1, 0, 'F', '0', '0', 'store:storeEmployee:query', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1957435675864506370, '员工分配新增', 1957435675864506368, '2', '#', '', 1, 0, 'F', '0', '0', 'store:storeEmployee:add', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1957435675864506371, '员工分配修改', 1957435675864506368, '3', '#', '', 1, 0, 'F', '0', '0', 'store:storeEmployee:edit', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1957435675864506372, '员工分配删除', 1957435675864506368, '4', '#', '', 1, 0, 'F', '0', '0', 'store:storeEmployee:remove', '#', 103, 1, sysdate(), null, null, '');
|
||||
|
||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||
values(1957435675864506373, '员工分配导出', 1957435675864506368, '5', '#', '', 1, 0, 'F', '0', '0', 'store:storeEmployee:export', '#', 103, 1, sysdate(), null, null, '');
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.ruoyi.system.mapper.StoreEmployeeMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.ruoyi.system.mapper.SysDemoMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -29,7 +29,7 @@ public class ${ClassName} implements Serializable {
|
||||
@Version
|
||||
#end
|
||||
#if($column.isPk==1)
|
||||
@TableId(value = "$column.columnName")
|
||||
@TableId(value = "${column.columnName}", type = IdType.AUTO)
|
||||
#end
|
||||
private $column.javaType $column.javaField;
|
||||
|
||||
|
||||
@@ -31,6 +31,14 @@ public class SysDictTypeController extends BaseController {
|
||||
|
||||
private final ISysDictTypeService dictTypeService;
|
||||
|
||||
/**
|
||||
* 查询所有字典类型列表
|
||||
*/
|
||||
|
||||
@GetMapping("/all")
|
||||
public TableDataInfo<SysDictTypeVo> all(SysDictTypeBo dictType, PageQuery pageQuery) {
|
||||
return dictTypeService.selectAll(dictType);
|
||||
}
|
||||
/**
|
||||
* 查询字典类型列表
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user