Commit f47e4f4d authored by lixiaolei's avatar lixiaolei

submit

parent 8e3a4c57
...@@ -33,7 +33,7 @@ public class BusinessBacklogController extends BaseController ...@@ -33,7 +33,7 @@ public class BusinessBacklogController extends BaseController
*/ */
// @PreAuthorize("@ss.hasPermi('system:backlog:list')") // @PreAuthorize("@ss.hasPermi('system:backlog:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(@RequestBody(required=false) BusinessBacklog businessBacklog) public TableDataInfo list(BusinessBacklog businessBacklog)
{ {
startPage(); startPage();
List<BusinessBacklog> list = businessBacklogService.selectBusinessBacklogList(businessBacklog); List<BusinessBacklog> list = businessBacklogService.selectBusinessBacklogList(businessBacklog);
......
...@@ -28,7 +28,7 @@ public class BusinessContactsController extends BaseController ...@@ -28,7 +28,7 @@ public class BusinessContactsController extends BaseController
*/ */
// @PreAuthorize("@ss.hasPermi('system:contacts:list')") // @PreAuthorize("@ss.hasPermi('system:contacts:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(@RequestBody(required=false) BusinessContacts businessContacts) public TableDataInfo list(BusinessContacts businessContacts)
{ {
startPage(); startPage();
List<BusinessContacts> list = businessContactsService.selectBusinessContactsList(businessContacts); List<BusinessContacts> list = businessContactsService.selectBusinessContactsList(businessContacts);
......
...@@ -3,7 +3,9 @@ package com.dsk.web.controller.business; ...@@ -3,7 +3,9 @@ package com.dsk.web.controller.business;
import com.dsk.common.config.RuoYiConfig; import com.dsk.common.config.RuoYiConfig;
import com.dsk.common.core.controller.BaseController; import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.AjaxResult; import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.core.domain.entity.BusinessFileVo;
import com.dsk.common.core.page.TableDataInfo; import com.dsk.common.core.page.TableDataInfo;
import com.dsk.common.utils.StringUtils;
import com.dsk.common.utils.file.FileUploadUtils; import com.dsk.common.utils.file.FileUploadUtils;
import com.dsk.common.utils.file.FileUtils; import com.dsk.common.utils.file.FileUtils;
import com.dsk.framework.config.ServerConfig; import com.dsk.framework.config.ServerConfig;
...@@ -16,6 +18,7 @@ import org.springframework.web.multipart.MultipartFile; ...@@ -16,6 +18,7 @@ import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* @author lxl * @author lxl
...@@ -35,17 +38,17 @@ public class BusinessFileController extends BaseController { ...@@ -35,17 +38,17 @@ public class BusinessFileController extends BaseController {
*/ */
// @PreAuthorize("@ss.hasPermi('system:file:add')") // @PreAuthorize("@ss.hasPermi('system:file:add')")
// @Log(title = "项目资料文档", businessType = BusinessType.INSERT) // @Log(title = "项目资料文档", businessType = BusinessType.INSERT)
@GetMapping("/new/{filePath}") @PostMapping("/new")
public AjaxResult newFolder(@PathVariable String filePath) { public AjaxResult newFolder(@RequestBody(required=false) BusinessIdDto filePath) {
return FileUtils.newFolder(RuoYiConfig.getProfile() + filePath) ? AjaxResult.success() : AjaxResult.error(); return FileUtils.newFolder(filePath.getFilePath()) ? AjaxResult.success() : AjaxResult.error();
} }
/** /**
* 删除某个文件或整个文件夹 * 删除某个文件或整个文件夹
*/ */
@PostMapping("/remove") @PostMapping("/remove")
public AjaxResult removeFile(@RequestBody(required=false) BusinessIdDto folderPath) { public AjaxResult removeFile(@RequestBody(required=false) BusinessIdDto filePath) {
return FileUtils.delFolder(RuoYiConfig.getProfile() + folderPath.getFolderPath()) ? AjaxResult.success() : AjaxResult.error(); return FileUtils.delFolder(filePath.getFilePath()) ? AjaxResult.success() : AjaxResult.error();
} }
/** /**
...@@ -53,9 +56,16 @@ public class BusinessFileController extends BaseController { ...@@ -53,9 +56,16 @@ public class BusinessFileController extends BaseController {
* 获取文件夹中所有文件 * 获取文件夹中所有文件
*/ */
@GetMapping(value = "/list") @GetMapping(value = "/list")
public TableDataInfo getAllFiles(@RequestBody(required=false) BusinessIdDto folderPath) { public TableDataInfo getAllFiles(BusinessIdDto filePath) {
startPage(); startPage();
List<String> allFiles = FileUtils.getAllFiles(RuoYiConfig.getProfile() + folderPath.getFolderPath()); List<BusinessFileVo> allFiles;
if(StringUtils.isNumeric(filePath.getFilePath())) filePath.setFilePath(RuoYiConfig.getProfile() + filePath.getFilePath());
allFiles = FileUtils.getAllFiles(filePath.getFilePath());
//模糊查询文件
if(StringUtils.isNotEmpty(filePath.getKeyword())){
List<BusinessFileVo> allFileName = FileUtils.getAllFileNames(filePath.getFilePath());
allFiles = allFileName.stream().filter(p -> p.getFilePath().contains(filePath.getKeyword())).collect(Collectors.toList());
}
return getDataTable(allFiles); return getDataTable(allFiles);
} }
...@@ -76,20 +86,18 @@ public class BusinessFileController extends BaseController { ...@@ -76,20 +86,18 @@ public class BusinessFileController extends BaseController {
* @param request 请求头参数 * @param request 请求头参数
* @return * @return
*/ */
@PostMapping("/upload/") @PostMapping("/upload")
public AjaxResult uploadFolder(@RequestPart("file") MultipartFile file, HttpServletRequest request){ public AjaxResult uploadFolder(@RequestPart("file") MultipartFile file,HttpServletRequest request){
try { try {
String businessFileName = request.getParameter("filePath"); // String businessFileName = request.getHeader("FilePath");
String businessFileName = "10";
// 上传文件路径 // 上传文件路径
String filePath = RuoYiConfig.getUploadPath()+businessFileName; String filePath = RuoYiConfig.getUploadPath()+businessFileName+"/";
// 上传并返回新文件名称 // 上传并返回文件全路径
String fileName = FileUploadUtils.upload(filePath, file); String fileName = FileUploadUtils.upload(filePath, file);
String url = serverConfig.getUrl() + fileName; String url = serverConfig.getUrl() + fileName;
AjaxResult ajax = AjaxResult.success(); AjaxResult ajax = AjaxResult.success();
ajax.put("url", url); ajax.put("url", url);
ajax.put("fileName", fileName);
ajax.put("newFileName", FileUtils.getName(fileName));
ajax.put("originalFilename", file.getOriginalFilename());
return ajax; return ajax;
} catch (IOException e) { } catch (IOException e) {
return AjaxResult.error(e.getMessage()); return AjaxResult.error(e.getMessage());
......
...@@ -5,6 +5,7 @@ import com.dsk.common.core.domain.AjaxResult; ...@@ -5,6 +5,7 @@ import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.core.domain.entity.BusinessFollowRecord; import com.dsk.common.core.domain.entity.BusinessFollowRecord;
import com.dsk.common.core.page.TableDataInfo; import com.dsk.common.core.page.TableDataInfo;
import com.dsk.system.domain.BusinessIdDto; import com.dsk.system.domain.BusinessIdDto;
import com.dsk.system.domain.BusinessListDto;
import com.dsk.system.service.IBusinessFollowRecordService; import com.dsk.system.service.IBusinessFollowRecordService;
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.*;
...@@ -24,16 +25,7 @@ public class BusinessFollowRecordController extends BaseController ...@@ -24,16 +25,7 @@ public class BusinessFollowRecordController extends BaseController
@Autowired @Autowired
private IBusinessFollowRecordService businessFollowRecordService; private IBusinessFollowRecordService businessFollowRecordService;
/**
* 根据项目id查询项目跟进记录
*/
// @PreAuthorize("@ss.hasPermi('system:record:list')")
// @GetMapping("/list/{businessId}")
// public TableDataInfo list(@PathVariable("businessId") Integer businessId)
// {
// startPage();
// return getDataTable(businessFollowRecordService.selectBusinessFollowRecordList(businessId));
// }
/** /**
* 新增项目跟进记录 * 新增项目跟进记录
...@@ -51,7 +43,7 @@ public class BusinessFollowRecordController extends BaseController ...@@ -51,7 +43,7 @@ public class BusinessFollowRecordController extends BaseController
*/ */
// @PreAuthorize("@ss.hasPermi('system:record:list')") // @PreAuthorize("@ss.hasPermi('system:record:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(@RequestBody(required=false) BusinessIdDto businessId) public TableDataInfo list(BusinessIdDto businessId)
{ {
startPage(); startPage();
List<BusinessFollowRecord> list = businessFollowRecordService.selectBusinessFollowRecordList(businessId); List<BusinessFollowRecord> list = businessFollowRecordService.selectBusinessFollowRecordList(businessId);
...@@ -69,6 +61,18 @@ public class BusinessFollowRecordController extends BaseController ...@@ -69,6 +61,18 @@ public class BusinessFollowRecordController extends BaseController
return toAjax(businessFollowRecordService.deleteBusinessFollowRecordByIds(ids)); return toAjax(businessFollowRecordService.deleteBusinessFollowRecordByIds(ids));
} }
/**
* 分页查询跟进动态
*/
// @PreAuthorize("@ss.hasPermi('system:record:list')")
@GetMapping("all/list")
public TableDataInfo allFollow(BusinessListDto dto)
{
startPage();
List<BusinessFollowRecord> list = businessFollowRecordService.allFollow(dto);
return getDataTable(list);
}
// /** // /**
// * 导出项目跟进记录列表 // * 导出项目跟进记录列表
// */ // */
...@@ -101,6 +105,17 @@ public class BusinessFollowRecordController extends BaseController ...@@ -101,6 +105,17 @@ public class BusinessFollowRecordController extends BaseController
// public AjaxResult edit(@RequestBody BusinessFollowRecord businessFollowRecord) // public AjaxResult edit(@RequestBody BusinessFollowRecord businessFollowRecord)
// { // {
// return toAjax(businessFollowRecordService.updateBusinessFollowRecord(businessFollowRecord)); // return toAjax(businessFollowRecordService.updateBusinessFollowRecord(businessFollowRecord));
// }
// /**
// * 根据项目id查询项目跟进记录
// */
// @PreAuthorize("@ss.hasPermi('system:record:list')")
// @GetMapping("/list/{businessId}")
// public TableDataInfo list(@PathVariable("businessId") Integer businessId)
// {
// startPage();
// return getDataTable(businessFollowRecordService.selectBusinessFollowRecordList(businessId));
// } // }
} }
...@@ -45,11 +45,11 @@ public class BusinessInfoController extends BaseController ...@@ -45,11 +45,11 @@ public class BusinessInfoController extends BaseController
} }
/** /**
* 查询项目列表 * 分页查询项目列表
*/ */
// @PreAuthorize("@ss.hasPermi('system:business:list')") // @PreAuthorize("@ss.hasPermi('system:business:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(@RequestBody(required=false) BusinessListDto dto) public TableDataInfo list(BusinessListDto dto)
{ {
startPage(); startPage();
List<BusinessListVo> list = businessInfoService.selectBusinessInfoList(dto); List<BusinessListVo> list = businessInfoService.selectBusinessInfoList(dto);
......
...@@ -37,7 +37,7 @@ public class BusinessRelateCompanyController extends BaseController ...@@ -37,7 +37,7 @@ public class BusinessRelateCompanyController extends BaseController
*/ */
// @PreAuthorize("@ss.hasPermi('system:company:list')") // @PreAuthorize("@ss.hasPermi('system:company:list')")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(@RequestBody(required=false) BusinessRelateCompany businessRelateCompany) public TableDataInfo list(BusinessRelateCompany businessRelateCompany)
{ {
startPage(); startPage();
List<BusinessRelateCompany> list = businessRelateCompanyService.selectBusinessRelateCompanyList(businessRelateCompany); List<BusinessRelateCompany> list = businessRelateCompanyService.selectBusinessRelateCompanyList(businessRelateCompany);
......
...@@ -130,6 +130,6 @@ public class RuoYiConfig ...@@ -130,6 +130,6 @@ public class RuoYiConfig
*/ */
public static String getUploadPath() public static String getUploadPath()
{ {
return getProfile() + "/upload"; return getProfile();
} }
} }
package com.dsk.common.core.domain.entity; package com.dsk.common.core.domain.entity;
import java.util.Date; import com.dsk.common.annotation.Excel;
import com.dsk.common.core.domain.BaseEntity; import com.dsk.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.dsk.common.annotation.Excel;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/** /**
* 项目跟进记录对象 business_follow_record * 项目跟进记录对象 business_follow_record
* *
...@@ -18,6 +18,16 @@ public class BusinessFollowRecord extends BaseEntity ...@@ -18,6 +18,16 @@ public class BusinessFollowRecord extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/**
* 项目名称
*/
private String projectName;
/**
* 业主单位
*/
private String ownerCompany;
/** $column.columnComment */ /** $column.columnComment */
private Integer id; private Integer id;
...@@ -64,6 +74,22 @@ public class BusinessFollowRecord extends BaseEntity ...@@ -64,6 +74,22 @@ public class BusinessFollowRecord extends BaseEntity
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date creatTime; private Date creatTime;
public String getProjectName() {
return projectName;
}
public void setProjectName(String projectName) {
this.projectName = projectName;
}
public String getOwnerCompany() {
return ownerCompany;
}
public void setOwnerCompany(String ownerCompany) {
this.ownerCompany = ownerCompany;
}
public String getNickName() { public String getNickName() {
return nickName; return nickName;
} }
...@@ -177,6 +203,8 @@ public class BusinessFollowRecord extends BaseEntity ...@@ -177,6 +203,8 @@ public class BusinessFollowRecord extends BaseEntity
.append("visitWay", getVisitWay()) .append("visitWay", getVisitWay())
.append("creatTime", getCreatTime()) .append("creatTime", getCreatTime())
.append("updateTime", getUpdateTime()) .append("updateTime", getUpdateTime())
.append("projectName", getProjectName())
.append("ownerCompany(", getOwnerCompany())
.toString(); .toString();
} }
} }
package com.dsk.common.utils.file; package com.dsk.common.utils.file;
import java.io.File; import com.dsk.common.config.RuoYiConfig;
import java.io.IOException;
import java.nio.file.Paths;
import java.util.Objects;
import com.dsk.common.constant.Constants; import com.dsk.common.constant.Constants;
import com.dsk.common.exception.file.FileNameLengthLimitExceededException; import com.dsk.common.exception.file.FileNameLengthLimitExceededException;
import com.dsk.common.exception.file.FileSizeLimitExceededException; import com.dsk.common.exception.file.FileSizeLimitExceededException;
import com.dsk.common.exception.file.InvalidExtensionException; import com.dsk.common.exception.file.InvalidExtensionException;
import com.dsk.common.utils.DateUtils; import com.dsk.common.utils.DateUtils;
import com.dsk.common.utils.StringUtils; import com.dsk.common.utils.StringUtils;
import com.dsk.common.utils.uuid.Seq;
import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.FilenameUtils;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import com.dsk.common.config.RuoYiConfig;
import com.dsk.common.utils.uuid.Seq; import java.io.File;
import java.io.IOException;
import java.nio.file.Paths;
import java.util.Objects;
/** /**
* 文件上传工具类 * 文件上传工具类
...@@ -111,11 +111,13 @@ public class FileUploadUtils ...@@ -111,11 +111,13 @@ public class FileUploadUtils
assertAllowed(file, allowedExtension); assertAllowed(file, allowedExtension);
String fileName = extractFilename(file); // String fileName = extractFilename(file);
String absPath = getAbsoluteFile(baseDir, fileName).getAbsolutePath(); // String absPath = getAbsoluteFile(baseDir, fileName).getAbsolutePath();
String absPath = getAbsoluteFile(baseDir, file.getOriginalFilename()).getAbsolutePath();
file.transferTo(Paths.get(absPath)); file.transferTo(Paths.get(absPath));
return getPathFileName(baseDir, fileName); // return getPathFileName(baseDir, fileName);
return baseDir+file.getOriginalFilename();
} }
/** /**
......
package com.dsk.common.utils.file; package com.dsk.common.utils.file;
import com.dsk.common.config.RuoYiConfig; import com.dsk.common.config.RuoYiConfig;
import com.dsk.common.core.domain.entity.BusinessFileVo;
import com.dsk.common.exception.base.BaseException; import com.dsk.common.exception.base.BaseException;
import com.dsk.common.utils.DateUtils; import com.dsk.common.utils.DateUtils;
import com.dsk.common.utils.StringUtils; import com.dsk.common.utils.StringUtils;
...@@ -25,6 +26,7 @@ import java.net.HttpURLConnection; ...@@ -25,6 +26,7 @@ import java.net.HttpURLConnection;
import java.net.URL; import java.net.URL;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
...@@ -40,11 +42,6 @@ public class FileUtils ...@@ -40,11 +42,6 @@ public class FileUtils
{ {
public static String FILENAME_PATTERN = "[a-zA-Z0-9_\\-\\|\\.\\u4e00-\\u9fa5]+"; public static String FILENAME_PATTERN = "[a-zA-Z0-9_\\-\\|\\.\\u4e00-\\u9fa5]+";
public static void main(String[] args) {
System.out.println(RuoYiConfig.getProfile());
}
/** /**
* 检查目录是否存在,如果不存在,则创建目录,如果创建失败则返回false * 检查目录是否存在,如果不存在,则创建目录,如果创建失败则返回false
* *
...@@ -251,8 +248,8 @@ public class FileUtils ...@@ -251,8 +248,8 @@ public class FileUtils
* @param filePath 全路径 * @param filePath 全路径
* @return * @return
*/ */
public static List<String> getAllFiles(String filePath) { public static List<BusinessFileVo> getAllFiles(String filePath) {
List<String> fileList = new ArrayList<String>(); List<BusinessFileVo> fileList = new ArrayList<>();
File file = new File(filePath); File file = new File(filePath);
if (!file.exists()) { if (!file.exists()) {
...@@ -269,11 +266,11 @@ public class FileUtils ...@@ -269,11 +266,11 @@ public class FileUtils
for (File directory : files) { for (File directory : files) {
// 如果是文件夹则递归调用此方法 // 如果是文件夹则递归调用此方法
if (directory.isDirectory()) { if (directory.isDirectory()) {
fileList.add(directory.getPath()); fileList.add(new BusinessFileVo(directory.getPath(),new SimpleDateFormat("yyyy-MM-dd").format(directory.lastModified())));
getAllFiles(directory.getPath()); getAllFiles(directory.getPath());
} else { } else {
// 如果是文件则直接输出路径 // 如果是文件则直接输出路径
fileList.add(directory.getPath()); fileList.add(new BusinessFileVo(directory.getPath(),new SimpleDateFormat("yyyy-MM-dd").format(directory.lastModified())));
} }
} }
return fileList; return fileList;
...@@ -287,8 +284,8 @@ public class FileUtils ...@@ -287,8 +284,8 @@ public class FileUtils
* @param path 文件夹路径 * @param path 文件夹路径
* @return List<File> * @return List<File>
*/ */
public static List<File> getAllFileNames(String path) { public static List<BusinessFileVo> getAllFileNames(String path) {
List<File> fileList = new ArrayList<File>(); List<BusinessFileVo> fileList = new ArrayList<>();
File file = new File(path); File file = new File(path);
if (!file.exists()) { if (!file.exists()) {
return fileList; return fileList;
...@@ -305,10 +302,10 @@ public class FileUtils ...@@ -305,10 +302,10 @@ public class FileUtils
tempFile = new File(path + File.separator + fileName); tempFile = new File(path + File.separator + fileName);
} }
if (tempFile.isFile()) { if (tempFile.isFile()) {
fileList.add(tempFile); fileList.add(new BusinessFileVo(tempFile.getPath(),new SimpleDateFormat("yyyy-MM-dd").format(tempFile.lastModified())));
} }
if (tempFile.isDirectory()) { if (tempFile.isDirectory()) {
List<File> allFiles = getAllFileNames(tempFile.getAbsolutePath()); List<BusinessFileVo> allFiles = getAllFileNames(tempFile.getAbsolutePath());
fileList.addAll(allFiles); fileList.addAll(allFiles);
} }
} }
......
...@@ -23,5 +23,10 @@ public class BusinessIdDto { ...@@ -23,5 +23,10 @@ public class BusinessIdDto {
/** /**
* 文件路径 * 文件路径
*/ */
private String folderPath; private String filePath;
/**
* 文件搜索关键字
*/
private String keyword;
} }
...@@ -12,6 +12,11 @@ import java.util.List; ...@@ -12,6 +12,11 @@ import java.util.List;
@Data @Data
public class BusinessListDto { public class BusinessListDto {
/**
* 拜访方式
*/
private String visitWay;
/** /**
* 项目名称 * 项目名称
*/ */
...@@ -23,7 +28,7 @@ public class BusinessListDto { ...@@ -23,7 +28,7 @@ public class BusinessListDto {
private Integer userId; private Integer userId;
/** /**
* 企业id * 部门id
*/ */
private Integer deptId; private Integer deptId;
...@@ -45,7 +50,7 @@ public class BusinessListDto { ...@@ -45,7 +50,7 @@ public class BusinessListDto {
/** /**
* 项目类型 * 项目类型
*/ */
private String projectType; private List<String> projectType;
/** /**
* 投资估算 * 投资估算
...@@ -55,7 +60,7 @@ public class BusinessListDto { ...@@ -55,7 +60,7 @@ public class BusinessListDto {
/** /**
* 项目阶段 * 项目阶段
*/ */
private String projectStage; private List<String> projectStage;
/** /**
* 最小金额 * 最小金额
......
package com.dsk.system.domain.vo; package com.dsk.system.domain.vo;
import com.dsk.common.annotation.Excel;
import com.dsk.common.core.domain.entity.BusinessRelateCompany;
import lombok.Data; import lombok.Data;
import java.util.List; import java.util.List;
...@@ -20,7 +18,7 @@ public class BusinessBrowseVo { ...@@ -20,7 +18,7 @@ public class BusinessBrowseVo {
private String projectName; private String projectName;
/** /**
* 项目名称 * 0 仅自己可见,1 他人可见
*/ */
private Integer isPrivate; private Integer isPrivate;
......
...@@ -63,4 +63,9 @@ public class BusinessListVo { ...@@ -63,4 +63,9 @@ public class BusinessListVo {
* 项目标签 * 项目标签
*/ */
private String label; private String label;
/**
* 项目类型
*/
private String projectType;
} }
...@@ -2,6 +2,7 @@ package com.dsk.system.mapper; ...@@ -2,6 +2,7 @@ package com.dsk.system.mapper;
import com.dsk.common.core.domain.entity.BusinessFollowRecord; import com.dsk.common.core.domain.entity.BusinessFollowRecord;
import com.dsk.system.domain.BusinessIdDto; import com.dsk.system.domain.BusinessIdDto;
import com.dsk.system.domain.BusinessListDto;
import java.util.List; import java.util.List;
...@@ -68,4 +69,12 @@ public interface BusinessFollowRecordMapper ...@@ -68,4 +69,12 @@ public interface BusinessFollowRecordMapper
* @return 结果 * @return 结果
*/ */
public int deleteBusinessFollowRecordByIds(Long[] ids); public int deleteBusinessFollowRecordByIds(Long[] ids);
/**
* 分页查询跟进动态
*
* @param dto
* @return
*/
List<BusinessFollowRecord> allFollow(BusinessListDto dto);
} }
...@@ -2,6 +2,7 @@ package com.dsk.system.service; ...@@ -2,6 +2,7 @@ package com.dsk.system.service;
import com.dsk.common.core.domain.entity.BusinessFollowRecord; import com.dsk.common.core.domain.entity.BusinessFollowRecord;
import com.dsk.system.domain.BusinessIdDto; import com.dsk.system.domain.BusinessIdDto;
import com.dsk.system.domain.BusinessListDto;
import java.util.List; import java.util.List;
...@@ -29,6 +30,14 @@ public interface IBusinessFollowRecordService ...@@ -29,6 +30,14 @@ public interface IBusinessFollowRecordService
*/ */
public List<BusinessFollowRecord> selectBusinessFollowRecordList(BusinessIdDto businessId); public List<BusinessFollowRecord> selectBusinessFollowRecordList(BusinessIdDto businessId);
/**
* 分页查询跟进动态
*
* @param dto
* @return
*/
List<BusinessFollowRecord> allFollow(BusinessListDto dto);
/** /**
* 分页查询项目跟进记录列表 * 分页查询项目跟进记录列表
* *
......
package com.dsk.system.service.impl; package com.dsk.system.service.impl;
import java.util.List;
import com.dsk.common.core.domain.entity.BusinessFollowRecord; import com.dsk.common.core.domain.entity.BusinessFollowRecord;
import com.dsk.common.utils.DateUtils; import com.dsk.common.utils.DateUtils;
import com.dsk.system.domain.BusinessIdDto; import com.dsk.system.domain.BusinessIdDto;
import com.dsk.system.domain.BusinessListDto;
import com.dsk.system.mapper.BusinessFollowRecordMapper; import com.dsk.system.mapper.BusinessFollowRecordMapper;
import com.dsk.system.service.IBusinessFollowRecordService; import com.dsk.system.service.IBusinessFollowRecordService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/** /**
* 项目跟进记录Service业务层处理 * 项目跟进记录Service业务层处理
* *
...@@ -41,6 +42,17 @@ public class BusinessFollowRecordServiceImpl implements IBusinessFollowRecordSer ...@@ -41,6 +42,17 @@ public class BusinessFollowRecordServiceImpl implements IBusinessFollowRecordSer
return businessFollowRecordMapper.selectBusinessFollowRecordList(businessId); return businessFollowRecordMapper.selectBusinessFollowRecordList(businessId);
} }
@Override
public List<BusinessFollowRecord> allFollow(BusinessListDto dto) {
//userId不传值,就查询全部门项目
// if (dto.getUserId() == null) {
// Long deptId = SecurityUtils.getLoginUser().getDeptId();
// if (deptId == null) throw new BaseException("请登录");
// dto.setDeptId(deptId.intValue());
// }
return businessFollowRecordMapper.allFollow(dto);
}
@Override @Override
public List<BusinessFollowRecord> businessFollowRecordPaging(BusinessFollowRecord businessFollowRecord) { public List<BusinessFollowRecord> businessFollowRecordPaging(BusinessFollowRecord businessFollowRecord) {
return businessFollowRecordMapper.businessFollowRecordPaging(businessFollowRecord); return businessFollowRecordMapper.businessFollowRecordPaging(businessFollowRecord);
......
package com.dsk.system.service.impl; package com.dsk.system.service.impl;
import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.dsk.common.config.RuoYiConfig; import com.dsk.common.config.RuoYiConfig;
import com.dsk.common.constant.HttpStatus; import com.dsk.common.constant.HttpStatus;
import com.dsk.common.core.domain.AjaxResult; import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.core.domain.entity.BusinessInfo; import com.dsk.common.core.domain.entity.BusinessInfo;
import com.dsk.common.core.domain.entity.BusinessLabel; import com.dsk.common.core.domain.entity.BusinessLabel;
import com.dsk.common.core.domain.entity.BusinessRelateCompany;
import com.dsk.common.core.domain.entity.BusinessUser; import com.dsk.common.core.domain.entity.BusinessUser;
import com.dsk.common.exception.base.BaseException; import com.dsk.common.exception.base.BaseException;
import com.dsk.common.utils.CheckUtils; import com.dsk.common.utils.CheckUtils;
...@@ -21,8 +13,8 @@ import com.dsk.common.utils.DateUtils; ...@@ -21,8 +13,8 @@ import com.dsk.common.utils.DateUtils;
import com.dsk.common.utils.SecurityUtils; import com.dsk.common.utils.SecurityUtils;
import com.dsk.common.utils.StringUtils; import com.dsk.common.utils.StringUtils;
import com.dsk.common.utils.file.FileUtils; import com.dsk.common.utils.file.FileUtils;
import com.dsk.system.domain.BusinessExcelDto;
import com.dsk.system.domain.BusinessAddDto; import com.dsk.system.domain.BusinessAddDto;
import com.dsk.system.domain.BusinessExcelDto;
import com.dsk.system.domain.BusinessListDto; import com.dsk.system.domain.BusinessListDto;
import com.dsk.system.domain.customer.dto.CustomerBusinessSearchDto; import com.dsk.system.domain.customer.dto.CustomerBusinessSearchDto;
import com.dsk.system.domain.customer.vo.CustomerBusinessListVo; import com.dsk.system.domain.customer.vo.CustomerBusinessListVo;
...@@ -34,13 +26,14 @@ import com.dsk.system.mapper.BusinessRelateCompanyMapper; ...@@ -34,13 +26,14 @@ import com.dsk.system.mapper.BusinessRelateCompanyMapper;
import com.dsk.system.mapper.BusinessUserMapper; import com.dsk.system.mapper.BusinessUserMapper;
import com.dsk.system.service.IBusinessInfoService; import com.dsk.system.service.IBusinessInfoService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse; import java.util.LinkedList;
import java.util.List;
import java.util.stream.Collectors;
/** /**
* 项目详情Service业务层处理 * 项目详情Service业务层处理
...@@ -86,6 +79,7 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService { ...@@ -86,6 +79,7 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
*/ */
@Override @Override
public List<BusinessListVo> selectBusinessInfoList(BusinessListDto dto) { public List<BusinessListVo> selectBusinessInfoList(BusinessListDto dto) {
//userId不传值,就查询全部门项目
// if (dto.getUserId() == null) { // if (dto.getUserId() == null) {
// Long deptId = SecurityUtils.getLoginUser().getDeptId(); // Long deptId = SecurityUtils.getLoginUser().getDeptId();
// if (deptId == null) throw new BaseException("请登录"); // if (deptId == null) throw new BaseException("请登录");
......
...@@ -58,7 +58,34 @@ ...@@ -58,7 +58,34 @@
<if test="visitWay != null and visitWay != ''">and f.visit_way = #{visitWay}</if> <if test="visitWay != null and visitWay != ''">and f.visit_way = #{visitWay}</if>
<if test="creatTime != null ">and f.creat_time = #{creatTime}</if> <if test="creatTime != null ">and f.creat_time = #{creatTime}</if>
</where> </where>
ORDER BY create_time DESC ORDER BY creat_time DESC
</select>
<select id="allFollow" resultType="com.dsk.common.core.domain.entity.BusinessFollowRecord">
select f.*,
i.project_name as projectName,
i.construction_unit as ownerCompany,
u.nick_name as nickName
from business_follow_record f
left join business_info i on i.id = f.business_id
left join sys_user u on f.user_id = u.user_id
<where>
<if test="userId != null">
and f.user_id = #{userId}
</if>
<if test="deptId != null">
and u.dept_id = #{deptId}
</if>
<if test="projectName != null and projectName != ''">
and i.project_name = #{projectName}
</if>
<if test="ownerCompany != null and ownerCompany != ''">
and i.construction_unit = #{ownerCompany}
</if>
<if test="visitWay != null and visitWay != ''">
and f.visit_way = #{visitWay}
</if>
</where>
ORDER BY f.creat_time DESC
</select> </select>
<insert id="insertBusinessFollowRecord" parameterType="com.dsk.common.core.domain.entity.BusinessFollowRecord" useGeneratedKeys="true" <insert id="insertBusinessFollowRecord" parameterType="com.dsk.common.core.domain.entity.BusinessFollowRecord" useGeneratedKeys="true"
......
...@@ -86,23 +86,26 @@ ...@@ -86,23 +86,26 @@
SELECT SELECT
i.id, i.id,
i.project_name projectName, i.project_name projectName,
i.project_type projectType,
i.province_name provinceName, i.province_name provinceName,
i.city_name cityName, i.city_name cityName,
i.district_name districtName, i.district_name districtName,
i.investment_amount investmentAmount, i.investment_amount investmentAmount,
GROUP_CONCAT(DISTINCT r.company_name) ownerCompany, i.construction_unit ownerCompany,
MAX(f.creat_time) followTime, MAX(f.creat_time) followTime,
u.nick_name nickName, u.nick_name nickName,
GROUP_CONCAT(DISTINCT l.label) label GROUP_CONCAT(DISTINCT l.label) label
FROM business_info i FROM business_info i
LEFT JOIN business_follow_record f on f.business_id = i.id LEFT JOIN business_follow_record f on f.business_id = i.id
LEFT JOIN (SELECT business_id,company_name FROM business_relate_company WHERE company_role LIKE '%业主%' ) r on r.business_id = i.id
LEFT JOIN business_label l on l.business_id = i.id LEFT JOIN business_label l on l.business_id = i.id
LEFT JOIN business_user bu on bu.business_id = i.id LEFT JOIN business_user bu on bu.business_id = i.id
LEFT JOIN sys_user u on u.user_id = f.user_id LEFT JOIN sys_user u on u.user_id = f.user_id
<where> <where>
<if test="projectType != null and projectType != ''"> <if test="projectType != null and projectType != ''">
and i.project_type = #{projectType} and i.project_type in
<foreach collection="projectType" item="projectType" open="(" separator="," close=")">
#{projectType}
</foreach>
</if> </if>
<if test="minAmount != null and minAmount != '' and maxAmount != minAmount"> <if test="minAmount != null and minAmount != '' and maxAmount != minAmount">
and i.investment_amount &gt;= #{minAmount} and i.investment_amount &gt;= #{minAmount}
...@@ -114,13 +117,16 @@ ...@@ -114,13 +117,16 @@
and i.investment_amount = #{minAmount} and i.investment_amount = #{minAmount}
</if> </if>
<if test="projectStage != null and projectStage != ''"> <if test="projectStage != null and projectStage != ''">
and i.project_stage = #{projectStage} and i.project_stage in
<foreach collection="projectStage" item="projectStage" open="(" separator="," close=")">
#{projectStage}
</foreach>
</if> </if>
<if test="projectName != null and projectName != ''"> <if test="projectName != null and projectName != ''">
and i.project_name like concat('%',#{projectName},'%') and i.project_name like concat('%',#{projectName},'%')
</if> </if>
<if test="ownerCompany != null and ownerCompany != ''"> <if test="ownerCompany != null and ownerCompany != ''">
or r.company_name like concat('%',#{ownerCompany},'%') or i.construction_unit like concat('%',#{ownerCompany},'%')
</if> </if>
<if test="userId != null"> <if test="userId != null">
and bu.user_id = #{userId} and bu.user_id = #{userId}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment