瀏覽代碼

Merge branch 'master' of http://git.dgtis.com/15896567520/RuoYi-flowable-master

armg 1 年之前
父節點
當前提交
92460d32eb
共有 43 個文件被更改,包括 3366 次插入23 次删除
  1. 9 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
  2. 71 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/CrmController.java
  3. 105 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/CrmFileController.java
  4. 4 4
      ruoyi-admin/src/main/resources/application-druid.yml
  5. 13 0
      ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java
  6. 37 0
      ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java
  7. 7 0
      ruoyi-flowable/src/main/java/com/ruoyi/flowable/controller/FlowDefinitionController.java
  8. 0 1
      ruoyi-flowable/src/main/java/com/ruoyi/flowable/controller/FlowInstanceController.java
  9. 7 0
      ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/IFlowDefinitionService.java
  10. 25 0
      ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/crm/CrmService.java
  11. 225 0
      ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/crm/Impl/CrmServiceImpl.java
  12. 36 5
      ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowDefinitionServiceImpl.java
  13. 11 9
      ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowTaskServiceImpl.java
  14. 135 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/CrmFiles.java
  15. 100 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/crm/Address.java
  16. 95 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/crm/Contacts.java
  17. 135 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/crm/CrmFile.java
  18. 30 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/crm/CrmVo.java
  19. 143 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/crm/Customer.java
  20. 135 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/dhrm/DhrmCompany.java
  21. 7 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/FlowDeployMapper.java
  22. 62 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/crm/AddressMapper.java
  23. 70 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/crm/ContactsMapper.java
  24. 62 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/crm/CrmFileMapper.java
  25. 69 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/crm/CustomerMapper.java
  26. 70 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/dhrm/DhrmCompanyMapper.java
  27. 62 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/crm/IAddressService.java
  28. 71 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/crm/IContactsService.java
  29. 62 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/crm/ICrmFileService.java
  30. 72 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/crm/ICustomerService.java
  31. 93 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/crm/impl/AddressServiceImpl.java
  32. 104 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/crm/impl/ContactsServiceImpl.java
  33. 94 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/crm/impl/CrmFileServiceImpl.java
  34. 102 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/crm/impl/CustomerServiceImpl.java
  35. 69 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/dhrm/IDhrmCompanyService.java
  36. 105 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/dhrm/impl/DhrmCompanyServiceImpl.java
  37. 171 0
      ruoyi-system/src/main/resources/mapper/crm/AddressMapper.xml
  38. 228 0
      ruoyi-system/src/main/resources/mapper/crm/ContactsMapper.xml
  39. 86 0
      ruoyi-system/src/main/resources/mapper/crm/CrmFileMapper.xml
  40. 257 0
      ruoyi-system/src/main/resources/mapper/crm/CustomerMapper.xml
  41. 96 0
      ruoyi-system/src/main/resources/mapper/dhrm/DhrmCompanyMapper.xml
  42. 23 0
      ruoyi-system/src/main/resources/mapper/flowable/FlowDeployMapper.xml
  43. 8 4
      ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml

+ 9 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java

@@ -2,6 +2,9 @@ package com.ruoyi.web.controller.system;
 
 
 import java.util.List;
 import java.util.List;
 import java.util.Set;
 import java.util.Set;
+
+import com.ruoyi.system.domain.dhrm.DhrmCompany;
+import com.ruoyi.system.service.dhrm.IDhrmCompanyService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 import com.ruoyi.common.constant.Constants;
 import com.ruoyi.common.constant.Constants;
@@ -31,6 +34,9 @@ public class SysLoginController
     @Autowired
     @Autowired
     private SysPermissionService permissionService;
     private SysPermissionService permissionService;
 
 
+    @Autowired
+    private IDhrmCompanyService dhrmCompanyService;
+
     /**
     /**
      * 登录方法
      * 登录方法
      * 
      * 
@@ -78,10 +84,13 @@ public class SysLoginController
         Set<String> roles = permissionService.getRolePermission(user);
         Set<String> roles = permissionService.getRolePermission(user);
         // 权限集合
         // 权限集合
         Set<String> permissions = permissionService.getMenuPermission(user);
         Set<String> permissions = permissionService.getMenuPermission(user);
+        // 所属公司
+        DhrmCompany dhrmCompany = dhrmCompanyService.selectDhrmCompanyByEmployNo(user.getEmployNo());
         AjaxResult ajax = AjaxResult.success();
         AjaxResult ajax = AjaxResult.success();
         ajax.put("user", user);
         ajax.put("user", user);
         ajax.put("roles", roles);
         ajax.put("roles", roles);
         ajax.put("permissions", permissions);
         ajax.put("permissions", permissions);
+        ajax.put("dhrmCompany",dhrmCompany);
         return ajax;
         return ajax;
     }
     }
 
 

+ 71 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/CrmController.java

@@ -0,0 +1,71 @@
+package com.ruoyi.web.controller.tool;
+
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import com.ruoyi.flowable.domain.vo.FlowTaskVo;
+import com.ruoyi.flowable.service.crm.CrmService;
+import com.ruoyi.system.domain.crm.Customer;
+import com.ruoyi.system.service.crm.ICustomerService;
+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.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ *  crm系统
+ */
+@Api(tags = "CRM系统")
+@RestController
+@RequestMapping("/crmSystem")
+public class CrmController extends BaseController {
+
+    @Autowired
+    private CrmService crmService;
+
+    @Autowired
+    private ICustomerService customerService;
+
+    @ApiOperation(value = "发起流程")
+    @PostMapping("/start/{procDefId}")
+    public AjaxResult start(@ApiParam(value = "流程定义id") @PathVariable(value = "procDefId") String procDefId,
+                            @ApiParam(value = "变量集合,json对象") @RequestBody Map<String, Object> variables
+    ) {
+        return crmService.startProcessInstanceById(procDefId,variables);
+    }
+
+    /**
+     * 获取公司客户列表
+     */
+    @ApiOperation(value = "获取公司客户列表")
+    @PreAuthorize("@ss.hasPermi('crmSystem:crm:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(Customer customer)
+    {
+        startPage();
+        List<Customer> list = customerService.selectCustomerList(customer);
+        return getDataTable(list);
+    }
+
+    @ApiOperation(value = "获取待办列表", response = Customer.class)
+    @GetMapping(value = "/myTaskList")
+    public TableDataInfo myTaskList(@ApiParam(value = "客户实体") @RequestBody Customer customer)
+    {
+        startPage();
+        List<Customer> list = customerService.myTaskList(customer);
+        return getDataTable(list);
+    }
+
+
+
+
+
+
+
+
+}

+ 105 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/CrmFileController.java

@@ -0,0 +1,105 @@
+package com.ruoyi.web.controller.tool;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.system.domain.crm.CrmFile;
+import com.ruoyi.system.service.crm.ICrmFileService;
+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.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+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.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * crm附件Controller
+ * 
+ * @author ruoyi
+ * @date 2023-11-15
+ */
+@RestController
+@RequestMapping("/crm/crmFile")
+public class CrmFileController extends BaseController
+{
+    @Autowired
+    private ICrmFileService crmFileService;
+
+    /**
+     * 查询crm附件列表
+     */
+    @PreAuthorize("@ss.hasPermi('crm:crmFile:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(CrmFile crmFile)
+    {
+        startPage();
+        List<CrmFile> list = crmFileService.selectCrmFileList(crmFile);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出crm附件列表
+     */
+    @PreAuthorize("@ss.hasPermi('crm:crmFile:export')")
+    @Log(title = "crm附件", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, CrmFile crmFile)
+    {
+        List<CrmFile> list = crmFileService.selectCrmFileList(crmFile);
+        ExcelUtil<CrmFile> util = new ExcelUtil<CrmFile>(CrmFile.class);
+        util.exportExcel(response, list, "crm附件数据");
+    }
+
+    /**
+     * 获取crm附件详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('crm:crmFile:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(crmFileService.selectCrmFileById(id));
+    }
+
+    /**
+     * 新增crm附件
+     */
+    @PreAuthorize("@ss.hasPermi('crm:crmFile:add')")
+    @Log(title = "crm附件", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody CrmFile crmFile)
+    {
+        return toAjax(crmFileService.insertCrmFile(crmFile));
+    }
+
+    /**
+     * 修改crm附件
+     */
+    @PreAuthorize("@ss.hasPermi('crm:crmFile:edit')")
+    @Log(title = "crm附件", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody CrmFile crmFile)
+    {
+        return toAjax(crmFileService.updateCrmFile(crmFile));
+    }
+
+    /**
+     * 删除crm附件
+     */
+    @PreAuthorize("@ss.hasPermi('crm:crmFile:remove')")
+    @Log(title = "crm附件", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(crmFileService.deleteCrmFileByIds(ids));
+    }
+}

+ 4 - 4
ruoyi-admin/src/main/resources/application-druid.yml

@@ -6,9 +6,9 @@ spring:
         druid:
         druid:
             # 主库数据源
             # 主库数据源
             master:
             master:
-                url: jdbc:mysql://127.0.0.1:3306/tony-flowable?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
-                username: root
-                password: admin
+                url: jdbc:mysql://10.32.2.215:3306/tony-flowable?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
+                username: oneportal
+                password: Shanghai_1
             # 从库数据源
             # 从库数据源
             slave:
             slave:
                 # 从数据源开关/默认关闭
                 # 从数据源开关/默认关闭
@@ -54,7 +54,7 @@ spring:
                     enabled: true
                     enabled: true
                     # 慢SQL记录
                     # 慢SQL记录
                     log-slow-sql: true
                     log-slow-sql: true
-                    slow-sql-millis: 1000
+                    slow-sql-millis: 10000
                     merge-sql: true
                     merge-sql: true
                 wall:
                 wall:
                     config:
                     config:

+ 13 - 0
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java

@@ -59,6 +59,10 @@ public class SysUser extends BaseEntity
     @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
     @Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
     private String status;
     private String status;
 
 
+    /** 用户性别 */
+    @Excel(name = "员工编号")
+    private String employNo;
+
     /** 删除标志(0代表存在 2代表删除) */
     /** 删除标志(0代表存在 2代表删除) */
     private String delFlag;
     private String delFlag;
 
 
@@ -309,6 +313,14 @@ public class SysUser extends BaseEntity
         this.roleId = roleId;
         this.roleId = roleId;
     }
     }
 
 
+    public String getEmployNo() {
+        return employNo;
+    }
+
+    public void setEmployNo(String employNo) {
+        this.employNo = employNo;
+    }
+
     @Override
     @Override
     public String toString() {
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@@ -322,6 +334,7 @@ public class SysUser extends BaseEntity
             .append("avatar", getAvatar())
             .append("avatar", getAvatar())
             .append("password", getPassword())
             .append("password", getPassword())
             .append("status", getStatus())
             .append("status", getStatus())
+            .append("employNo", getEmployNo())
             .append("delFlag", getDelFlag())
             .append("delFlag", getDelFlag())
             .append("loginIp", getLoginIp())
             .append("loginIp", getLoginIp())
             .append("loginDate", getLoginDate())
             .append("loginDate", getLoginDate())

+ 37 - 0
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java

@@ -9,6 +9,10 @@ import java.io.OutputStream;
 import java.io.UnsupportedEncodingException;
 import java.io.UnsupportedEncodingException;
 import java.net.URLEncoder;
 import java.net.URLEncoder;
 import java.nio.charset.StandardCharsets;
 import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponse;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.io.IOUtils;
@@ -288,4 +292,37 @@ public class FileUtils
         String baseName = FilenameUtils.getBaseName(fileName);
         String baseName = FilenameUtils.getBaseName(fileName);
         return baseName;
         return baseName;
     }
     }
+
+    /**
+     * 获取文件对应的objectId和type类型
+     * <p>Title: getData</p>
+     * <p>Description: </p>
+     * @author koucx
+     * @date 2018年11月1日
+     *
+     */
+    public static List<String> getData(Map<String, Map<String,List<String>>> mapStr, String fileName){
+        List<String> list = new ArrayList<String>();
+        if(mapStr!=null && mapStr.size()>0){
+            Set<Map.Entry<String, Map<String, List<String>>>> entrySet = mapStr.entrySet();
+            for(Map.Entry<String, Map<String, List<String>>> fileMap:entrySet){
+                String objectId = fileMap.getKey();
+                Map<String, List<String>> value = fileMap.getValue();
+                Set<Map.Entry<String, List<String>>> entrySet2 = value.entrySet();
+                for (Map.Entry<String, List<String>> entry : entrySet2) {
+                    String type = entry.getKey();
+                    List<String> fileNames = entry.getValue();
+                    for (String str : fileNames) {
+                        if(str.equals(objectId+"_"+fileName)){
+                            list.add(objectId);
+                            list.add(type);
+                            return list;
+                        }
+                    }
+                }
+            }
+        }
+        return null;
+    }
+
 }
 }

+ 7 - 0
ruoyi-flowable/src/main/java/com/ruoyi/flowable/controller/FlowDefinitionController.java

@@ -65,6 +65,13 @@ public class FlowDefinitionController extends BaseController {
     }
     }
 
 
 
 
+    @GetMapping(value = "/selectByFlowKey")
+    @ApiOperation(value = "查询最新流程版本", response = FlowProcDefDto.class)
+    public AjaxResult selectByFlowKey(@ApiParam(value = "流程key") @RequestParam String flowKey) {
+        return AjaxResult.success(flowDefinitionService.selectByFlowKey(flowKey));
+    }
+
+
     @ApiOperation(value = "导入流程文件", notes = "上传bpmn20的xml文件")
     @ApiOperation(value = "导入流程文件", notes = "上传bpmn20的xml文件")
     @PostMapping("/import")
     @PostMapping("/import")
     public AjaxResult importFile(@RequestParam(required = false) String name,
     public AjaxResult importFile(@RequestParam(required = false) String name,

+ 0 - 1
ruoyi-flowable/src/main/java/com/ruoyi/flowable/controller/FlowInstanceController.java

@@ -33,7 +33,6 @@ public class FlowInstanceController {
     public AjaxResult startById(@ApiParam(value = "流程定义id") @PathVariable(value = "procDefId") String procDefId,
     public AjaxResult startById(@ApiParam(value = "流程定义id") @PathVariable(value = "procDefId") String procDefId,
                                 @ApiParam(value = "变量集合,json对象") @RequestBody Map<String, Object> variables) {
                                 @ApiParam(value = "变量集合,json对象") @RequestBody Map<String, Object> variables) {
         return flowInstanceService.startProcessInstanceById(procDefId, variables);
         return flowInstanceService.startProcessInstanceById(procDefId, variables);
-
     }
     }
 
 
 
 

+ 7 - 0
ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/IFlowDefinitionService.java

@@ -26,6 +26,13 @@ public interface IFlowDefinitionService {
      */
      */
     Page<FlowProcDefDto> list(String name,Integer pageNum, Integer pageSize);
     Page<FlowProcDefDto> list(String name,Integer pageNum, Integer pageSize);
 
 
+    /**
+     * 查询最新流程版本
+     * @param flowKey
+     * @return
+     */
+    FlowProcDefDto selectByFlowKey(String flowKey);
+
     /**
     /**
      * 导入流程文件
      * 导入流程文件
      * 当每个key的流程第一次部署时,指定版本为1。对其后所有使用相同key的流程定义,
      * 当每个key的流程第一次部署时,指定版本为1。对其后所有使用相同key的流程定义,

+ 25 - 0
ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/crm/CrmService.java

@@ -0,0 +1,25 @@
+package com.ruoyi.flowable.service.crm;
+
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.flowable.domain.vo.FlowQueryVo;
+import com.ruoyi.system.domain.crm.Address;
+import com.ruoyi.system.domain.crm.Contacts;
+import com.ruoyi.system.domain.crm.Customer;
+import io.swagger.annotations.ApiParam;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ *
+ */
+public interface CrmService {
+
+
+    AjaxResult startProcessInstanceById(String procDefId, Map<String, Object>  variables);
+
+
+
+}

+ 225 - 0
ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/crm/Impl/CrmServiceImpl.java

@@ -0,0 +1,225 @@
+package com.ruoyi.flowable.service.crm.Impl;
+
+import com.alibaba.fastjson2.JSONObject;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.ruoyi.common.annotation.DataScope;
+import com.ruoyi.common.config.RuoYiConfig;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.file.FileUtils;
+import com.ruoyi.common.utils.uuid.IdUtils;
+import com.ruoyi.flowable.common.enums.FlowComment;
+import com.ruoyi.flowable.domain.dto.FlowTaskDto;
+import com.ruoyi.flowable.domain.vo.FlowQueryVo;
+import com.ruoyi.flowable.factory.FlowServiceFactory;
+import com.ruoyi.flowable.service.crm.CrmService;
+import com.ruoyi.system.domain.crm.Address;
+import com.ruoyi.system.domain.crm.Contacts;
+import com.ruoyi.system.domain.crm.CrmFile;
+import com.ruoyi.system.domain.crm.Customer;
+import com.ruoyi.system.service.crm.IAddressService;
+import com.ruoyi.system.service.crm.IContactsService;
+import com.ruoyi.system.service.crm.ICrmFileService;
+import com.ruoyi.system.service.crm.ICustomerService;
+import io.swagger.annotations.ApiParam;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
+import org.flowable.engine.repository.ProcessDefinition;
+import org.flowable.engine.runtime.ProcessInstance;
+import org.flowable.task.api.Task;
+import org.flowable.task.api.TaskQuery;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.multipart.MultipartFile;
+import com.ruoyi.flowable.common.constant.ProcessConstants;
+
+import javax.annotation.Resource;
+import java.io.File;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service
+@Slf4j
+public class CrmServiceImpl extends FlowServiceFactory implements CrmService {
+
+
+    @Resource
+    private ICustomerService customerService;
+
+    @Resource
+    private IContactsService contactsService;
+
+    @Resource
+    private IAddressService addressService;
+
+    @Resource
+    private ICrmFileService crmFileService;
+
+
+    /**
+     * 新增客户流程开启
+     * @param procDefId
+     * @param variables
+     * @return
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public AjaxResult startProcessInstanceById(String procDefId, Map<String, Object>  variables) {
+        try {
+
+            if (StringUtils.isNull(variables.get("customer")))return AjaxResult.error("请填写客户联系人信息");
+
+            if (StringUtils.isNull(variables.get("contactsList")))return AjaxResult.error("请填写客户联系人信息");
+
+            SysUser sysUser = SecurityUtils.getLoginUser().getUser();
+
+            ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(procDefId)
+                    .latestVersion().singleResult();
+            if (Objects.nonNull(processDefinition) && processDefinition.isSuspended()) {
+                return AjaxResult.error("流程已被挂起,请先激活流程");
+            }
+
+            identityService.setAuthenticatedUserId(sysUser.getUserId().toString());
+            variables.put(ProcessConstants.PROCESS_INITIATOR, sysUser.getUserId());
+            //设置部门领导审批人
+            variables.put("MANAGER", sysUser.getUserId());
+
+            //设置事业部负责人审批人
+            variables.put("LEADER", sysUser.getUserId());
+            //设置事业群领导审批人
+            variables.put("DEPTLEADER", sysUser.getUserId());
+
+            /**
+             * todo 流程节点流转配置
+             * =============================
+             */
+
+
+
+            //开启流程
+            ProcessInstance processInstance = runtimeService.startProcessInstanceById(procDefId, variables);
+
+            //判断审批通过或暂存
+            //true 提交 false:暂存
+            if(Boolean.valueOf(variables.get("FLAG").toString())) {
+                // 给第一步申请人节点设置任务执行人和意见
+                Task task = taskService.createTaskQuery().processInstanceId(processInstance.getProcessInstanceId()).singleResult();
+                if (Objects.nonNull(task)) {
+                    taskService.addComment(task.getId(), processInstance.getProcessInstanceId(), FlowComment.NORMAL.getType(), sysUser.getNickName() + "发起流程申请");
+                    taskService.setAssignee(task.getId(), sysUser.getUserId().toString());
+                    taskService.complete(task.getId(), variables);
+                }
+            }
+            Customer customer = new ObjectMapper().readValue(variables.get("customer").toString(), Customer.class);
+
+            List<Contacts> contactsList = new ObjectMapper().readValue(variables.get("contactsList").toString(), new TypeReference<List<Contacts>>(){});
+
+            Address address = new ObjectMapper().readValue(variables.get("address").toString(), Address.class);
+
+            //保存客户信息
+            customer.setProcInsId(processInstance.getProcessInstanceId());
+//			customer.setCustomerId(uuid);
+//			customer.setCustomerCode(getNumber());
+            customer.setCreateBy(sysUser.getUserName());
+            customer.setSalesManager(sysUser.getUserName());
+//            customer.setCompanyId(userInfo.getCompanyId());//所在的公司Id
+            customer.setDeptId(sysUser.getDeptId().toString());//添加部门
+            customer.setDatefrom("0");//系统
+            if(Boolean.valueOf(variables.get("FLAG").toString())){
+                customer.setState("0");//已提交状态
+            }else{
+                customer.setState("1");//暂存状态
+            }
+            customerService.insertCustomer(customer);
+
+            //保存客户联系人信息
+            if (CollectionUtils.isNotEmpty(contactsList)){
+                SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
+                for (Contacts contacts : contactsList) {
+					contacts.setContactsId(IdUtils.fastUUID());
+                    contacts.setCustomerId(customer.getCustomerId());
+                    contacts.setContactCode(sdf.format(new Date()));
+//                    contacts.setCompanyId(customer.getCompanyId());
+                    contacts.setCreatedBy(sysUser.getUserName());
+                }
+                contactsService.batchInsertContacts(contactsList);
+            }
+
+            //保存账户信息
+            if (StringUtils.isNull(address)){
+                address.setCustomerId(customer.getCustomerId());
+                addressService.insertAddress(address);
+            }
+
+            //保存附件信息
+//            if(upfile.length>0){
+//                this.uploadFile(upfile,variables.get("fileMap").toString());
+//            }
+
+            // todo 保存流程审批记录-待开发
+
+            return AjaxResult.success("流程启动成功");
+        } catch (Exception e) {
+            e.printStackTrace();
+            return AjaxResult.error("流程启动错误");
+        }
+    }
+
+    public AjaxResult  uploadFile(MultipartFile[] upfile,String fileMap){
+        try {
+            SysUser sysUser = SecurityUtils.getLoginUser().getUser();
+            if(sysUser!=null){
+                List<CrmFile> fileList = new ArrayList<CrmFile>();
+                JSONObject jsonObject = JSONObject.from(fileMap);
+                Map<String, Map<String,List<String>>> mapStr = (Map)jsonObject;
+                //获取文件保存地址
+                String visit_url = RuoYiConfig.getUploadPath();
+
+                for(int i=0;i<upfile.length;i++){
+                    CrmFile cf = new CrmFile();
+                    String fileName = upfile[i].getOriginalFilename().trim();
+
+                    String uuid = IdUtils.fastUUID();
+                    //获取文件后缀
+                    String prefix=fileName.substring(fileName.lastIndexOf(".")+1);
+                    String newFileName = uuid+"."+prefix;
+                    File file = new File(visit_url+"/crmFile");
+                    if(!file.exists()){
+                        file.mkdirs();
+                    }
+                    upfile[i].transferTo(new File(file,newFileName));
+                    cf.setFileId(IdUtils.fastUUID());
+                    List<String> data = FileUtils.getData(mapStr, fileName);
+                    if(data!=null && data.size()>0 && data.size()>1){
+                        cf.setObjectId(data.get(0));
+                        cf.setType(data.get(1));
+                    }
+                    cf.setUploadName(fileName);
+                    cf.setUploadPath(visit_url+"/crmFile/"+newFileName);
+                    cf.setUploadType(prefix);
+                    fileList.add(cf);
+                }
+                if(fileList.size()>0){
+                    for (CrmFile po:fileList) {
+                        crmFileService.insertCrmFile(po);
+                    }
+                }
+                return AjaxResult.success("文件上传成功");
+            }else{
+                return AjaxResult.error("系统出错,请联系管理员");
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            return AjaxResult.error("文件上传失败");
+        }
+
+    }
+
+
+}

+ 36 - 5
ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowDefinitionServiceImpl.java

@@ -6,7 +6,6 @@ import com.github.pagehelper.PageInfo;
 import com.ruoyi.flowable.common.constant.ProcessConstants;
 import com.ruoyi.flowable.common.constant.ProcessConstants;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.core.domain.entity.SysUser;
-import com.ruoyi.flowable.common.enums.FlowComment;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.system.domain.FlowProcDefDto;
 import com.ruoyi.system.domain.FlowProcDefDto;
 import com.ruoyi.flowable.factory.FlowServiceFactory;
 import com.ruoyi.flowable.factory.FlowServiceFactory;
@@ -19,15 +18,12 @@ import com.ruoyi.system.service.ISysPostService;
 import com.ruoyi.system.service.ISysUserService;
 import com.ruoyi.system.service.ISysUserService;
 import lombok.extern.slf4j.Slf4j;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang3.StringUtils;
 import org.flowable.bpmn.model.BpmnModel;
 import org.flowable.bpmn.model.BpmnModel;
 import org.flowable.engine.repository.Deployment;
 import org.flowable.engine.repository.Deployment;
 import org.flowable.engine.repository.ProcessDefinition;
 import org.flowable.engine.repository.ProcessDefinition;
 import org.flowable.engine.repository.ProcessDefinitionQuery;
 import org.flowable.engine.repository.ProcessDefinitionQuery;
 import org.flowable.engine.runtime.ProcessInstance;
 import org.flowable.engine.runtime.ProcessInstance;
 import org.flowable.image.impl.DefaultProcessDiagramGenerator;
 import org.flowable.image.impl.DefaultProcessDiagramGenerator;
-import org.flowable.task.api.Task;
-import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
@@ -122,6 +118,29 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
     }
     }
 
 
 
 
+    /**
+     * 查询最新流程版本
+     * @param flowKey
+     * @return
+     */
+    @Override
+    public FlowProcDefDto selectByFlowKey(String flowKey) {
+        if (!Objects.nonNull(flowKey)) {
+            return new FlowProcDefDto();
+        }
+        FlowProcDefDto po = flowDeployMapper.selectByFlowKey(flowKey);
+        // 加载挂表单
+        if (Objects.nonNull(po)) {
+            SysForm sysForm = sysDeployFormService.selectSysDeployFormByDeployId(po.getDeploymentId());
+            if (Objects.nonNull(sysForm)) {
+                po.setFormName(sysForm.getFormName());
+                po.setFormId(sysForm.getFormId());
+            }
+        }
+        return po;
+    }
+
+
     /**
     /**
      * 导入流程文件
      * 导入流程文件
      *
      *
@@ -199,7 +218,19 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
             SysUser sysUser = SecurityUtils.getLoginUser().getUser();
             SysUser sysUser = SecurityUtils.getLoginUser().getUser();
             identityService.setAuthenticatedUserId(sysUser.getUserId().toString());
             identityService.setAuthenticatedUserId(sysUser.getUserId().toString());
             variables.put(ProcessConstants.PROCESS_INITIATOR, sysUser.getUserId());
             variables.put(ProcessConstants.PROCESS_INITIATOR, sysUser.getUserId());
-            runtimeService.startProcessInstanceById(procDefId, variables);
+            variables.put("MANAGER", sysUser.getUserId());
+            variables.put("LEADER", sysUser.getUserId());
+            variables.put("DEPTLEADER", sysUser.getUserId());
+
+
+
+
+            ProcessInstance p = runtimeService.startProcessInstanceById(procDefId, variables);
+
+
+
+
+
             // 流程发起时 跳过发起人节点
             // 流程发起时 跳过发起人节点
 //            SysUser sysUser = SecurityUtils.getLoginUser().getUser();
 //            SysUser sysUser = SecurityUtils.getLoginUser().getUser();
 //            identityService.setAuthenticatedUserId(sysUser.getUserId().toString());
 //            identityService.setAuthenticatedUserId(sysUser.getUserId().toString());

+ 11 - 9
ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowTaskServiceImpl.java

@@ -560,15 +560,17 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
                 }
                 }
             } else {
             } else {
                 List<HistoricTaskInstance> historicTaskInstance = historyService.createHistoricTaskInstanceQuery().processInstanceId(hisIns.getId()).orderByHistoricTaskInstanceEndTime().desc().list();
                 List<HistoricTaskInstance> historicTaskInstance = historyService.createHistoricTaskInstanceQuery().processInstanceId(hisIns.getId()).orderByHistoricTaskInstanceEndTime().desc().list();
-                flowTask.setTaskId(historicTaskInstance.get(0).getId());
-                flowTask.setTaskName(historicTaskInstance.get(0).getName());
-                if (StringUtils.isNotBlank(historicTaskInstance.get(0).getAssignee())) {
-                    // 当前任务节点办理人信息
-                    SysUser sysUser = sysUserService.selectUserById(Long.parseLong(historicTaskInstance.get(0).getAssignee()));
-                    if (Objects.nonNull(sysUser)) {
-                        flowTask.setAssigneeId(sysUser.getUserId());
-                        flowTask.setAssigneeName(sysUser.getNickName());
-                        flowTask.setAssigneeDeptName(Objects.nonNull(sysUser.getDept()) ? sysUser.getDept().getDeptName() : "");
+                if(historicTaskInstance!=null && historicTaskInstance.size() > 0){
+                    flowTask.setTaskId(historicTaskInstance.get(0).getId());
+                    flowTask.setTaskName(historicTaskInstance.get(0).getName());
+                    if (StringUtils.isNotBlank(historicTaskInstance.get(0).getAssignee())) {
+                        // 当前任务节点办理人信息
+                        SysUser sysUser = sysUserService.selectUserById(Long.parseLong(historicTaskInstance.get(0).getAssignee()));
+                        if (Objects.nonNull(sysUser)) {
+                            flowTask.setAssigneeId(sysUser.getUserId());
+                            flowTask.setAssigneeName(sysUser.getNickName());
+                            flowTask.setAssigneeDeptName(Objects.nonNull(sysUser.getDept()) ? sysUser.getDept().getDeptName() : "");
+                        }
                     }
                     }
                 }
                 }
             }
             }

+ 135 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/CrmFiles.java

@@ -0,0 +1,135 @@
+package com.ruoyi.system.domain;
+
+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_file
+ * 
+ * @author ruoyi
+ * @date 2023-11-15
+ */
+public class CrmFiles extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    private Long id;
+
+    /** 文件ID */
+    @Excel(name = "文件ID")
+    private String fileId;
+
+    /** 关联信息ID */
+    @Excel(name = "关联信息ID")
+    private String objectId;
+
+    /** 0:项目文件;1:活动计划文件;2活动实际文件;3客户信息文件;4联系人信息文件;5地址信息文件 */
+    @Excel(name = "0:项目文件;1:活动计划文件;2活动实际文件;3客户信息文件;4联系人信息文件;5地址信息文件")
+    private String type;
+
+    /** 文件名称 */
+    @Excel(name = "文件名称")
+    private String uploadName;
+
+    /** 文件类型 */
+    @Excel(name = "文件类型")
+    private String uploadType;
+
+    /** 文件地址 */
+    @Excel(name = "文件地址")
+    private String uploadPath;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    private String companyId;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setFileId(String fileId) 
+    {
+        this.fileId = fileId;
+    }
+
+    public String getFileId() 
+    {
+        return fileId;
+    }
+    public void setObjectId(String objectId) 
+    {
+        this.objectId = objectId;
+    }
+
+    public String getObjectId() 
+    {
+        return objectId;
+    }
+    public void setType(String type) 
+    {
+        this.type = type;
+    }
+
+    public String getType() 
+    {
+        return type;
+    }
+    public void setUploadName(String uploadName) 
+    {
+        this.uploadName = uploadName;
+    }
+
+    public String getUploadName() 
+    {
+        return uploadName;
+    }
+    public void setUploadType(String uploadType) 
+    {
+        this.uploadType = uploadType;
+    }
+
+    public String getUploadType() 
+    {
+        return uploadType;
+    }
+    public void setUploadPath(String uploadPath) 
+    {
+        this.uploadPath = uploadPath;
+    }
+
+    public String getUploadPath() 
+    {
+        return uploadPath;
+    }
+    public void setCompanyId(String companyId) 
+    {
+        this.companyId = companyId;
+    }
+
+    public String getCompanyId() 
+    {
+        return companyId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("fileId", getFileId())
+            .append("objectId", getObjectId())
+            .append("type", getType())
+            .append("uploadName", getUploadName())
+            .append("uploadType", getUploadType())
+            .append("uploadPath", getUploadPath())
+            .append("companyId", getCompanyId())
+            .toString();
+    }
+}

+ 100 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/crm/Address.java

@@ -0,0 +1,100 @@
+package com.ruoyi.system.domain.crm;
+
+import com.ruoyi.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@ApiModel("账户信息")
+public class Address extends BaseEntity {
+
+    @ApiModelProperty("主键id")
+    private String id;
+
+    @ApiModelProperty("账户id")
+    private String addressId;
+
+    @ApiModelProperty("客户id")
+    private String customerId;
+
+    @ApiModelProperty("发票地址")
+    private String invoiceAddress;//发票地址
+
+    @ApiModelProperty("送货地址")
+    private String sendAddress;//送货地址
+
+    @ApiModelProperty("【发票地址】邮政信箱")
+    private String invoicePostbox;//【发票地址】邮政信箱
+
+    @ApiModelProperty("【送货地址】邮政信箱")
+    private String sendPostbox;//【送货地址】邮政信箱
+
+    @ApiModelProperty("【发票地址】国家")
+    private String invoiceCountry;//【发票地址】国家
+
+    @ApiModelProperty("【送货地址】国家")
+    private String sendCountry;//【送货地址】国家
+
+    @ApiModelProperty("【发票地址】省份")
+    private String invoiceProvince;//【发票地址】省份
+
+    @ApiModelProperty("【送货地址】省份")
+    private String sendProvince;//【送货地址】省份
+
+    @ApiModelProperty("【发票地址】城市")
+    private String invoiceCity;//【发票地址】城市
+
+    @ApiModelProperty("【送货地址】城市")
+    private String sendCity;//【送货地址】城市
+
+    @ApiModelProperty("【发票地址】邮编")
+    private String invoicePostCode;//【发票地址】邮编
+
+    @ApiModelProperty("【送货地址】邮编")
+    private String sendPostCode;//【送货地址】邮编
+
+    @ApiModelProperty("审核")
+    private String isActive;
+
+    @ApiModelProperty("客户名称")
+    private String customerName;//销售经理
+
+    @ApiModelProperty("姓名")
+    private String userName;//销售经理
+
+    @ApiModelProperty("公司id")
+    private String companyId;
+
+    private String salesManager;
+
+    @ApiModelProperty("开户名称")
+    private String accountName;//开户名称
+
+    @ApiModelProperty("公司税号")
+    private String companyTaxNum;//公司税号
+
+    @ApiModelProperty("开户银行")
+    private String bankOfDeposit;//开户银行
+
+    @ApiModelProperty("银行账号")
+    private String bankAccount;//银行账号
+
+    @ApiModelProperty("公司地址")
+    private String companyAddress;//公司地址
+
+    @ApiModelProperty("公司电话")
+    private String companyPhone;//公司电话
+
+    @ApiModelProperty("纳税人")
+    private String taxpayer;//纳税人
+
+    @ApiModelProperty("税率")
+    private  String customerTaxrate;//税率
+
+
+}

+ 95 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/crm/Contacts.java

@@ -0,0 +1,95 @@
+package com.ruoyi.system.domain.crm;
+
+
+import com.ruoyi.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@ApiModel("联系人")
+public class Contacts extends BaseEntity {
+
+    @ApiModelProperty("主键id")
+    private Integer id;
+
+    @ApiModelProperty("联系人ID")
+    private String contactsId;
+
+    @ApiModelProperty("客户实体id")
+    private String customerId;
+
+    @ApiModelProperty("姓名")
+    private String name;
+
+    @ApiModelProperty("联系人编号")
+    private String contactCode;
+
+    @ApiModelProperty("手机")
+    private String phone;
+
+    @ApiModelProperty("手机")
+    private String tel;
+
+    @ApiModelProperty("手机")
+    private String tel2;
+
+    @ApiModelProperty("传真")
+    private String fax;
+
+    @ApiModelProperty("电子邮箱")
+    private String email;
+
+    @ApiModelProperty("QQ")
+    private String qq;
+
+    @ApiModelProperty("所属部门")
+    private String department;
+
+    @ApiModelProperty("职位")
+    private String position;
+
+    @ApiModelProperty("办公地址")
+    private String officeAddress;
+
+    @ApiModelProperty("来源")
+    private String source;
+
+    @ApiModelProperty("邮编")
+    private String postcode;
+
+    @ApiModelProperty("照片")
+    private String Photo;
+
+    @ApiModelProperty("创建人")
+    private String createdBy;
+
+    @ApiModelProperty("创建时间")
+    private String createdDate;
+
+    @ApiModelProperty("修改人")
+    private String updatedBy;
+
+    @ApiModelProperty("修改时间")
+    private String updatedDate;
+
+    @ApiModelProperty("")
+    private String is_Active;
+
+    @ApiModelProperty("删除时间")
+    private String deleteDate;
+
+    @ApiModelProperty("删除人")
+    private String deleteBy;
+
+    @ApiModelProperty("公司id")
+    private String companyId;
+
+    @ApiModelProperty("是否删除0:未删除,1:已删除")
+    private String isDelete;
+
+}

+ 135 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/crm/CrmFile.java

@@ -0,0 +1,135 @@
+package com.ruoyi.system.domain.crm;
+
+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;
+
+/**
+ * crm附件对象 crm_file
+ * 
+ * @author ruoyi
+ * @date 2023-11-15
+ */
+public class CrmFile extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    private Long id;
+
+    /** 文件ID */
+    @Excel(name = "文件ID")
+    private String fileId;
+
+    /** 关联信息ID */
+    @Excel(name = "关联信息ID")
+    private String objectId;
+
+    /** 0:项目文件;1:活动计划文件;2活动实际文件;3客户信息文件;4联系人信息文件;5地址信息文件 */
+    @Excel(name = "0:项目文件;1:活动计划文件;2活动实际文件;3客户信息文件;4联系人信息文件;5地址信息文件")
+    private String type;
+
+    /** 文件名称 */
+    @Excel(name = "文件名称")
+    private String uploadName;
+
+    /** 文件类型 */
+    @Excel(name = "文件类型")
+    private String uploadType;
+
+    /** 文件地址 */
+    @Excel(name = "文件地址")
+    private String uploadPath;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    private String companyId;
+
+    public void setId(Long id) 
+    {
+        this.id = id;
+    }
+
+    public Long getId() 
+    {
+        return id;
+    }
+    public void setFileId(String fileId) 
+    {
+        this.fileId = fileId;
+    }
+
+    public String getFileId() 
+    {
+        return fileId;
+    }
+    public void setObjectId(String objectId) 
+    {
+        this.objectId = objectId;
+    }
+
+    public String getObjectId() 
+    {
+        return objectId;
+    }
+    public void setType(String type) 
+    {
+        this.type = type;
+    }
+
+    public String getType() 
+    {
+        return type;
+    }
+    public void setUploadName(String uploadName) 
+    {
+        this.uploadName = uploadName;
+    }
+
+    public String getUploadName() 
+    {
+        return uploadName;
+    }
+    public void setUploadType(String uploadType) 
+    {
+        this.uploadType = uploadType;
+    }
+
+    public String getUploadType() 
+    {
+        return uploadType;
+    }
+    public void setUploadPath(String uploadPath) 
+    {
+        this.uploadPath = uploadPath;
+    }
+
+    public String getUploadPath() 
+    {
+        return uploadPath;
+    }
+    public void setCompanyId(String companyId) 
+    {
+        this.companyId = companyId;
+    }
+
+    public String getCompanyId() 
+    {
+        return companyId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("id", getId())
+            .append("fileId", getFileId())
+            .append("objectId", getObjectId())
+            .append("type", getType())
+            .append("uploadName", getUploadName())
+            .append("uploadType", getUploadType())
+            .append("uploadPath", getUploadPath())
+            .append("companyId", getCompanyId())
+            .toString();
+    }
+}

+ 30 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/crm/CrmVo.java

@@ -0,0 +1,30 @@
+package com.ruoyi.system.domain.crm;
+
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class CrmVo {
+
+    private String expenseItemName;//项目名称
+
+    private String expenseItemNumber;//项目编号
+
+    private String costCenter;//成本中心
+
+    private String planIncome;//合同收入
+
+    private String flag;//0:总裁室开放所有权限    1:部门领导看这个部门所有数据    2:个人权限数据
+
+    private String startMonth;
+
+    private String endMonth;
+
+    private String key;
+
+    private List<CrmFile> crmFiles;
+
+
+}

+ 143 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/crm/Customer.java

@@ -0,0 +1,143 @@
+package com.ruoyi.system.domain.crm;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.util.Date;
+
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@ApiModel("客户实体")
+public class Customer extends BaseEntity {
+
+    @ApiModelProperty("主键id")
+    private String id;
+
+    @ApiModelProperty("客户id")
+    private String customerId;
+
+    @ApiModelProperty("客户编码")
+    private String customerCode;
+
+    @ApiModelProperty("客户名称")
+    private String customerName;
+
+    @ApiModelProperty("客户状态")
+    private String status;
+
+    @ApiModelProperty("网站")
+    private String website;
+
+    private String yearBusiness;
+
+    @ApiModelProperty("股票代码")
+    private String stockCode;
+
+    @ApiModelProperty("法人代表")
+    private String legalPerson;
+
+    @ApiModelProperty("关联单位")
+    private String connectedEntities;
+
+    @ApiModelProperty("行业")
+    private String trade;
+
+    @ApiModelProperty("员工人数")
+    private int workforce;
+
+    @ApiModelProperty("客户类型")
+    private String customerType;
+
+    @ApiModelProperty("负责部门")
+    private String responsibleDept;
+
+    @ApiModelProperty("销售经理")
+    private String salesManager;
+
+    @ApiModelProperty("备注")
+    private String mark;
+
+    @ApiModelProperty("isActive")
+    private String isActive;
+
+    @ApiModelProperty("删除时间")
+    private String deleteDate;
+
+    @ApiModelProperty("删除人")
+    private String deleteBy;
+
+    @ApiModelProperty("销售经理")
+    private String salesManagerName;
+
+    @ApiModelProperty("角色名称")
+    private String roleName;
+
+    private String technicalSupport;
+
+    @ApiModelProperty("公司Id")
+    private String companyId;
+
+    @ApiModelProperty("公司名称")
+    private String companyName;
+
+    @ApiModelProperty("部门id")
+    private String deptId;
+
+    @ApiModelProperty("部门名称")
+    private String deptName;
+
+    private boolean finish;
+
+    private String customerNature;
+
+    private String state;
+
+    @ApiModelProperty("0:系统,1:U8")
+    private String datefrom;
+
+    @ApiModelProperty("是否删除")
+    private  int isDelete;
+
+    private String companyAddress;
+
+    @ApiModelProperty("0:开启,1:关闭")
+    private String isOpen;
+
+    @ApiModelProperty("其他性质")
+    private String otherNature;
+
+    @ApiModelProperty("其他类别")
+    private String otherCategory;
+
+    @ApiModelProperty("注册资本金")
+    private String capital;
+
+    @ApiModelProperty("销售经理")
+    private String currency;
+
+    @ApiModelProperty("客户成立时间")
+    private String registDate;
+
+    @ApiModelProperty("流程示例id")
+    private String procInsId;
+
+    @ApiModelProperty("预签公司Id")
+    private String dhrmCompanyId;
+
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createDate;
+
+    /** 更新时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateDate;
+
+
+}

+ 135 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/dhrm/DhrmCompany.java

@@ -0,0 +1,135 @@
+package com.ruoyi.system.domain.dhrm;
+
+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;
+
+/**
+ * 公司管理对象 dhrm_company
+ * 
+ * @author ruoyi
+ * @date 2023-11-16
+ */
+public class DhrmCompany extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    /** $column.columnComment */
+    private Long dhrmId;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    private String dhrmCompanyId;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    private String dhrmCompanyName;
+
+    /** DSK */
+    @Excel(name = "DSK")
+    private String dhrmCompanyDsk;
+
+    /** $column.columnComment */
+    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
+    private String isClose;
+
+    /** 开户行 */
+    @Excel(name = "开户行")
+    private String bankName;
+
+    /** 账号 */
+    @Excel(name = "账号")
+    private String bankNum;
+
+    /** 所属公司 */
+    @Excel(name = "所属公司")
+    private String companyId;
+
+    public void setDhrmId(Long dhrmId) 
+    {
+        this.dhrmId = dhrmId;
+    }
+
+    public Long getDhrmId() 
+    {
+        return dhrmId;
+    }
+    public void setDhrmCompanyId(String dhrmCompanyId) 
+    {
+        this.dhrmCompanyId = dhrmCompanyId;
+    }
+
+    public String getDhrmCompanyId() 
+    {
+        return dhrmCompanyId;
+    }
+    public void setDhrmCompanyName(String dhrmCompanyName) 
+    {
+        this.dhrmCompanyName = dhrmCompanyName;
+    }
+
+    public String getDhrmCompanyName() 
+    {
+        return dhrmCompanyName;
+    }
+    public void setDhrmCompanyDsk(String dhrmCompanyDsk) 
+    {
+        this.dhrmCompanyDsk = dhrmCompanyDsk;
+    }
+
+    public String getDhrmCompanyDsk() 
+    {
+        return dhrmCompanyDsk;
+    }
+    public void setIsClose(String isClose) 
+    {
+        this.isClose = isClose;
+    }
+
+    public String getIsClose() 
+    {
+        return isClose;
+    }
+    public void setBankName(String bankName) 
+    {
+        this.bankName = bankName;
+    }
+
+    public String getBankName() 
+    {
+        return bankName;
+    }
+    public void setBankNum(String bankNum) 
+    {
+        this.bankNum = bankNum;
+    }
+
+    public String getBankNum() 
+    {
+        return bankNum;
+    }
+    public void setCompanyId(String companyId) 
+    {
+        this.companyId = companyId;
+    }
+
+    public String getCompanyId() 
+    {
+        return companyId;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
+            .append("dhrmId", getDhrmId())
+            .append("dhrmCompanyId", getDhrmCompanyId())
+            .append("dhrmCompanyName", getDhrmCompanyName())
+            .append("dhrmCompanyDsk", getDhrmCompanyDsk())
+            .append("isClose", getIsClose())
+            .append("bankName", getBankName())
+            .append("bankNum", getBankNum())
+            .append("companyId", getCompanyId())
+            .toString();
+    }
+}

+ 7 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/FlowDeployMapper.java

@@ -19,4 +19,11 @@ public interface FlowDeployMapper {
      * @return
      * @return
      */
      */
     List<FlowProcDefDto> selectDeployList(String name);
     List<FlowProcDefDto> selectDeployList(String name);
+
+    /**
+     * 查询最新流程版本
+     * @param flowKey
+     * @return
+     */
+    FlowProcDefDto selectByFlowKey(String flowKey);
 }
 }

+ 62 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/crm/AddressMapper.java

@@ -0,0 +1,62 @@
+package com.ruoyi.system.mapper.crm;
+
+import com.ruoyi.system.domain.crm.Address;
+
+import java.util.List;
+
+/**
+ * 账户信息Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2023-11-15
+ */
+public interface AddressMapper 
+{
+    /**
+     * 查询账户信息
+     * 
+     * @param id 账户信息主键
+     * @return 账户信息
+     */
+    public Address selectAddressById(Long id);
+
+    /**
+     * 查询账户信息列表
+     * 
+     * @param address 账户信息
+     * @return 账户信息集合
+     */
+    public List<Address> selectAddressList(Address address);
+
+    /**
+     * 新增账户信息
+     * 
+     * @param address 账户信息
+     * @return 结果
+     */
+    public int insertAddress(Address address);
+
+    /**
+     * 修改账户信息
+     * 
+     * @param address 账户信息
+     * @return 结果
+     */
+    public int updateAddress(Address address);
+
+    /**
+     * 删除账户信息
+     * 
+     * @param id 账户信息主键
+     * @return 结果
+     */
+    public int deleteAddressById(Long id);
+
+    /**
+     * 批量删除账户信息
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteAddressByIds(Long[] ids);
+}

+ 70 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/crm/ContactsMapper.java

@@ -0,0 +1,70 @@
+package com.ruoyi.system.mapper.crm;
+
+import com.ruoyi.system.domain.crm.Contacts;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 客户联系人信息Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2023-11-15
+ */
+public interface ContactsMapper 
+{
+    /**
+     * 查询客户联系人信息
+     * 
+     * @param id 客户联系人信息主键
+     * @return 客户联系人信息
+     */
+    public Contacts selectContactsById(Long id);
+
+    /**
+     * 查询客户联系人信息列表
+     * 
+     * @param contacts 客户联系人信息
+     * @return 客户联系人信息集合
+     */
+    public List<Contacts> selectContactsList(Contacts contacts);
+
+    /**
+     * 新增客户联系人信息
+     * 
+     * @param contacts 客户联系人信息
+     * @return 结果
+     */
+    public int insertContacts(Contacts contacts);
+
+    /**
+     * 修改客户联系人信息
+     * 
+     * @param contacts 客户联系人信息
+     * @return 结果
+     */
+    public int updateContacts(Contacts contacts);
+
+    /**
+     * 删除客户联系人信息
+     * 
+     * @param id 客户联系人信息主键
+     * @return 结果
+     */
+    public int deleteContactsById(Long id);
+
+    /**
+     * 批量删除客户联系人信息
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteContactsByIds(Long[] ids);
+
+    /**
+     * 批量新增客户联系人信息
+     * @param contactsList
+     * @return
+     */
+    public int batchInsertContacts(@Param("contactsList") List<Contacts> contactsList);
+}

+ 62 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/crm/CrmFileMapper.java

@@ -0,0 +1,62 @@
+package com.ruoyi.system.mapper.crm;
+
+import com.ruoyi.system.domain.crm.CrmFile;
+
+import java.util.List;
+
+/**
+ * crm附件Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2023-11-15
+ */
+public interface CrmFileMapper 
+{
+    /**
+     * 查询crm附件
+     * 
+     * @param id crm附件主键
+     * @return crm附件
+     */
+    public CrmFile selectCrmFileById(Long id);
+
+    /**
+     * 查询crm附件列表
+     * 
+     * @param crmFile crm附件
+     * @return crm附件集合
+     */
+    public List<CrmFile> selectCrmFileList(CrmFile crmFile);
+
+    /**
+     * 新增crm附件
+     * 
+     * @param crmFile crm附件
+     * @return 结果
+     */
+    public int insertCrmFile(CrmFile crmFile);
+
+    /**
+     * 修改crm附件
+     * 
+     * @param crmFile crm附件
+     * @return 结果
+     */
+    public int updateCrmFile(CrmFile crmFile);
+
+    /**
+     * 删除crm附件
+     * 
+     * @param id crm附件主键
+     * @return 结果
+     */
+    public int deleteCrmFileById(Long id);
+
+    /**
+     * 批量删除crm附件
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteCrmFileByIds(Long[] ids);
+}

+ 69 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/crm/CustomerMapper.java

@@ -0,0 +1,69 @@
+package com.ruoyi.system.mapper.crm;
+
+import com.ruoyi.system.domain.crm.Customer;
+
+import java.util.List;
+
+/**
+ * CRM系统Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2023-11-15
+ */
+public interface CustomerMapper 
+{
+    /**
+     * 查询CRM系统
+     * 
+     * @param id CRM系统主键
+     * @return CRM系统
+     */
+    public Customer selectCustomerById(Long id);
+
+    /**
+     * 查询CRM系统列表
+     * 
+     * @param customer CRM系统
+     * @return CRM系统集合
+     */
+    public List<Customer> selectCustomerList(Customer customer);
+
+    /**
+     * 新增CRM系统
+     * 
+     * @param customer CRM系统
+     * @return 结果
+     */
+    public int insertCustomer(Customer customer);
+
+    /**
+     * 修改CRM系统
+     * 
+     * @param customer CRM系统
+     * @return 结果
+     */
+    public int updateCustomer(Customer customer);
+
+    /**
+     * 删除CRM系统
+     * 
+     * @param id CRM系统主键
+     * @return 结果
+     */
+    public int deleteCustomerById(Long id);
+
+    /**
+     * 批量删除CRM系统
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteCustomerByIds(Long[] ids);
+
+    /**
+     * 我的待办任务
+     * @param customer
+     * @return
+     */
+    public List<Customer> myTaskList(Customer customer);
+}

+ 70 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/dhrm/DhrmCompanyMapper.java

@@ -0,0 +1,70 @@
+package com.ruoyi.system.mapper.dhrm;
+
+import com.ruoyi.system.domain.dhrm.DhrmCompany;
+
+import java.util.List;
+
+/**
+ * 公司管理Mapper接口
+ * 
+ * @author ruoyi
+ * @date 2023-11-16
+ */
+public interface DhrmCompanyMapper 
+{
+    /**
+     * 查询公司管理
+     * 
+     * @param dhrmId 公司管理主键
+     * @return 公司管理
+     */
+    public DhrmCompany selectDhrmCompanyByDhrmId(Long dhrmId);
+
+    /**
+     * 查询公司管理列表
+     * 
+     * @param dhrmCompany 公司管理
+     * @return 公司管理集合
+     */
+    public List<DhrmCompany> selectDhrmCompanyList(DhrmCompany dhrmCompany);
+
+    /**
+     * 新增公司管理
+     * 
+     * @param dhrmCompany 公司管理
+     * @return 结果
+     */
+    public int insertDhrmCompany(DhrmCompany dhrmCompany);
+
+    /**
+     * 修改公司管理
+     * 
+     * @param dhrmCompany 公司管理
+     * @return 结果
+     */
+    public int updateDhrmCompany(DhrmCompany dhrmCompany);
+
+    /**
+     * 删除公司管理
+     * 
+     * @param dhrmId 公司管理主键
+     * @return 结果
+     */
+    public int deleteDhrmCompanyByDhrmId(Long dhrmId);
+
+    /**
+     * 批量删除公司管理
+     * 
+     * @param dhrmIds 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteDhrmCompanyByDhrmIds(Long[] dhrmIds);
+
+    /**
+     * 根据员工编号查询公司数据
+     *
+     * @param employNo
+     * @return
+     */
+    public DhrmCompany selectDhrmCompanyByEmployNo(String employNo);
+}

+ 62 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/crm/IAddressService.java

@@ -0,0 +1,62 @@
+package com.ruoyi.system.service.crm;
+
+import com.ruoyi.system.domain.crm.Address;
+
+import java.util.List;
+
+/**
+ * 账户信息Service接口
+ * 
+ * @author ruoyi
+ * @date 2023-11-15
+ */
+public interface IAddressService 
+{
+    /**
+     * 查询账户信息
+     * 
+     * @param id 账户信息主键
+     * @return 账户信息
+     */
+    public Address selectAddressById(Long id);
+
+    /**
+     * 查询账户信息列表
+     * 
+     * @param address 账户信息
+     * @return 账户信息集合
+     */
+    public List<Address> selectAddressList(Address address);
+
+    /**
+     * 新增账户信息
+     * 
+     * @param address 账户信息
+     * @return 结果
+     */
+    public int insertAddress(Address address);
+
+    /**
+     * 修改账户信息
+     * 
+     * @param address 账户信息
+     * @return 结果
+     */
+    public int updateAddress(Address address);
+
+    /**
+     * 批量删除账户信息
+     * 
+     * @param ids 需要删除的账户信息主键集合
+     * @return 结果
+     */
+    public int deleteAddressByIds(Long[] ids);
+
+    /**
+     * 删除账户信息信息
+     * 
+     * @param id 账户信息主键
+     * @return 结果
+     */
+    public int deleteAddressById(Long id);
+}

+ 71 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/crm/IContactsService.java

@@ -0,0 +1,71 @@
+package com.ruoyi.system.service.crm;
+
+import com.ruoyi.system.domain.crm.Contacts;
+
+import java.util.List;
+
+/**
+ * 客户联系人信息Service接口
+ * 
+ * @author ruoyi
+ * @date 2023-11-15
+ */
+public interface IContactsService 
+{
+    /**
+     * 查询客户联系人信息
+     * 
+     * @param id 客户联系人信息主键
+     * @return 客户联系人信息
+     */
+    public Contacts selectContactsById(Long id);
+
+    /**
+     * 查询客户联系人信息列表
+     * 
+     * @param contacts 客户联系人信息
+     * @return 客户联系人信息集合
+     */
+    public List<Contacts> selectContactsList(Contacts contacts);
+
+    /**
+     * 新增客户联系人信息
+     * 
+     * @param contacts 客户联系人信息
+     * @return 结果
+     */
+    public int insertContacts(Contacts contacts);
+
+    /**
+     * 修改客户联系人信息
+     * 
+     * @param contacts 客户联系人信息
+     * @return 结果
+     */
+    public int updateContacts(Contacts contacts);
+
+    /**
+     * 批量删除客户联系人信息
+     * 
+     * @param ids 需要删除的客户联系人信息主键集合
+     * @return 结果
+     */
+    public int deleteContactsByIds(Long[] ids);
+
+    /**
+     * 删除客户联系人信息信息
+     * 
+     * @param id 客户联系人信息主键
+     * @return 结果
+     */
+    public int deleteContactsById(Long id);
+
+
+    /**
+     * 批量新增客户联系人信息
+     * @param contactsList
+     */
+    public int batchInsertContacts(List<Contacts> contactsList);
+
+
+}

+ 62 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/crm/ICrmFileService.java

@@ -0,0 +1,62 @@
+package com.ruoyi.system.service.crm;
+
+import com.ruoyi.system.domain.crm.CrmFile;
+
+import java.util.List;
+
+/**
+ * crm附件Service接口
+ * 
+ * @author ruoyi
+ * @date 2023-11-15
+ */
+public interface ICrmFileService 
+{
+    /**
+     * 查询crm附件
+     * 
+     * @param id crm附件主键
+     * @return crm附件
+     */
+    public CrmFile selectCrmFileById(Long id);
+
+    /**
+     * 查询crm附件列表
+     * 
+     * @param crmFile crm附件
+     * @return crm附件集合
+     */
+    public List<CrmFile> selectCrmFileList(CrmFile crmFile);
+
+    /**
+     * 新增crm附件
+     * 
+     * @param crmFile crm附件
+     * @return 结果
+     */
+    public int insertCrmFile(CrmFile crmFile);
+
+    /**
+     * 修改crm附件
+     * 
+     * @param crmFile crm附件
+     * @return 结果
+     */
+    public int updateCrmFile(CrmFile crmFile);
+
+    /**
+     * 批量删除crm附件
+     * 
+     * @param ids 需要删除的crm附件主键集合
+     * @return 结果
+     */
+    public int deleteCrmFileByIds(Long[] ids);
+
+    /**
+     * 删除crm附件信息
+     * 
+     * @param id crm附件主键
+     * @return 结果
+     */
+    public int deleteCrmFileById(Long id);
+}

+ 72 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/crm/ICustomerService.java

@@ -0,0 +1,72 @@
+package com.ruoyi.system.service.crm;
+
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.system.domain.crm.Customer;
+
+import java.util.List;
+
+/**
+ * CRM系统Service接口
+ * 
+ * @author ruoyi
+ * @date 2023-11-15
+ */
+public interface ICustomerService 
+{
+    /**
+     * 查询CRM系统
+     * 
+     * @param id CRM系统主键
+     * @return CRM系统
+     */
+    public Customer selectCustomerById(Long id);
+
+    /**
+     * 查询CRM系统列表
+     * 
+     * @param customer CRM系统
+     * @return CRM系统集合
+     */
+    public List<Customer> selectCustomerList(Customer customer);
+
+    /**
+     * 新增CRM系统
+     * 
+     * @param customer CRM系统
+     * @return 结果
+     */
+    public int insertCustomer(Customer customer);
+
+    /**
+     * 修改CRM系统
+     * 
+     * @param customer CRM系统
+     * @return 结果
+     */
+    public int updateCustomer(Customer customer);
+
+    /**
+     * 批量删除CRM系统
+     * 
+     * @param ids 需要删除的CRM系统主键集合
+     * @return 结果
+     */
+    public int deleteCustomerByIds(Long[] ids);
+
+    /**
+     * 删除CRM系统信息
+     * 
+     * @param id CRM系统主键
+     * @return 结果
+     */
+    public int deleteCustomerById(Long id);
+
+    /**
+     * 我的待办任务
+     * @param customer
+     * @return
+     */
+    List<Customer> myTaskList(Customer customer);
+
+
+}

+ 93 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/crm/impl/AddressServiceImpl.java

@@ -0,0 +1,93 @@
+package com.ruoyi.system.service.crm.impl;
+
+import java.util.List;
+
+import com.ruoyi.system.domain.crm.Address;
+import com.ruoyi.system.mapper.crm.AddressMapper;
+import com.ruoyi.system.service.crm.IAddressService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+/**
+ * 账户信息Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2023-11-15
+ */
+@Service
+public class AddressServiceImpl implements IAddressService
+{
+    @Autowired
+    private AddressMapper addressMapper;
+
+    /**
+     * 查询账户信息
+     * 
+     * @param id 账户信息主键
+     * @return 账户信息
+     */
+    @Override
+    public Address selectAddressById(Long id)
+    {
+        return addressMapper.selectAddressById(id);
+    }
+
+    /**
+     * 查询账户信息列表
+     * 
+     * @param address 账户信息
+     * @return 账户信息
+     */
+    @Override
+    public List<Address> selectAddressList(Address address)
+    {
+        return addressMapper.selectAddressList(address);
+    }
+
+    /**
+     * 新增账户信息
+     * 
+     * @param address 账户信息
+     * @return 结果
+     */
+    @Override
+    public int insertAddress(Address address)
+    {
+        return addressMapper.insertAddress(address);
+    }
+
+    /**
+     * 修改账户信息
+     * 
+     * @param address 账户信息
+     * @return 结果
+     */
+    @Override
+    public int updateAddress(Address address)
+    {
+        return addressMapper.updateAddress(address);
+    }
+
+    /**
+     * 批量删除账户信息
+     * 
+     * @param ids 需要删除的账户信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAddressByIds(Long[] ids)
+    {
+        return addressMapper.deleteAddressByIds(ids);
+    }
+
+    /**
+     * 删除账户信息信息
+     * 
+     * @param id 账户信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteAddressById(Long id)
+    {
+        return addressMapper.deleteAddressById(id);
+    }
+}

+ 104 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/crm/impl/ContactsServiceImpl.java

@@ -0,0 +1,104 @@
+package com.ruoyi.system.service.crm.impl;
+
+import java.util.List;
+
+import com.ruoyi.system.domain.crm.Contacts;
+import com.ruoyi.system.mapper.crm.ContactsMapper;
+import com.ruoyi.system.service.crm.IContactsService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 客户联系人信息Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2023-11-15
+ */
+@Service
+public class ContactsServiceImpl implements IContactsService
+{
+    @Autowired
+    private ContactsMapper contactsMapper;
+
+    /**
+     * 查询客户联系人信息
+     * 
+     * @param id 客户联系人信息主键
+     * @return 客户联系人信息
+     */
+    @Override
+    public Contacts selectContactsById(Long id)
+    {
+        return contactsMapper.selectContactsById(id);
+    }
+
+    /**
+     * 查询客户联系人信息列表
+     * 
+     * @param contacts 客户联系人信息
+     * @return 客户联系人信息
+     */
+    @Override
+    public List<Contacts> selectContactsList(Contacts contacts)
+    {
+        return contactsMapper.selectContactsList(contacts);
+    }
+
+    /**
+     * 新增客户联系人信息
+     * 
+     * @param contacts 客户联系人信息
+     * @return 结果
+     */
+    @Override
+    public int insertContacts(Contacts contacts)
+    {
+        return contactsMapper.insertContacts(contacts);
+    }
+
+    /**
+     * 修改客户联系人信息
+     * 
+     * @param contacts 客户联系人信息
+     * @return 结果
+     */
+    @Override
+    public int updateContacts(Contacts contacts)
+    {
+        return contactsMapper.updateContacts(contacts);
+    }
+
+    /**
+     * 批量删除客户联系人信息
+     * 
+     * @param ids 需要删除的客户联系人信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteContactsByIds(Long[] ids)
+    {
+        return contactsMapper.deleteContactsByIds(ids);
+    }
+
+    /**
+     * 删除客户联系人信息信息
+     * 
+     * @param id 客户联系人信息主键
+     * @return 结果
+     */
+    @Override
+    public int deleteContactsById(Long id)
+    {
+        return contactsMapper.deleteContactsById(id);
+    }
+
+    /**
+     * 批量新增客户联系人信息
+     * @param contactsList
+     * @return
+     */
+    @Override
+    public int batchInsertContacts(List<Contacts> contactsList) {
+        return contactsMapper.batchInsertContacts(contactsList);
+    }
+}

+ 94 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/crm/impl/CrmFileServiceImpl.java

@@ -0,0 +1,94 @@
+package com.ruoyi.system.service.crm.impl;
+
+import java.util.List;
+
+import com.ruoyi.system.domain.crm.CrmFile;
+import com.ruoyi.system.mapper.crm.CrmFileMapper;
+import com.ruoyi.system.service.crm.ICrmFileService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * crm附件Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2023-11-15
+ */
+@Service
+public class CrmFileServiceImpl implements ICrmFileService
+{
+    @Autowired
+    private CrmFileMapper crmFileMapper;
+
+    /**
+     * 查询crm附件
+     * 
+     * @param id crm附件主键
+     * @return crm附件
+     */
+    @Override
+    public CrmFile selectCrmFileById(Long id)
+    {
+        return crmFileMapper.selectCrmFileById(id);
+    }
+
+    /**
+     * 查询crm附件列表
+     * 
+     * @param crmFile crm附件
+     * @return crm附件
+     */
+    @Override
+    public List<CrmFile> selectCrmFileList(CrmFile crmFile)
+    {
+        return crmFileMapper.selectCrmFileList(crmFile);
+    }
+
+    /**
+     * 新增crm附件
+     * 
+     * @param crmFile crm附件
+     * @return 结果
+     */
+    @Override
+    public int insertCrmFile(CrmFile crmFile)
+    {
+        return crmFileMapper.insertCrmFile(crmFile);
+    }
+
+    /**
+     * 修改crm附件
+     * 
+     * @param crmFile crm附件
+     * @return 结果
+     */
+    @Override
+    public int updateCrmFile(CrmFile crmFile)
+    {
+        return crmFileMapper.updateCrmFile(crmFile);
+    }
+
+    /**
+     * 批量删除crm附件
+     * 
+     * @param ids 需要删除的crm附件主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCrmFileByIds(Long[] ids)
+    {
+        return crmFileMapper.deleteCrmFileByIds(ids);
+    }
+
+    /**
+     * 删除crm附件信息
+     * 
+     * @param id crm附件主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCrmFileById(Long id)
+    {
+        return crmFileMapper.deleteCrmFileById(id);
+    }
+}

+ 102 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/crm/impl/CustomerServiceImpl.java

@@ -0,0 +1,102 @@
+package com.ruoyi.system.service.crm.impl;
+
+import java.util.List;
+
+import com.ruoyi.common.annotation.DataScope;
+import com.ruoyi.system.domain.crm.Customer;
+import com.ruoyi.system.mapper.crm.CustomerMapper;
+import com.ruoyi.system.service.crm.ICustomerService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * CRM系统Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2023-11-15
+ */
+@Service
+public class CustomerServiceImpl implements ICustomerService
+{
+    @Autowired
+    private CustomerMapper customerMapper;
+
+    /**
+     * 查询CRM系统
+     * 
+     * @param id CRM系统主键
+     * @return CRM系统
+     */
+    @Override
+    public Customer selectCustomerById(Long id)
+    {
+        return customerMapper.selectCustomerById(id);
+    }
+
+    /**
+     * 查询CRM系统列表
+     * 
+     * @param customer CRM系统
+     * @return CRM系统
+     */
+    @Override
+    @DataScope(deptAlias = "d", userAlias = "u")
+    public List<Customer> selectCustomerList(Customer customer)
+    {
+        return customerMapper.selectCustomerList(customer);
+    }
+
+    /**
+     * 新增CRM系统
+     * 
+     * @param customer CRM系统
+     * @return 结果
+     */
+    @Override
+    public int insertCustomer(Customer customer)
+    {
+        return customerMapper.insertCustomer(customer);
+    }
+
+    /**
+     * 修改CRM系统
+     * 
+     * @param customer CRM系统
+     * @return 结果
+     */
+    @Override
+    public int updateCustomer(Customer customer)
+    {
+        return customerMapper.updateCustomer(customer);
+    }
+
+    /**
+     * 批量删除CRM系统
+     * 
+     * @param ids 需要删除的CRM系统主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCustomerByIds(Long[] ids)
+    {
+        return customerMapper.deleteCustomerByIds(ids);
+    }
+
+    /**
+     * 删除CRM系统信息
+     * 
+     * @param id CRM系统主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCustomerById(Long id)
+    {
+        return customerMapper.deleteCustomerById(id);
+    }
+
+    @Override
+    @DataScope(deptAlias = "d", userAlias = "u")
+    public List<Customer> myTaskList(Customer customer) {
+        return customerMapper.myTaskList(customer);
+    }
+}

+ 69 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/dhrm/IDhrmCompanyService.java

@@ -0,0 +1,69 @@
+package com.ruoyi.system.service.dhrm;
+
+import com.ruoyi.system.domain.dhrm.DhrmCompany;
+
+import java.util.List;
+
+/**
+ * 公司管理Service接口
+ * 
+ * @author ruoyi
+ * @date 2023-11-16
+ */
+public interface IDhrmCompanyService 
+{
+    /**
+     * 查询公司管理
+     * 
+     * @param dhrmId 公司管理主键
+     * @return 公司管理
+     */
+    public DhrmCompany selectDhrmCompanyByDhrmId(Long dhrmId);
+
+    /**
+     * 查询公司管理列表
+     * 
+     * @param dhrmCompany 公司管理
+     * @return 公司管理集合
+     */
+    public List<DhrmCompany> selectDhrmCompanyList(DhrmCompany dhrmCompany);
+
+    /**
+     * 新增公司管理
+     * 
+     * @param dhrmCompany 公司管理
+     * @return 结果
+     */
+    public int insertDhrmCompany(DhrmCompany dhrmCompany);
+
+    /**
+     * 修改公司管理
+     * 
+     * @param dhrmCompany 公司管理
+     * @return 结果
+     */
+    public int updateDhrmCompany(DhrmCompany dhrmCompany);
+
+    /**
+     * 批量删除公司管理
+     * 
+     * @param dhrmIds 需要删除的公司管理主键集合
+     * @return 结果
+     */
+    public int deleteDhrmCompanyByDhrmIds(Long[] dhrmIds);
+
+    /**
+     * 删除公司管理信息
+     * 
+     * @param dhrmId 公司管理主键
+     * @return 结果
+     */
+    public int deleteDhrmCompanyByDhrmId(Long dhrmId);
+
+    /**
+     * 根据员工编号查询公司数据
+     * @param employNo
+     * @return
+     */
+    public DhrmCompany selectDhrmCompanyByEmployNo(String employNo);
+}

+ 105 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/dhrm/impl/DhrmCompanyServiceImpl.java

@@ -0,0 +1,105 @@
+package com.ruoyi.system.service.dhrm.impl;
+
+import java.util.List;
+
+import com.ruoyi.system.domain.dhrm.DhrmCompany;
+import com.ruoyi.system.mapper.dhrm.DhrmCompanyMapper;
+import com.ruoyi.system.service.dhrm.IDhrmCompanyService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 公司管理Service业务层处理
+ * 
+ * @author ruoyi
+ * @date 2023-11-16
+ */
+@Service
+public class DhrmCompanyServiceImpl implements IDhrmCompanyService
+{
+    @Autowired
+    private DhrmCompanyMapper dhrmCompanyMapper;
+
+    /**
+     * 查询公司管理
+     * 
+     * @param dhrmId 公司管理主键
+     * @return 公司管理
+     */
+    @Override
+    public DhrmCompany selectDhrmCompanyByDhrmId(Long dhrmId)
+    {
+        return dhrmCompanyMapper.selectDhrmCompanyByDhrmId(dhrmId);
+    }
+
+    /**
+     * 查询公司管理列表
+     * 
+     * @param dhrmCompany 公司管理
+     * @return 公司管理
+     */
+    @Override
+    public List<DhrmCompany> selectDhrmCompanyList(DhrmCompany dhrmCompany)
+    {
+        return dhrmCompanyMapper.selectDhrmCompanyList(dhrmCompany);
+    }
+
+    /**
+     * 新增公司管理
+     * 
+     * @param dhrmCompany 公司管理
+     * @return 结果
+     */
+    @Override
+    public int insertDhrmCompany(DhrmCompany dhrmCompany)
+    {
+        return dhrmCompanyMapper.insertDhrmCompany(dhrmCompany);
+    }
+
+    /**
+     * 修改公司管理
+     * 
+     * @param dhrmCompany 公司管理
+     * @return 结果
+     */
+    @Override
+    public int updateDhrmCompany(DhrmCompany dhrmCompany)
+    {
+        return dhrmCompanyMapper.updateDhrmCompany(dhrmCompany);
+    }
+
+    /**
+     * 批量删除公司管理
+     * 
+     * @param dhrmIds 需要删除的公司管理主键
+     * @return 结果
+     */
+    @Override
+    public int deleteDhrmCompanyByDhrmIds(Long[] dhrmIds)
+    {
+        return dhrmCompanyMapper.deleteDhrmCompanyByDhrmIds(dhrmIds);
+    }
+
+    /**
+     * 删除公司管理信息
+     * 
+     * @param dhrmId 公司管理主键
+     * @return 结果
+     */
+    @Override
+    public int deleteDhrmCompanyByDhrmId(Long dhrmId)
+    {
+        return dhrmCompanyMapper.deleteDhrmCompanyByDhrmId(dhrmId);
+    }
+
+    /**
+     *
+     * 根据员工编号查询公司数据
+     * @param employNo
+     * @return
+     */
+    @Override
+    public DhrmCompany selectDhrmCompanyByEmployNo(String employNo) {
+        return dhrmCompanyMapper.selectDhrmCompanyByEmployNo(employNo);
+    }
+}

+ 171 - 0
ruoyi-system/src/main/resources/mapper/crm/AddressMapper.xml

@@ -0,0 +1,171 @@
+<?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.crm.AddressMapper">
+    
+    <resultMap type="Address" id="AddressResult">
+        <result property="id"    column="id"    />
+        <result property="addressId"    column="address_id"    />
+        <result property="customerId"    column="customer_id"    />
+        <result property="addressType"    column="address_type"    />
+        <result property="invoiceAddress"    column="invoice_address"    />
+        <result property="sendAddress"    column="send_address"    />
+        <result property="invoicePostbox"    column="invoice_postbox"    />
+        <result property="sendPostbox"    column="send_postbox"    />
+        <result property="invoiceCountry"    column="invoice_country"    />
+        <result property="sendCountry"    column="send_country"    />
+        <result property="invoiceProvince"    column="invoice_province"    />
+        <result property="sendProvince"    column="send_province"    />
+        <result property="invoiceCity"    column="invoice_city"    />
+        <result property="sendCity"    column="send_city"    />
+        <result property="invoicePostCode"    column="invoice_post_code"    />
+        <result property="sendPostCode"    column="send_post_code"    />
+        <result property="isActive"    column="is_Active"    />
+        <result property="accountName"    column="account_name"    />
+        <result property="companyTaxNum"    column="company_tax_num"    />
+        <result property="bankOfDeposit"    column="bank_of_deposit"    />
+        <result property="bankAccount"    column="bank_account"    />
+        <result property="companyAddress"    column="company_address"    />
+        <result property="companyPhone"    column="company_phone"    />
+        <result property="taxpayer"    column="taxpayer"    />
+        <result property="customerTaxrate"    column="customer_taxrate"    />
+    </resultMap>
+
+    <sql id="selectAddressVo">
+        select id, address_id, customer_id, address_type, invoice_address, send_address, invoice_postbox, send_postbox, invoice_country, send_country, invoice_province, send_province, invoice_city, send_city, invoice_post_code, send_post_code, is_Active, account_name, company_tax_num, bank_of_deposit, bank_account, company_address, company_phone, taxpayer, customer_taxrate from crm_address
+    </sql>
+
+    <select id="selectAddressList" parameterType="Address" resultMap="AddressResult">
+        <include refid="selectAddressVo"/>
+        <where>  
+            <if test="addressId != null  and addressId != ''"> and address_id = #{addressId}</if>
+            <if test="customerId != null  and customerId != ''"> and customer_id = #{customerId}</if>
+            <if test="addressType != null  and addressType != ''"> and address_type = #{addressType}</if>
+            <if test="invoiceAddress != null  and invoiceAddress != ''"> and invoice_address = #{invoiceAddress}</if>
+            <if test="sendAddress != null  and sendAddress != ''"> and send_address = #{sendAddress}</if>
+            <if test="invoicePostbox != null  and invoicePostbox != ''"> and invoice_postbox = #{invoicePostbox}</if>
+            <if test="sendPostbox != null  and sendPostbox != ''"> and send_postbox = #{sendPostbox}</if>
+            <if test="invoiceCountry != null  and invoiceCountry != ''"> and invoice_country = #{invoiceCountry}</if>
+            <if test="sendCountry != null  and sendCountry != ''"> and send_country = #{sendCountry}</if>
+            <if test="invoiceProvince != null  and invoiceProvince != ''"> and invoice_province = #{invoiceProvince}</if>
+            <if test="sendProvince != null  and sendProvince != ''"> and send_province = #{sendProvince}</if>
+            <if test="invoiceCity != null  and invoiceCity != ''"> and invoice_city = #{invoiceCity}</if>
+            <if test="sendCity != null  and sendCity != ''"> and send_city = #{sendCity}</if>
+            <if test="invoicePostCode != null  and invoicePostCode != ''"> and invoice_post_code = #{invoicePostCode}</if>
+            <if test="sendPostCode != null  and sendPostCode != ''"> and send_post_code = #{sendPostCode}</if>
+            <if test="isActive != null  and isActive != ''"> and is_Active = #{isActive}</if>
+            <if test="accountName != null  and accountName != ''"> and account_name like concat('%', #{accountName}, '%')</if>
+            <if test="companyTaxNum != null  and companyTaxNum != ''"> and company_tax_num = #{companyTaxNum}</if>
+            <if test="bankOfDeposit != null  and bankOfDeposit != ''"> and bank_of_deposit = #{bankOfDeposit}</if>
+            <if test="bankAccount != null  and bankAccount != ''"> and bank_account = #{bankAccount}</if>
+            <if test="companyAddress != null  and companyAddress != ''"> and company_address = #{companyAddress}</if>
+            <if test="companyPhone != null  and companyPhone != ''"> and company_phone = #{companyPhone}</if>
+            <if test="taxpayer != null "> and taxpayer = #{taxpayer}</if>
+            <if test="customerTaxrate != null  and customerTaxrate != ''"> and customer_taxrate = #{customerTaxrate}</if>
+        </where>
+    </select>
+    
+    <select id="selectAddressById" parameterType="Long" resultMap="AddressResult">
+        <include refid="selectAddressVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertAddress" parameterType="Address" useGeneratedKeys="true" keyProperty="id">
+        insert into crm_address
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="addressId != null">address_id,</if>
+            <if test="customerId != null and customerId != ''">customer_id,</if>
+            <if test="addressType != null">address_type,</if>
+            <if test="invoiceAddress != null">invoice_address,</if>
+            <if test="sendAddress != null">send_address,</if>
+            <if test="invoicePostbox != null">invoice_postbox,</if>
+            <if test="sendPostbox != null">send_postbox,</if>
+            <if test="invoiceCountry != null">invoice_country,</if>
+            <if test="sendCountry != null">send_country,</if>
+            <if test="invoiceProvince != null">invoice_province,</if>
+            <if test="sendProvince != null">send_province,</if>
+            <if test="invoiceCity != null">invoice_city,</if>
+            <if test="sendCity != null">send_city,</if>
+            <if test="invoicePostCode != null">invoice_post_code,</if>
+            <if test="sendPostCode != null">send_post_code,</if>
+            <if test="isActive != null">is_Active,</if>
+            <if test="accountName != null">account_name,</if>
+            <if test="companyTaxNum != null">company_tax_num,</if>
+            <if test="bankOfDeposit != null">bank_of_deposit,</if>
+            <if test="bankAccount != null">bank_account,</if>
+            <if test="companyAddress != null">company_address,</if>
+            <if test="companyPhone != null">company_phone,</if>
+            <if test="taxpayer != null">taxpayer,</if>
+            <if test="customerTaxrate != null">customer_taxrate,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="addressId != null">#{addressId},</if>
+            <if test="customerId != null and customerId != ''">#{customerId},</if>
+            <if test="addressType != null">#{addressType},</if>
+            <if test="invoiceAddress != null">#{invoiceAddress},</if>
+            <if test="sendAddress != null">#{sendAddress},</if>
+            <if test="invoicePostbox != null">#{invoicePostbox},</if>
+            <if test="sendPostbox != null">#{sendPostbox},</if>
+            <if test="invoiceCountry != null">#{invoiceCountry},</if>
+            <if test="sendCountry != null">#{sendCountry},</if>
+            <if test="invoiceProvince != null">#{invoiceProvince},</if>
+            <if test="sendProvince != null">#{sendProvince},</if>
+            <if test="invoiceCity != null">#{invoiceCity},</if>
+            <if test="sendCity != null">#{sendCity},</if>
+            <if test="invoicePostCode != null">#{invoicePostCode},</if>
+            <if test="sendPostCode != null">#{sendPostCode},</if>
+            <if test="isActive != null">#{isActive},</if>
+            <if test="accountName != null">#{accountName},</if>
+            <if test="companyTaxNum != null">#{companyTaxNum},</if>
+            <if test="bankOfDeposit != null">#{bankOfDeposit},</if>
+            <if test="bankAccount != null">#{bankAccount},</if>
+            <if test="companyAddress != null">#{companyAddress},</if>
+            <if test="companyPhone != null">#{companyPhone},</if>
+            <if test="taxpayer != null">#{taxpayer},</if>
+            <if test="customerTaxrate != null">#{customerTaxrate},</if>
+         </trim>
+    </insert>
+
+    <update id="updateAddress" parameterType="Address">
+        update crm_address
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="addressId != null">address_id = #{addressId},</if>
+            <if test="customerId != null and customerId != ''">customer_id = #{customerId},</if>
+            <if test="addressType != null">address_type = #{addressType},</if>
+            <if test="invoiceAddress != null">invoice_address = #{invoiceAddress},</if>
+            <if test="sendAddress != null">send_address = #{sendAddress},</if>
+            <if test="invoicePostbox != null">invoice_postbox = #{invoicePostbox},</if>
+            <if test="sendPostbox != null">send_postbox = #{sendPostbox},</if>
+            <if test="invoiceCountry != null">invoice_country = #{invoiceCountry},</if>
+            <if test="sendCountry != null">send_country = #{sendCountry},</if>
+            <if test="invoiceProvince != null">invoice_province = #{invoiceProvince},</if>
+            <if test="sendProvince != null">send_province = #{sendProvince},</if>
+            <if test="invoiceCity != null">invoice_city = #{invoiceCity},</if>
+            <if test="sendCity != null">send_city = #{sendCity},</if>
+            <if test="invoicePostCode != null">invoice_post_code = #{invoicePostCode},</if>
+            <if test="sendPostCode != null">send_post_code = #{sendPostCode},</if>
+            <if test="isActive != null">is_Active = #{isActive},</if>
+            <if test="accountName != null">account_name = #{accountName},</if>
+            <if test="companyTaxNum != null">company_tax_num = #{companyTaxNum},</if>
+            <if test="bankOfDeposit != null">bank_of_deposit = #{bankOfDeposit},</if>
+            <if test="bankAccount != null">bank_account = #{bankAccount},</if>
+            <if test="companyAddress != null">company_address = #{companyAddress},</if>
+            <if test="companyPhone != null">company_phone = #{companyPhone},</if>
+            <if test="taxpayer != null">taxpayer = #{taxpayer},</if>
+            <if test="customerTaxrate != null">customer_taxrate = #{customerTaxrate},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteAddressById" parameterType="Long">
+        delete from crm_address where id = #{id}
+    </delete>
+
+    <delete id="deleteAddressByIds" parameterType="String">
+        delete from crm_address where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 228 - 0
ruoyi-system/src/main/resources/mapper/crm/ContactsMapper.xml

@@ -0,0 +1,228 @@
+<?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.crm.ContactsMapper">
+    
+    <resultMap type="Contacts" id="ContactsResult">
+        <result property="id"    column="id"    />
+        <result property="contactsId"    column="contacts_id"    />
+        <result property="customerId"    column="customer_id"    />
+        <result property="name"    column="name"    />
+        <result property="contactCode"    column="contact_code"    />
+        <result property="phone"    column="phone"    />
+        <result property="tel"    column="tel"    />
+        <result property="tel2"    column="tel2"    />
+        <result property="fax"    column="fax"    />
+        <result property="email"    column="email"    />
+        <result property="qq"    column="qq"    />
+        <result property="department"    column="department"    />
+        <result property="position"    column="position"    />
+        <result property="officeAddress"    column="office_address"    />
+        <result property="source"    column="source"    />
+        <result property="postcode"    column="postcode"    />
+        <result property="photo"    column="photo"    />
+        <result property="createdBy"    column="createdBy"    />
+        <result property="createdDate"    column="createdDate"    />
+        <result property="updatedBy"    column="updatedBy"    />
+        <result property="updatedDate"    column="updatedDate"    />
+        <result property="isActive"    column="is_Active"    />
+        <result property="deleteDate"    column="deleteDate"    />
+        <result property="deleteBy"    column="deleteBy"    />
+        <result property="companyId"    column="company_id"    />
+        <result property="isDelete"    column="is_delete"    />
+    </resultMap>
+
+    <sql id="selectContactsVo">
+        select id, contacts_id, customer_id, name, contact_code, phone, tel, tel2, fax, email, qq, department, position, office_address, source, postcode, photo, createdBy, createdDate, updatedBy, updatedDate, is_Active, deleteDate, deleteBy, company_id, is_delete from crm_contacts_info
+    </sql>
+
+    <select id="selectContactsList" parameterType="Contacts" resultMap="ContactsResult">
+        <include refid="selectContactsVo"/>
+        <where>  
+            <if test="contactsId != null  and contactsId != ''"> and contacts_id = #{contactsId}</if>
+            <if test="customerId != null  and customerId != ''"> and customer_id = #{customerId}</if>
+            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+            <if test="contactCode != null  and contactCode != ''"> and contact_code = #{contactCode}</if>
+            <if test="phone != null  and phone != ''"> and phone = #{phone}</if>
+            <if test="tel != null  and tel != ''"> and tel = #{tel}</if>
+            <if test="tel2 != null  and tel2 != ''"> and tel2 = #{tel2}</if>
+            <if test="fax != null  and fax != ''"> and fax = #{fax}</if>
+            <if test="email != null  and email != ''"> and email = #{email}</if>
+            <if test="qq != null  and qq != ''"> and qq = #{qq}</if>
+            <if test="department != null  and department != ''"> and department = #{department}</if>
+            <if test="position != null  and position != ''"> and position = #{position}</if>
+            <if test="officeAddress != null  and officeAddress != ''"> and office_address = #{officeAddress}</if>
+            <if test="source != null  and source != ''"> and source = #{source}</if>
+            <if test="postcode != null  and postcode != ''"> and postcode = #{postcode}</if>
+            <if test="photo != null  and photo != ''"> and photo = #{photo}</if>
+            <if test="createdBy != null  and createdBy != ''"> and createdBy = #{createdBy}</if>
+            <if test="createdDate != null "> and createdDate = #{createdDate}</if>
+            <if test="updatedBy != null  and updatedBy != ''"> and updatedBy = #{updatedBy}</if>
+            <if test="updatedDate != null "> and updatedDate = #{updatedDate}</if>
+            <if test="isActive != null  and isActive != ''"> and is_Active = #{isActive}</if>
+            <if test="deleteDate != null "> and deleteDate = #{deleteDate}</if>
+            <if test="deleteBy != null  and deleteBy != ''"> and deleteBy = #{deleteBy}</if>
+            <if test="companyId != null  and companyId != ''"> and company_id = #{companyId}</if>
+            <if test="isDelete != null "> and is_delete = #{isDelete}</if>
+        </where>
+    </select>
+    
+    <select id="selectContactsById" parameterType="Long" resultMap="ContactsResult">
+        <include refid="selectContactsVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertContacts" parameterType="Contacts" useGeneratedKeys="true" keyProperty="id">
+        insert into crm_contacts_info
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="contactsId != null">contacts_id,</if>
+            <if test="customerId != null">customer_id,</if>
+            <if test="name != null">name,</if>
+            <if test="contactCode != null">contact_code,</if>
+            <if test="phone != null">phone,</if>
+            <if test="tel != null">tel,</if>
+            <if test="tel2 != null">tel2,</if>
+            <if test="fax != null">fax,</if>
+            <if test="email != null">email,</if>
+            <if test="qq != null">qq,</if>
+            <if test="department != null">department,</if>
+            <if test="position != null">position,</if>
+            <if test="officeAddress != null">office_address,</if>
+            <if test="source != null">source,</if>
+            <if test="postcode != null">postcode,</if>
+            <if test="photo != null">photo,</if>
+            <if test="createdBy != null">createdBy,</if>
+            <if test="createdDate != null">createdDate,</if>
+            <if test="updatedBy != null">updatedBy,</if>
+            <if test="updatedDate != null">updatedDate,</if>
+            <if test="isActive != null">is_Active,</if>
+            <if test="deleteDate != null">deleteDate,</if>
+            <if test="deleteBy != null">deleteBy,</if>
+            <if test="companyId != null">company_id,</if>
+            <if test="isDelete != null">is_delete,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="contactsId != null">#{contactsId},</if>
+            <if test="customerId != null">#{customerId},</if>
+            <if test="name != null">#{name},</if>
+            <if test="contactCode != null">#{contactCode},</if>
+            <if test="phone != null">#{phone},</if>
+            <if test="tel != null">#{tel},</if>
+            <if test="tel2 != null">#{tel2},</if>
+            <if test="fax != null">#{fax},</if>
+            <if test="email != null">#{email},</if>
+            <if test="qq != null">#{qq},</if>
+            <if test="department != null">#{department},</if>
+            <if test="position != null">#{position},</if>
+            <if test="officeAddress != null">#{officeAddress},</if>
+            <if test="source != null">#{source},</if>
+            <if test="postcode != null">#{postcode},</if>
+            <if test="photo != null">#{photo},</if>
+            <if test="createdBy != null">#{createdBy},</if>
+            <if test="createdDate != null">#{createdDate},</if>
+            <if test="updatedBy != null">#{updatedBy},</if>
+            <if test="updatedDate != null">#{updatedDate},</if>
+            <if test="isActive != null">#{isActive},</if>
+            <if test="deleteDate != null">#{deleteDate},</if>
+            <if test="deleteBy != null">#{deleteBy},</if>
+            <if test="companyId != null">#{companyId},</if>
+            <if test="isDelete != null">#{isDelete},</if>
+         </trim>
+    </insert>
+
+    <update id="updateContacts" parameterType="Contacts">
+        update crm_contacts_info
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="contactsId != null">contacts_id = #{contactsId},</if>
+            <if test="customerId != null">customer_id = #{customerId},</if>
+            <if test="name != null">name = #{name},</if>
+            <if test="contactCode != null">contact_code = #{contactCode},</if>
+            <if test="phone != null">phone = #{phone},</if>
+            <if test="tel != null">tel = #{tel},</if>
+            <if test="tel2 != null">tel2 = #{tel2},</if>
+            <if test="fax != null">fax = #{fax},</if>
+            <if test="email != null">email = #{email},</if>
+            <if test="qq != null">qq = #{qq},</if>
+            <if test="department != null">department = #{department},</if>
+            <if test="position != null">position = #{position},</if>
+            <if test="officeAddress != null">office_address = #{officeAddress},</if>
+            <if test="source != null">source = #{source},</if>
+            <if test="postcode != null">postcode = #{postcode},</if>
+            <if test="photo != null">photo = #{photo},</if>
+            <if test="createdBy != null">createdBy = #{createdBy},</if>
+            <if test="createdDate != null">createdDate = #{createdDate},</if>
+            <if test="updatedBy != null">updatedBy = #{updatedBy},</if>
+            <if test="updatedDate != null">updatedDate = #{updatedDate},</if>
+            <if test="isActive != null">is_Active = #{isActive},</if>
+            <if test="deleteDate != null">deleteDate = #{deleteDate},</if>
+            <if test="deleteBy != null">deleteBy = #{deleteBy},</if>
+            <if test="companyId != null">company_id = #{companyId},</if>
+            <if test="isDelete != null">is_delete = #{isDelete},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteContactsById" parameterType="Long">
+        delete from crm_contacts_info where id = #{id}
+    </delete>
+
+    <delete id="deleteContactsByIds" parameterType="String">
+        delete from crm_contacts_info where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+    <insert id="batchInsertContacts" parameterType="java.util.List">
+        insert into crm_contacts_info(
+            contacts_id,
+            customer_id,
+            name,
+            contact_code,
+            phone,
+            tel,
+            tel2,
+            fax,
+            email,
+            qq,
+            department,
+            position,
+            office_address,
+            source,
+            postcode,
+            photo,
+            company_id,
+            createdBy,
+            createdDate,
+            is_Active
+        )
+        values
+        <foreach collection="contactsList" item="contacts" index="index" separator="," >
+            (
+            #{contacts.contactsId},
+            #{contacts.customerId},
+            #{contacts.name},
+            #{contacts.contactCode},
+            #{contacts.phone},
+            #{contacts.tel},
+            #{contacts.tel2},
+            #{contacts.fax},
+            #{contacts.email},
+            #{contacts.qq},
+            #{contacts.department},
+            #{contacts.position},
+            #{contacts.officeAddress},
+            #{contacts.source},
+            #{contacts.postcode},
+            #{contacts.photo},
+            #{contacts.companyId},
+            #{contacts.createdBy},
+            NOW(),
+            'Y'
+            )
+        </foreach>
+    </insert>
+
+
+</mapper>

+ 86 - 0
ruoyi-system/src/main/resources/mapper/crm/CrmFileMapper.xml

@@ -0,0 +1,86 @@
+<?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.crm.CrmFileMapper">
+    
+    <resultMap type="CrmFile" id="CrmFileResult">
+        <result property="id"    column="id"    />
+        <result property="fileId"    column="file_id"    />
+        <result property="objectId"    column="object_id"    />
+        <result property="type"    column="type"    />
+        <result property="uploadName"    column="upload_name"    />
+        <result property="uploadType"    column="upload_type"    />
+        <result property="uploadPath"    column="upload_path"    />
+        <result property="companyId"    column="company_id"    />
+    </resultMap>
+
+    <sql id="selectCrmFileVo">
+        select id, file_id, object_id, type, upload_name, upload_type, upload_path, company_id from crm_file
+    </sql>
+
+    <select id="selectCrmFileList" parameterType="CrmFile" resultMap="CrmFileResult">
+        <include refid="selectCrmFileVo"/>
+        <where>  
+            <if test="fileId != null  and fileId != ''"> and file_id = #{fileId}</if>
+            <if test="objectId != null  and objectId != ''"> and object_id = #{objectId}</if>
+            <if test="type != null  and type != ''"> and type = #{type}</if>
+            <if test="uploadName != null  and uploadName != ''"> and upload_name like concat('%', #{uploadName}, '%')</if>
+            <if test="uploadType != null  and uploadType != ''"> and upload_type = #{uploadType}</if>
+            <if test="uploadPath != null  and uploadPath != ''"> and upload_path = #{uploadPath}</if>
+            <if test="companyId != null  and companyId != ''"> and company_id = #{companyId}</if>
+        </where>
+    </select>
+    
+    <select id="selectCrmFileById" parameterType="Long" resultMap="CrmFileResult">
+        <include refid="selectCrmFileVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertCrmFile" parameterType="CrmFile" useGeneratedKeys="true" keyProperty="id">
+        insert into crm_file
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="fileId != null and fileId != ''">file_id,</if>
+            <if test="objectId != null and objectId != ''">object_id,</if>
+            <if test="type != null and type != ''">type,</if>
+            <if test="uploadName != null and uploadName != ''">upload_name,</if>
+            <if test="uploadType != null and uploadType != ''">upload_type,</if>
+            <if test="uploadPath != null and uploadPath != ''">upload_path,</if>
+            <if test="companyId != null">company_id,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="fileId != null and fileId != ''">#{fileId},</if>
+            <if test="objectId != null and objectId != ''">#{objectId},</if>
+            <if test="type != null and type != ''">#{type},</if>
+            <if test="uploadName != null and uploadName != ''">#{uploadName},</if>
+            <if test="uploadType != null and uploadType != ''">#{uploadType},</if>
+            <if test="uploadPath != null and uploadPath != ''">#{uploadPath},</if>
+            <if test="companyId != null">#{companyId},</if>
+         </trim>
+    </insert>
+
+    <update id="updateCrmFile" parameterType="CrmFile">
+        update crm_file
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="fileId != null and fileId != ''">file_id = #{fileId},</if>
+            <if test="objectId != null and objectId != ''">object_id = #{objectId},</if>
+            <if test="type != null and type != ''">type = #{type},</if>
+            <if test="uploadName != null and uploadName != ''">upload_name = #{uploadName},</if>
+            <if test="uploadType != null and uploadType != ''">upload_type = #{uploadType},</if>
+            <if test="uploadPath != null and uploadPath != ''">upload_path = #{uploadPath},</if>
+            <if test="companyId != null">company_id = #{companyId},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteCrmFileById" parameterType="Long">
+        delete from crm_file where id = #{id}
+    </delete>
+
+    <delete id="deleteCrmFileByIds" parameterType="String">
+        delete from crm_file where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 257 - 0
ruoyi-system/src/main/resources/mapper/crm/CustomerMapper.xml

@@ -0,0 +1,257 @@
+<?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.crm.CustomerMapper">
+    
+    <resultMap type="Customer" id="CustomerResult">
+        <result property="id"    column="id"    />
+        <result property="customerId"    column="customer_id"    />
+        <result property="customerCode"    column="customer_code"    />
+        <result property="customerName"    column="customer_name"    />
+        <result property="status"    column="status"    />
+        <result property="website"    column="website"    />
+        <result property="yearBusiness"    column="year_business"    />
+        <result property="stockCode"    column="stock_code"    />
+        <result property="legalPerson"    column="legalPerson"    />
+        <result property="connectedEntities"    column="connected_entities"    />
+        <result property="trade"    column="trade"    />
+        <result property="workforce"    column="workforce"    />
+        <result property="customerType"    column="customer_type"    />
+        <result property="responsibleDept"    column="responsible_dept"    />
+        <result property="salesManager"    column="sales_manager"    />
+        <result property="mark"    column="mark"    />
+        <result property="createBy"    column="createBy"    />
+        <result property="createDate"    column="createDate"    />
+        <result property="updateBy"    column="updateBy"    />
+        <result property="updateDate"    column="updateDate"    />
+        <result property="isActive"    column="is_Active"    />
+        <result property="deleteDate"    column="deleteDate"    />
+        <result property="deleteBy"    column="deleteBy"    />
+        <result property="companyId"    column="company_id"    />
+        <result property="procInsId"    column="proc_ins_id"    />
+        <result property="deptId"    column="deptId"    />
+        <result property="dhrmCompanyId"    column="dhrmCompanyId"    />
+        <result property="customerNature"    column="customer_nature"    />
+        <result property="datefrom"    column="datefrom"    />
+        <result property="state"    column="state"    />
+        <result property="isDelete"    column="is_delete"    />
+        <result property="companyAddress"    column="company_address"    />
+        <result property="isOpen"    column="is_open"    />
+        <result property="otherNature"    column="other_nature"    />
+        <result property="otherCategory"    column="other_category"    />
+        <result property="capital"    column="capital"    />
+        <result property="currency"    column="currency"    />
+        <result property="registDate"    column="registDate"    />
+    </resultMap>
+
+    <sql id="selectCustomerVo">
+        select id, customer_id, customer_code, customer_name, status, website, year_business, stock_code, legalPerson, connected_entities, trade, workforce, customer_type, responsible_dept, sales_manager, mark, createBy, createDate, updateBy, updateDate, is_Active, deleteDate, deleteBy, company_id, proc_ins_id, deptId, dhrmCompanyId, customer_nature, datefrom, state, is_delete, company_address, is_open, other_nature, other_category, capital, currency, registDate from crm_customer_info
+    </sql>
+
+    <select id="selectCustomerList" parameterType="Customer" resultMap="CustomerResult">
+        <include refid="selectCustomerVo"/>
+        <where>
+            is_Active = 'Y' and state != 4 and (datefrom = '0'or datefrom='2') and is_delete=0
+            <if test="customerId != null  and customerId != ''"> and customer_id = #{customerId}</if>
+            <if test="customerCode != null  and customerCode != ''"> and customer_code = #{customerCode}</if>
+            <if test="customerName != null  and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
+            <if test="status != null  and status != ''"> and status = #{status}</if>
+            <if test="website != null  and website != ''"> and website = #{website}</if>
+            <if test="yearBusiness != null "> and year_business = #{yearBusiness}</if>
+            <if test="stockCode != null  and stockCode != ''"> and stock_code = #{stockCode}</if>
+            <if test="legalPerson != null  and legalPerson != ''"> and legalPerson = #{legalPerson}</if>
+            <if test="connectedEntities != null  and connectedEntities != ''"> and connected_entities = #{connectedEntities}</if>
+            <if test="trade != null  and trade != ''"> and trade = #{trade}</if>
+            <if test="workforce != null "> and workforce = #{workforce}</if>
+            <if test="customerType != null  and customerType != ''"> and customer_type = #{customerType}</if>
+            <if test="responsibleDept != null  and responsibleDept != ''"> and responsible_dept = #{responsibleDept}</if>
+            <if test="salesManager != null  and salesManager != ''"> and sales_manager = #{salesManager}</if>
+            <if test="mark != null  and mark != ''"> and mark = #{mark}</if>
+            <if test="createBy != null  and createBy != ''"> and createBy = #{createBy}</if>
+            <if test="createDate != null  and createDate != ''"> and createDate = #{createDate}</if>
+            <if test="updateBy != null  and updateBy != ''"> and updateBy = #{updateBy}</if>
+            <if test="updateDate != null "> and updatedDate = #{updateDate}</if>
+            <if test="isActive != null  and isActive != ''"> and is_Active = #{isActive}</if>
+            <if test="deleteDate != null  and deleteDate != ''"> and deleteDate = #{deleteDate}</if>
+            <if test="deleteBy != null  and deleteBy != ''"> and deleteBy = #{deleteBy}</if>
+            <if test="companyId != null  and companyId != ''"> and company_id = #{companyId}</if>
+            <if test="procInsId != null  and procInsId != ''"> and proc_ins_id = #{procInsId}</if>
+            <if test="deptId != null  and deptId != ''"> and deptId = #{deptId}</if>
+            <if test="dhrmCompanyId != null  and dhrmCompanyId != ''"> and dhrmCompanyId = #{dhrmCompanyId}</if>
+            <if test="customerNature != null  and customerNature != ''"> and customer_nature = #{customerNature}</if>
+            <if test="datefrom != null  and datefrom != ''"> and datefrom = #{datefrom}</if>
+            <if test="state != null  and state != ''"> and state = #{state}</if>
+            <if test="isDelete != null "> and is_delete = #{isDelete}</if>
+            <if test="companyAddress != null  and companyAddress != ''"> and company_address = #{companyAddress}</if>
+            <if test="isOpen != null  and isOpen != ''"> and is_open = #{isOpen}</if>
+            <if test="otherNature != null  and otherNature != ''"> and other_nature = #{otherNature}</if>
+            <if test="otherCategory != null  and otherCategory != ''"> and other_category = #{otherCategory}</if>
+            <if test="capital != null "> and capital = #{capital}</if>
+            <if test="currency != null  and currency != ''"> and currency = #{currency}</if>
+            <if test="registDate != null  and registDate != ''"> and registDate = #{registDate}</if>
+        </where>
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+    </select>
+    
+    <select id="selectCustomerById" parameterType="Long" resultMap="CustomerResult">
+        <include refid="selectCustomerVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertCustomer" parameterType="Customer" useGeneratedKeys="true" keyProperty="id">
+        insert into crm_customer_info
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="customerId != null">customer_id,</if>
+            <if test="customerCode != null">customer_code,</if>
+            <if test="customerName != null">customer_name,</if>
+            <if test="status != null">status,</if>
+            <if test="website != null">website,</if>
+            <if test="yearBusiness != null">year_business,</if>
+            <if test="stockCode != null">stock_code,</if>
+            <if test="legalPerson != null">legalPerson,</if>
+            <if test="connectedEntities != null">connected_entities,</if>
+            <if test="trade != null">trade,</if>
+            <if test="workforce != null">workforce,</if>
+            <if test="customerType != null">customer_type,</if>
+            <if test="responsibleDept != null">responsible_dept,</if>
+            <if test="salesManager != null">sales_manager,</if>
+            <if test="mark != null">mark,</if>
+            <if test="createBy != null">createBy,</if>
+            <if test="createDate != null">createDate,</if>
+            <if test="updateBy != null">updateBy,</if>
+            <if test="updateDate != null">updateDate,</if>
+            <if test="isActive != null">is_Active,</if>
+            <if test="deleteDate != null">deleteDate,</if>
+            <if test="deleteBy != null">deleteBy,</if>
+            <if test="companyId != null">company_id,</if>
+            <if test="procInsId != null">proc_ins_id,</if>
+            <if test="deptId != null">deptId,</if>
+            <if test="dhrmCompanyId != null">dhrmCompanyId,</if>
+            <if test="customerNature != null">customer_nature,</if>
+            <if test="datefrom != null">datefrom,</if>
+            <if test="state != null">state,</if>
+            <if test="isDelete != null">is_delete,</if>
+            <if test="companyAddress != null">company_address,</if>
+            <if test="isOpen != null">is_open,</if>
+            <if test="otherNature != null">other_nature,</if>
+            <if test="otherCategory != null">other_category,</if>
+            <if test="capital != null">capital,</if>
+            <if test="currency != null">currency,</if>
+            <if test="registDate != null">registDate,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="customerId != null">#{customerId},</if>
+            <if test="customerCode != null">#{customerCode},</if>
+            <if test="customerName != null">#{customerName},</if>
+            <if test="status != null">#{status},</if>
+            <if test="website != null">#{website},</if>
+            <if test="yearBusiness != null">#{yearBusiness},</if>
+            <if test="stockCode != null">#{stockCode},</if>
+            <if test="legalPerson != null">#{legalPerson},</if>
+            <if test="connectedEntities != null">#{connectedEntities},</if>
+            <if test="trade != null">#{trade},</if>
+            <if test="workforce != null">#{workforce},</if>
+            <if test="customerType != null">#{customerType},</if>
+            <if test="responsibleDept != null">#{responsibleDept},</if>
+            <if test="salesManager != null">#{salesManager},</if>
+            <if test="mark != null">#{mark},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="createDate != null">#{createDate},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+            <if test="updateDate != null">#{updateDate},</if>
+            <if test="isActive != null">#{isActive},</if>
+            <if test="deleteDate != null">#{deleteDate},</if>
+            <if test="deleteBy != null">#{deleteBy},</if>
+            <if test="companyId != null">#{companyId},</if>
+            <if test="procInsId != null">#{procInsId},</if>
+            <if test="deptId != null">#{deptId},</if>
+            <if test="dhrmCompanyId != null">#{dhrmCompanyId},</if>
+            <if test="customerNature != null">#{customerNature},</if>
+            <if test="datefrom != null">#{datefrom},</if>
+            <if test="state != null">#{state},</if>
+            <if test="isDelete != null">#{isDelete},</if>
+            <if test="companyAddress != null">#{companyAddress},</if>
+            <if test="isOpen != null">#{isOpen},</if>
+            <if test="otherNature != null">#{otherNature},</if>
+            <if test="otherCategory != null">#{otherCategory},</if>
+            <if test="capital != null">#{capital},</if>
+            <if test="currency != null">#{currency},</if>
+            <if test="registDate != null">#{registDate},</if>
+         </trim>
+    </insert>
+
+    <update id="updateCustomer" parameterType="Customer">
+        update crm_customer_info
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="customerId != null">customer_id = #{customerId},</if>
+            <if test="customerCode != null">customer_code = #{customerCode},</if>
+            <if test="customerName != null">customer_name = #{customerName},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="website != null">website = #{website},</if>
+            <if test="yearBusiness != null">year_business = #{yearBusiness},</if>
+            <if test="stockCode != null">stock_code = #{stockCode},</if>
+            <if test="legalPerson != null">legalPerson = #{legalPerson},</if>
+            <if test="connectedEntities != null">connected_entities = #{connectedEntities},</if>
+            <if test="trade != null">trade = #{trade},</if>
+            <if test="workforce != null">workforce = #{workforce},</if>
+            <if test="customerType != null">customer_type = #{customerType},</if>
+            <if test="responsibleDept != null">responsible_dept = #{responsibleDept},</if>
+            <if test="salesManager != null">sales_manager = #{salesManager},</if>
+            <if test="mark != null">mark = #{mark},</if>
+            <if test="createBy != null">createBy = #{createBy},</if>
+            <if test="createDate != null">createDate = #{createDate},</if>
+            <if test="updateBy != null">updateBy = #{updateBy},</if>
+            <if test="updateDate != null">updateDate = #{updateDate},</if>
+            <if test="isActive != null">is_Active = #{isActive},</if>
+            <if test="deleteDate != null">deleteDate = #{deleteDate},</if>
+            <if test="deleteBy != null">deleteBy = #{deleteBy},</if>
+            <if test="companyId != null">company_id = #{companyId},</if>
+            <if test="procInsId != null">proc_ins_id = #{procInsId},</if>
+            <if test="deptId != null">deptId = #{deptId},</if>
+            <if test="dhrmCompanyId != null">dhrmCompanyId = #{dhrmCompanyId},</if>
+            <if test="customerNature != null">customer_nature = #{customerNature},</if>
+            <if test="datefrom != null">datefrom = #{datefrom},</if>
+            <if test="state != null">state = #{state},</if>
+            <if test="isDelete != null">is_delete = #{isDelete},</if>
+            <if test="companyAddress != null">company_address = #{companyAddress},</if>
+            <if test="isOpen != null">is_open = #{isOpen},</if>
+            <if test="otherNature != null">other_nature = #{otherNature},</if>
+            <if test="otherCategory != null">other_category = #{otherCategory},</if>
+            <if test="capital != null">capital = #{capital},</if>
+            <if test="currency != null">currency = #{currency},</if>
+            <if test="registDate != null">registDate = #{registDate},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteCustomerById" parameterType="Long">
+        delete from crm_customer_info where id = #{id}
+    </delete>
+
+    <delete id="deleteCustomerByIds" parameterType="String">
+        delete from crm_customer_info where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+    <select id="myTaskList" resultMap="CustomerResult">
+        select
+            distinct
+            m.*
+        from crm_customer_info m
+        where m.is_delete ='0'
+        <if test="customer.customerCode!=null and customer.customerCode!=''">
+            and m.customer_code like concat('%',#{customer.customerCode},'%')
+        </if>
+        <if test="customer.customerName!=null and customer.customerName!=''">
+            and m.customer_name like concat('%',#{customer.customerName},'%')
+        </if>
+        ORDER BY applyTime DESC
+        <!-- 数据范围过滤 -->
+        ${params.dataScope}
+    </select>
+
+</mapper>

+ 96 - 0
ruoyi-system/src/main/resources/mapper/dhrm/DhrmCompanyMapper.xml

@@ -0,0 +1,96 @@
+<?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.dhrm.DhrmCompanyMapper">
+    
+    <resultMap type="DhrmCompany" id="DhrmCompanyResult">
+        <result property="dhrmId"    column="dhrm_id"    />
+        <result property="dhrmCompanyId"    column="dhrm_company_id"    />
+        <result property="dhrmCompanyName"    column="dhrm_company_name"    />
+        <result property="dhrmCompanyDsk"    column="dhrm_company_DSK"    />
+        <result property="isClose"    column="is_close"    />
+        <result property="bankName"    column="bank_name"    />
+        <result property="bankNum"    column="bank_num"    />
+        <result property="companyId"    column="companyId"    />
+    </resultMap>
+
+    <sql id="selectDhrmCompanyVo">
+        select dhrm_id, dhrm_company_id, dhrm_company_name, dhrm_company_DSK, is_close, bank_name, bank_num, companyId from dhrm_company
+    </sql>
+
+    <select id="selectDhrmCompanyList" parameterType="DhrmCompany" resultMap="DhrmCompanyResult">
+        <include refid="selectDhrmCompanyVo"/>
+        <where>  
+            <if test="dhrmCompanyId != null  and dhrmCompanyId != ''"> and dhrm_company_id = #{dhrmCompanyId}</if>
+            <if test="dhrmCompanyName != null  and dhrmCompanyName != ''"> and dhrm_company_name like concat('%', #{dhrmCompanyName}, '%')</if>
+            <if test="dhrmCompanyDsk != null  and dhrmCompanyDsk != ''"> and dhrm_company_DSK = #{dhrmCompanyDsk}</if>
+            <if test="isClose != null  and isClose != ''"> and is_close = #{isClose}</if>
+            <if test="bankName != null  and bankName != ''"> and bank_name like concat('%', #{bankName}, '%')</if>
+            <if test="bankNum != null  and bankNum != ''"> and bank_num = #{bankNum}</if>
+            <if test="companyId != null  and companyId != ''"> and companyId = #{companyId}</if>
+        </where>
+    </select>
+    
+    <select id="selectDhrmCompanyByDhrmId" parameterType="Long" resultMap="DhrmCompanyResult">
+        <include refid="selectDhrmCompanyVo"/>
+        where dhrm_id = #{dhrmId}
+    </select>
+        
+    <insert id="insertDhrmCompany" parameterType="DhrmCompany" useGeneratedKeys="true" keyProperty="dhrmId">
+        insert into dhrm_company
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="dhrmCompanyId != null and dhrmCompanyId != ''">dhrm_company_id,</if>
+            <if test="dhrmCompanyName != null">dhrm_company_name,</if>
+            <if test="dhrmCompanyDsk != null">dhrm_company_DSK,</if>
+            <if test="isClose != null">is_close,</if>
+            <if test="bankName != null">bank_name,</if>
+            <if test="bankNum != null">bank_num,</if>
+            <if test="companyId != null">companyId,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="dhrmCompanyId != null and dhrmCompanyId != ''">#{dhrmCompanyId},</if>
+            <if test="dhrmCompanyName != null">#{dhrmCompanyName},</if>
+            <if test="dhrmCompanyDsk != null">#{dhrmCompanyDsk},</if>
+            <if test="isClose != null">#{isClose},</if>
+            <if test="bankName != null">#{bankName},</if>
+            <if test="bankNum != null">#{bankNum},</if>
+            <if test="companyId != null">#{companyId},</if>
+         </trim>
+    </insert>
+
+    <update id="updateDhrmCompany" parameterType="DhrmCompany">
+        update dhrm_company
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="dhrmCompanyId != null and dhrmCompanyId != ''">dhrm_company_id = #{dhrmCompanyId},</if>
+            <if test="dhrmCompanyName != null">dhrm_company_name = #{dhrmCompanyName},</if>
+            <if test="dhrmCompanyDsk != null">dhrm_company_DSK = #{dhrmCompanyDsk},</if>
+            <if test="isClose != null">is_close = #{isClose},</if>
+            <if test="bankName != null">bank_name = #{bankName},</if>
+            <if test="bankNum != null">bank_num = #{bankNum},</if>
+            <if test="companyId != null">companyId = #{companyId},</if>
+        </trim>
+        where dhrm_id = #{dhrmId}
+    </update>
+
+    <delete id="deleteDhrmCompanyByDhrmId" parameterType="Long">
+        delete from dhrm_company where dhrm_id = #{dhrmId}
+    </delete>
+
+    <delete id="deleteDhrmCompanyByDhrmIds" parameterType="String">
+        delete from dhrm_company where dhrm_id in 
+        <foreach item="dhrmId" collection="array" open="(" separator="," close=")">
+            #{dhrmId}
+        </foreach>
+    </delete>
+
+    <select id="selectDhrmCompanyByEmployNo" parameterType="String" resultMap="DhrmCompanyResult">
+        select
+            c.dhrm_id, c.dhrm_company_id, c.dhrm_company_name, c.dhrm_company_DSK, c.is_close, c.bank_name, c.bank_num, c.companyId
+        from
+            dhrm_company c
+        LEFT JOIN dhrm_employee_info e ON e.dhrm_company = c.dhrm_company_id
+        where e.employee_no = #{employNo}
+    </select>
+
+</mapper>

+ 23 - 0
ruoyi-system/src/main/resources/mapper/flowable/FlowDeployMapper.xml

@@ -28,4 +28,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
     </select>
 
 
 
 
+    <select id="selectByFlowKey" resultType="com.ruoyi.system.domain.FlowProcDefDto">
+        SELECT
+            rp.id_ as id,
+            rp.deployment_id_ as deploymentId,
+            rd.name_ as name,
+            rd.category_ as category,
+            rp.key_ as flowKey,
+            rp.version_ as version,
+            rp.suspension_state_ as suspensionState,
+            rd.deploy_time_  as deploymentTime
+        FROM
+        act_re_procdef rp
+        LEFT JOIN act_re_deployment rd ON rp.deployment_id_ = rd.id_
+        <where>
+            <if test="flowKey != null and flowKey != ''">
+                and rp.KEY_ = #{flowKey}
+            </if>
+        </where>
+        ORDER BY rd.deploy_time_ DESC
+        LIMIT 1
+    </select>
+
+
 </mapper>
 </mapper>

+ 8 - 4
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -15,6 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="avatar"       column="avatar"       />
         <result property="avatar"       column="avatar"       />
         <result property="password"     column="password"     />
         <result property="password"     column="password"     />
         <result property="status"       column="status"       />
         <result property="status"       column="status"       />
+		<result property="employNo"       column="employ_no"       />
         <result property="delFlag"      column="del_flag"     />
         <result property="delFlag"      column="del_flag"     />
         <result property="loginIp"      column="login_ip"     />
         <result property="loginIp"      column="login_ip"     />
         <result property="loginDate"    column="login_date"   />
         <result property="loginDate"    column="login_date"   />
@@ -47,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
     </resultMap>
 	
 	
 	<sql id="selectUserVo">
 	<sql id="selectUserVo">
-        select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, 
+        select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, u.employ_no,
         d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
         d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
         r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
         r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
         from sys_user u
         from sys_user u
@@ -57,7 +58,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </sql>
     </sql>
     
     
     <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
     <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
-		select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
+		select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, u.employ_no, d.dept_name, d.leader from sys_user u
 		left join sys_dept d on u.dept_id = d.dept_id
 		left join sys_dept d on u.dept_id = d.dept_id
 		where u.del_flag = '0'
 		where u.del_flag = '0'
 		<if test="userId != null and userId != 0">
 		<if test="userId != null and userId != 0">
@@ -86,7 +87,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	</select>
 	</select>
 	
 	
 	<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
 	<select id="selectAllocatedList" parameterType="SysUser" resultMap="SysUserResult">
-	    select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
+	    select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time, u.employ_no
 	    from sys_user u
 	    from sys_user u
 			 left join sys_dept d on u.dept_id = d.dept_id
 			 left join sys_dept d on u.dept_id = d.dept_id
 			 left join sys_user_role ur on u.user_id = ur.user_id
 			 left join sys_user_role ur on u.user_id = ur.user_id
@@ -103,7 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	</select>
 	</select>
 	
 	
 	<select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
 	<select id="selectUnallocatedList" parameterType="SysUser" resultMap="SysUserResult">
-	    select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time
+	    select distinct u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.phonenumber, u.status, u.create_time, u.employ_no
 	    from sys_user u
 	    from sys_user u
 			 left join sys_dept d on u.dept_id = d.dept_id
 			 left join sys_dept d on u.dept_id = d.dept_id
 			 left join sys_user_role ur on u.user_id = ur.user_id
 			 left join sys_user_role ur on u.user_id = ur.user_id
@@ -154,6 +155,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="sex != null and sex != ''">sex,</if>
  			<if test="sex != null and sex != ''">sex,</if>
  			<if test="password != null and password != ''">password,</if>
  			<if test="password != null and password != ''">password,</if>
  			<if test="status != null and status != ''">status,</if>
  			<if test="status != null and status != ''">status,</if>
+			<if test="employNo != null and employNo != ''">employ_no,</if>
  			<if test="createBy != null and createBy != ''">create_by,</if>
  			<if test="createBy != null and createBy != ''">create_by,</if>
  			<if test="remark != null and remark != ''">remark,</if>
  			<if test="remark != null and remark != ''">remark,</if>
  			create_time
  			create_time
@@ -168,6 +170,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="sex != null and sex != ''">#{sex},</if>
  			<if test="sex != null and sex != ''">#{sex},</if>
  			<if test="password != null and password != ''">#{password},</if>
  			<if test="password != null and password != ''">#{password},</if>
  			<if test="status != null and status != ''">#{status},</if>
  			<if test="status != null and status != ''">#{status},</if>
+			<if test="employNo != null and employNo != ''">#{employNo},</if>
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
  			<if test="remark != null and remark != ''">#{remark},</if>
  			<if test="remark != null and remark != ''">#{remark},</if>
  			sysdate()
  			sysdate()
@@ -186,6 +189,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
  			<if test="avatar != null and avatar != ''">avatar = #{avatar},</if>
  			<if test="password != null and password != ''">password = #{password},</if>
  			<if test="password != null and password != ''">password = #{password},</if>
  			<if test="status != null and status != ''">status = #{status},</if>
  			<if test="status != null and status != ''">status = #{status},</if>
+			<if test="employNo != null and employNo != ''">employ_no = #{employNo},</if>
  			<if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if>
  			<if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if>
  			<if test="loginDate != null">login_date = #{loginDate},</if>
  			<if test="loginDate != null">login_date = #{loginDate},</if>
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>