浏览代码

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	user_center/src/main/java/com/huaxu/config/ResourceServerConfig.java
hym 4 年之前
父节点
当前提交
be0bb1956a
共有 32 个文件被更改,包括 1699 次插入42 次删除
  1. 2 0
      common/src/main/java/com/huaxu/model/ResultStatus.java
  2. 23 0
      user_center/pom.xml
  3. 80 0
      user_center/src/main/java/com/huaxu/common/CustemhandlerUtils.java
  4. 121 0
      user_center/src/main/java/com/huaxu/common/EasyExcelUtil.java
  5. 1 0
      user_center/src/main/java/com/huaxu/config/ResourceServerConfig.java
  6. 140 0
      user_center/src/main/java/com/huaxu/controller/LoginLogController.java
  7. 57 7
      user_center/src/main/java/com/huaxu/controller/MenuController.java
  8. 140 0
      user_center/src/main/java/com/huaxu/controller/OperateLogController.java
  9. 79 0
      user_center/src/main/java/com/huaxu/controller/SysDownloadContorller.java
  10. 7 8
      user_center/src/main/java/com/huaxu/controller/TenantController.java
  11. 83 0
      user_center/src/main/java/com/huaxu/dao/LoginLogMapper.java
  12. 11 7
      user_center/src/main/java/com/huaxu/dao/MenuMapper.java
  13. 83 0
      user_center/src/main/java/com/huaxu/dao/OperateLogMapper.java
  14. 7 7
      user_center/src/main/java/com/huaxu/dao/TenantMapper.java
  15. 41 0
      user_center/src/main/java/com/huaxu/dto/LoginLogDto.java
  16. 38 0
      user_center/src/main/java/com/huaxu/dto/OperateLogDto.java
  17. 54 0
      user_center/src/main/java/com/huaxu/entity/LoginLogEntity.java
  18. 45 0
      user_center/src/main/java/com/huaxu/entity/OperateLogEntity.java
  19. 4 4
      user_center/src/main/java/com/huaxu/entity/TenantEntity.java
  20. 84 0
      user_center/src/main/java/com/huaxu/service/LoginLogService.java
  21. 6 0
      user_center/src/main/java/com/huaxu/service/MenuService.java
  22. 85 0
      user_center/src/main/java/com/huaxu/service/OperateLogService.java
  23. 3 4
      user_center/src/main/java/com/huaxu/service/TenantService.java
  24. 73 0
      user_center/src/main/java/com/huaxu/service/impl/LoginLogServiceImpl.java
  25. 73 0
      user_center/src/main/java/com/huaxu/service/impl/OperateLogServiceImpl.java
  26. 5 5
      user_center/src/main/java/com/huaxu/service/impl/TenantServiceImpl.java
  27. 1 0
      user_center/src/main/resources/application-dev.properties
  28. 1 0
      user_center/src/main/resources/application-sit.properties
  29. 1 0
      user_center/src/main/resources/application-uat.properties
  30. 172 0
      user_center/src/main/resources/mapper/LoginLog.xml
  31. 12 0
      user_center/src/main/resources/mapper/MenuMapper.xml
  32. 167 0
      user_center/src/main/resources/mapper/OperateLog.xml

+ 2 - 0
common/src/main/java/com/huaxu/model/ResultStatus.java

@@ -99,6 +99,8 @@ public enum ResultStatus {
     ACCESS_DISABLED_ERROR(900013, "您的账号已被禁用,如有问题请联系管理员。"),
     PHONE_NUMBER_NOT_FOUND_WECHAT_ERROR(900014, "您微信绑定的手机号尚未注册,请使用平台注册账号进行登录。"),
 
+    EXSIT_IS_PARENT_ERROR(800001,"存在下级信息不能删除"),
+
     SYSTEM_ERROR(999999, "系统错误"),
     ;
 

+ 23 - 0
user_center/pom.xml

@@ -21,6 +21,29 @@
            <artifactId>common</artifactId>
            <version>1.0-SNAPSHOT</version>
        </dependency>
+       <dependency>
+           <groupId>com.alibaba</groupId>
+           <artifactId>easyexcel</artifactId>
+           <version>2.2.6</version>
+           <exclusions>
+               <exclusion>
+                   <groupId>com.alibaba</groupId>
+                   <artifactId>fastjson</artifactId>
+               </exclusion>
+               <exclusion>
+                   <groupId>org.projectlombok</groupId>
+                   <artifactId>lombok</artifactId>
+               </exclusion>
+               <exclusion>
+                   <groupId>org.springframework.boot</groupId>
+                   <artifactId>spring-boot</artifactId>
+               </exclusion>
+               <exclusion>
+                   <groupId>org.springframework.boot</groupId>
+                   <artifactId>spring-boot-starter-web</artifactId>
+               </exclusion>
+           </exclusions>
+       </dependency>
    </dependencies>
 
 </project>

+ 80 - 0
user_center/src/main/java/com/huaxu/common/CustemhandlerUtils.java

@@ -0,0 +1,80 @@
+package com.huaxu.common;
+
+import com.alibaba.excel.enums.CellDataTypeEnum;
+import com.alibaba.excel.metadata.CellData;
+import com.alibaba.excel.metadata.Head;
+import com.alibaba.excel.util.CollectionUtils;
+import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
+import com.alibaba.excel.write.style.column.AbstractColumnWidthStyleStrategy;
+import org.apache.poi.ss.usermodel.Cell;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author xjh
+ * @version 1.0
+ * @date 2020/10/19 19 19:21
+ */
+public class CustemhandlerUtils extends AbstractColumnWidthStyleStrategy {
+    private static final int MAX_COLUMN_WIDTH = 255;
+    //因为在自动列宽的过程中,有些设置地方让列宽显得紧凑,所以做出了个判断
+    private static final int COLUMN_WIDTH = 20;
+    private  Map<Integer, Map<Integer, Integer>> CACHE = new HashMap(8);
+
+    public CustemhandlerUtils() {
+    }
+
+    @Override
+    protected void setColumnWidth(WriteSheetHolder writeSheetHolder, List<CellData> cellDataList, Cell cell, Head head, Integer relativeRowIndex, Boolean isHead) {
+        boolean needSetWidth = isHead || !CollectionUtils.isEmpty(cellDataList);
+        if (needSetWidth) {
+            Map<Integer, Integer> maxColumnWidthMap = (Map)CACHE.get(writeSheetHolder.getSheetNo());
+            if (maxColumnWidthMap == null) {
+                maxColumnWidthMap = new HashMap(16);
+                CACHE.put(writeSheetHolder.getSheetNo(), maxColumnWidthMap);
+            }
+
+            Integer columnWidth = this.dataLength(cellDataList, cell, isHead);
+            if (columnWidth >= 0) {
+                if (columnWidth > MAX_COLUMN_WIDTH) {
+                    columnWidth = MAX_COLUMN_WIDTH;
+                }else {
+                    if(columnWidth<COLUMN_WIDTH){
+                        columnWidth =columnWidth;
+                    }
+                }
+
+                Integer maxColumnWidth = (Integer)((Map)maxColumnWidthMap).get(cell.getColumnIndex());
+                if (maxColumnWidth == null || columnWidth > maxColumnWidth) {
+                    ((Map)maxColumnWidthMap).put(cell.getColumnIndex(), columnWidth);
+                    writeSheetHolder.getSheet().setColumnWidth(cell.getColumnIndex(),  columnWidth* 256);
+                }
+            }
+        }
+    }
+
+    private  Integer dataLength(List<CellData> cellDataList, Cell cell, Boolean isHead) {
+        if (isHead) {
+            return cell.getStringCellValue().getBytes().length;
+        } else {
+            CellData cellData = (CellData)cellDataList.get(0);
+            CellDataTypeEnum type = cellData.getType();
+            if (type == null) {
+                return -1;
+            } else {
+                switch(type) {
+                    case STRING:
+                        return cellData.getStringValue().getBytes().length;
+                    case BOOLEAN:
+                        return cellData.getBooleanValue().toString().getBytes().length;
+                    case NUMBER:
+                        return cellData.getNumberValue().toString().getBytes().length;
+                    default:
+                        return -1;
+                }
+            }
+        }
+    }
+}

+ 121 - 0
user_center/src/main/java/com/huaxu/common/EasyExcelUtil.java

@@ -0,0 +1,121 @@
+package com.huaxu.common;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import com.alibaba.excel.metadata.Font;
+import com.alibaba.excel.metadata.Sheet;
+import com.alibaba.excel.metadata.TableStyle;
+import com.alibaba.excel.support.ExcelTypeEnum;
+import org.apache.commons.lang.time.DateFormatUtils;
+import org.apache.poi.ss.formula.functions.T;
+import org.apache.poi.ss.usermodel.FillPatternType;
+import org.apache.poi.ss.usermodel.HorizontalAlignment;
+import org.apache.poi.ss.usermodel.IndexedColors;
+import org.apache.poi.ss.usermodel.VerticalAlignment;
+import org.apache.poi.xssf.streaming.SXSSFSheet;
+
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.ExcelWriter;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.format.DateTimeFormat;
+import com.alibaba.excel.annotation.format.NumberFormat;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import com.alibaba.excel.util.FileUtils;
+import com.alibaba.excel.write.merge.LoopMergeStrategy;
+import com.alibaba.excel.write.metadata.WriteSheet;
+import com.alibaba.excel.write.metadata.WriteTable;
+import com.alibaba.excel.write.metadata.style.WriteCellStyle;
+import com.alibaba.excel.write.metadata.style.WriteFont;
+import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
+import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy;
+/**
+ * @ClassName EasyExcelUtil
+ * @Description: Excel导出通用工具类
+ * @Author :WYY
+ * @Date 2020/10/27
+ * @Version V1.0
+ **/
+public  class EasyExcelUtil {
+    /**
+     * @MethodName:Excel导出
+     * @Description: TODO
+     * @Param: path 导出基础路径 t实体名 excelName 文件名 data数据
+     * @Return:
+     * @Author: WYY
+     * @Date: 2020/10/28
+    **/
+    public static String excelWrite(String path,Class t, String excelName,List data) {
+        String filePath = "";
+        String fileName = DateFormatUtils.format(new Date(), "yyyy/MM/dd") + File.separator;
+        fileName = fileName + excelName + System.currentTimeMillis() + ".xlsx";
+        try {
+            getAbsoluteFile(path, fileName);
+            EasyExcel.write(path + fileName, t)
+                    .excelType(ExcelTypeEnum.XLSX)
+                    .registerWriteHandler(new CustemhandlerUtils())
+                    .registerWriteHandler(EasyExcelUtil.getStyleStrategy())
+                    .sheet("Export")
+                    .doWrite(data);
+            filePath = getPathFileName(path, fileName);
+        } catch (IOException e) {
+            e.printStackTrace();
+        } finally {
+
+        }
+        return filePath;
+    }
+    private static final String getPathFileName(String uploadDir, String fileName) throws IOException {
+        String pathFileName = uploadDir  + "/" + fileName;
+        return ToolUtil.path(pathFileName);
+    }
+    private static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException {
+        File desc = new File(uploadDir + File.separator + fileName);
+
+        if (!desc.getParentFile().exists()) {
+            desc.getParentFile().mkdirs();
+        }
+
+        return desc;
+    }
+    public static HorizontalCellStyleStrategy getStyleStrategy(){
+        // 头的策略
+        WriteCellStyle headWriteCellStyle = new WriteCellStyle();
+        // 背景设置为灰色
+        headWriteCellStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
+        WriteFont headWriteFont = new WriteFont();
+        headWriteFont.setFontHeightInPoints((short)12);
+        // 字体样式
+        headWriteFont.setFontName("Frozen");
+        headWriteCellStyle.setWriteFont(headWriteFont);
+        //自动换行
+        headWriteCellStyle.setWrapped(false);
+        // 水平对齐方式
+        headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
+        // 垂直对齐方式
+        headWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
+
+        // 内容的策略
+        WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
+        // 这里需要指定 FillPatternType 为FillPatternType.SOLID_FOREGROUND 不然无法显示背景颜色.头默认了 FillPatternType所以可以不指定
+//        contentWriteCellStyle.setFillPatternType(FillPatternType.SQUARES);
+        // 背景白色
+        contentWriteCellStyle.setFillForegroundColor(IndexedColors.WHITE.getIndex());
+        WriteFont contentWriteFont = new WriteFont();
+        // 字体大小
+        contentWriteFont.setFontHeightInPoints((short)12);
+        // 字体样式
+        contentWriteFont.setFontName("Calibri");
+        contentWriteCellStyle.setWriteFont(contentWriteFont);
+        // 这个策略是 头是头的样式 内容是内容的样式 其他的策略可以自己实现
+        return new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle);
+    }
+}

+ 1 - 0
user_center/src/main/java/com/huaxu/config/ResourceServerConfig.java

@@ -18,6 +18,7 @@ public class ResourceServerConfig extends ResourceServerConfigurerAdapter {
                 .authorizeRequests()
                 .antMatchers("/swagger-ui.html","/webjars/**", "/webjars/**", "/swagger-resources/**",
                         "/v2/**","/app/**","/user/**","/menu/**","/role/**","/org/**","/userGroup/**")
+                        "/v2/**","/app/**","/user/**","/menu/**","/loginLog/**","/operateLog/**","/excel/download/**")
                 .permitAll() //配置不需要身份认证的请求路径
                 .anyRequest().authenticated() //其他所有访问路径都需要身份认证
                 .and()

+ 140 - 0
user_center/src/main/java/com/huaxu/controller/LoginLogController.java

@@ -0,0 +1,140 @@
+package com.huaxu.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.huaxu.common.EasyExcelUtil;
+import com.huaxu.dto.LoginLogDto;
+import com.huaxu.entity.LoginLogEntity;
+import com.huaxu.model.AjaxMessage;
+import com.huaxu.model.Pagination;
+import com.huaxu.model.ResultStatus;
+import com.huaxu.service.LoginLogService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * @description 登录日志管理控制层
+ * @auto wangli
+ * @data 2020-10-27 9:19
+ */
+@RestController
+@RequestMapping("/loginLog")
+@Api(tags = "登录日志管理")
+public class LoginLogController {
+
+    @Autowired
+    private LoginLogService loginLogService;
+    @Value("${UMIS.sys_excel_path}")
+    private String baseDir;
+
+    /**
+     * 通过主键查询单条数据
+     *
+     * @param id
+     * @return 单条数据
+     */
+    @RequestMapping(value = "get", method = RequestMethod.POST)
+    @ApiOperation(value = "根据id查询登录日志")
+    public AjaxMessage<LoginLogDto> selectOne(
+            @ApiParam(value = "登录日志信息", required = true) @RequestParam Long id) {
+        LoginLogDto result = loginLogService.selectById(id);
+
+        return new AjaxMessage<>(ResultStatus.OK, result);
+    }
+
+    /**
+     * 查询登录日志信息
+     *
+     * @param loginLogDto 参数对象
+     * @return 多条数据
+     */
+    @RequestMapping(value = "selectList", method = RequestMethod.POST)
+    @ApiOperation(value = "查询登录日志信息")
+    public AjaxMessage<List<LoginLogDto>> selectList(
+            @ApiParam(value = "登录日志信息", required = true) @RequestBody LoginLogDto loginLogDto) {
+        List<LoginLogDto> result = loginLogService.selectList(loginLogDto);
+
+        return new AjaxMessage<>(ResultStatus.OK, result);
+    }
+
+
+    /**
+     * 新增一条数据
+     *
+     * @param loginLogEntity 实体类
+     * @return Response对象
+     */
+    @RequestMapping(value = "insert", method = RequestMethod.POST)
+    @ApiOperation(value = "插入登录日志信息")
+    public AjaxMessage<Integer> insert(@ApiParam(value = "登录日志信息", required = true) @RequestBody LoginLogEntity loginLogEntity) {
+        int result = loginLogService.insert(loginLogEntity);
+
+        return new AjaxMessage<>(ResultStatus.OK, result);
+    }
+
+    /**
+     * 修改一条数据
+     *
+     * @param loginLogEntity 实体类
+     * @return Response对象
+     */
+    @RequestMapping(value = "update", method = RequestMethod.POST)
+    @ApiOperation(value = "修改登录日志信息")
+    public AjaxMessage<Integer> update(@ApiParam(value = "登录日志信息", required = true) @RequestBody LoginLogEntity loginLogEntity) {
+        int result = loginLogService.update(loginLogEntity);
+        return new AjaxMessage<>(ResultStatus.OK, result);
+
+    }
+
+    /**
+     * 单条删除数据
+     *
+     * @param id
+     * @return Response对象
+     */
+    @RequestMapping(value = "delete", method = RequestMethod.POST)
+    @ApiOperation(value = "删除登录日志信息")
+    public AjaxMessage<Integer> delete(@ApiParam(value = "登录日志信息", required = true) @RequestParam Long id) {
+        int result = loginLogService.deleteById(id);
+        return new AjaxMessage<>(ResultStatus.OK, result);
+    }
+
+
+    /**
+     * 分页查询
+     *
+     * @param pageNum  偏移
+     * @param pageSize 条数
+     * @return Response对象
+     */
+    @RequestMapping(value = "selectPage", method = RequestMethod.POST)
+    @ApiOperation(value = "查询登录日志信息列表")
+    public AjaxMessage<Pagination<LoginLogDto>> selectPage(
+            @ApiParam(value = "登录日志信息", required = true) @RequestBody LoginLogDto loginLogDto,
+            @ApiParam(value = "页数,非必传,默认第一页", defaultValue = "1") int pageNum,
+            @ApiParam(value = "条数,非必传,默认15条", defaultValue = "30") int pageSize
+
+    ) {
+        IPage<LoginLogDto> iPage = new Page<>(pageNum, pageSize);
+
+        iPage = loginLogService.selectPage(iPage, loginLogDto);
+
+        Pagination<LoginLogDto> pages = new Pagination<>(iPage);
+
+        return new AjaxMessage<>(ResultStatus.OK, pages);
+    }
+
+    @RequestMapping(value = "/exportExcel", method = RequestMethod.POST)
+    @ApiOperation(value = "登录日志导出")
+    public AjaxMessage<String> exportExcel(@ApiParam(value = "日志IDS", required = true) @RequestParam Long[] ids) {
+        List<LoginLogDto> result = loginLogService.selectListByIds(ids);
+        String filePath = EasyExcelUtil.excelWrite(baseDir, LoginLogDto.class, "登录日志", result);
+        return new AjaxMessage<>(ResultStatus.OK, filePath);
+    }
+}

+ 57 - 7
user_center/src/main/java/com/huaxu/controller/MenuController.java

@@ -2,6 +2,7 @@ package com.huaxu.controller;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.huaxu.common.FileUploadUtil;
 import com.huaxu.entity.UserEntity;
 import com.huaxu.model.AjaxMessage;
 import com.huaxu.model.Pagination;
@@ -10,14 +11,20 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Controller;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.ui.ModelMap;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Map;
 import java.util.Date;
 import org.springframework.web.bind.annotation.*;
 import com.huaxu.entity.MenuEntity;
 import com.huaxu.service.MenuService;
+import org.springframework.web.multipart.MultipartFile;
 
 /**
  * 菜单页面控制器
@@ -30,10 +37,12 @@ import com.huaxu.service.MenuService;
 public class MenuController {
     @Autowired
     private MenuService menuService;
+    @Value("${UMIS.sys_config_path}")
+    private String baseDir;
 
     @ApiOperation(value = "分页查询菜单信息")
-    @RequestMapping(value = "/selectPage",method = RequestMethod.POST)
-    public  AjaxMessage<Pagination<MenuEntity>> list(@RequestParam Integer pageNum, @RequestParam Integer pageSize,@ApiParam(value = "菜单信息", required = false)@RequestBody MenuEntity menuEntity) {
+    @RequestMapping(value = "/selectPage", method = RequestMethod.POST)
+    public AjaxMessage<Pagination<MenuEntity>> list(@RequestParam Integer pageNum, @RequestParam Integer pageSize, @ApiParam(value = "菜单信息", required = false) @RequestBody MenuEntity menuEntity) {
         IPage<MenuEntity> iPage = new Page<>(pageNum, pageSize);
         iPage = menuService.findPage(iPage, menuEntity);
         Pagination<MenuEntity> pages = new Pagination<>(iPage);
@@ -45,11 +54,39 @@ public class MenuController {
      */
     @ApiOperation(value = "新增菜单信息")
     @RequestMapping(value = "/add", method = RequestMethod.POST)
-    public AjaxMessage<Integer> addMenu(@ApiParam(value = "菜单信息", required = true)@RequestBody  MenuEntity menu) {
+    public AjaxMessage<Integer> addMenu(@ApiParam(value = "菜单信息", required = true) @RequestBody MenuEntity menu) {
         int result = menuService.addMenu(menu) ? 1 : 0;
         return new AjaxMessage<>(ResultStatus.OK, result);
     }
 
+    /**
+     * 批量新增
+     */
+    @ApiOperation(value = "批量新增菜单信息")
+    @RequestMapping(value = "/addBatch", method = RequestMethod.POST)
+    public AjaxMessage<Integer> addMenus(@ApiParam(value = "菜单信息", required = true) @RequestBody ArrayList<MenuEntity> menus) {
+        int result = menuService.saveBatch(menus) ? 1 : 0;
+        return new AjaxMessage<>(ResultStatus.OK, result);
+    }
+
+    /**
+     * 新增
+     */
+    @ApiOperation(value = "菜单图标")
+    @RequestMapping(value = "addMenuImag", method = RequestMethod.POST)
+    @ResponseBody
+    public AjaxMessage<String> addUserPhoto(@ApiParam(value = "菜单图标", required = true) @RequestParam("avatarfile") MultipartFile file) {
+        String avatar = "";
+        if (!file.isEmpty()) {
+            try {
+                avatar = FileUploadUtil.uploadWeb(baseDir, file);
+            } catch (IOException e) {
+                return new AjaxMessage<>(ResultStatus.ERROR, e.getMessage());
+            }
+        }
+        return new AjaxMessage<>(ResultStatus.OK, avatar);
+    }
+
     /**
      * 按ID查询菜单
      */
@@ -65,7 +102,7 @@ public class MenuController {
      */
     @ApiOperation(value = "修改保存菜单")
     @RequestMapping(value = "/edit", method = RequestMethod.POST)
-    public  AjaxMessage<Integer> editMenu(@ApiParam(value = "菜单信息", required = true)@RequestBody MenuEntity menu) {
+    public AjaxMessage<Integer> editMenu(@ApiParam(value = "菜单信息", required = true) @RequestBody MenuEntity menu) {
         int result = menuService.updateMenuById(menu) ? 1 : 0;
         return new AjaxMessage<>(ResultStatus.OK, result);
     }
@@ -75,7 +112,13 @@ public class MenuController {
      */
     @ApiOperation(value = "批量删除菜单")
     @RequestMapping(value = "/deleteByIds", method = RequestMethod.DELETE)
-    public AjaxMessage<Integer> deleteByIds(@ApiParam(value = "菜单IDS", required = true)@RequestParam Long[] ids) {
+    public AjaxMessage<Integer> deleteByIds(@ApiParam(value = "菜单IDS", required = true) @RequestParam Long[] ids) {
+
+        List<MenuEntity> menuEntityList = menuService.findMenuByParentIds(ids);
+        if (menuEntityList.size() > 0) {
+            return new AjaxMessage<>(ResultStatus.EXSIT_IS_PARENT_ERROR, 0);
+        }
+
         int result = menuService.delMenuByIds(ids) ? 1 : 0;
         return new AjaxMessage<>(ResultStatus.OK, result);
     }
@@ -86,7 +129,14 @@ public class MenuController {
     @ApiOperation(value = "单个删除菜单")
     @RequestMapping(value = "/deleteById", method = RequestMethod.DELETE)
     public AjaxMessage<Integer> deleteById(@ApiParam(value = "菜单ID", required = true) @RequestParam Long id) {
-        int result = menuService.delMenuById(id) ? 1 : 0;
-        return new AjaxMessage<>(ResultStatus.OK, result);
+        MenuEntity menuEntity = new MenuEntity();
+        menuEntity.setParentMenuId(id);
+        List<MenuEntity> menuEntityList = menuService.findList(menuEntity);
+        if (menuEntityList.size() > 0) {
+            return new AjaxMessage<>(ResultStatus.EXSIT_IS_PARENT_ERROR, 0);
+        } else {
+            int result = menuService.delMenuById(id) ? 1 : 0;
+            return new AjaxMessage<>(ResultStatus.OK, result);
+        }
     }
 }

+ 140 - 0
user_center/src/main/java/com/huaxu/controller/OperateLogController.java

@@ -0,0 +1,140 @@
+package com.huaxu.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.huaxu.common.EasyExcelUtil;
+import com.huaxu.dto.LoginLogDto;
+import com.huaxu.dto.OperateLogDto;
+import com.huaxu.entity.OperateLogEntity;
+import com.huaxu.model.AjaxMessage;
+import com.huaxu.model.Pagination;
+import com.huaxu.model.ResultStatus;
+import com.huaxu.service.OperateLogService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * @description
+ * @auto wangli
+ * @data 2020-10-27 9:19
+ */
+@RestController
+@RequestMapping("/operateLog")
+@Api(tags = "操作日志管理")
+public class OperateLogController {
+
+    @Autowired
+    private OperateLogService operateLogService;
+    @Value("${UMIS.sys_excel_path}")
+    private String baseDir;
+    /**
+     * 通过主键查询单条数据
+     *
+     * @param id
+     * @return 单条数据
+     */
+    @RequestMapping(value = "get", method = RequestMethod.POST)
+    @ApiOperation(value = "根据id查询操作日志")
+    public AjaxMessage<OperateLogDto> selectOne(
+            @ApiParam(value = "操作日志信息", required = true) @RequestParam Integer id) {
+        OperateLogDto result = operateLogService.selectById(id);
+
+        return new AjaxMessage<>(ResultStatus.OK, result);
+    }
+
+    /**
+     * 查询操作日志信息
+     *
+     * @param operateLogDto 参数对象
+     * @return 多条数据
+     */
+    @RequestMapping(value = "selectList", method = RequestMethod.POST)
+    @ApiOperation(value = "查询操作日志信息")
+    public AjaxMessage<List<OperateLogDto>> selectList(
+            @ApiParam(value = "操作日志信息", required = true) @RequestBody OperateLogDto operateLogDto) {
+        List<OperateLogDto> result = operateLogService.selectList(operateLogDto);
+
+        return new AjaxMessage<>(ResultStatus.OK, result);
+    }
+
+
+    /**
+     * 新增一条数据
+     *
+     * @param operateLogEntity 实体类
+     * @return Response对象
+     */
+    @RequestMapping(value = "insert", method = RequestMethod.POST)
+    @ApiOperation(value = "插入操作日志信息")
+    public AjaxMessage<Integer> insert(@ApiParam(value = "操作日志信息", required = true) @RequestBody OperateLogEntity operateLogEntity) {
+        int result = operateLogService.insert(operateLogEntity);
+
+        return new AjaxMessage<>(ResultStatus.OK, result);
+    }
+
+    /**
+     * 修改一条数据
+     *
+     * @param operateLogEntity 实体类
+     * @return Response对象
+     */
+    @RequestMapping(value = "update", method = RequestMethod.POST)
+    @ApiOperation(value = "修改操作日志信息")
+    public AjaxMessage<Integer> update(@ApiParam(value = "操作日志信息", required = true) @RequestBody OperateLogEntity operateLogEntity) {
+        int result = operateLogService.update(operateLogEntity);
+        return new AjaxMessage<>(ResultStatus.OK, result);
+
+    }
+
+    /**
+     * 单条删除数据
+     *
+     * @param id
+     * @return Response对象
+     */
+    @RequestMapping(value = "delete", method = RequestMethod.POST)
+    @ApiOperation(value = "删除操作日志信息")
+    public AjaxMessage<Integer> delete(@ApiParam(value = "操作日志信息", required = true) @RequestParam Integer id) {
+        int result = operateLogService.deleteById(id);
+        return new AjaxMessage<>(ResultStatus.OK, result);
+    }
+
+
+    /**
+     * 分页查询
+     *
+     * @param pageNum  偏移
+     * @param pageSize 条数
+     * @return Response对象
+     */
+    @RequestMapping(value = "selectPage", method = RequestMethod.POST)
+    @ApiOperation(value = "查询操作日志信息列表")
+    public AjaxMessage<Pagination<OperateLogDto>> selectPage(
+            @ApiParam(value = "操作日志信息", required = true) @RequestBody OperateLogDto operateLogDto,
+            @ApiParam(value = "页数,非必传,默认第一页",  defaultValue = "1")  int pageNum,
+            @ApiParam(value = "条数,非必传,默认15条",  defaultValue = "30")  int pageSize
+
+    ) {
+        IPage<OperateLogDto> iPage = new Page<>(pageNum, pageSize);
+
+        iPage = operateLogService.selectPage(iPage, operateLogDto);
+
+        Pagination<OperateLogDto> pages = new Pagination<>(iPage);
+
+        return new AjaxMessage<>(ResultStatus.OK, pages);
+    }
+
+    @RequestMapping(value = "/exportExcel", method = RequestMethod.POST)
+    @ApiOperation(value = "操作日志导出")
+    public AjaxMessage<String> exportExcel(@ApiParam(value = "日志IDS", required = true) @RequestParam Long[] ids) {
+        List<OperateLogDto> result = operateLogService.selectListByIds(ids);
+        String filePath = EasyExcelUtil.excelWrite(baseDir, OperateLogDto.class, "操作日志", result);
+        return new AjaxMessage<>(ResultStatus.OK, filePath);
+    }
+}

+ 79 - 0
user_center/src/main/java/com/huaxu/controller/SysDownloadContorller.java

@@ -0,0 +1,79 @@
+package com.huaxu.controller;
+
+import cn.hutool.core.io.FileUtil;
+import io.swagger.annotations.Api;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import javax.servlet.ServletOutputStream;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.net.URLDecoder;
+
+/**
+ * <p>下载控制</p>
+ *
+ * @author: WYY
+ * @date: 2020-10-28 11:33
+ * @version: 1.0.1
+ */
+@Slf4j
+@Controller
+@Api(tags = "通用下载接口")
+public class SysDownloadContorller {
+	@RequestMapping(value = "/excel/download", method = RequestMethod.GET)
+	public void download(HttpServletRequest request,
+						 HttpServletResponse response, @RequestParam("fileName") String fileName) {
+		try {
+			String path = fileName;
+			if (FileUtil.exist(path)) {
+				//浏览器设置
+				String userAgent = request.getHeader("User-Agent");
+				if (userAgent.contains("MSIE") || userAgent.contains("Trident")) {
+					//IE浏览器处理
+					fileName = java.net.URLEncoder.encode(fileName, "UTF-8");
+				} else {
+					// 非IE浏览器的处理:
+					fileName = new String(fileName.getBytes("UTF-8"), "ISO-8859-1");
+				}
+				//下载的文件携带这个名称
+				response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
+				//文件下载类型--二进制文件
+				response.setContentType("application/octet-stream");
+
+				File imageFile = FileUtil.file(path);
+				FileInputStream fis = new FileInputStream(imageFile);
+				byte[] buffer = new byte[1024];
+				ByteArrayOutputStream bos = new ByteArrayOutputStream(fis.available());
+				int len = 0;
+				while (-1 != (len = fis.read(buffer, 0, buffer.length))) {
+					bos.write(buffer, 0, len);
+				}
+				log.info("==============================下载包长度:!" + bos.size() + "   ========================");
+				response.setHeader("Content-Length", bos.size() + "");
+				fis.close();
+				ServletOutputStream sos = response.getOutputStream();
+				sos.write(bos.toByteArray());
+				sos.flush();
+				sos.close();
+				log.info("==============================下载完成![" + path + "]   ========================");
+				//删除
+				FileUtil.del(path);
+				return;
+			} else {
+				log.error("文件不存在");
+				return;
+			}
+		} catch (Exception e) {
+			log.error("下载文件异常");
+			return;
+		}
+	}
+}
+

+ 7 - 8
user_center/src/main/java/com/huaxu/controller/TenantController.java

@@ -19,15 +19,14 @@ import org.springframework.web.multipart.MultipartFile;
 import java.io.IOException;
 import java.util.List;
 
-/**
- * 租户(Tenant)控制层
- *
- * @author makejava
- * @since 2020-10-20 16:56:39
+ /**
+ * @description 租户(Tenant)控制层
+ * @auto wangli
+ * @data 2020-10-26 15:44
  */
 @RestController
 @RequestMapping("/tenant")
-@Api(tags = "租户接口")
+@Api(tags = "租户管理")
 public class TenantController {
     /**
      * 租户
@@ -46,7 +45,7 @@ public class TenantController {
     @RequestMapping(value = "get", method = RequestMethod.POST)
     @ApiOperation(value = "根据id查询租户")
     public AjaxMessage<TenantEntity> selectOne(
-            @ApiParam(value = "租户信息", required = true) Integer id) {
+            @ApiParam(value = "租户信息", required = true) @RequestParam Integer id) {
         TenantEntity result = tenantService.selectById(id);
 
         return new AjaxMessage<>(ResultStatus.OK, result);
@@ -121,7 +120,7 @@ public class TenantController {
      */
     @RequestMapping(value = "delete", method = RequestMethod.POST)
     @ApiOperation(value = "删除租户信息")
-    public AjaxMessage<Integer> delete(@ApiParam(value = "租户信息", required = true) Integer id) {
+    public AjaxMessage<Integer> delete(@ApiParam(value = "租户信息", required = true) @RequestParam Integer id) {
         int result = tenantService.deleteById(id);
         return new AjaxMessage<>(ResultStatus.OK, result);
     }

+ 83 - 0
user_center/src/main/java/com/huaxu/dao/LoginLogMapper.java

@@ -0,0 +1,83 @@
+package com.huaxu.dao;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.huaxu.dto.LoginLogDto;
+import com.huaxu.entity.LoginLogEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @description 登录日志数据层
+ * @auto wangli
+ * @data 2020-10-26 17:05
+ */
+@Mapper
+public interface LoginLogMapper {
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    LoginLogDto selectById(Long id);
+
+    /**
+     * 查询全部
+     *
+     * @return 对象列表
+     */
+    List<LoginLogDto> selectAll();
+
+    /**
+     * 通过实体作为筛选条件查询
+     *
+     * @param loginLogEntity 实例对象
+     * @return 对象列表
+     */
+    List<LoginLogDto> selectList(LoginLogEntity loginLogEntity);
+
+    /**
+     * 新增数据
+     *
+     * @param loginLogEntity 实例对象
+     * @return 影响行数
+     */
+    int insert(LoginLogEntity loginLogEntity);
+
+    /**
+     * 批量新增
+     *
+     * @param loginLogEntities 实例对象的集合
+     * @return 影响行数
+     */
+    int batchInsert(List<LoginLogEntity> loginLogEntities);
+
+    /**
+     * 修改数据
+     *
+     * @param loginLogEntity 实例对象
+     * @return 影响行数
+     */
+    int update(LoginLogEntity loginLogEntity);
+
+    /**
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 影响行数
+     */
+    int deleteById(Long id);
+
+    /**
+     * 查询总数据数
+     *
+     * @return 数据总数
+     */
+    int count();
+
+    IPage<LoginLogDto> selectPage(IPage<LoginLogDto> page, LoginLogDto loginLogDto);
+
+    List<LoginLogDto> selectListByIds(@Param("ids") Long[] ids);
+}

+ 11 - 7
user_center/src/main/java/com/huaxu/dao/MenuMapper.java

@@ -17,16 +17,20 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 @Mapper
 public interface MenuMapper extends BaseMapper<MenuEntity> {
 
-	/**
+    /**
      * 自定义分页查询
-     * @param  page 
-     * @param  menuEntity 实体类
+     *
+     * @param page
+     * @param menuEntity 实体类
      */
-     Page<MenuEntity> findPage(IPage<MenuEntity> page, @Param("menu") MenuEntity menuEntity);
+    Page<MenuEntity> findPage(IPage<MenuEntity> page, @Param("menu") MenuEntity menuEntity);
 
-     MenuEntity findMenuById(Serializable id);
+    MenuEntity findMenuById(Serializable id);
 
-     List<MenuEntity> findList(MenuEntity menuEntity);
+    List<MenuEntity> findList(MenuEntity menuEntity);
 
-     /**删除相关方法  使用mybatis-plus集成的 **/
+    List<MenuEntity> findMenuByParentIds(@Param("Ids") Long[] Ids);
+
+
+    /**删除相关方法  使用mybatis-plus集成的 **/
 }

+ 83 - 0
user_center/src/main/java/com/huaxu/dao/OperateLogMapper.java

@@ -0,0 +1,83 @@
+package com.huaxu.dao;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.huaxu.dto.OperateLogDto;
+import com.huaxu.entity.OperateLogEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @description 操作日志数据层
+ * @auto wangli
+ * @data 2020-10-26 17:04
+ */
+@Mapper
+public interface OperateLogMapper {
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    OperateLogDto selectById(Integer id);
+
+    /**
+     * 查询全部
+     *
+     * @return 对象列表
+     */
+    List<OperateLogDto> selectAll();
+
+    /**
+     * 通过实体作为筛选条件查询
+     *
+     * @param operateLogDto 实例对象
+     * @return 对象列表
+     */
+    List<OperateLogDto> selectList(OperateLogDto operateLogDto);
+
+    /**
+     * 新增数据
+     *
+     * @param operateLogEntity 实例对象
+     * @return 影响行数
+     */
+    int insert(OperateLogEntity operateLogEntity);
+
+    /**
+     * 批量新增
+     *
+     * @param loginLogEntities 实例对象的集合
+     * @return 影响行数
+     */
+    int batchInsert(List<OperateLogEntity> loginLogEntities);
+
+    /**
+     * 修改数据
+     *
+     * @param operateLogEntity 实例对象
+     * @return 影响行数
+     */
+    int update(OperateLogEntity operateLogEntity);
+
+    /**
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 影响行数
+     */
+    int deleteById(Integer id);
+
+    /**
+     * 查询总数据数
+     *
+     * @return 数据总数
+     */
+    int count();
+
+    IPage<OperateLogDto> selectPage(IPage<OperateLogDto> page, OperateLogDto operateLogDto);
+
+    List<OperateLogDto> selectListByIds(@Param("ids") Long[] ids);
+}

+ 7 - 7
user_center/src/main/java/com/huaxu/dao/TenantMapper.java

@@ -32,18 +32,18 @@ public interface TenantMapper {
     /**
      * 通过实体作为筛选条件查询
      *
-     * @param TenantEntity 实例对象
+     * @param tenantEntity 实例对象
      * @return 对象列表
      */
-    List<TenantEntity> selectList(TenantEntity TenantEntity);
+    List<TenantEntity> selectList(TenantEntity tenantEntity);
 
     /**
      * 新增数据
      *
-     * @param TenantEntity 实例对象
+     * @param tenantEntity 实例对象
      * @return 影响行数
      */
-    int insert(TenantEntity TenantEntity);
+    int insert(TenantEntity tenantEntity);
 
     /**
      * 批量新增
@@ -56,10 +56,10 @@ public interface TenantMapper {
     /**
      * 修改数据
      *
-     * @param TenantEntity 实例对象
+     * @param tenantEntity 实例对象
      * @return 影响行数
      */
-    int update(TenantEntity TenantEntity);
+    int update(TenantEntity tenantEntity);
 
     /**
      * 通过主键删除数据
@@ -76,7 +76,7 @@ public interface TenantMapper {
      */
     int count();
 
-    IPage<TenantEntity> selectPage(IPage<TenantEntity> page, TenantEntity TenantEntity);
+    IPage<TenantEntity> selectPage(IPage<TenantEntity> page, TenantEntity tenantEntity);
 
 
 

+ 41 - 0
user_center/src/main/java/com/huaxu/dto/LoginLogDto.java

@@ -0,0 +1,41 @@
+package com.huaxu.dto;
+
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.huaxu.entity.LoginLogEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @description
+ * @auto wangli
+ * @data 2020-10-26 17:40
+ */
+@Data
+public class LoginLogDto extends LoginLogEntity {
+
+    @ApiModelProperty(value = "公司名称")
+    @ExcelProperty(value = {"登录日志","公司名称"},index = 0)
+    private String companyName;
+
+    @ExcelProperty(value = {"登录日志","部门名称"},index = 1)
+    @ApiModelProperty(value = "部门名称")
+    private String departmentName;
+
+    @ExcelIgnore
+    @ApiModelProperty(value = "查询条件(用户名/手机号)")
+    private String condition;
+
+    @ExcelIgnore
+    @ApiModelProperty(value = "查询条件(起始时间)" )
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date beginTime;
+
+    @ExcelIgnore
+    @ApiModelProperty(value = "查询条件(终止时间)")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date endTime;
+}

+ 38 - 0
user_center/src/main/java/com/huaxu/dto/OperateLogDto.java

@@ -0,0 +1,38 @@
+package com.huaxu.dto;
+
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.huaxu.entity.OperateLogEntity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @description
+ * @auto wangli
+ * @data 2020-10-26 17:40
+ */
+@Data
+public class OperateLogDto extends OperateLogEntity {
+
+    @ExcelProperty(value = {"操作日志","公司名称"},index = 0)
+    @ApiModelProperty(value = "公司名称")
+    private String companyName;
+    @ExcelProperty(value = {"操作日志","部门名称"},index = 1)
+    @ApiModelProperty(value = "部门名称")
+    private String departmentName;
+
+    @ExcelIgnore
+    @ApiModelProperty(value = "查询条件(用户名/手机号)")
+    private String condition;
+    @ExcelIgnore
+    @ApiModelProperty(value = "查询条件(起始时间)" )
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date beginTime;
+    @ExcelIgnore
+    @ApiModelProperty(value = "查询条件(终止时间)" )
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date endTime;
+}

+ 54 - 0
user_center/src/main/java/com/huaxu/entity/LoginLogEntity.java

@@ -0,0 +1,54 @@
+package com.huaxu.entity;
+
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @description 登录日志实体类(uims_login_log)
+ * @auto wangli
+ * @data 2020-10-26 15:51
+ */
+@Data
+public class LoginLogEntity implements Serializable {
+
+    private static final long serialVersionUID = 2497615333704709016L;
+
+    @ExcelIgnore
+    @ApiModelProperty(value = "主键id")
+    private Long id ;
+
+    @ExcelProperty(value = {"登录日志","用户名"},index = 2)
+    @ApiModelProperty(value = "用户名")
+    private String name;
+
+    @ExcelProperty(value = {"登录日志","手机号"},index = 3)
+    @ApiModelProperty(value = "手机号")
+    private String phone;
+
+    @ExcelIgnore
+    @ApiModelProperty(value = "公司id")
+    private Long companyId;
+
+    @ExcelIgnore
+    @ApiModelProperty(value = "部门id")
+    private Long departmentId;
+
+    @ExcelProperty(value = {"登录日志","登录类型"},index = 4)
+    @ApiModelProperty(value = "登录类型")
+    private String type;
+
+    @ExcelProperty(value = {"登录日志","创建时间"},index = 6)
+    @ApiModelProperty(value = "创建时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createTime;
+
+    @ExcelProperty(value = {"登录日志","登录IP"},index = 5)
+    @ApiModelProperty(value = "登录IP")
+    private String loginIp;
+}

+ 45 - 0
user_center/src/main/java/com/huaxu/entity/OperateLogEntity.java

@@ -0,0 +1,45 @@
+package com.huaxu.entity;
+
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @description 操作日志实体类(uims_opr_log)
+ * @auto wangli
+ * @data 2020-10-26 15:53
+ */
+@Data
+public class OperateLogEntity implements Serializable {
+
+    private static final long serialVersionUID = 7048815501996712070L;
+
+    @ExcelIgnore
+    @ApiModelProperty(value = "主键id")
+    private Long id ;
+    @ExcelProperty(value = {"操作日志","用户名"},index = 2)
+    @ApiModelProperty(value = "用户名")
+    private String userName;
+    @ExcelProperty(value = {"操作日志","手机号"},index = 3)
+    @ApiModelProperty(value = "手机号")
+    private String phone;
+    @ExcelIgnore
+    @ApiModelProperty(value = "公司id")
+    private Integer companyId;
+    @ExcelIgnore
+    @ApiModelProperty(value = "部门id")
+    private Integer departmentId;
+    @ExcelProperty(value = {"操作日志","操作内容"},index = 4)
+    @ApiModelProperty(value = "操作内容")
+    private String operateContent;
+    @ExcelProperty(value = {"操作日志","创建时间"},index = 5)
+    @ApiModelProperty(value = "创建时间")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    private Date createTime;
+
+}

+ 4 - 4
user_center/src/main/java/com/huaxu/entity/TenantEntity.java

@@ -8,11 +8,11 @@ import javax.validation.constraints.NotNull;
 import java.io.Serializable;
 import java.time.LocalDateTime;
 
-/**
- * 租户实体类(uims_tenant)
- * @description
+
+ /**
+ * @description 租户实体类(uims_tenant)
  * @auto wangli
- * @data 2020-10-26 9:43
+ * @data 2020-10-26 15:44
  */
 @Data
 @ApiModel("租户信息")

+ 84 - 0
user_center/src/main/java/com/huaxu/service/LoginLogService.java

@@ -0,0 +1,84 @@
+package com.huaxu.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.huaxu.dto.LoginLogDto;
+import com.huaxu.entity.LoginLogEntity;
+
+import java.util.List;
+
+/**
+ * @description 登录日志接口
+ * @auto wangli
+ * @data 2020-10-27 8:59
+ */
+public interface LoginLogService {
+
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    LoginLogDto selectById(Long id);
+
+    /**
+     * 查询全部
+     *
+     * @return 对象列表
+     */
+    List<LoginLogDto> selectAll();
+
+    /**
+     * 通过实体作为筛选条件查询
+     *
+     * @param loginLogEntity 实例对象
+     * @return 对象列表
+     */
+    List<LoginLogDto> selectList(LoginLogEntity loginLogEntity);
+
+    /**
+     * 新增数据
+     *
+     * @param loginLogEntity 实例对象
+     * @return 影响行数
+     */
+    int insert(LoginLogEntity loginLogEntity);
+
+    /**
+     * 批量新增
+     *
+     * @param loginLogEntities 实例对象的集合
+     * @return 影响行数
+     */
+    int batchInsert(List<LoginLogEntity> loginLogEntities);
+
+    /**
+     * 修改数据
+     *
+     * @param loginLogEntity 实例对象
+     * @return 影响行数
+     */
+    int update(LoginLogEntity loginLogEntity);
+
+    /**
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 影响行数
+     */
+    int deleteById(Long id);
+
+    /**
+     * 查询总数据数
+     *
+     * @return 数据总数
+     */
+    int count();
+
+    IPage<LoginLogDto> selectPage(IPage<LoginLogDto> page, LoginLogDto loginLogDto);
+    /**
+     * 通过实体作为筛选条件查询
+     * @return 对象列表
+     */
+    List<LoginLogDto> selectListByIds(Long[] Ids);
+}

+ 6 - 0
user_center/src/main/java/com/huaxu/service/MenuService.java

@@ -39,6 +39,12 @@ public class MenuService extends ServiceImpl<MenuMapper,MenuEntity> {
 		return menuMapper.findList(menuEntity);
 	}
 
+	/**
+	 * 按父级节点查列表
+	 */
+	public List<MenuEntity> findMenuByParentIds( Long[] ids) {
+		return menuMapper.findMenuByParentIds(ids);
+	}
 	/**
 	 * 批量删除
 	 */

+ 85 - 0
user_center/src/main/java/com/huaxu/service/OperateLogService.java

@@ -0,0 +1,85 @@
+package com.huaxu.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.huaxu.dto.LoginLogDto;
+import com.huaxu.dto.OperateLogDto;
+import com.huaxu.entity.OperateLogEntity;
+
+import java.util.List;
+
+/**
+ * @description 操作日志接口
+ * @auto wangli
+ * @data 2020-10-27 8:59
+ */
+public interface OperateLogService {
+    /**
+     * 通过ID查询单条数据
+     *
+     * @param id 主键
+     * @return 实例对象
+     */
+    OperateLogDto selectById(Integer id);
+
+    /**
+     * 查询全部
+     *
+     * @return 对象列表
+     */
+    List<OperateLogDto> selectAll();
+
+    /**
+     * 通过实体作为筛选条件查询
+     *
+     * @param operateLogDto 实例对象
+     * @return 对象列表
+     */
+    List<OperateLogDto> selectList(OperateLogDto operateLogDto);
+
+    /**
+     * 新增数据
+     *
+     * @param operateLogEntity 实例对象
+     * @return 影响行数
+     */
+    int insert(OperateLogEntity operateLogEntity);
+
+    /**
+     * 批量新增
+     *
+     * @param loginLogEntities 实例对象的集合
+     * @return 影响行数
+     */
+    int batchInsert(List<OperateLogEntity> loginLogEntities);
+
+    /**
+     * 修改数据
+     *
+     * @param operateLogEntity 实例对象
+     * @return 影响行数
+     */
+    int update(OperateLogEntity operateLogEntity);
+
+    /**
+     * 通过主键删除数据
+     *
+     * @param id 主键
+     * @return 影响行数
+     */
+    int deleteById(Integer id);
+
+    /**
+     * 查询总数据数
+     *
+     * @return 数据总数
+     */
+    int count();
+
+    IPage<OperateLogDto> selectPage(IPage<OperateLogDto> page, OperateLogDto operateLogDto);
+
+    /**
+     * 通过实体作为筛选条件查询
+     * @return 对象列表
+     */
+    List<OperateLogDto> selectListByIds(Long[] Ids);
+}

+ 3 - 4
user_center/src/main/java/com/huaxu/service/TenantService.java

@@ -6,10 +6,9 @@ import com.huaxu.entity.TenantEntity;
 import java.util.List;
 
 /**
- * 租户(Tenant)表服务接口
- *
- * @author makejava
- * @since 2020-10-20 17:08:13
+ * @description 租户管理接口
+ * @auto wangli
+ * @data 2020-10-26 15:44
  */
 public interface TenantService {
 

+ 73 - 0
user_center/src/main/java/com/huaxu/service/impl/LoginLogServiceImpl.java

@@ -0,0 +1,73 @@
+package com.huaxu.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.huaxu.dao.LoginLogMapper;
+import com.huaxu.dto.LoginLogDto;
+import com.huaxu.entity.LoginLogEntity;
+import com.huaxu.service.LoginLogService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * @description 登录日志管理实现类
+ * @auto wangli
+ * @data 2020-10-27 9:03
+ */
+@Service("loginLogService")
+public class LoginLogServiceImpl implements LoginLogService {
+
+    @Resource
+    private LoginLogMapper loginLogMapper;
+
+    @Override
+    public LoginLogDto selectById(Long id) {
+        return loginLogMapper.selectById(id);
+    }
+
+    @Override
+    public List<LoginLogDto> selectAll() {
+        return loginLogMapper.selectAll();
+    }
+
+    @Override
+    public List<LoginLogDto> selectList(LoginLogEntity loginLogEntity) {
+        return loginLogMapper.selectList(loginLogEntity);
+    }
+
+    @Override
+    public int insert(LoginLogEntity loginLogEntity) {
+        return loginLogMapper.insert(loginLogEntity);
+    }
+
+    @Override
+    public int batchInsert(List<LoginLogEntity> loginLogEntities) {
+        return loginLogMapper.batchInsert(loginLogEntities);
+    }
+
+    @Override
+    public int update(LoginLogEntity loginLogEntity) {
+        return loginLogMapper.update(loginLogEntity);
+    }
+
+    @Override
+    public int deleteById(Long id) {
+        return loginLogMapper.deleteById(id);
+    }
+
+    @Override
+    public int count() {
+        return loginLogMapper.count();
+    }
+
+    @Override
+    public IPage<LoginLogDto> selectPage(IPage<LoginLogDto> page, LoginLogDto loginLogDto) {
+        return loginLogMapper.selectPage(page, loginLogDto);
+    }
+
+    @Override
+    public List<LoginLogDto> selectListByIds(Long[] Ids) {
+        return loginLogMapper.selectListByIds(Ids);
+    }
+}

+ 73 - 0
user_center/src/main/java/com/huaxu/service/impl/OperateLogServiceImpl.java

@@ -0,0 +1,73 @@
+package com.huaxu.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.huaxu.dao.OperateLogMapper;
+import com.huaxu.dto.OperateLogDto;
+import com.huaxu.entity.OperateLogEntity;
+import com.huaxu.service.OperateLogService;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+import java.util.List;
+
+/**
+ * @description  操作日志管理实现类
+ * @auto wangli
+ * @data 2020-10-27 9:03
+ */
+@Service("operateLogService")
+public class OperateLogServiceImpl implements OperateLogService {
+
+    @Resource
+    private OperateLogMapper operateLogMapper;
+
+    @Override
+    public OperateLogDto selectById(Integer id) {
+        return operateLogMapper.selectById(id);
+    }
+
+    @Override
+    public List<OperateLogDto> selectAll() {
+        return operateLogMapper.selectAll();
+    }
+
+    @Override
+    public List<OperateLogDto> selectList(OperateLogDto operateLogDto) {
+        return operateLogMapper.selectList(operateLogDto);
+    }
+
+    @Override
+    public int insert(OperateLogEntity operateLogEntity) {
+        return operateLogMapper.insert(operateLogEntity);
+    }
+
+    @Override
+    public int batchInsert(List<OperateLogEntity> loginLogEntities) {
+        return operateLogMapper.batchInsert(loginLogEntities);
+    }
+
+    @Override
+    public int update(OperateLogEntity operateLogEntity) {
+        return operateLogMapper.update(operateLogEntity);
+    }
+
+    @Override
+    public int deleteById(Integer id) {
+        return operateLogMapper.deleteById(id);
+    }
+
+    @Override
+    public int count() {
+        return operateLogMapper.count();
+    }
+
+    @Override
+    public IPage<OperateLogDto> selectPage(IPage<OperateLogDto> page, OperateLogDto operateLogDto) {
+        return operateLogMapper.selectPage(page, operateLogDto);
+    }
+
+    @Override
+    public List<OperateLogDto> selectListByIds(Long[] Ids) {
+        return operateLogMapper.selectListByIds(Ids);
+    }
+}

+ 5 - 5
user_center/src/main/java/com/huaxu/service/impl/TenantServiceImpl.java

@@ -9,11 +9,11 @@ import org.springframework.stereotype.Service;
 
 import java.util.List;
 
-/**
- * 租户(App表)服务实现类
- *
- * @author makejava
- * @since 2020-10-20 17:08:14
+
+ /**
+ * @description 租户管理实现类
+ * @auto wangli
+ * @data 2020-10-26 15:44
  */
 @Service("tenantService")
 public class TenantServiceImpl implements TenantService {

+ 1 - 0
user_center/src/main/resources/application-dev.properties

@@ -65,6 +65,7 @@ spring.kafka.consumer.properties.spring.json.trusted.packages=*
 #nacos
 spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848
 UMIS.sys_config_path=E:/UMIS_USER_IMAGES/
+UMIS.sys_excel_path=E:/UMIS_USER_EXCEL/
 
 
 

+ 1 - 0
user_center/src/main/resources/application-sit.properties

@@ -91,4 +91,5 @@ dubbo.application.qos-accept-foreign-ip=false
 login.auth.tips.template=7lh0fkmppfPywI4YfrnMOAKQTGXzjueU6awMRD7KRUk
 spring.cloud.stream.bindings.wechat-notify-message.destination=wechat_notify_channel_sit
 UMIS.sys_config_path=/UMIS_USER_IMAGES/
+UMIS.sys_excel_path=/UMIS_USER_EXCEL/
 

+ 1 - 0
user_center/src/main/resources/application-uat.properties

@@ -94,3 +94,4 @@ dubbo.application.qos-accept-foreign-ip=false
 login.auth.tips.template=7lh0fkmppfPywI4YfrnMOAKQTGXzjueU6awMRD7KRUk
 spring.cloud.stream.bindings.wechat-notify-message.destination=wechat_notify_channel_uat
 UMIS.sys_config_path=/UMIS_USER_IMAGES/
+UMIS.sys_excel_path=/UMIS_USER_EXCEL/

+ 172 - 0
user_center/src/main/resources/mapper/LoginLog.xml

@@ -0,0 +1,172 @@
+<?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="com.huaxu.dao.LoginLogMapper">
+
+    <!-- 结果集 -->
+    <resultMap type="com.huaxu.dto.LoginLogDto" id="LoginLogMap">
+        <result property="id" column="id" jdbcType="BIGINT"/>
+        <result property="name" column="name" jdbcType="VARCHAR"/>
+        <result property="phone" column="phone" jdbcType="VARCHAR"/>
+        <result property="companyId" column="company_id" jdbcType="INTEGER"/>
+        <result property="departmentId" column="DEPARTMENT_ID" jdbcType="INTEGER"/>
+        <result property="type" column="type" jdbcType="VARCHAR"/>
+        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
+        <result property="loginIp" column="login_ip" jdbcType="VARCHAR"/>
+        <result property="companyName" column="companyName" jdbcType="VARCHAR"/>
+        <result property="departmentName" column="departmentName" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <!-- 基本字段 -->
+    <sql id="Base_Column_List">
+        a.id,
+        a.name,
+        a.phone,
+        a.company_id,
+        a.DEPARTMENT_ID,
+        a.type,
+        a.create_time,
+        a.login_ip,
+        com.ORG_NAME as "companyName",
+        dep.ORG_NAME as "departmentName"
+    </sql>
+    <!-- 外联表  -->
+    <sql id="loginLogJoins">
+        left join uims_org com on com.id = a.company_id
+        left join uims_org dep on dep.id = a.DEPARTMENT_ID
+    </sql>
+
+    <!-- 查询单个 -->
+    <select id="selectById" resultMap="LoginLogMap">
+        select
+        <include refid="Base_Column_List"/>
+        from uims_login_log a
+        <include refid="loginLogJoins"/>
+        where a.id = #{id}
+    </select>
+    <!-- 查询全部 -->
+    <select id="selectAll" resultMap="LoginLogMap">
+        select
+        <include refid="Base_Column_List"/>
+        from uims_login_log a
+        <include refid="loginLogJoins"/>
+    </select>
+    <!--通过实体作为筛选条件查询-->
+    <select id="selectList" resultMap="LoginLogMap">
+        select
+        <include refid="Base_Column_List"/>
+        from uims_login_log a
+        <include refid="loginLogJoins"/>
+        <where>
+            <if test="id != null">
+                and a.id = #{id}
+            </if>
+            <if test="condition != null and condition != ''">
+                and (a.name like concat('%', #{condition},'%')
+                    or a.phone like concat('%', #{condition},'%'))
+            </if>
+            <if test="companyId != null">
+                and a.company_id = #{companyId}
+            </if>
+            <if test="departmentId != null">
+                and a.DEPARTMENT_ID = #{departmentId}
+            </if>
+            <if test="beginTime != null">
+                and a.create_time >= #{beginTime}
+            </if>
+            <if test="endTime != null">
+                and a.create_time &lt;= #{endTime}
+            </if>
+        </where>
+    </select>
+    <!--通过实体作为筛选条件查询-->
+    <select id="selectListByIds" resultMap="LoginLogMap">
+        select
+        <include refid="Base_Column_List"/>
+        from uims_login_log a
+        <include refid="loginLogJoins"/>
+        <where>
+             a.id in
+            <foreach collection = "ids" item = "dramaId" open = "(" close = ")" separator = "," >
+                #{dramaId}
+            </foreach>
+        </where>
+    </select>
+    <!-- 新增所有列 -->
+    <insert id="insert" keyProperty="id" useGeneratedKeys="true">
+        insert into uims_login_log( name, phone, company_id, DEPARTMENT_ID, type, create_time, login_ip)
+        values (  #{name}, #{phone}, #{companyId}, #{departmentId}, #{type}, #{createTime}, #{loginIp})
+    </insert>
+    <!-- 批量新增 -->
+    <insert id="batchInsert">
+        insert into uims_login_log( name, phone, company_id, DEPARTMENT_ID, type, create_time, login_ip)
+        values
+        <foreach collection="loginLogs" item="item" index="index" separator=",">
+            ( #{item.name}, #{item.phone}, #{item.companyId}, #{item.departmentId}, #{item.type},
+            #{item.createTime}, #{item.loginIp} )
+        </foreach>
+    </insert>
+    <!-- 通过主键修改数据 -->
+    <update id="update">
+        update uims.uims_login_log
+        <set>
+            <if test="name != null and name != ''">
+                name = #{name},
+            </if>
+            <if test="phone != null and phone != ''">
+                phone = #{phone},
+            </if>
+            <if test="companyId != null">
+                company_id = #{companyId},
+            </if>
+            <if test="departmentId != null">
+                DEPARTMENT_ID = #{departmentId},
+            </if>
+            <if test="type != null and type != ''">
+                type = #{type},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime},
+            </if>
+            <if test="loginIp != null and loginIp != ''">
+                login_ip = #{loginIp},
+            </if>
+        </set>
+        where id = #{id}
+    </update>
+    <!--通过主键删除-->
+    <delete id="deleteById">
+        delete from uims_login_log where id = #{id}
+    </delete>
+    <!-- 总数 -->
+    <select id="count" resultType="int">
+        select count(*) from uims_login_log
+    </select>
+    <select id="selectPage" resultMap="LoginLogMap">
+        select
+        <include refid="Base_Column_List"/>
+        from uims_login_log a
+        <include refid="loginLogJoins"/>
+        <where>
+            <if test="id != null">
+                and a.id = #{loginLogDto.id}
+            </if>
+            <if test="condition != null and condition != ''">
+                and (a.name like concat('%', #{loginLogDto.condition},'%')
+                or a.phone like concat('%', #{loginLogDto.condition},'%'))
+            </if>
+            <if test="companyId != null">
+                and a.company_id = #{loginLogDto.companyId}
+            </if>
+            <if test="departmentId != null">
+                and a.DEPARTMENT_ID = #{loginLogDto.departmentId}
+            </if>
+            <if test="beginTime != null">
+                and a.create_time >= #{loginLogDto.beginTime}
+            </if>
+            <if test="endTime != null">
+                and a.create_time &lt;= #{loginLogDto.endTime}
+            </if>
+        </where>
+    </select>
+
+</mapper>

+ 12 - 0
user_center/src/main/resources/mapper/MenuMapper.xml

@@ -52,6 +52,18 @@
         FROM uims_menu a
         WHERE a.id = #{id} and a.status=1
     </select>
+    <!--  根据主键获取实体   -->
+    <select id="findMenuByParentIds" resultType="com.huaxu.entity.MenuEntity">
+        SELECT
+        <include refid="menuColumns"/>
+        FROM uims_menu a
+        WHERE a.PARENT_MENU_ID in
+        <foreach collection = "Ids" item = "dramaId" open = "(" close = ")" separator = "," >
+            #{dramaId}
+        </foreach>
+
+        and a.status=1
+    </select>
 
     <!--  根据获取实体List   -->
     <select id="findList" resultType="com.huaxu.entity.MenuEntity">

+ 167 - 0
user_center/src/main/resources/mapper/OperateLog.xml

@@ -0,0 +1,167 @@
+<?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="com.huaxu.dao.OperateLogMapper">
+
+
+    <!-- 结果集 -->
+    <resultMap type="com.huaxu.dto.OperateLogDto" id="OperateLogMap">
+        <result property="id" column="ID" jdbcType="BIGINT"/>
+        <result property="userName" column="USER_NAME" jdbcType="VARCHAR"/>
+        <result property="phone" column="PHONE" jdbcType="VARCHAR"/>
+        <result property="companyId" column="COMPANY_ID" jdbcType="INTEGER"/>
+        <result property="departmentId" column="DEPARTMENT_ID" jdbcType="INTEGER"/>
+        <result property="operateContent" column="OPERATE_CONTENT" jdbcType="VARCHAR"/>
+        <result property="createTime" column="CREATE_TIME" jdbcType="TIMESTAMP"/>
+        <result property="companyName" column="companyName" jdbcType="VARCHAR"/>
+        <result property="departmentName" column="departmentName" jdbcType="VARCHAR"/>
+    </resultMap>
+
+    <!-- 基本字段 -->
+    <sql id="Base_Column_List">
+        a.id,
+        a.USER_NAME,
+        a.phone,
+        a.company_id,
+        a.DEPARTMENT_ID,
+        a.operate_content,
+        a.create_time,
+        com.ORG_NAME as "companyName",
+        dep.ORG_NAME as "departmentName"
+    </sql>
+    <!-- 外联表  -->
+    <sql id="loginLogJoins">
+        left join uims_org com on com.id = a.company_id
+        left join uims_org dep on dep.id = a.DEPARTMENT_ID
+    </sql>
+
+    <!-- 查询单个 -->
+    <select id="selectById" resultMap="OperateLogMap">
+        select
+        <include refid="Base_Column_List"/>
+        from uims_opr_log a
+        <include refid="loginLogJoins"/>
+        where a.id = #{id}
+    </select>
+    <!-- 查询全部 -->
+    <select id="selectAll" resultMap="OperateLogMap">
+        select
+        <include refid="Base_Column_List"/>
+        from uims_opr_log a
+        <include refid="loginLogJoins"/>
+    </select>
+    <!--通过实体作为筛选条件查询-->
+    <select id="selectList" resultMap="OperateLogMap">
+        select
+        <include refid="Base_Column_List"/>
+        from uims_opr_log a
+        <include refid="loginLogJoins"/>
+        <where>
+            <if test="id != null">
+                and a.id = #{id}
+            </if>
+            <if test="condition != null and condition != ''">
+                and (a.USER_NAME like concat('%', #{condition},'%')
+                or a.phone like concat('%', #{condition},'%'))
+            </if>
+            <if test="companyId != null">
+                and a.company_id = #{companyId}
+            </if>
+            <if test="departmentId != null">
+                and a.DEPARTMENT_ID = #{departmentId}
+            </if>
+            <if test="beginTime != null">
+                and a.create_time >= #{beginTime}
+            </if>
+            <if test="endTime != null">
+                and a.create_time &lt;= #{endTime}
+            </if>
+        </where>
+    </select>
+    <!--通过实体作为筛选条件查询-->
+    <select id="selectListByIds" resultMap="OperateLogMap">
+        select
+        <include refid="Base_Column_List"/>
+        from uims_opr_log a
+        <include refid="loginLogJoins"/>
+        <where>
+            a.id in
+            <foreach collection = "ids" item = "dramaId" open = "(" close = ")" separator = "," >
+                #{dramaId}
+            </foreach>
+        </where>
+    </select>
+    <!-- 新增所有列 -->
+    <insert id="insert" keyProperty="id" useGeneratedKeys="true">
+        insert into uims_opr_log( USER_NAME, phone, company_id, DEPARTMENT_ID, operate_content, create_time )
+        values ( #{userName}, #{phone}, #{companyId}, #{departmentId}, #{operateContent}, #{createTime})
+    </insert>
+    <!-- 批量新增 -->
+    <insert id="batchInsert">
+        insert into uims_opr_log( USER_NAME, phone, company_id, DEPARTMENT_ID, operate_content, create_time )
+        values
+        <foreach collection="loginLogs" item="item" index="index" separator=",">
+            ( #{item.userName}, #{item.phone}, #{item.companyId}, #{item.departmentId}, #{item.operateContent},
+            #{item.createTime})
+        </foreach>
+    </insert>
+    <!-- 通过主键修改数据 -->
+    <update id="update">
+        update uims.uims_opr_log
+        <set>
+            <if test="userName != null and userName != ''">
+                USER_NAME = #{userName},
+            </if>
+            <if test="phone != null and phone != ''">
+                phone = #{phone},
+            </if>
+            <if test="companyId != null">
+                company_id = #{companyId},
+            </if>
+            <if test="departmentId != null">
+                DEPARTMENT_ID = #{departmentId},
+            </if>
+            <if test="operateContent != null and operateContent != ''">
+                operate_content = #{operateContent},
+            </if>
+            <if test="createTime != null">
+                create_time = #{createTime},
+            </if>
+        </set>
+        where id = #{id}
+    </update>
+    <!--通过主键删除-->
+    <delete id="deleteById">
+        delete from uims_opr_log where id = #{id}
+    </delete>
+    <!-- 总数 -->
+    <select id="count" resultType="int">
+        select count(*) from uims_opr_log
+    </select>
+    <select id="selectPage" resultMap="OperateLogMap">
+        select
+        <include refid="Base_Column_List"/>
+        from uims_opr_log a
+        <include refid="loginLogJoins"/>
+        <where>
+            <if test="id != null">
+                and a.id = #{operateLogDto.id}
+            </if>
+            <if test="condition != null and condition != ''">
+                and (a.USER_NAME like concat('%', #{operateLogDto.condition},'%')
+                or a.phone like concat('%', #{operateLogDto.condition},'%'))
+            </if>
+            <if test="companyId != null">
+                and a.company_id = #{operateLogDto.companyId}
+            </if>
+            <if test="departmentId != null">
+                and a.DEPARTMENT_ID = #{operateLogDto.departmentId}
+            </if>
+            <if test="beginTime != null">
+                and a.create_time >= #{operateLogDto.beginTime}
+            </if>
+            <if test="endTime != null">
+                and a.create_time &lt;= #{operateLogDto.endTime}
+            </if>
+        </where>
+    </select>
+</mapper>