Browse Source

新增 用户身份证注册,营业执照信息

Administrator 1 năm trước cách đây
mục cha
commit
64f4c75f03
19 tập tin đã thay đổi với 1579 bổ sung248 xóa
  1. 6 0
      ruoyi-admin/pom.xml
  2. 0 203
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/Idcard/BusinessLicense.java
  3. 46 41
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java
  4. 54 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/OcrController.java
  5. 96 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/enterprise/SysUserEnterpriseController.java
  6. 96 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/idcard/SysUserIdcardController.java
  7. 226 3
      ruoyi-common/src/main/java/com/ruoyi/common/utils/IdCardUtil.java
  8. 1 1
      ruoyi-generator/src/main/resources/generator.yml
  9. 1 0
      ruoyi-generator/src/main/resources/vm/xml/mapper.xml.vm
  10. 208 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/enterprise/SysUserEnterprise.java
  11. 152 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/idcard/SysUserIdcard.java
  12. 63 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserEnterpriseMapper.java
  13. 63 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserIdcardMapper.java
  14. 63 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/enterprise/ISysUserEnterpriseService.java
  15. 97 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/enterprise/impl/SysUserEnterpriseServiceImpl.java
  16. 63 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/idcard/ISysUserIdcardService.java
  17. 99 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/idcard/impl/SysUserIdcardServiceImpl.java
  18. 133 0
      ruoyi-system/src/main/resources/mapper/system/SysUserEnterpriseMapper.xml
  19. 112 0
      ruoyi-system/src/main/resources/mapper/system/SysUserIdcardMapper.xml

+ 6 - 0
ruoyi-admin/pom.xml

@@ -17,6 +17,12 @@
 
     <dependencies>
 
+        <!--压缩目录-->
+        <dependency>
+            <groupId>net.lingala.zip4j</groupId>
+            <artifactId>zip4j</artifactId>
+            <version>2.9.0</version>
+        </dependency>
         <!-- spring-boot-devtools -->
         <dependency>
             <groupId>org.springframework.boot</groupId>

+ 0 - 203
ruoyi-admin/src/main/java/com/ruoyi/web/controller/Idcard/BusinessLicense.java

@@ -1,203 +0,0 @@
-package com.ruoyi.web.controller.Idcard;
-
-
-import com.alibaba.fastjson2.JSONObject;
-import com.ruoyi.common.utils.Base64Util;
-import com.ruoyi.common.utils.FileUtil;
-import com.ruoyi.common.utils.HttpUtil;
-
-import java.net.URLEncoder;
-/**
- * 营业执照识别
- * @Author: tjf
- * @Date: 2024/4/17 9:57
- * @Describe:
- */
-public class BusinessLicense {
-
-    /**
-     * 重要提示代码中所需工具类
-     * FileUtil,Base64Util,HttpUtil,GsonUtils请从
-     * https://ai.baidu.com/file/658A35ABAB2D404FBF903F64D47C1F72
-     * https://ai.baidu.com/file/C8D81F3301E24D2892968F09AE1AD6E2
-     * https://ai.baidu.com/file/544D677F5D4E4F17B4122FBD60DB82B3
-     * https://ai.baidu.com/file/470B3ACCA3FE43788B5A963BF0B625F3
-     * 下载
-     */
-    public static JSONObject businessLicense(String image) {
-        // 请求url
-        String url = "https://aip.baidubce.com/rest/2.0/ocr/v1/business_license";
-        try {
-            // 本地文件路径
-            byte[] imgData = FileUtil.readFileByBytes(image);
-            String imgStr = Base64Util.encode(imgData);
-            String imgParam = URLEncoder.encode(imgStr, "UTF-8");
-
-            String param = "image=" + imgParam;
-
-            // 注意这里仅为了简化编码每一次请求都去获取access_token,线上环境access_token有过期时间, 客户端可自行缓存,过期后重新获取。
-            String accessToken = Idcard.getAccessToken();
-
-            String result = HttpUtil.post(url, accessToken, param);
-            /**
-             *
-             {
-             "words_result": {
-             "经营范围": {
-             "location": {
-             "top": 589,
-             "left": 381,
-             "width": 90,
-             "height": 19
-             },
-             "words": "商务服务业"
-             },
-             "组成形式": {
-             "location": {
-             "top": -1,
-             "left": -1,
-             "width": 0,
-             "height": 0
-             },
-             "words": "无"
-             },
-             "法人": {
-             "location": {
-             "top": 537,
-             "left": 381,
-             "width": 36,
-             "height": 19
-             },
-             "words": "方平"
-             },
-             "证件编号": {
-             "location": {
-             "top": 218,
-             "left": 302,
-             "width": 140,
-             "height": 15
-             },
-             "words": "921MA190538210301"
-             },
-             "注册资本": {
-             "location": {
-             "top": 431,
-             "left": 1044,
-             "width": 152,
-             "height": 21
-             },
-             "words": "200万元"
-             },
-             "单位名称": {
-             "location": {
-             "top": 431,
-             "left": 384,
-             "width": 71,
-             "height": 20
-             },
-             "words": "有限公司"
-             },
-             "有效期": {
-             "location": {
-             "top": 536,
-             "left": 1044,
-             "width": 198,
-             "height": 20
-             },
-             "words": "长期"
-             },
-             "社会信用代码": {
-             "location": {
-             "top": 300,
-             "left": 241,
-             "width": 156,
-             "height": 16
-             },
-             "words": "10440119MA06M85"
-             },
-             "实收资本": {
-             "location": {
-             "top": -1,
-             "left": -1,
-             "width": 0,
-             "height": 0
-             },
-             "words": "无"
-             },
-             "有效期起始日期": {
-             "location": {
-             "top": 536,
-             "left": 1044,
-             "width": 198,
-             "height": 20
-             },
-             "words": "2019年01月01日"
-             },
-             "核准日期": {
-             "location": {
-             "top": 884,
-             "left": 1188,
-             "width": 199,
-             "height": 22
-             },
-             "words": "2019年01月01日"
-             },
-             "成立日期": {
-             "location": {
-             "top": 484,
-             "left": 1043,
-             "width": 126,
-             "height": 19
-             },
-             "words": "2019年01月01日"
-             },
-             "税务登记号": {
-             "location": {
-             "top": -1,
-             "left": -1,
-             "width": 0,
-             "height": 0
-             },
-             "words": "无"
-             },
-             "地址": {
-             "location": {
-             "top": 588,
-             "left": 1043,
-             "width": 55,
-             "height": 22
-             },
-             "words": "广州市"
-             },
-             "登记机关": {
-             "location": {
-             "top": 0,
-             "left": 0,
-             "width": 0,
-             "height": 0
-             },
-             "words": "无"
-             },
-             "类型": {
-             "location": {
-             "top": 484,
-             "left": 382,
-             "width": 258,
-             "height": 20
-             },
-             "words": "有限责任公司(自然人投资或控股)"
-             }
-             },
-             "direction": 0,
-             "words_result_num": 16,
-             "log_id": "3166723741167575145"
-             }
-             */
-            JSONObject jsonObject = JSONObject.parseObject(result);
-            return jsonObject;
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        return null;
-    }
-}

+ 46 - 41
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java

@@ -4,6 +4,11 @@ import java.util.ArrayList;
 import java.util.List;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
+
+import net.lingala.zip4j.ZipFile;
+import net.lingala.zip4j.exception.ZipException;
+import net.lingala.zip4j.model.ZipParameters;
+import net.lingala.zip4j.model.enums.EncryptionMethod;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -23,13 +28,12 @@ import com.ruoyi.framework.config.ServerConfig;
 
 /**
  * 通用请求处理
- * 
+ *
  * @author ruoyi
  */
 @RestController
 @RequestMapping("/common")
-public class CommonController
-{
+public class CommonController {
     private static final Logger log = LoggerFactory.getLogger(CommonController.class);
 
     @Autowired
@@ -39,17 +43,14 @@ public class CommonController
 
     /**
      * 通用下载请求
-     * 
+     *
      * @param fileName 文件名称
-     * @param delete 是否删除
+     * @param delete   是否删除
      */
     @GetMapping("/download")
-    public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request)
-    {
-        try
-        {
-            if (!FileUtils.checkAllowDownload(fileName))
-            {
+    public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request) {
+        try {
+            if (!FileUtils.checkAllowDownload(fileName)) {
                 throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
             }
             String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
@@ -58,13 +59,10 @@ public class CommonController
             response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
             FileUtils.setAttachmentResponseHeader(response, realFileName);
             FileUtils.writeBytes(filePath, response.getOutputStream());
-            if (delete)
-            {
+            if (delete) {
                 FileUtils.deleteFile(filePath);
             }
-        }
-        catch (Exception e)
-        {
+        } catch (Exception e) {
             log.error("下载文件失败", e);
         }
     }
@@ -73,10 +71,8 @@ public class CommonController
      * 通用上传请求(单个)
      */
     @PostMapping("/upload")
-    public AjaxResult uploadFile(MultipartFile file) throws Exception
-    {
-        try
-        {
+    public AjaxResult uploadFile(MultipartFile file) throws Exception {
+        try {
             // 上传文件路径
             String filePath = RuoYiConfig.getUploadPath();
             // 上传并返回新文件名称
@@ -88,9 +84,7 @@ public class CommonController
             ajax.put("newFileName", FileUtils.getName(fileName));
             ajax.put("originalFilename", file.getOriginalFilename());
             return ajax;
-        }
-        catch (Exception e)
-        {
+        } catch (Exception e) {
             return AjaxResult.error(e.getMessage());
         }
     }
@@ -99,18 +93,15 @@ public class CommonController
      * 通用上传请求(多个)
      */
     @PostMapping("/uploads")
-    public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception
-    {
-        try
-        {
+    public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception {
+        try {
             // 上传文件路径
             String filePath = RuoYiConfig.getUploadPath();
             List<String> urls = new ArrayList<String>();
             List<String> fileNames = new ArrayList<String>();
             List<String> newFileNames = new ArrayList<String>();
             List<String> originalFilenames = new ArrayList<String>();
-            for (MultipartFile file : files)
-            {
+            for (MultipartFile file : files) {
                 // 上传并返回新文件名称
                 String fileName = FileUploadUtils.upload(filePath, file);
                 String url = serverConfig.getUrl() + fileName;
@@ -125,9 +116,7 @@ public class CommonController
             ajax.put("newFileNames", StringUtils.join(newFileNames, FILE_DELIMETER));
             ajax.put("originalFilenames", StringUtils.join(originalFilenames, FILE_DELIMETER));
             return ajax;
-        }
-        catch (Exception e)
-        {
+        } catch (Exception e) {
             return AjaxResult.error(e.getMessage());
         }
     }
@@ -137,12 +126,9 @@ public class CommonController
      */
     @GetMapping("/download/resource")
     public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response)
-            throws Exception
-    {
-        try
-        {
-            if (!FileUtils.checkAllowDownload(resource))
-            {
+            throws Exception {
+        try {
+            if (!FileUtils.checkAllowDownload(resource)) {
                 throw new Exception(StringUtils.format("资源文件({})非法,不允许下载。 ", resource));
             }
             // 本地资源路径
@@ -154,10 +140,29 @@ public class CommonController
             response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
             FileUtils.setAttachmentResponseHeader(response, downloadName);
             FileUtils.writeBytes(downloadPath, response.getOutputStream());
-        }
-        catch (Exception e)
-        {
+        } catch (Exception e) {
             log.error("下载文件失败", e);
         }
     }
+
+    /**
+     * 压缩文件,返回地址
+     * @param sourceFilePath 源文件或目录路径
+     * @param zipFilePath ZIP文件输出路径
+     * @param password 加密密码
+     * @return
+     */
+    public String zipEncryptExample(String sourceFilePath, String zipFilePath, String password) {
+        try {
+            ZipParameters zipParameters = new ZipParameters();
+            zipParameters.setEncryptFiles(true);
+            zipParameters.setEncryptionMethod(EncryptionMethod.ZIP_STANDARD); // 标准AES加密
+            ZipFile zipFile = new ZipFile(zipFilePath,password.toCharArray());
+            zipFile.addFile(sourceFilePath, zipParameters);
+            System.out.println("文件加密成功,保存位置:" + zipFilePath);
+        } catch (ZipException e) {
+            e.printStackTrace();
+        }
+        return zipFilePath;
+    }
 }

+ 54 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/OcrController.java

@@ -0,0 +1,54 @@
+package com.ruoyi.web.controller.common;
+
+import com.alibaba.fastjson2.JSONObject;
+import com.ruoyi.common.annotation.RepeatSubmit;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.core.domain.model.LoginBody;
+import com.ruoyi.common.utils.IdCardUtil;
+import com.ruoyi.common.utils.SendSmsUtils;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.concurrent.TimeUnit;
+
+import static com.ruoyi.common.constant.CommonConstants.LOGIN_USER_SMS;
+
+/**
+ * @Author: tjf
+ * @Date: 2024/4/22 14:24
+ * @Describe:
+ */
+@RestController
+@RequestMapping("/ocr")
+public class OcrController {
+    /**
+     * 身份证识别
+     * @return
+     */
+    @PostMapping("/ocrIdCard")
+    @RepeatSubmit(interval = 1000, message = "请求过于频繁")
+    public AjaxResult ocrIdCard(String image) {
+        JSONObject jsonObject = IdCardUtil.idCard(image);
+        if (image != null){
+            return  AjaxResult.success(jsonObject);
+        }
+        return AjaxResult.error("图片为空");
+    }
+
+    /**
+     * 营业执照识别
+     * @return
+     */
+    @PostMapping("/ocrBusinessLicense")
+    @RepeatSubmit(interval = 1000, message = "请求过于频繁")
+    public AjaxResult ocrBusinessLicense(String image) {
+        JSONObject jsonObject = IdCardUtil.businessLicense(image);
+        if (image != null){
+            return  AjaxResult.success(jsonObject);
+        }
+        return AjaxResult.error("图片为空");
+    }
+}

+ 96 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/enterprise/SysUserEnterpriseController.java

@@ -0,0 +1,96 @@
+package com.ruoyi.web.controller.enterprise;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.domain.enterprise.SysUserEnterprise;
+import com.ruoyi.system.service.enterprise.ISysUserEnterpriseService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 用户企业信息Controller
+ *
+ * @author boman
+ * @date 2024-04-22
+ */
+@RestController
+@RequestMapping("/enterprise")
+public class SysUserEnterpriseController extends BaseController {
+    @Autowired
+    private ISysUserEnterpriseService sysUserEnterpriseService;
+
+    /**
+     * 查询用户企业信息列表
+     */
+    @PreAuthorize("@ss.hasPermi('enterprise:enterprise:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(SysUserEnterprise sysUserEnterprise) {
+        startPage();
+        List<SysUserEnterprise> list = sysUserEnterpriseService.selectSysUserEnterpriseList(sysUserEnterprise);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出用户企业信息列表
+     */
+    @PreAuthorize("@ss.hasPermi('enterprise:enterprise:export')")
+    @Log(title = "用户企业信息", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, SysUserEnterprise sysUserEnterprise) {
+        List<SysUserEnterprise> list = sysUserEnterpriseService.selectSysUserEnterpriseList(sysUserEnterprise);
+        ExcelUtil<SysUserEnterprise> util = new ExcelUtil<SysUserEnterprise>(SysUserEnterprise.class);
+        util.exportExcel(response, list, "用户企业信息数据");
+    }
+
+    /**
+     * 获取用户企业信息详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('enterprise:enterprise:query')")
+    @GetMapping(value = "/{userId}")
+    public AjaxResult getInfo(@PathVariable("userId") Long userId) {
+        return success(sysUserEnterpriseService.selectSysUserEnterpriseByUserId(userId));
+    }
+
+    /**
+     * 新增用户企业信息
+     */
+    @PreAuthorize("@ss.hasPermi('enterprise:enterprise:add')")
+    @Log(title = "用户企业信息", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody SysUserEnterprise sysUserEnterprise) {
+        return toAjax(sysUserEnterpriseService.insertSysUserEnterprise(sysUserEnterprise));
+    }
+
+    /**
+     * 修改用户企业信息
+     */
+    @PreAuthorize("@ss.hasPermi('enterprise:enterprise:edit')")
+    @Log(title = "用户企业信息", businessType = BusinessType.UPDATE)
+    @PostMapping("/put")
+    public AjaxResult edit(@RequestBody SysUserEnterprise sysUserEnterprise) {
+        return toAjax(sysUserEnterpriseService.updateSysUserEnterprise(sysUserEnterprise));
+    }
+
+    /**
+     * 删除用户企业信息
+     */
+    @PreAuthorize("@ss.hasPermi('enterprise:enterprise:remove')")
+    @Log(title = "用户企业信息", businessType = BusinessType.DELETE)
+    @GetMapping("/delete/{userIds}")
+    public AjaxResult remove(@PathVariable Long[] userIds) {
+        return toAjax(sysUserEnterpriseService.deleteSysUserEnterpriseByUserIds(userIds));
+    }
+}

+ 96 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/idcard/SysUserIdcardController.java

@@ -0,0 +1,96 @@
+package com.ruoyi.web.controller.idcard;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.system.domain.idcard.SysUserIdcard;
+import com.ruoyi.system.service.idcard.ISysUserIdcardService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 用户身份证信息Controller
+ *
+ * @author boman
+ * @date 2024-04-22
+ */
+@RestController
+@RequestMapping("/idCard")
+public class SysUserIdcardController extends BaseController {
+    @Autowired
+    private ISysUserIdcardService sysUserIdcardService;
+
+    /**
+     * 查询用户身份证信息列表
+     */
+    @PreAuthorize("@ss.hasPermi('idcard:idcard:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(SysUserIdcard sysUserIdcard) {
+        startPage();
+        List<SysUserIdcard> list = sysUserIdcardService.selectSysUserIdcardList(sysUserIdcard);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出用户身份证信息列表
+     */
+    @PreAuthorize("@ss.hasPermi('idcard:idcard:export')")
+    @Log(title = "用户身份证信息", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, SysUserIdcard sysUserIdcard) {
+        List<SysUserIdcard> list = sysUserIdcardService.selectSysUserIdcardList(sysUserIdcard);
+        ExcelUtil<SysUserIdcard> util = new ExcelUtil<SysUserIdcard>(SysUserIdcard.class);
+        util.exportExcel(response, list, "用户身份证信息数据");
+    }
+
+    /**
+     * 获取用户身份证信息详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('idcard:idcard:query')")
+    @GetMapping(value = "/{userId}")
+    public AjaxResult getInfo(@PathVariable("userId") Long userId) {
+        return success(sysUserIdcardService.selectSysUserIdcardByUserId(userId));
+    }
+
+    /**
+     * 新增用户身份证信息
+     */
+    @PreAuthorize("@ss.hasPermi('idcard:idcard:add')")
+    @Log(title = "用户身份证信息", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody SysUserIdcard sysUserIdcard) {
+        return toAjax(sysUserIdcardService.insertSysUserIdcard(sysUserIdcard));
+    }
+
+    /**
+     * 修改用户身份证信息
+     */
+    @PreAuthorize("@ss.hasPermi('idcard:idcard:edit')")
+    @Log(title = "用户身份证信息", businessType = BusinessType.UPDATE)
+    @PostMapping("/put")
+    public AjaxResult edit(@RequestBody SysUserIdcard sysUserIdcard) {
+        return toAjax(sysUserIdcardService.updateSysUserIdcard(sysUserIdcard));
+    }
+
+    /**
+     * 删除用户身份证信息
+     */
+    @PreAuthorize("@ss.hasPermi('idcard:idcard:remove')")
+    @Log(title = "用户身份证信息", businessType = BusinessType.DELETE)
+    @GetMapping("/delete/{userIds}")
+    public AjaxResult remove(@PathVariable Long[] userIds) {
+        return toAjax(sysUserIdcardService.deleteSysUserIdcardByUserIds(userIds));
+    }
+}

+ 226 - 3
ruoyi-admin/src/main/java/com/ruoyi/web/controller/Idcard/Idcard.java → ruoyi-common/src/main/java/com/ruoyi/common/utils/IdCardUtil.java

@@ -1,4 +1,4 @@
-package com.ruoyi.web.controller.Idcard;
+package com.ruoyi.common.utils;
 
 /**
  * @Author: tjf
@@ -17,8 +17,9 @@ import javax.crypto.spec.SecretKeySpec;
 import java.io.IOException;
 import java.net.URLEncoder;
 import java.util.Base64;
+import java.util.Map;
 
-public class Idcard {
+public class IdCardUtil {
 
     /**
      * 重要提示代码中所需工具类
@@ -117,9 +118,45 @@ public class Idcard {
      * "words_result_num": 6
      * }
      *
+     *
+     {
+     "words_result": {
+     "失效日期": {
+     "words": "20390711",
+     "location": {
+     "top": 445,
+     "left": 523,
+     "width": 153,
+     "height": 38
+     }
+     },
+     "签发机关": {
+     "words": "陆丰市公安局",
+     "location": {
+     "top": 377,
+     "left": 339,
+     "width": 195,
+     "height": 38
+     }
+     },
+     "签发日期": {
+     "words": "20190606",
+     "location": {
+     "top": 445,
+     "left": 343,
+     "width": 152,
+     "height": 38
+     }
+     }
+     },
+     "log_id": "1559208562721579328",
+     "words_result_num": 3,
+     "error_code": 0,
+     "image_status": "normal"
+     }
      * @return
      */
-    public static JSONObject idcard(String image) {
+    public static JSONObject idCard(String image) {
         try {
             // 文件路径
             byte[] imgData = FileUtil.readFileByBytes(image);
@@ -286,6 +323,192 @@ public class Idcard {
 
     static final OkHttpClient HTTP_CLIENT = new OkHttpClient().newBuilder().build();
 
+    /**
+     * 营业执照识别
+     * 重要提示代码中所需工具类
+     * FileUtil,Base64Util,HttpUtil,GsonUtils请从
+     * https://ai.baidu.com/file/658A35ABAB2D404FBF903F64D47C1F72
+     * https://ai.baidu.com/file/C8D81F3301E24D2892968F09AE1AD6E2
+     * https://ai.baidu.com/file/544D677F5D4E4F17B4122FBD60DB82B3
+     * https://ai.baidu.com/file/470B3ACCA3FE43788B5A963BF0B625F3
+     * 下载
+     */
+    public static JSONObject businessLicense(String image) {
+        // 请求url
+        String url = "https://aip.baidubce.com/rest/2.0/ocr/v1/business_license";
+        try {
+            // 本地文件路径
+            byte[] imgData = FileUtil.readFileByBytes(image);
+            String imgStr = com.ruoyi.common.utils.Base64Util.encode(imgData);
+            String imgParam = URLEncoder.encode(imgStr, "UTF-8");
+
+            String param = "image=" + imgParam;
+
+            // 注意这里仅为了简化编码每一次请求都去获取access_token,线上环境access_token有过期时间, 客户端可自行缓存,过期后重新获取。
+            String accessToken = IdCardUtil.getAccessToken();
+
+            String result = HttpUtil.post(url, accessToken, param);
+            /**
+             *
+             {
+             "words_result": {
+             "经营范围": {
+             "location": {
+             "top": 589,
+             "left": 381,
+             "width": 90,
+             "height": 19
+             },
+             "words": "商务服务业"
+             },
+             "组成形式": {
+             "location": {
+             "top": -1,
+             "left": -1,
+             "width": 0,
+             "height": 0
+             },
+             "words": "无"
+             },
+             "法人": {
+             "location": {
+             "top": 537,
+             "left": 381,
+             "width": 36,
+             "height": 19
+             },
+             "words": "方平"
+             },
+             "证件编号": {
+             "location": {
+             "top": 218,
+             "left": 302,
+             "width": 140,
+             "height": 15
+             },
+             "words": "921MA190538210301"
+             },
+             "注册资本": {
+             "location": {
+             "top": 431,
+             "left": 1044,
+             "width": 152,
+             "height": 21
+             },
+             "words": "200万元"
+             },
+             "单位名称": {
+             "location": {
+             "top": 431,
+             "left": 384,
+             "width": 71,
+             "height": 20
+             },
+             "words": "有限公司"
+             },
+             "有效期": {
+             "location": {
+             "top": 536,
+             "left": 1044,
+             "width": 198,
+             "height": 20
+             },
+             "words": "长期"
+             },
+             "社会信用代码": {
+             "location": {
+             "top": 300,
+             "left": 241,
+             "width": 156,
+             "height": 16
+             },
+             "words": "10440119MA06M85"
+             },
+             "实收资本": {
+             "location": {
+             "top": -1,
+             "left": -1,
+             "width": 0,
+             "height": 0
+             },
+             "words": "无"
+             },
+             "有效期起始日期": {
+             "location": {
+             "top": 536,
+             "left": 1044,
+             "width": 198,
+             "height": 20
+             },
+             "words": "2019年01月01日"
+             },
+             "核准日期": {
+             "location": {
+             "top": 884,
+             "left": 1188,
+             "width": 199,
+             "height": 22
+             },
+             "words": "2019年01月01日"
+             },
+             "成立日期": {
+             "location": {
+             "top": 484,
+             "left": 1043,
+             "width": 126,
+             "height": 19
+             },
+             "words": "2019年01月01日"
+             },
+             "税务登记号": {
+             "location": {
+             "top": -1,
+             "left": -1,
+             "width": 0,
+             "height": 0
+             },
+             "words": "无"
+             },
+             "地址": {
+             "location": {
+             "top": 588,
+             "left": 1043,
+             "width": 55,
+             "height": 22
+             },
+             "words": "广州市"
+             },
+             "登记机关": {
+             "location": {
+             "top": 0,
+             "left": 0,
+             "width": 0,
+             "height": 0
+             },
+             "words": "无"
+             },
+             "类型": {
+             "location": {
+             "top": 484,
+             "left": 382,
+             "width": 258,
+             "height": 20
+             },
+             "words": "有限责任公司(自然人投资或控股)"
+             }
+             },
+             "direction": 0,
+             "words_result_num": 16,
+             "log_id": "3166723741167575145"
+             }
+             */
+            JSONObject jsonObject = JSONObject.parseObject(result);
+            return jsonObject;
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
     /**
      * 获取百度开放平台的AccessToken
      * @return

+ 1 - 1
ruoyi-generator/src/main/resources/generator.yml

@@ -1,7 +1,7 @@
 # 代码生成
 gen:
   # 作者
-  author: ruoyi
+  author: boman
   # 默认生成包路径 system 需改成自己的模块名称 如 system monitor tool
   packageName: com.ruoyi.system
   # 自动去除表前缀,默认是false

+ 1 - 0
ruoyi-generator/src/main/resources/vm/xml/mapper.xml.vm

@@ -56,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 #end
 #end
         </where>
+        order by create_time
     </select>
     
     <select id="select${ClassName}By${pkColumn.capJavaField}" parameterType="${pkColumn.javaType}" resultMap="#if($table.sub)${ClassName}${subClassName}Result#else${ClassName}Result#end">

+ 208 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/enterprise/SysUserEnterprise.java

@@ -0,0 +1,208 @@
+package com.ruoyi.system.domain.enterprise;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 用户企业信息对象 sys_user_enterprise
+ * 
+ * @author boman
+ * @date 2024-04-22
+ */
+public class SysUserEnterprise extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 用户ID */
+    private Long userId;
+
+    /** 身份证号码 */
+    @Excel(name = "身份证号码")
+    private String idCard;
+
+    /** 真实姓名 */
+    @Excel(name = "真实姓名")
+    private String realName;
+
+    /** 统一社会信用代码 */
+    private String creditCode;
+
+    /** 企业名称 */
+    @Excel(name = "企业名称")
+    private String enterpriseName;
+
+    /** 企业类型 */
+    @Excel(name = "企业类型")
+    private String enterpriseType;
+
+    /** 企业地址 */
+    @Excel(name = "企业地址")
+    private String enterpriseAddress;
+
+    /** 法人姓名 */
+    @Excel(name = "法人姓名")
+    private String legalName;
+
+    /** 注册资金 */
+    @Excel(name = "注册资金")
+    private String registeredCapital;
+
+    /** 成立日期 */
+    @Excel(name = "成立日期")
+    private String establishData;
+
+    /** 营业期限 */
+    @Excel(name = "营业期限")
+    private String businessTerm;
+
+    /** 营业执照URL */
+    @Excel(name = "营业执照URL")
+    private String imageUrl;
+
+    /** 删除标志(0代表存在 2代表删除) */
+    private String delFlag;
+
+    public void setUserId(Long userId) 
+    {
+        this.userId = userId;
+    }
+
+    public Long getUserId() 
+    {
+        return userId;
+    }
+    public void setIdCard(String idCard) 
+    {
+        this.idCard = idCard;
+    }
+
+    public String getIdCard() 
+    {
+        return idCard;
+    }
+    public void setRealName(String realName) 
+    {
+        this.realName = realName;
+    }
+
+    public String getRealName() 
+    {
+        return realName;
+    }
+    public void setCreditCode(String creditCode) 
+    {
+        this.creditCode = creditCode;
+    }
+
+    public String getCreditCode() 
+    {
+        return creditCode;
+    }
+    public void setEnterpriseName(String enterpriseName) 
+    {
+        this.enterpriseName = enterpriseName;
+    }
+
+    public String getEnterpriseName() 
+    {
+        return enterpriseName;
+    }
+    public void setEnterpriseType(String enterpriseType) 
+    {
+        this.enterpriseType = enterpriseType;
+    }
+
+    public String getEnterpriseType() 
+    {
+        return enterpriseType;
+    }
+    public void setEnterpriseAddress(String enterpriseAddress) 
+    {
+        this.enterpriseAddress = enterpriseAddress;
+    }
+
+    public String getEnterpriseAddress() 
+    {
+        return enterpriseAddress;
+    }
+    public void setLegalName(String legalName) 
+    {
+        this.legalName = legalName;
+    }
+
+    public String getLegalName() 
+    {
+        return legalName;
+    }
+    public void setRegisteredCapital(String registeredCapital) 
+    {
+        this.registeredCapital = registeredCapital;
+    }
+
+    public String getRegisteredCapital() 
+    {
+        return registeredCapital;
+    }
+    public void setEstablishData(String establishData) 
+    {
+        this.establishData = establishData;
+    }
+
+    public String getEstablishData() 
+    {
+        return establishData;
+    }
+    public void setBusinessTerm(String businessTerm) 
+    {
+        this.businessTerm = businessTerm;
+    }
+
+    public String getBusinessTerm() 
+    {
+        return businessTerm;
+    }
+    public void setImageUrl(String imageUrl) 
+    {
+        this.imageUrl = imageUrl;
+    }
+
+    public String getImageUrl() 
+    {
+        return imageUrl;
+    }
+    public void setDelFlag(String delFlag) 
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag() 
+    {
+        return delFlag;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("userId", getUserId())
+            .append("idCard", getIdCard())
+            .append("realName", getRealName())
+            .append("creditCode", getCreditCode())
+            .append("enterpriseName", getEnterpriseName())
+            .append("enterpriseType", getEnterpriseType())
+            .append("enterpriseAddress", getEnterpriseAddress())
+            .append("legalName", getLegalName())
+            .append("registeredCapital", getRegisteredCapital())
+            .append("establishData", getEstablishData())
+            .append("businessTerm", getBusinessTerm())
+            .append("imageUrl", getImageUrl())
+            .append("delFlag", getDelFlag())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 152 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/idcard/SysUserIdcard.java

@@ -0,0 +1,152 @@
+package com.ruoyi.system.domain.idcard;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 用户身份证信息对象 sys_user_idcard
+ * 
+ * @author boman
+ * @date 2024-04-22
+ */
+public class SysUserIdcard extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 用户ID */
+    private Long userId;
+
+    /** 身份证号码 */
+    private String idCard;
+
+    /** 真实姓名 */
+    @Excel(name = "真实姓名")
+    private String realName;
+
+    /** 失效日期 */
+    @Excel(name = "失效日期")
+    private String expirationDate;
+
+    /** 手机号码 */
+    @Excel(name = "手机号码")
+    private String phonenumber;
+
+    /** 居住地址 */
+    @Excel(name = "居住地址")
+    private String address;
+
+    /** 正面地址 */
+    @Excel(name = "正面地址")
+    private String front;
+
+    /** 反面地址 */
+    @Excel(name = "反面地址")
+    private String back;
+
+    /** 删除标志(0代表存在 2代表删除) */
+    private String delFlag;
+
+    public void setUserId(Long userId) 
+    {
+        this.userId = userId;
+    }
+
+    public Long getUserId() 
+    {
+        return userId;
+    }
+    public void setIdCard(String idCard) 
+    {
+        this.idCard = idCard;
+    }
+
+    public String getIdCard() 
+    {
+        return idCard;
+    }
+    public void setRealName(String realName) 
+    {
+        this.realName = realName;
+    }
+
+    public String getRealName() 
+    {
+        return realName;
+    }
+    public void setExpirationDate(String expirationDate) 
+    {
+        this.expirationDate = expirationDate;
+    }
+
+    public String getExpirationDate() 
+    {
+        return expirationDate;
+    }
+    public void setPhonenumber(String phonenumber) 
+    {
+        this.phonenumber = phonenumber;
+    }
+
+    public String getPhonenumber() 
+    {
+        return phonenumber;
+    }
+    public void setAddress(String address) 
+    {
+        this.address = address;
+    }
+
+    public String getAddress() 
+    {
+        return address;
+    }
+    public void setFront(String front) 
+    {
+        this.front = front;
+    }
+
+    public String getFront() 
+    {
+        return front;
+    }
+    public void setBack(String back) 
+    {
+        this.back = back;
+    }
+
+    public String getBack() 
+    {
+        return back;
+    }
+    public void setDelFlag(String delFlag) 
+    {
+        this.delFlag = delFlag;
+    }
+
+    public String getDelFlag() 
+    {
+        return delFlag;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("userId", getUserId())
+            .append("idCard", getIdCard())
+            .append("realName", getRealName())
+            .append("expirationDate", getExpirationDate())
+            .append("phonenumber", getPhonenumber())
+            .append("address", getAddress())
+            .append("front", getFront())
+            .append("back", getBack())
+            .append("delFlag", getDelFlag())
+            .append("createBy", getCreateBy())
+            .append("createTime", getCreateTime())
+            .append("updateBy", getUpdateBy())
+            .append("updateTime", getUpdateTime())
+            .append("remark", getRemark())
+            .toString();
+    }
+}

+ 63 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserEnterpriseMapper.java

@@ -0,0 +1,63 @@
+package com.ruoyi.system.mapper;
+
+import com.ruoyi.system.domain.enterprise.SysUserEnterprise;
+
+import java.util.List;
+
+
+/**
+ * 用户企业信息Mapper接口
+ * 
+ * @author boman
+ * @date 2024-04-22
+ */
+public interface SysUserEnterpriseMapper 
+{
+    /**
+     * 查询用户企业信息
+     * 
+     * @param userId 用户企业信息主键
+     * @return 用户企业信息
+     */
+    public SysUserEnterprise selectSysUserEnterpriseByUserId(Long userId);
+
+    /**
+     * 查询用户企业信息列表
+     * 
+     * @param sysUserEnterprise 用户企业信息
+     * @return 用户企业信息集合
+     */
+    public List<SysUserEnterprise> selectSysUserEnterpriseList(SysUserEnterprise sysUserEnterprise);
+
+    /**
+     * 新增用户企业信息
+     * 
+     * @param sysUserEnterprise 用户企业信息
+     * @return 结果
+     */
+    public int insertSysUserEnterprise(SysUserEnterprise sysUserEnterprise);
+
+    /**
+     * 修改用户企业信息
+     * 
+     * @param sysUserEnterprise 用户企业信息
+     * @return 结果
+     */
+    public int updateSysUserEnterprise(SysUserEnterprise sysUserEnterprise);
+
+    /**
+     * 删除用户企业信息
+     * 
+     * @param userId 用户企业信息主键
+     * @return 结果
+     */
+    public int deleteSysUserEnterpriseByUserId(Long userId);
+
+    /**
+     * 批量删除用户企业信息
+     * 
+     * @param userIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteSysUserEnterpriseByUserIds(Long[] userIds);
+}

+ 63 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserIdcardMapper.java

@@ -0,0 +1,63 @@
+package com.ruoyi.system.mapper;
+
+import com.ruoyi.system.domain.idcard.SysUserIdcard;
+
+import java.util.List;
+
+
+/**
+ * 用户身份证信息Mapper接口
+ * 
+ * @author boman
+ * @date 2024-04-22
+ */
+public interface SysUserIdcardMapper 
+{
+    /**
+     * 查询用户身份证信息
+     * 
+     * @param userId 用户身份证信息主键
+     * @return 用户身份证信息
+     */
+    public SysUserIdcard selectSysUserIdcardByUserId(Long userId);
+
+    /**
+     * 查询用户身份证信息列表
+     * 
+     * @param sysUserIdcard 用户身份证信息
+     * @return 用户身份证信息集合
+     */
+    public List<SysUserIdcard> selectSysUserIdcardList(SysUserIdcard sysUserIdcard);
+
+    /**
+     * 新增用户身份证信息
+     * 
+     * @param sysUserIdcard 用户身份证信息
+     * @return 结果
+     */
+    public int insertSysUserIdcard(SysUserIdcard sysUserIdcard);
+
+    /**
+     * 修改用户身份证信息
+     * 
+     * @param sysUserIdcard 用户身份证信息
+     * @return 结果
+     */
+    public int updateSysUserIdcard(SysUserIdcard sysUserIdcard);
+
+    /**
+     * 删除用户身份证信息
+     * 
+     * @param userId 用户身份证信息主键
+     * @return 结果
+     */
+    public int deleteSysUserIdcardByUserId(Long userId);
+
+    /**
+     * 批量删除用户身份证信息
+     * 
+     * @param userIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteSysUserIdcardByUserIds(Long[] userIds);
+}

+ 63 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/enterprise/ISysUserEnterpriseService.java

@@ -0,0 +1,63 @@
+package com.ruoyi.system.service.enterprise;
+
+import com.ruoyi.system.domain.enterprise.SysUserEnterprise;
+
+import java.util.List;
+
+
+/**
+ * 用户企业信息Service接口
+ * 
+ * @author boman
+ * @date 2024-04-22
+ */
+public interface ISysUserEnterpriseService 
+{
+    /**
+     * 查询用户企业信息
+     * 
+     * @param userId 用户企业信息主键
+     * @return 用户企业信息
+     */
+    public SysUserEnterprise selectSysUserEnterpriseByUserId(Long userId);
+
+    /**
+     * 查询用户企业信息列表
+     * 
+     * @param sysUserEnterprise 用户企业信息
+     * @return 用户企业信息集合
+     */
+    public List<SysUserEnterprise> selectSysUserEnterpriseList(SysUserEnterprise sysUserEnterprise);
+
+    /**
+     * 新增用户企业信息
+     * 
+     * @param sysUserEnterprise 用户企业信息
+     * @return 结果
+     */
+    public int insertSysUserEnterprise(SysUserEnterprise sysUserEnterprise);
+
+    /**
+     * 修改用户企业信息
+     * 
+     * @param sysUserEnterprise 用户企业信息
+     * @return 结果
+     */
+    public int updateSysUserEnterprise(SysUserEnterprise sysUserEnterprise);
+
+    /**
+     * 批量删除用户企业信息
+     * 
+     * @param userIds 需要删除的用户企业信息主键集合
+     * @return 结果
+     */
+    public int deleteSysUserEnterpriseByUserIds(Long[] userIds);
+
+    /**
+     * 删除用户企业信息信息
+     * 
+     * @param userId 用户企业信息主键
+     * @return 结果
+     */
+    public int deleteSysUserEnterpriseByUserId(Long userId);
+}

+ 97 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/enterprise/impl/SysUserEnterpriseServiceImpl.java

@@ -0,0 +1,97 @@
+package com.ruoyi.system.service.enterprise.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.system.domain.enterprise.SysUserEnterprise;
+import com.ruoyi.system.mapper.SysUserEnterpriseMapper;
+import com.ruoyi.system.service.enterprise.ISysUserEnterpriseService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+/**
+ * 用户企业信息Service业务层处理
+ * 
+ * @author boman
+ * @date 2024-04-22
+ */
+@Service
+public class SysUserEnterpriseServiceImpl implements ISysUserEnterpriseService
+{
+    @Autowired
+    private SysUserEnterpriseMapper sysUserEnterpriseMapper;
+
+    /**
+     * 查询用户企业信息
+     * 
+     * @param userId 用户企业信息主键
+     * @return 用户企业信息
+     */
+    @Override
+    public SysUserEnterprise selectSysUserEnterpriseByUserId(Long userId)
+    {
+        return sysUserEnterpriseMapper.selectSysUserEnterpriseByUserId(userId);
+    }
+
+    /**
+     * 查询用户企业信息列表
+     * 
+     * @param sysUserEnterprise 用户企业信息
+     * @return 用户企业信息
+     */
+    @Override
+    public List<SysUserEnterprise> selectSysUserEnterpriseList(SysUserEnterprise sysUserEnterprise)
+    {
+        return sysUserEnterpriseMapper.selectSysUserEnterpriseList(sysUserEnterprise);
+    }
+
+    /**
+     * 新增用户企业信息
+     * 
+     * @param sysUserEnterprise 用户企业信息
+     * @return 结果
+     */
+    @Override
+    public int insertSysUserEnterprise(SysUserEnterprise sysUserEnterprise)
+    {
+        sysUserEnterprise.setUserId(SecurityUtils.getUserId());
+        sysUserEnterprise.setCreateTime(DateUtils.getNowDate());
+        return sysUserEnterpriseMapper.insertSysUserEnterprise(sysUserEnterprise);
+    }
+
+    /**
+     * 修改用户企业信息
+     * 
+     * @param sysUserEnterprise 用户企业信息
+     * @return 结果
+     */
+    @Override
+    public int updateSysUserEnterprise(SysUserEnterprise sysUserEnterprise)
+    {
+        sysUserEnterprise.setUpdateTime(DateUtils.getNowDate());
+        return sysUserEnterpriseMapper.updateSysUserEnterprise(sysUserEnterprise);
+    }
+
+    /**
+     * 批量删除用户企业信息
+     * 
+     * @param userIds 需要删除的用户企业信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSysUserEnterpriseByUserIds(Long[] userIds)
+    {
+        return sysUserEnterpriseMapper.deleteSysUserEnterpriseByUserIds(userIds);
+    }
+
+    /**
+     * 删除用户企业信息信息
+     * 
+     * @param userId 用户企业信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSysUserEnterpriseByUserId(Long userId)
+    {
+        return sysUserEnterpriseMapper.deleteSysUserEnterpriseByUserId(userId);
+    }
+}

+ 63 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/idcard/ISysUserIdcardService.java

@@ -0,0 +1,63 @@
+package com.ruoyi.system.service.idcard;
+
+import com.ruoyi.system.domain.idcard.SysUserIdcard;
+
+import java.util.List;
+
+
+/**
+ * 用户身份证信息Service接口
+ * 
+ * @author boman
+ * @date 2024-04-22
+ */
+public interface ISysUserIdcardService 
+{
+    /**
+     * 查询用户身份证信息
+     * 
+     * @param userId 用户身份证信息主键
+     * @return 用户身份证信息
+     */
+    public SysUserIdcard selectSysUserIdcardByUserId(Long userId);
+
+    /**
+     * 查询用户身份证信息列表
+     * 
+     * @param sysUserIdcard 用户身份证信息
+     * @return 用户身份证信息集合
+     */
+    public List<SysUserIdcard> selectSysUserIdcardList(SysUserIdcard sysUserIdcard);
+
+    /**
+     * 新增用户身份证信息
+     * 
+     * @param sysUserIdcard 用户身份证信息
+     * @return 结果
+     */
+    public int insertSysUserIdcard(SysUserIdcard sysUserIdcard);
+
+    /**
+     * 修改用户身份证信息
+     * 
+     * @param sysUserIdcard 用户身份证信息
+     * @return 结果
+     */
+    public int updateSysUserIdcard(SysUserIdcard sysUserIdcard);
+
+    /**
+     * 批量删除用户身份证信息
+     * 
+     * @param userIds 需要删除的用户身份证信息主键集合
+     * @return 结果
+     */
+    public int deleteSysUserIdcardByUserIds(Long[] userIds);
+
+    /**
+     * 删除用户身份证信息信息
+     * 
+     * @param userId 用户身份证信息主键
+     * @return 结果
+     */
+    public int deleteSysUserIdcardByUserId(Long userId);
+}

+ 99 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/idcard/impl/SysUserIdcardServiceImpl.java

@@ -0,0 +1,99 @@
+package com.ruoyi.system.service.idcard.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.system.domain.idcard.SysUserIdcard;
+import com.ruoyi.system.mapper.SysUserIdcardMapper;
+import com.ruoyi.system.service.idcard.ISysUserIdcardService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+
+/**
+ * 用户身份证信息Service业务层处理
+ * 
+ * @author boman
+ * @date 2024-04-22
+ */
+@Service
+public class SysUserIdcardServiceImpl implements ISysUserIdcardService
+{
+    @Autowired
+    private SysUserIdcardMapper sysUserIdcardMapper;
+
+    /**
+     * 查询用户身份证信息
+     * 
+     * @param userId 用户身份证信息主键
+     * @return 用户身份证信息
+     */
+    @Override
+    public SysUserIdcard selectSysUserIdcardByUserId(Long userId)
+    {
+        return sysUserIdcardMapper.selectSysUserIdcardByUserId(userId);
+    }
+
+    /**
+     * 查询用户身份证信息列表
+     * 
+     * @param sysUserIdcard 用户身份证信息
+     * @return 用户身份证信息
+     */
+    @Override
+    public List<SysUserIdcard> selectSysUserIdcardList(SysUserIdcard sysUserIdcard)
+    {
+        return sysUserIdcardMapper.selectSysUserIdcardList(sysUserIdcard);
+    }
+
+    /**
+     * 新增用户身份证信息
+     * 
+     * @param sysUserIdcard 用户身份证信息
+     * @return 结果
+     */
+    @Override
+    public int insertSysUserIdcard(SysUserIdcard sysUserIdcard)
+    {
+        sysUserIdcard.setUserId(SecurityUtils.getUserId());
+        sysUserIdcard.setCreateTime(DateUtils.getNowDate());
+        return sysUserIdcardMapper.insertSysUserIdcard(sysUserIdcard);
+    }
+
+    /**
+     * 修改用户身份证信息
+     * 
+     * @param sysUserIdcard 用户身份证信息
+     * @return 结果
+     */
+    @Override
+    public int updateSysUserIdcard(SysUserIdcard sysUserIdcard)
+    {
+        sysUserIdcard.setUpdateTime(DateUtils.getNowDate());
+        return sysUserIdcardMapper.updateSysUserIdcard(sysUserIdcard);
+    }
+
+    /**
+     * 批量删除用户身份证信息
+     * 
+     * @param userIds 需要删除的用户身份证信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSysUserIdcardByUserIds(Long[] userIds)
+    {
+        return sysUserIdcardMapper.deleteSysUserIdcardByUserIds(userIds);
+    }
+
+    /**
+     * 删除用户身份证信息信息
+     * 
+     * @param userId 用户身份证信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteSysUserIdcardByUserId(Long userId)
+    {
+        return sysUserIdcardMapper.deleteSysUserIdcardByUserId(userId);
+    }
+}

+ 133 - 0
ruoyi-system/src/main/resources/mapper/system/SysUserEnterpriseMapper.xml

@@ -0,0 +1,133 @@
+<?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.ruoyi.system.mapper.SysUserEnterpriseMapper">
+    
+    <resultMap type="SysUserEnterprise" id="SysUserEnterpriseResult">
+        <result property="userId"    column="user_id"    />
+        <result property="idCard"    column="id_card"    />
+        <result property="realName"    column="real_name"    />
+        <result property="creditCode"    column="credit_code"    />
+        <result property="enterpriseName"    column="enterprise_name"    />
+        <result property="enterpriseType"    column="enterprise_type"    />
+        <result property="enterpriseAddress"    column="enterprise_address"    />
+        <result property="legalName"    column="legal_name"    />
+        <result property="registeredCapital"    column="registered_capital"    />
+        <result property="establishData"    column="establish_data"    />
+        <result property="businessTerm"    column="business_term"    />
+        <result property="imageUrl"    column="image_url"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectSysUserEnterpriseVo">
+        select user_id, id_card, real_name, credit_code, enterprise_name, enterprise_type, enterprise_address, legal_name, registered_capital, establish_data, business_term, image_url, del_flag, create_by, create_time, update_by, update_time, remark from sys_user_enterprise
+    </sql>
+
+    <select id="selectSysUserEnterpriseList" parameterType="SysUserEnterprise" resultMap="SysUserEnterpriseResult">
+        <include refid="selectSysUserEnterpriseVo"/>
+        <where>  
+            <if test="idCard != null  and idCard != ''"> and id_card = #{idCard}</if>
+            <if test="userId != null  and userId != ''"> and user_id = #{userId}</if>
+            <if test="realName != null  and realName != ''"> and real_name like concat('%', #{realName}, '%')</if>
+            <if test="enterpriseName != null  and enterpriseName != ''"> and enterprise_name like concat('%', #{enterpriseName}, '%')</if>
+            <if test="enterpriseType != null  and enterpriseType != ''"> and enterprise_type = #{enterpriseType}</if>
+            <if test="enterpriseAddress != null  and enterpriseAddress != ''"> and enterprise_address = #{enterpriseAddress}</if>
+            <if test="legalName != null  and legalName != ''"> and legal_name like concat('%', #{legalName}, '%')</if>
+            <if test="registeredCapital != null  and registeredCapital != ''"> and registered_capital = #{registeredCapital}</if>
+            <if test="establishData != null  and establishData != ''"> and establish_data = #{establishData}</if>
+            <if test="businessTerm != null  and businessTerm != ''"> and business_term = #{businessTerm}</if>
+            <if test="imageUrl != null  and imageUrl != ''"> and image_url = #{imageUrl}</if>
+        </where>
+        order by create_time
+    </select>
+    
+    <select id="selectSysUserEnterpriseByUserId" parameterType="Long" resultMap="SysUserEnterpriseResult">
+        <include refid="selectSysUserEnterpriseVo"/>
+        where user_id = #{userId}
+    </select>
+        
+    <insert id="insertSysUserEnterprise" parameterType="SysUserEnterprise">
+        insert into sys_user_enterprise
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="userId != null">user_id,</if>
+            <if test="idCard != null and idCard != ''">id_card,</if>
+            <if test="realName != null and realName != ''">real_name,</if>
+            <if test="creditCode != null">credit_code,</if>
+            <if test="enterpriseName != null and enterpriseName != ''">enterprise_name,</if>
+            <if test="enterpriseType != null and enterpriseType != ''">enterprise_type,</if>
+            <if test="enterpriseAddress != null and enterpriseAddress != ''">enterprise_address,</if>
+            <if test="legalName != null and legalName != ''">legal_name,</if>
+            <if test="registeredCapital != null and registeredCapital != ''">registered_capital,</if>
+            <if test="establishData != null and establishData != ''">establish_data,</if>
+            <if test="businessTerm != null and businessTerm != ''">business_term,</if>
+            <if test="imageUrl != null and imageUrl != ''">image_url,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+            create_time
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="userId != null">#{userId},</if>
+            <if test="idCard != null and idCard != ''">#{idCard},</if>
+            <if test="realName != null and realName != ''">#{realName},</if>
+            <if test="creditCode != null">#{creditCode},</if>
+            <if test="enterpriseName != null and enterpriseName != ''">#{enterpriseName},</if>
+            <if test="enterpriseType != null and enterpriseType != ''">#{enterpriseType},</if>
+            <if test="enterpriseAddress != null and enterpriseAddress != ''">#{enterpriseAddress},</if>
+            <if test="legalName != null and legalName != ''">#{legalName},</if>
+            <if test="registeredCapital != null and registeredCapital != ''">#{registeredCapital},</if>
+            <if test="establishData != null and establishData != ''">#{establishData},</if>
+            <if test="businessTerm != null and businessTerm != ''">#{businessTerm},</if>
+            <if test="imageUrl != null and imageUrl != ''">#{imageUrl},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+        sysdate()
+    </insert>
+
+    <update id="updateSysUserEnterprise" parameterType="SysUserEnterprise">
+        update sys_user_enterprise
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="idCard != null and idCard != ''">id_card = #{idCard},</if>
+            <if test="realName != null and realName != ''">real_name = #{realName},</if>
+            <if test="creditCode != null">credit_code = #{creditCode},</if>
+            <if test="enterpriseName != null and enterpriseName != ''">enterprise_name = #{enterpriseName},</if>
+            <if test="enterpriseType != null and enterpriseType != ''">enterprise_type = #{enterpriseType},</if>
+            <if test="enterpriseAddress != null and enterpriseAddress != ''">enterprise_address = #{enterpriseAddress},</if>
+            <if test="legalName != null and legalName != ''">legal_name = #{legalName},</if>
+            <if test="registeredCapital != null and registeredCapital != ''">registered_capital = #{registeredCapital},</if>
+            <if test="establishData != null and establishData != ''">establish_data = #{establishData},</if>
+            <if test="businessTerm != null and businessTerm != ''">business_term = #{businessTerm},</if>
+            <if test="imageUrl != null and imageUrl != ''">image_url = #{imageUrl},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where user_id = #{userId}
+    </update>
+
+    <delete id="deleteSysUserEnterpriseByUserId" parameterType="Long">
+        delete from sys_user_enterprise where user_id = #{userId}
+    </delete>
+
+    <delete id="deleteSysUserEnterpriseByUserIds" parameterType="String">
+        delete from sys_user_enterprise where user_id in 
+        <foreach item="userId" collection="array" open="(" separator="," close=")">
+            #{userId}
+        </foreach>
+    </delete>
+</mapper>

+ 112 - 0
ruoyi-system/src/main/resources/mapper/system/SysUserIdcardMapper.xml

@@ -0,0 +1,112 @@
+<?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.ruoyi.system.mapper.SysUserIdcardMapper">
+    
+    <resultMap type="SysUserIdcard" id="SysUserIdcardResult">
+        <result property="userId"    column="user_id"    />
+        <result property="idCard"    column="id_card"    />
+        <result property="realName"    column="real_name"    />
+        <result property="expirationDate"    column="expiration_date"    />
+        <result property="phonenumber"    column="phonenumber"    />
+        <result property="address"    column="address"    />
+        <result property="front"    column="front"    />
+        <result property="back"    column="back"    />
+        <result property="delFlag"    column="del_flag"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="remark"    column="remark"    />
+    </resultMap>
+
+    <sql id="selectSysUserIdcardVo">
+        select user_id, id_card, real_name, expiration_date, phonenumber, address, front, back, del_flag, create_by, create_time, update_by, update_time, remark from sys_user_idcard
+    </sql>
+
+    <select id="selectSysUserIdcardList" parameterType="SysUserIdcard" resultMap="SysUserIdcardResult">
+        <include refid="selectSysUserIdcardVo"/>
+        <where>  
+            <if test="realName != null  and realName != ''"> and real_name like concat('%', #{realName}, '%')</if>
+            <if test="expirationDate != null  and expirationDate != ''"> and expiration_date = #{expirationDate}</if>
+            <if test="phonenumber != null  and phonenumber != ''"> and phonenumber = #{phonenumber}</if>
+            <if test="address != null  and address != ''"> and address = #{address}</if>
+            <if test="front != null  and front != ''"> and front = #{front}</if>
+            <if test="back != null  and back != ''"> and back = #{back}</if>
+        </where>
+        order by create_time
+    </select>
+    
+    <select id="selectSysUserIdcardByUserId" parameterType="Long" resultMap="SysUserIdcardResult">
+        <include refid="selectSysUserIdcardVo"/>
+        where user_id = #{userId}
+    </select>
+        
+    <insert id="insertSysUserIdcard" parameterType="SysUserIdcard">
+        insert into sys_user_idcard
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="userId != null">user_id,</if>
+            <if test="idCard != null">id_card,</if>
+            <if test="realName != null and realName != ''">real_name,</if>
+            <if test="expirationDate != null and expirationDate != ''">expiration_date,</if>
+            <if test="phonenumber != null">phonenumber,</if>
+            <if test="address != null and address != ''">address,</if>
+            <if test="front != null and front != ''">front,</if>
+            <if test="back != null and back != ''">back,</if>
+            <if test="delFlag != null">del_flag,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="updateBy != null">update_by,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="remark != null">remark,</if>
+            create_time
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="userId != null">#{userId},</if>
+            <if test="idCard != null">#{idCard},</if>
+            <if test="realName != null and realName != ''">#{realName},</if>
+            <if test="expirationDate != null and expirationDate != ''">#{expirationDate},</if>
+            <if test="phonenumber != null">#{phonenumber},</if>
+            <if test="address != null and address != ''">#{address},</if>
+            <if test="front != null and front != ''">#{front},</if>
+            <if test="back != null and back != ''">#{back},</if>
+            <if test="delFlag != null">#{delFlag},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="remark != null">#{remark},</if>
+         </trim>
+        sysdate()
+    </insert>
+
+    <update id="updateSysUserIdcard" parameterType="SysUserIdcard">
+        update sys_user_idcard
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="idCard != null">id_card = #{idCard},</if>
+            <if test="realName != null and realName != ''">real_name = #{realName},</if>
+            <if test="expirationDate != null and expirationDate != ''">expiration_date = #{expirationDate},</if>
+            <if test="phonenumber != null">phonenumber = #{phonenumber},</if>
+            <if test="address != null and address != ''">address = #{address},</if>
+            <if test="front != null and front != ''">front = #{front},</if>
+            <if test="back != null and back != ''">back = #{back},</if>
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="remark != null">remark = #{remark},</if>
+        </trim>
+        where user_id = #{userId}
+    </update>
+
+    <delete id="deleteSysUserIdcardByUserId" parameterType="Long">
+        delete from sys_user_idcard where user_id = #{userId}
+    </delete>
+
+    <delete id="deleteSysUserIdcardByUserIds" parameterType="String">
+        delete from sys_user_idcard where user_id in 
+        <foreach item="userId" collection="array" open="(" separator="," close=")">
+            #{userId}
+        </foreach>
+    </delete>
+</mapper>