Commit 762d594c authored by lcl's avatar lcl

项目相关代码迁移

parent 266e38b5
...@@ -99,6 +99,8 @@ spring: ...@@ -99,6 +99,8 @@ spring:
deserialization: deserialization:
# 允许对象忽略json中不存在的属性 # 允许对象忽略json中不存在的属性
fail_on_unknown_properties: false fail_on_unknown_properties: false
main:
allow-circular-references: true
# Sa-Token配置 # Sa-Token配置
sa-token: sa-token:
......
package com.dsk.common.utils;
import java.math.BigDecimal;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* 邮箱和手机号验证
*/
public class CheckUtils {
public static final String REG_Moblie = "^((13[0-9])|(14(0|[5-7]|9))|(15([0-3]|[5-9]))|(16(2|[5-7]))|(17[0-8])|(18[0-9])|(19([0-3]|[5-9])))\\d{8}$";//手机号
public static final String REG_Landline = "(\\(\\d{3,4}\\)|\\d{3,4}-|\\s)?\\d{8}";//座机号
public static final String REG_EMAIL = "[a-zA-Z0-9]+@[a-zA-Z0-9]+\\.[a-zA-Z0-9]+";
/**
* 校验email
* @param email
* @return
*/
public static boolean isEmail(String email){
if (email == null){
return false;
}else {
boolean isMatch = Pattern.matches(REG_EMAIL,email);
return isMatch;
}
}
/**
* 校验手机号
* @param phone
* @return
*/
public static boolean isPhone(String phone){
if (phone == null){
return false;
}else {
Pattern mobilePattern = Pattern.compile(REG_Moblie);
Pattern landlinePattern = Pattern.compile(REG_Landline);
Matcher mobileMatcher = mobilePattern.matcher(phone);
Matcher landlineMatcher = landlinePattern.matcher(phone);
return mobileMatcher.matches() || landlineMatcher.matches();
}
}
/**
* Double小数点前的位数
* @param number
* @return
*/
public static int checkIntegerPlaces(Double number) {
BigDecimal bigDecimal = new BigDecimal(String.valueOf(number));
String strNumber = bigDecimal.toString();
int integerPlaces = strNumber.indexOf('.');
if (integerPlaces == -1) {
return strNumber.length();
} else {
return integerPlaces;
}
}
/**
* Double小数点后的位数
* @param number
* @return
*/
public static int checkDecimalPlaces(Double number) {
BigDecimal bigDecimal = new BigDecimal(String.valueOf(number));
String strNumber = bigDecimal.toString();
int decimalPlaces = 0;
int index = strNumber.indexOf('.');
if (index != -1) {
decimalPlaces = strNumber.length() - index - 1;
}
return decimalPlaces;
}
}
package com.dsk.biz.controller;
import com.dsk.biz.domain.BusinessBacklog;
import com.dsk.biz.domain.bo.BusinessBacklogListDto;
import com.dsk.biz.domain.vo.BusinessBacklogListVo;
import com.dsk.biz.service.IBusinessBacklogService;
import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.domain.R;
import com.dsk.common.core.page.TableDataInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* 项目工作待办Controller
*
* @author lxl
* @date 2023-05-17
*/
@RestController
@RequestMapping("/business/backlog")
@Slf4j
public class BusinessBacklogController extends BaseController
{
@Autowired
private IBusinessBacklogService businessBacklogService;
/**
* 分页查询项目工作待办列表
*/
// @PreAuthorize("@ss.hasPermi('system:backlog:list')")
@GetMapping("/list")
public TableDataInfo<BusinessBacklogListVo> list(BusinessBacklogListDto dto, PageQuery pageQuery)
{
return businessBacklogService.selectBusinessBacklogList(dto, pageQuery);
}
/**
* 新增项目工作待办
*/
// @PreAuthorize("@ss.hasPermi('system:backlog:add')")
// @Log(title = "项目工作待办", businessType = BusinessType.INSERT)
@PostMapping("/add")
public R<Void> add(@RequestBody BusinessBacklog businessBacklog)
{
return toAjax(businessBacklogService.insertBusinessBacklog(businessBacklog));
}
/**
* 修改项目工作待办
*/
// @PreAuthorize("@ss.hasPermi('system:backlog:edit')")
// @Log(title = "项目工作待办", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
public R<Void> edit(@RequestBody BusinessBacklog businessBacklog)
{
return toAjax(businessBacklogService.updateBusinessBacklog(businessBacklog));
}
/**
* 获取项目工作代办逾期数量
*/
@GetMapping("/overdue/count/{businessId}")
public R<Integer> overdueCount(@PathVariable Integer businessId)
{
return R.ok(businessBacklogService.overdueCount(businessId));
}
}
package com.dsk.biz.controller;
import com.dsk.biz.domain.bo.BusinessIdDto;
import com.dsk.biz.domain.vo.BusinessFileVo;
import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.core.page.TableDataInfo;
import com.dsk.common.utils.StringUtils;
import com.dsk.common.utils.file.FileUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
/**
* @author lxl
* @Description: 项目文件管理Controller
* @Date 2023/5/30 上午 8:44
**/
@Slf4j
@RestController
@RequestMapping("/business/file")
public class BusinessFileController extends BaseController {
// @Autowired
// private ServerConfig serverConfig;
//
// /**
// * 新建文件夹
// */
//// @PreAuthorize("@ss.hasPermi('system:file:add')")
//// @Log(title = "项目资料文档", businessType = BusinessType.INSERT)
// @PostMapping("/new")
// public AjaxResult newFolder(@RequestBody(required=false) BusinessIdDto filePath) {
// return FileUtils.newFolder(filePath.getFilePath()) ? AjaxResult.success() : AjaxResult.error();
// }
//
// /**
// * 删除某个文件或整个文件夹
// */
// @PostMapping("/remove")
// public AjaxResult removeFile(@RequestBody(required=false) BusinessIdDto filePath) {
// return FileUtils.delFolder(filePath.getFilePath()) ? AjaxResult.success() : AjaxResult.error();
// }
//
// /**
// * 分页查询项目的所有文件
// * 获取文件夹中所有文件
// */
// @GetMapping(value = "/list")
// public TableDataInfo getAllFiles(BusinessIdDto filePath) {
// startPage();
// List<BusinessFileVo> allFiles;
// if(StringUtils.isNumeric(filePath.getFilePath())) filePath.setFilePath(ShuZhiHuaConfig.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());
// }
// //文件按照时间倒序
// allFiles = allFiles.stream().sorted(Comparator.comparing(BusinessFileVo::getCreatTime).reversed()).collect(Collectors.toList());
// return getDataTable(allFiles);
// }
//
// /**
// * 上传文件及文件夹
// * @param file 文件流
// * @param request 请求头参数
// * @return
// */
// @PostMapping("/upload")
// public AjaxResult uploadFolder(@RequestPart("file") MultipartFile file, HttpServletRequest request) {
// try {
// //获取文件名
// String filename = file.getOriginalFilename();
// String businessFileName = request.getHeader("FilePath");
// // 上传文件路径
// String filePath = ShuZhiHuaConfig.getUploadPath() + businessFileName + "/";
//
// //校验是否上传同名文件
// File newFile = new File(filePath);
// if (newFile.exists()) {
// // 获取当前目录下的文件和文件夹
// File[] files = newFile.listFiles();
// for (File allFile : files) {
// if (filename.equals(allFile.getName())) return error("文件已存在");
// }
// }
//
// // 上传并返回文件全路径
// String fileName = FileUploadUtils.upload(filePath, file);
//// String url = serverConfig.getUrl() + fileName;
// AjaxResult ajax = AjaxResult.success();
// ajax.put("url", fileName);
// return ajax;
// } catch (IOException e) {
// return AjaxResult.error(e.getMessage());
// }
// }
//
// /**
// * 下载文件
// * @param filePath 要下载的文件路径
// * @param response 返回的响应
// */
// @PostMapping("/download")
// public void downloadFolder(@RequestBody BusinessIdDto filePath, HttpServletResponse response) {
// FileUtils.downloadByFilePath(filePath.getFilePath(),response);
// }
}
package com.dsk.biz.controller;
import com.dsk.biz.domain.BusinessFollowRecord;
import com.dsk.biz.domain.bo.BusinessIdDto;
import com.dsk.biz.domain.bo.BusinessListDto;
import com.dsk.biz.domain.vo.BusinessListVo;
import com.dsk.biz.service.IBusinessFollowRecordService;
import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.domain.R;
import com.dsk.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 项目跟进记录Controller
*
* @author lxl
* @date 2023-05-17
*/
@RestController
@RequestMapping("/business/record")
public class BusinessFollowRecordController extends BaseController
{
@Autowired
private IBusinessFollowRecordService businessFollowRecordService;
/**
* 查询关联项目
*/
@GetMapping("/relate/project/{userId}")
public R<List<BusinessListVo>> selectRelateProject(@PathVariable("userId") Integer userId)
{
return R.ok(businessFollowRecordService.selectRelateProject(userId));
}
/**
* 查询关联业主企业
*/
@GetMapping("/relate/company/{userId}")
public R<List<String>> selectRelateCompany(@PathVariable("userId") Integer userId)
{
return R.ok(businessFollowRecordService.selectRelateCompany(userId));
}
/**
* 新增项目跟进记录
*/
// @PreAuthorize("@ss.hasPermi('system:record:add')")
// @Log(title = "项目跟进记录", businessType = BusinessType.INSERT)
@PostMapping("/add")
public R<Void> add(@RequestBody BusinessFollowRecord businessFollowRecord)
{
return toAjax(businessFollowRecordService.insertBusinessFollowRecord(businessFollowRecord));
}
/**
* 分页查询项目跟进记录
*/
// @PreAuthorize("@ss.hasPermi('system:record:list')")
@GetMapping("/list")
public TableDataInfo<BusinessFollowRecord> list(BusinessIdDto dto, PageQuery pageQuery)
{
return businessFollowRecordService.selectBusinessFollowRecordList(dto, pageQuery);
}
/**
* 删除项目跟进记录
*/
// @PreAuthorize("@ss.hasPermi('system:record:remove')")
// @Log(title = "项目跟进记录", businessType = BusinessType.DELETE)
@DeleteMapping("remove/{ids}")
public R<Void> remove(@PathVariable(value = "ids",required=false) Long[] ids)
{
return toAjax(businessFollowRecordService.deleteBusinessFollowRecordByIds(ids));
}
/**
* 分页查询跟进动态
*/
// @PreAuthorize("@ss.hasPermi('system:record:list')")
@GetMapping("all/list")
public TableDataInfo<BusinessFollowRecord> allFollow(BusinessListDto dto, PageQuery pageQuery)
{
return businessFollowRecordService.allFollow(dto, pageQuery);
}
}
//package com.dsk.biz.controller; package com.dsk.biz.controller;
//
//import com.dsk.biz.domain.BusinessInfo; import com.dsk.biz.domain.BusinessInfo;
//import com.dsk.biz.domain.bo.BusinessListDto; import com.dsk.biz.domain.bo.BusinessAddDto;
//import com.dsk.common.core.controller.BaseController; import com.dsk.biz.domain.bo.BusinessListDto;
//import com.dsk.common.core.domain.AjaxResult; import com.dsk.biz.domain.vo.BusinessBrowseVo;
//import com.dsk.common.core.page.TableDataInfo; import com.dsk.biz.domain.vo.BusinessLikeProjectNameListVo;
//import com.dsk.system.domain.business.dto.BusinessAddDto; import com.dsk.biz.domain.vo.BusinessListVo;
//import com.dsk.system.domain.business.dto.BusinessListDto; import com.dsk.biz.service.IBusinessInfoService;
//import com.dsk.system.service.IBusinessInfoService; import com.dsk.common.core.controller.BaseController;
//import org.springframework.beans.factory.annotation.Autowired; import com.dsk.common.core.domain.AjaxResult;
//import org.springframework.web.bind.annotation.*; import com.dsk.common.core.domain.PageQuery;
//import org.springframework.web.multipart.MultipartFile; import com.dsk.common.core.domain.R;
// import com.dsk.common.core.page.TableDataInfo;
///** import com.dsk.common.enums.BusinessType;
// * 项目详情Controller import org.springframework.beans.factory.annotation.Autowired;
// * import org.springframework.web.bind.annotation.*;
// * @author lxl import org.springframework.web.multipart.MultipartFile;
// * @date 2023-05-17
// */ import javax.servlet.http.HttpServletResponse;
//@RestController import java.util.List;
//@RequestMapping("/business/info")
//public class BusinessInfoController extends BaseController /**
//{ * 项目详情Controller
// @Autowired *
// private IBusinessInfoService businessInfoService; * @author lxl
// * @date 2023-05-17
//// /** */
//// * 项目批量导入 @RestController
//// */ @RequestMapping("/business/info")
//// @PostMapping("/upload") public class BusinessInfoController extends BaseController
////// public AjaxResult batchUpload(@RequestPart("file") MultipartFile file, HttpServletRequest request, HttpServletResponse response){ {
//// public AjaxResult batchUpload(@RequestPart("file") MultipartFile file){ @Autowired
//// return businessInfoService.batchUpload(file); private IBusinessInfoService businessInfoService;
//// }
//// /**
//// /** * 项目批量导入
//// * 查询所有项目名称(支持模糊查询) */
//// */ @PostMapping("/upload")
//// @PostMapping("/query/project") // public AjaxResult batchUpload(@RequestPart("file") MultipartFile file, HttpServletRequest request, HttpServletResponse response){
//// public AjaxResult queryprojectName(@RequestBody BusinessListDto dto){ public AjaxResult batchUpload(@RequestPart("file") MultipartFile file){
//// return AjaxResult.success(businessInfoService.selectProjectName(dto)); return businessInfoService.batchUpload(file);
//// } }
//
// /** /**
// * 分页查询项目列表 * 查询所有项目名称(支持模糊查询)
// */ */
//// @PreAuthorize("@ss.hasPermi('system:business:list')") @PostMapping("/query/project")
// @GetMapping("/list") public R<List<BusinessLikeProjectNameListVo>> queryprojectName(@RequestBody BusinessListDto dto){
// public TableDataInfo list(BusinessListDto dto) return R.ok(businessInfoService.selectProjectName(dto));
// { }
// return businessInfoService.selectBusinessInfoList(dto);
// } /**
// * 分页查询项目列表
// /** */
// * 查询项目速览 // @PreAuthorize("@ss.hasPermi('system:business:list')")
// */ @GetMapping("/list")
//// @PreAuthorize("@ss.hasPermi('system:business:query')") public TableDataInfo<BusinessListVo> list(BusinessListDto dto, PageQuery pageQuery)
// @GetMapping("/browse/{businessId}") {
// public AjaxResult browse(@PathVariable("businessId") Integer businessId) return businessInfoService.selectBusinessInfoList(dto, pageQuery);
// { }
// return success(businessInfoService.browse(businessId));
// } /**
// * 查询项目速览
// /** */
// * 获取项目建设内容 // @PreAuthorize("@ss.hasPermi('system:business:query')")
// */ @GetMapping("/browse/{businessId}")
//// @PreAuthorize("@ss.hasPermi('system:business:query')") public R<BusinessBrowseVo> browse(@PathVariable("businessId") Integer businessId)
// @GetMapping(value = "/construction/{id}") {
// public AjaxResult getConstruction(@PathVariable("id") Integer id) return R.ok(businessInfoService.browse(businessId));
// { }
// return success(businessInfoService.getConstruction(id));
// } /**
// * 获取项目建设内容
// /** */
// * 删除项目列表 // @PreAuthorize("@ss.hasPermi('system:business:query')")
// */ @GetMapping(value = "/construction/{id}")
//// @PreAuthorize("@ss.hasPermi('system:business:remove')") public R<BusinessInfo> getConstruction(@PathVariable("id") Integer id)
//// @Log(title = "项目管理", businessType = BusinessType.DELETE) {
// @DeleteMapping("/remove/{ids}") return R.ok(businessInfoService.getConstruction(id));
// public AjaxResult remove(@PathVariable(value = "ids",required=false) Long[] ids) }
// {
// return toAjax(businessInfoService.deleteBusinessInfoByIds(ids)); /**
// } * 删除项目列表
// */
//// /** // @PreAuthorize("@ss.hasPermi('system:business:remove')")
//// * 新增项目详情 // @Log(title = "项目管理", businessType = BusinessType.DELETE)
//// */ @DeleteMapping("/remove/{ids}")
////// @PreAuthorize("@ss.hasPermi('system:business:add')")Z public R<Void> remove(@PathVariable(value = "ids",required=false) Long[] ids)
////// @Log(title = "项目管理", businessType = BusinessType.INSERT) {
//// @PostMapping("/add") return toAjax(businessInfoService.deleteBusinessInfoByIds(ids));
//// public AjaxResult add(@RequestBody BusinessAddDto dto) }
//// {
//// return businessInfoService.insertBusinessInfo(dto); /**
//// } * 新增项目详情
//// */
//// /** // @PreAuthorize("@ss.hasPermi('system:business:add')")Z
//// * 修改项目详情 // @Log(title = "项目管理", businessType = BusinessType.INSERT)
//// */ @PostMapping("/add")
////// @PreAuthorize("@ss.hasPermi('system:business:edit')") public R<Void> add(@RequestBody BusinessAddDto dto)
////// @Log(title = "项目管理", businessType = BusinessType.UPDATE) {
//// @PostMapping("/edit") return toAjax(businessInfoService.insertBusinessInfo(dto));
//// public AjaxResult edit(@RequestBody BusinessInfo businessInfo) }
//// {
//// return toAjax(businessInfoService.updateBusinessInfo(businessInfo)); /**
//// } * 修改项目详情
// */
//// /** // @PreAuthorize("@ss.hasPermi('system:business:edit')")
//// * 获取项目详情详细信息 // @Log(title = "项目管理", businessType = BusinessType.UPDATE)
//// */ @PostMapping("/edit")
//// @PreAuthorize("@ss.hasPermi('system:info:query')") public R<Void> edit(@RequestBody BusinessInfo businessInfo)
//// @GetMapping(value = "/{id}") {
//// public AjaxResult getInfo(@PathVariable("id") Integer id) return toAjax(businessInfoService.updateBusinessInfo(businessInfo));
//// { }
//// return success(businessInfoService.selectBusinessInfoById(id));
//// } }
//
//// /**
//// * 导出项目详情列表
//// */
//// @PreAuthorize("@ss.hasPermi('system:info:export')")
//// @Log(title = "项目详情", businessType = BusinessType.EXPORT)
//// @PostMapping("/export")
//// public void export(HttpServletResponse response, BusinessInfo businessInfo)
//// {
//// List<BusinessInfo> list = businessInfoService.selectBusinessInfoList(businessInfo);
//// ExcelUtil<BusinessInfo> util = new ExcelUtil<BusinessInfo>(BusinessInfo.class);
//// util.exportExcel(response, list, "项目详情数据");
//// }
//
//}
package com.dsk.biz.controller;
import com.dsk.biz.domain.BusinessLabel;
import com.dsk.biz.domain.bo.BusinessIdDto;
import com.dsk.biz.service.IBusinessLabelService;
import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.core.domain.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 项目标签Controller
*
* @author lxl
* @date 2023-05-17
*/
@RestController
@RequestMapping("/business/label")
public class BusinessLabelController extends BaseController
{
@Autowired
private IBusinessLabelService businessLabelService;
/**
* 新增项目标签
*/
// @PreAuthorize("@ss.hasPermi('system:label:add')")
// @Log(title = "项目标签", businessType = BusinessType.INSERT)
@PostMapping("/add")
public R<Void> add(@RequestBody BusinessLabel businessLabel)
{
return toAjax(businessLabelService.insertBusinessLabel(businessLabel));
}
/**
* 删除项目标签
*/
// @PreAuthorize("@ss.hasPermi('system:label:remove')")
// @Log(title = "项目标签", businessType = BusinessType.DELETE)
@PostMapping("/remove")
public R<Void> remove(@RequestBody BusinessIdDto dto)
{
return toAjax(businessLabelService.deleteBusinessLabelById(dto));
}
}
package com.dsk.biz.controller;
import com.dsk.biz.domain.bo.BusinessSearchDto;
import com.dsk.biz.service.IBusinessOverviewService;
import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.helper.LoginHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* 项目概览
*
* @author lcl
* @create 2023/8/14
*/
@RestController
@RequestMapping("/business/overview")
public class BusinessOverviewController extends BaseController {
@Autowired
private IBusinessOverviewService baseService;
/**
* 项目状态统计
*/
@GetMapping("/status/statistics")
public AjaxResult statusStatistics() {
return AjaxResult.success(baseService.statusStatistics(new BusinessSearchDto(LoginHelper.getUserId())));
}
/**
* 项目资金分析
*/
@GetMapping("/amount/analyze")
public AjaxResult amountAnalyze() {
return AjaxResult.success(baseService.amountAnalyze(new BusinessSearchDto(LoginHelper.getUserId(), 0)));
}
/**
* 项目类型分析
*/
@GetMapping("/type/analyze/{status}")
public AjaxResult typeAnalyze(@PathVariable Integer status) {
return AjaxResult.success(baseService.typeAnalyze(new BusinessSearchDto(LoginHelper.getUserId(), status)));
}
/**
* 项目类别分析
*/
@GetMapping("/category/analyze/{status}")
public AjaxResult categoryAnalyze(@PathVariable Integer status) {
return AjaxResult.success(baseService.categoryAnalyze(new BusinessSearchDto(LoginHelper.getUserId(), status)));
}
/**
* 公招项目地区统计
*
* @return
*/
@RequestMapping("/countGroupByProvince")
public AjaxResult countGroupByProvince(@RequestBody Map<String,Object> object) {
return baseService.countGroupByProvince(object);
}
/**
* 公招项目投资金额统计
*
* @return
*/
@RequestMapping("/rangByMoney")
public AjaxResult rangByMoney(@RequestBody Map<String,Object> object) {
return baseService.rangByMoney(object);
}
}
package com.dsk.biz.controller;
import com.dsk.biz.domain.BusinessRelateCompany;
import com.dsk.biz.domain.bo.BusinessIdDto;
import com.dsk.biz.service.IBusinessRelateCompanyService;
import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.domain.R;
import com.dsk.common.core.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 项目相关企业Controller
*
* @author lxl
* @date 2023-05-17
*/
@RestController
@RequestMapping("/business/company")
public class BusinessRelateCompanyController extends BaseController
{
@Autowired
private IBusinessRelateCompanyService businessRelateCompanyService;
/**
* 查询相关企业角色
*/
@PostMapping("/role/list")
public R<List<String>> companyRoleList(@RequestBody BusinessIdDto dto){
return R.ok(businessRelateCompanyService.companyRoleList(dto));
}
/**
* 查询项目相关企业列表
*/
// @PreAuthorize("@ss.hasPermi('system:company:list')")
@GetMapping("/list")
public TableDataInfo<BusinessRelateCompany> list(BusinessRelateCompany bo, PageQuery pageQuery)
{
return businessRelateCompanyService.selectBusinessRelateCompanyList(bo, pageQuery);
}
/**
* 新增项目关联单位
*/
// @PreAuthorize("@ss.hasPermi('system:company:add')")
// @Log(title = "项目关联单位", businessType = BusinessType.INSERT)
@PostMapping("/add")
public R<Void> add(@RequestBody BusinessRelateCompany businessRelateCompany)
{
return toAjax(businessRelateCompanyService.insertBusinessRelateCompany(businessRelateCompany));
}
/**
* 修改项目关联单位
*/
// @PreAuthorize("@ss.hasPermi('system:company:edit')")
// @Log(title = "项目关联单位", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
public R<Void> edit(@RequestBody BusinessRelateCompany businessRelateCompany)
{
return toAjax(businessRelateCompanyService.updateBusinessRelateCompany(businessRelateCompany));
}
/**
* 删除项目关联单位
*/
// @PreAuthorize("@ss.hasPermi('system:company:remove')")
// @Log(title = "项目关联单位", businessType = BusinessType.DELETE)
@DeleteMapping("/remove/{ids}")
public R<Void> remove(@PathVariable Long[] ids)
{
return toAjax(businessRelateCompanyService.deleteBusinessRelateCompanyByIds(ids));
}
// /**
// * 导出项目关联单位列表
// */
// @PreAuthorize("@ss.hasPermi('system:company:export')")
// @Log(title = "项目关联单位", businessType = BusinessType.EXPORT)
// @PostMapping("/export")
// public void export(HttpServletResponse response, BusinessRelateCompany businessRelateCompany)
// {
// List<BusinessRelateCompany> list = businessRelateCompanyService.selectBusinessRelateCompanyList(businessRelateCompany);
// ExcelUtil<BusinessRelateCompany> util = new ExcelUtil<BusinessRelateCompany>(BusinessRelateCompany.class);
// util.exportExcel(response, list, "项目关联单位数据");
// }
// /**
// * 获取项目关联单位详细信息
// */
// @PreAuthorize("@ss.hasPermi('system:company:query')")
// @GetMapping(value = "/{id}")
// public AjaxResult getInfo(@PathVariable("id") Long id)
// {
// return success(businessRelateCompanyService.selectBusinessRelateCompanyById(id));
// }
}
package com.dsk.biz.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
/**
* 项目工作待办对象 business_backlog
*
* @author lxl
* @date 2023-05-17
*/
@Data
public class BusinessBacklog
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Integer id;
/** 项目id */
private Integer businessId;
/** 关联客户 */
private String target;
/** 待办工作内容 */
private String task;
/** 完成时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date finishTime;
/** 完成时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date dueTime;
/** 状态(2已完成,1进行中,0逾期) */
private Integer state;
private Date createTime;
private Date updateTime;
}
package com.dsk.biz.domain;
import com.dsk.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
/**
* 项目跟进记录对象 business_follow_record
*
* @author lxl
* @date 2023-05-17
*/
@Data
public class BusinessFollowRecord extends BaseEntity
{
private static final long serialVersionUID = 1L;
/**
* 项目名称
*/
private String projectName;
/**
* 业主单位
*/
private String ownerCompany;
/** $column.columnComment */
private Integer id;
/** 项目id */
private Integer businessId;
/** 用户id */
private Integer userId;
/** 用户昵称 */
private String nickName;
/** 拜访对象 */
private String visitPerson;
/** 职位 */
private String position;
/** 拜访时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
private Date visitTime;
/** 下次拜访时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
private Date nextVisitTime;
/** 记录内容 */
private String recordInfo;
/** 拜访方式 */
private String visitWay;
/** 创建时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
private Date creatTime;
}
package com.dsk.biz.domain;
import com.dsk.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 项目标签对象 business_label
*
* @author lxl
* @date 2023-05-17
*/
@Data
@NoArgsConstructor
public class BusinessLabel extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Integer id;
/** 项目id */
private Integer businessId;
/** 标签 */
private String label;
public BusinessLabel(Integer businessId) {
this.businessId = businessId;
}
}
package com.dsk.biz.domain;
import com.dsk.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 项目关联单位对象 business_relate_company
*
* @author lxl
* @date 2023-05-17
*/
@Data
@NoArgsConstructor
public class BusinessRelateCompany extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Integer id;
/** 项目id */
private Integer businessId;
/** 单位建设库id */
private Integer companyId;
/** 单位城投id */
private String companyUipId;
/** 单位名称 */
private String companyName;
/** 单位角色 */
private String companyRole;
/** 负责任人 */
private String responsiblePerson;
/** 负责人电话 */
private String phone;
/** 对接深度/竞争力度 */
private String depth;
/** 是否业主单位 0:否 1:是 */
private Integer isProprietor;
private String remark;
}
package com.dsk.biz.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dsk.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
/**
* 项目用户关联对象 business_user
*
* @author lxl
* @date 2023-05-17
*/
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("business_user")
public class BusinessUser extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
@TableId(value = "id",type = IdType.INPUT)
private Integer id;
/** 项目id(business_info表id) */
private Integer businessId;
/** 部门id */
private Long deptId;
/** 用户id */
private Long userId;
/** 是否创建人(1 是,0 否) */
private Integer isFounder;
public BusinessUser(Integer businessId, Long deptId, Long userId, Integer isFounder) {
this.businessId = businessId;
this.deptId = deptId;
this.userId = userId;
this.isFounder = isFounder;
}
}
package com.dsk.biz.domain.bo;
import lombok.Data;
/**
* @author lxl
* @Description:
* @Date 2023/5/19 下午 5:58
**/
@Data
public class BusinessAddDto {
/**
* 项目名称
*/
private String projectName;
/**
* 用户id
*/
private Long userId;
/**
* 项目类型
*/
private String projectType;
/**
* 项目类别
*/
private String projectCategory;
/**
* 投资估算
*/
private Double investmentAmount;
/**
* 项目阶段
*/
private String projectStage;
/**
* 项目状态(0.储备中1.跟进中2.已合作)
*/
private Integer status;
/**
* 业主单位
*/
private String ownerCompany;
/**
* 单位id
*/
private Integer companyId;
/**
* 可见范围
*/
private Integer isPrivate;
/**
* 客户id
*/
private String customerId;
}
package com.dsk.biz.domain.bo;
import com.dsk.common.core.domain.BaseEntity;
import lombok.Data;
import java.util.Date;
/**
* 项目工作待办对象 business_backlog
*
* @author lxl
* @date 2023-05-17
*/
@Data
public class BusinessBacklogListDto extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 项目id */
private Integer businessId;
/** 状态 (0进行中 1已完成 2逾期) */
private Integer state;
private Date startTime;
private Date endTime;
}
package com.dsk.biz.domain.bo;
import lombok.Data;
/**
* @author lxl
* @Description:
* @Date 2023/6/1 下午 6:41
**/
@Data
public class BusinessExcelDto {
/**
* 项目名称
*/
private String projectName;
/**
* 投资估算(万元)
*/
private String investmentAmount;
/**
* 业主单位
*/
private String ownerCompany;
}
package com.dsk.biz.domain.bo;
import lombok.Data;
/**
* @author lxl
* @Description:
* @Date 2023/5/13 下午 3:58
**/
@Data
public class BusinessIdDto {
/**
* 项目id
*/
private Integer businessId;
/**
* 项目标签id
*/
private Integer labelId;
/**
* 项目标签名称
*/
private String label;
/**
* 文件路径
*/
private String filePath;
/**
* 文件搜索关键字
*/
private String keyword;
}
package com.dsk.biz.domain.bo;
import com.dsk.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @author lcl
* @create 2023/8/14
*/
@Data
@NoArgsConstructor
public class BusinessSearchDto extends BaseEntity implements Serializable {
/**
* 用户id
*/
private Long userId;
/**
* 状态
*/
private Integer status;
public BusinessSearchDto(Long userId) {
this.userId = userId;
}
public BusinessSearchDto(Long userId, Integer status) {
this.userId = userId;
this.status = status;
}
}
package com.dsk.biz.domain.vo;
import lombok.Data;
import java.io.Serializable;
/**
* 项目金额分析
*
* @author lcl
* @create 2023/8/15
*/
@Data
public class BusinessAnalyzeVo implements Serializable {
/**
* 项目类型
*/
private String projectType;
/**
* 项目类别
*/
private String projectCategory;
/**
* 资金来源
*/
private String amountSource;
/**
* 项目数量
*/
private Integer businessCount;
/**
* 总投资金额
*/
private Double totalAmount;
}
package com.dsk.biz.domain.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
/**
* 项目工作待办对象 business_backlog
*
* @author lxl
* @date 2023-05-17
*/
@Data
public class BusinessBacklogListVo {
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Integer id;
/** 项目id */
private Integer businessId;
/** 关联客户 */
private String target;
/** 待办工作内容 */
private String task;
/** 完成时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date finishTime;
/** 完成时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date dueTime;
/** 状态(2已完成,1进行中,0逾期) */
private Integer state;
}
package com.dsk.biz.domain.vo;
import lombok.Data;
/**
* @author lxl
* @Description:
* @Date 2023/5/22 下午 5:19
**/
@Data
public class BusinessBrowseVo {
/**
* 项目名称
*/
private String projectName;
/**
* 0 仅自己可见,1 他人可见
*/
private Integer isPrivate;
/**
* 项目类型
*/
private String projectType;
/**
* 项目类别
*/
private String projectCategory;
/**
* 项目状态(0.储备中1.跟进中2.已合作)
*/
private Integer status;
/**
* 投资估算
*/
private Double investmentAmount;
/**
* 省
*/
private String provinceName;
/**
* 市
*/
private String cityName;
/**
* 区
*/
private String districtName;
/**
* 省id
*/
private Integer provinceId;
/**
* 市id
*/
private Integer cityId;
/**
* 区id
*/
private Integer districtId;
/**
* 商务团队
*/
private String team;
/**
* 项目阶段
*/
private String projectStage;
/**
* 项目级别
*/
private String projectLevel;
/**
* 项目标签
*/
private String labelList;
/** 建设单位 */
private String constructionUnit;
/** 建设单位负责人 */
private String constructionPrincipal;
/** 建设单位联系电话 */
private String constructionPhone;
/** 主管单位 */
private String supervisorUnit;
/** 主管单位负责人 */
private String supervisorPrincipal;
/** 主管单位联系电话 */
private String supervisorPhone;
/**
* 联系人统计
*/
private Integer contactsCount;
/**
* 跟进记录统计
*/
private Integer followRecordCount;
/**
* 工作待办统计
*/
private Integer backlogCount;
/**
* 相关企业统计
*/
private Integer relateCompanyCount;
/**
* 资料文档统计
*/
private Integer fileCount;
/**
* 是否创建人(1 是,0 否)
*/
private Integer isFounder;
}
package com.dsk.biz.domain.vo;
import lombok.Data;
/**
* @author lxl
* @Description:
* @Date 2023/6/7 上午 11:05
**/
@Data
public class BusinessFileVo {
private String filePath;
private String creatTime;
public BusinessFileVo(String filePath, String creatTime) {
this.filePath = filePath;
this.creatTime = creatTime == null ? "" : creatTime;
}
}
package com.dsk.biz.domain.vo;
import lombok.Data;
/**
* @author lxl
* @Description:
* @Date 2023/6/27 下午 2:51
**/
@Data
public class BusinessLabelVo {
//主键
private Integer id;
//标签
private String label;
}
package com.dsk.biz.domain.vo;
import lombok.Data;
/**
* @author lcl
* @create 2023/7/27
*/
@Data
public class BusinessLikeProjectNameListVo {
private String projectName;
private String companyName;
/** 总投金额(万元) */
private Double investmentAmount;
/** 项目级别 */
private String projectLevel;
/** 项目阶段 */
private String projectStage;
/** 项目类型 */
private String projectType;
/** 项目类别 */
private String projectCategory;
/** 项目状态(0.储备中1.跟进中2.已合作) */
private Integer status;
}
package com.dsk.biz.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dsk.biz.domain.BusinessBacklog;
import com.dsk.biz.domain.bo.BusinessBacklogListDto;
import com.dsk.biz.domain.vo.BusinessBacklogListVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 项目工作待办Mapper接口
*
* @author lxl
* @date 2023-05-17
*/
public interface BusinessBacklogMapper
{
/**
* 查询项目工作待办
*
* @param id 项目工作待办主键
* @return 项目工作待办
*/
public BusinessBacklog selectBusinessBacklogById(Integer id);
/**
* 查询项目工作待办列表
*/
public Page<BusinessBacklogListVo> selectBusinessBacklogList(IPage<BusinessBacklogListDto> page, @Param("dto") BusinessBacklogListDto dto);
/**
* 新增项目工作待办
*
* @param businessBacklog 项目工作待办
* @return 结果
*/
public int insertBusinessBacklog(BusinessBacklog businessBacklog);
/**
* 修改项目工作待办
*
* @param businessBacklog 项目工作待办
* @return 结果
*/
public int updateBusinessBacklog(BusinessBacklog businessBacklog);
/**
* 删除项目工作待办
*
* @param id 项目工作待办主键
* @return 结果
*/
public int deleteBusinessBacklogById(Long id);
/**
* 批量删除项目工作待办
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteBusinessBacklogByIds(Long[] ids);
Integer overdueCount(Integer businessId);
}
package com.dsk.biz.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dsk.biz.domain.BusinessFollowRecord;
import com.dsk.biz.domain.bo.BusinessIdDto;
import com.dsk.biz.domain.bo.BusinessListDto;
import com.dsk.biz.domain.vo.BusinessListVo;
import com.dsk.common.annotation.DataColumn;
import com.dsk.common.annotation.DataPermission;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 项目跟进记录Mapper接口
*
* @author lxl
* @date 2023-05-17
*/
public interface BusinessFollowRecordMapper
{
/**
* 查询关联项目
* @param userId
* @return
*/
List<BusinessListVo> selectRelateProject(Integer userId);
/**
* 查询关联业主企业
* @param userId
* @return
*/
List<String> selectRelateCompany(Integer userId);
/**
* 查询项目跟进记录
*
* @param id 项目跟进记录主键
* @return 项目跟进记录
*/
public BusinessFollowRecord selectBusinessFollowRecordById(Long id);
/**
* 分页查询项目跟进记录列表
*
* @param businessFollowRecord 项目跟进记录
* @return 项目跟进记录集合
*/
public List<BusinessFollowRecord> businessFollowRecordPaging(BusinessFollowRecord businessFollowRecord);
/**
* 根据项目id查询项目跟进记录
*
* @param dto 项目id
* @return 项目跟进记录集合
*/
public Page<BusinessFollowRecord> selectBusinessFollowRecordList(IPage<BusinessIdDto> page,@Param("dto") BusinessIdDto dto);
/**
* 新增项目跟进记录
*
* @param businessFollowRecord 项目跟进记录
* @return 结果
*/
public int insertBusinessFollowRecord(BusinessFollowRecord businessFollowRecord);
/**
* 修改项目跟进记录
*
* @param businessFollowRecord 项目跟进记录
* @return 结果
*/
public int updateBusinessFollowRecord(BusinessFollowRecord businessFollowRecord);
/**
* 删除项目跟进记录
*
* @param id 项目跟进记录主键
* @return 结果
*/
public int deleteBusinessFollowRecordById(Long id);
/**
* 批量删除项目跟进记录
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteBusinessFollowRecordByIds(Long[] ids);
/**
* 分页查询跟进动态
*
* @param dto
* @return
*/
@DataPermission({
@DataColumn(key = "deptName", value = "d.dept_id"),
@DataColumn(key = "userName", value = "u.user_id")
})
Page<BusinessFollowRecord> allFollow(IPage<BusinessListDto> page, @Param("dto") BusinessListDto dto);
}
...@@ -5,9 +5,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -5,9 +5,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dsk.biz.domain.BusinessInfo; import com.dsk.biz.domain.BusinessInfo;
import com.dsk.biz.domain.bo.BusinessListDto; import com.dsk.biz.domain.bo.BusinessListDto;
import com.dsk.biz.domain.bo.BusinessSearchDto;
import com.dsk.biz.domain.bo.CustomerBusinessSearchDto; import com.dsk.biz.domain.bo.CustomerBusinessSearchDto;
import com.dsk.biz.domain.vo.BusinessListVo; import com.dsk.biz.domain.vo.*;
import com.dsk.biz.domain.vo.CustomerBusinessListVo;
import com.dsk.common.annotation.DataColumn; import com.dsk.common.annotation.DataColumn;
import com.dsk.common.annotation.DataPermission; import com.dsk.common.annotation.DataPermission;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
...@@ -23,28 +23,28 @@ import java.util.List; ...@@ -23,28 +23,28 @@ import java.util.List;
*/ */
@Mapper @Mapper
public interface BusinessInfoMapper extends BaseMapper<BusinessInfo> { public interface BusinessInfoMapper extends BaseMapper<BusinessInfo> {
// /** /**
// * 查询项目详情 * 查询项目详情
// * *
// * @param id 项目详情主键 * @param id 项目详情主键
// * @return 项目详情 * @return 项目详情
// */ */
// public BusinessInfo selectBusinessInfoById(Integer id); public BusinessInfo selectBusinessInfoById(Integer id);
//
// /** /**
// * 查询项目建设内容 * 查询项目建设内容
// * *
// * @param id 项目详情主键 * @param id 项目详情主键
// * @return * @return
// */ */
// BusinessInfo getConstruction(Integer id); BusinessInfo getConstruction(Integer id);
//
// /** /**
// * 查询所有项目名称(支持模糊查询) * 查询所有项目名称(支持模糊查询)
// * *
// * @return * @return
// */ */
// List<BusinessLikeProjectNameListVo> selectProjectName(BusinessListDto dto); List<BusinessLikeProjectNameListVo> selectProjectName(BusinessListDto dto);
/** /**
* 查询项目详情列表 * 查询项目详情列表
...@@ -58,66 +58,68 @@ public interface BusinessInfoMapper extends BaseMapper<BusinessInfo> { ...@@ -58,66 +58,68 @@ public interface BusinessInfoMapper extends BaseMapper<BusinessInfo> {
}) })
public Page<BusinessListVo> selectBusinessInfoList(@Param("page") Page<BusinessListVo> page,@Param("dto") BusinessListDto dto); public Page<BusinessListVo> selectBusinessInfoList(@Param("page") Page<BusinessListVo> page,@Param("dto") BusinessListDto dto);
// /** /**
// * 新增项目详情 * 新增项目详情
// * *
// * @param businessInfo 项目详情 * @param businessInfo 项目详情
// * @return 结果 * @return 结果
// */ */
// public int insertBusinessInfo(BusinessInfo businessInfo); public int insertBusinessInfo(BusinessInfo businessInfo);
//
// /** /**
// * 修改项目详情 * 修改项目详情
// * *
// * @param businessInfo 项目详情 * @param businessInfo 项目详情
// * @return 结果 * @return 结果
// */ */
// public int updateBusinessInfo(BusinessInfo businessInfo); public int updateBusinessInfo(BusinessInfo businessInfo);
//
// /** /**
// * 删除项目详情 * 删除项目详情
// * *
// * @param id 项目详情主键 * @param id 项目详情主键
// * @return 结果 * @return 结果
// */ */
// public int deleteBusinessInfoById(Long id); public int deleteBusinessInfoById(Long id);
//
// /** /**
// * 批量删除项目 * 批量删除项目
// * 项目关联的其他所有表数据一并删除 * 项目关联的其他所有表数据一并删除
// * *
// * @param ids 需要删除的数据主键集合 * @param ids 需要删除的数据主键集合
// * @return 结果 * @return 结果
// */ */
// public int deleteBusinessInfoByIds(Long[] ids); public int deleteBusinessInfoByIds(Long[] ids);
//
// /** /**
// * 根据项目统计 * 根据项目统计
// * *
// * @param business * @param business
// * @return * @return
// */ */
// BusinessBrowseVo selectTotal(Integer business); BusinessBrowseVo selectTotal(Integer business);
//
// /** /**
// * 查询项目名称是否存在 * 查询项目名称是否存在
// * *
// * @param projectName * @param projectName
// * @param userId * @param userId
// * @return * @return
// */ */
// int isRepetitionProjectName(@Param("projectName") String projectName, int isRepetitionProjectName(@Param("projectName") String projectName,
// @Param("userId") Long userId, @Param("userId") Long userId,
// @Param("companyName") String companyName); @Param("companyName") String companyName);
//
// int selectCountByStatusAndCustomerId(@Param("status") Integer status, @Param("customerId") String customerId); int selectCountByStatusAndCustomerId(@Param("status") Integer status, @Param("customerId") String customerId);
//
Page<CustomerBusinessListVo> selectCustomerBusinessList(IPage<CustomerBusinessSearchDto> page,@Param("dto") CustomerBusinessSearchDto dto); Page<CustomerBusinessListVo> selectCustomerBusinessList(IPage<CustomerBusinessSearchDto> page,@Param("dto") CustomerBusinessSearchDto dto);
//
// int selectCountByStatus(BusinessSearchDto dto); int selectCountByStatus(BusinessSearchDto dto);
//
// List<BusinessAnalyzeVo> selectAmountAnalyze(BusinessSearchDto dto); List<BusinessAnalyzeVo> selectAmountAnalyze(BusinessSearchDto dto);
//
// List<BusinessAnalyzeVo> selectTypeAnalyze(BusinessSearchDto dto); List<BusinessAnalyzeVo> selectTypeAnalyze(BusinessSearchDto dto);
List<BusinessAnalyzeVo> selectCategoryAnalyze(BusinessSearchDto dto);
} }
package com.dsk.biz.mapper;
import com.dsk.biz.domain.BusinessLabel;
import com.dsk.biz.domain.bo.BusinessIdDto;
import java.util.List;
/**
* 项目标签Mapper接口
*
* @date 2023-05-17
*/
public interface BusinessLabelMapper
{
/**
* 查询项目标签
*
* @param id 项目标签主键
* @return 项目标签
*/
public BusinessLabel selectBusinessLabelById(Long id);
/**
* 查询项目标签列表
*
* @param businessLabel 项目标签
* @return 项目标签集合
*/
public List<BusinessLabel> selectBusinessLabelList(BusinessLabel businessLabel);
/**
* 新增项目标签
*
* @param businessLabel 项目标签
* @return 结果
*/
public int insertBusinessLabel(BusinessLabel businessLabel);
/**
* 修改项目标签
*
* @param businessLabel 项目标签
* @return 结果
*/
public int updateBusinessLabel(BusinessLabel businessLabel);
/**
* 删除项目标签
*
* @param dto 项目主键
* @return 结果
*/
public int deleteBusinessLabelById(BusinessIdDto dto);
/**
* 批量删除项目标签
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteBusinessLabelByIds(Long[] ids);
}
package com.dsk.biz.mapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dsk.biz.domain.BusinessRelateCompany;
import com.dsk.common.core.mapper.BaseMapperPlus;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 项目关联单位Mapper接口
*
* @author lxl
* @date 2023-05-17
*/
public interface BusinessRelateCompanyMapper extends BaseMapperPlus<BusinessRelateCompany,BusinessRelateCompany,BusinessRelateCompany>
{
/**
* 查询项目关联单位
*
* @param id 项目关联单位主键
* @return 项目关联单位
*/
public BusinessRelateCompany selectBusinessRelateCompanyById(Long id);
/**
* 查询项目关联单位列表
*
* @param bo 项目关联单位
* @return 项目关联单位集合
*/
public Page<BusinessRelateCompany> selectBusinessRelateCompanyList(IPage<BusinessRelateCompany> page, @Param("bo") BusinessRelateCompany bo);
/**
* 新增项目关联单位
*
* @param businessRelateCompany 项目关联单位
* @return 结果
*/
public int insertBusinessRelateCompany(BusinessRelateCompany businessRelateCompany);
/**
* 修改项目关联单位
*
* @param businessRelateCompany 项目关联单位
* @return 结果
*/
public int updateBusinessRelateCompany(BusinessRelateCompany businessRelateCompany);
/**
* 删除项目关联单位
*
* @param id 项目关联单位主键
* @return 结果
*/
public int deleteBusinessRelateCompanyById(Long id);
/**
* 批量删除项目关联单位
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteBusinessRelateCompanyByIds(Long[] ids);
BusinessRelateCompany selectByProprietor(Integer id);
}
package com.dsk.biz.mapper;
import com.dsk.biz.domain.BusinessUser;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 项目用户关联Mapper接口
*
* @author lxl
* @date 2023-05-17
*/
public interface BusinessUserMapper
{
/**
* 查询项目用户关联
*
* @param id 项目用户关联主键
* @return 项目用户关联
*/
public BusinessUser selectBusinessUserById(Long id);
/**
* 查询项目用户关联列表
*
* @param businessUser 项目用户关联
* @return 项目用户关联集合
*/
public List<BusinessUser> selectBusinessUserList(BusinessUser businessUser);
/**
* 新增项目用户关联
*
* @param businessUser 项目用户关联
* @return 结果
*/
public int insertBusinessUser(BusinessUser businessUser);
/**
* 修改项目用户关联
*
* @param businessUser 项目用户关联
* @return 结果
*/
public int updateBusinessUser(BusinessUser businessUser);
/**
* 删除项目用户关联
*
* @param id 项目用户关联主键
* @return 结果
*/
public int deleteBusinessUserById(Long id);
/**
* 批量删除项目用户关联
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteBusinessUserByIds(Long[] ids);
/**
* 根据项目id查询项目的创建人
* @param businessId
* @return
*/
String selectCreatorByBusinessId(Integer businessId);
/**
* 查询是否为项目的创建人
* @param businessId
* @return
*/
Integer selectFounder(@Param("businessId") Integer businessId, @Param("userId") Long userId);
}
package com.dsk.biz.service;
import com.dsk.biz.domain.BusinessBacklog;
import com.dsk.biz.domain.bo.BusinessBacklogListDto;
import com.dsk.biz.domain.vo.BusinessBacklogListVo;
import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.page.TableDataInfo;
/**
* 项目工作待办Service接口
*
* @author llx
* @date 2023-05-17
*/
public interface IBusinessBacklogService
{
/**
* 查询项目工作待办
*
* @param id 项目工作待办主键
* @return 项目工作待办
*/
public BusinessBacklog selectBusinessBacklogById(Integer id);
/**
* 查询项目工作待办列表
*/
public TableDataInfo<BusinessBacklogListVo> selectBusinessBacklogList(BusinessBacklogListDto dto, PageQuery pageQuery);
/**
* 新增项目工作待办
*
* @param businessBacklog 项目工作待办
* @return 结果
*/
public int insertBusinessBacklog(BusinessBacklog businessBacklog);
/**
* 修改项目工作待办
*
* @param businessBacklog 项目工作待办
* @return 结果
*/
public int updateBusinessBacklog(BusinessBacklog businessBacklog);
/**
* 批量删除项目工作待办
*
* @param ids 需要删除的项目工作待办主键集合
* @return 结果
*/
public int deleteBusinessBacklogByIds(Long[] ids);
/**
* 删除项目工作待办信息
*
* @param id 项目工作待办主键
* @return 结果
*/
public int deleteBusinessBacklogById(Long id);
Integer overdueCount(Integer businessId);
}
package com.dsk.biz.service;
import com.dsk.biz.domain.BusinessFollowRecord;
import com.dsk.biz.domain.bo.BusinessIdDto;
import com.dsk.biz.domain.bo.BusinessListDto;
import com.dsk.biz.domain.vo.BusinessListVo;
import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.page.TableDataInfo;
import java.util.List;
/**
* 项目跟进记录Service接口
*
* @author lxl
* @date 2023-05-17
*/
public interface IBusinessFollowRecordService
{
/**
* 查询项目跟进记录
*
* @param id 项目跟进记录主键
* @return 项目跟进记录
*/
public BusinessFollowRecord selectBusinessFollowRecordById(Long id);
/**
* 根据项目id查询项目跟进记录
*
* @param dto 项目跟进记录
* @return 项目跟进记录集合
*/
public TableDataInfo<BusinessFollowRecord> selectBusinessFollowRecordList(BusinessIdDto dto, PageQuery pageQuery);
/**
* 分页查询跟进动态
*
* @param dto
* @return
*/
TableDataInfo<BusinessFollowRecord> allFollow(BusinessListDto dto, PageQuery pageQuery);
/**
* 分页查询项目跟进记录列表
*
* @param businessFollowRecord 项目跟进记录
* @return 项目跟进记录集合
*/
public List<BusinessFollowRecord> businessFollowRecordPaging(BusinessFollowRecord businessFollowRecord);
/**
* 新增项目跟进记录
*
* @param businessFollowRecord 项目跟进记录
* @return 结果
*/
public int insertBusinessFollowRecord(BusinessFollowRecord businessFollowRecord);
/**
* 查询关联项目
* @param userId
* @return
*/
List<BusinessListVo> selectRelateProject(Integer userId);
/**
* 查询关联业主企业
* @param userId
* @return
*/
List<String> selectRelateCompany(Integer userId);
/**
* 修改项目跟进记录
*
* @param businessFollowRecord 项目跟进记录
* @return 结果
*/
public int updateBusinessFollowRecord(BusinessFollowRecord businessFollowRecord);
/**
* 批量删除项目跟进记录
*
* @param ids 需要删除的项目跟进记录主键集合
* @return 结果
*/
public int deleteBusinessFollowRecordByIds(Long[] ids);
/**
* 删除项目跟进记录信息
*
* @param id 项目跟进记录主键
* @return 结果
*/
public int deleteBusinessFollowRecordById(Long id);
}
package com.dsk.biz.service; package com.dsk.biz.service;
import com.dsk.biz.domain.BusinessInfo;
import com.dsk.biz.domain.bo.BusinessAddDto;
import com.dsk.biz.domain.bo.BusinessListDto; import com.dsk.biz.domain.bo.BusinessListDto;
import com.dsk.biz.domain.bo.CustomerBusinessSearchDto; import com.dsk.biz.domain.bo.CustomerBusinessSearchDto;
import com.dsk.biz.domain.vo.BusinessBrowseVo;
import com.dsk.biz.domain.vo.BusinessLikeProjectNameListVo;
import com.dsk.biz.domain.vo.BusinessListVo; import com.dsk.biz.domain.vo.BusinessListVo;
import com.dsk.biz.domain.vo.CustomerBusinessListVo; import com.dsk.biz.domain.vo.CustomerBusinessListVo;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.core.domain.PageQuery; import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.page.TableDataInfo; import com.dsk.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
...@@ -17,21 +22,21 @@ import java.util.List; ...@@ -17,21 +22,21 @@ import java.util.List;
*/ */
public interface IBusinessInfoService public interface IBusinessInfoService
{ {
// /** /**
// * 查询项目详情 * 查询项目详情
// * *
// * @param id 项目详情主键 * @param id 项目详情主键
// * @return 项目详情 * @return 项目详情
// */ */
// public BusinessInfo selectBusinessInfoById(Integer id); public BusinessInfo selectBusinessInfoById(Integer id);
// /** /**
// * 查询项目建设内容 * 查询项目建设内容
// * *
// * @param id 项目详情主键 * @param id 项目详情主键
// * @return * @return
// */ */
// BusinessInfo getConstruction(Integer id); BusinessInfo getConstruction(Integer id);
/** /**
* 查询项目详情列表 * 查询项目详情列表
...@@ -41,58 +46,58 @@ public interface IBusinessInfoService ...@@ -41,58 +46,58 @@ public interface IBusinessInfoService
*/ */
public TableDataInfo<BusinessListVo> selectBusinessInfoList(BusinessListDto dto, PageQuery pageQuery); public TableDataInfo<BusinessListVo> selectBusinessInfoList(BusinessListDto dto, PageQuery pageQuery);
// /** /**
// * 查询项目速览 * 查询项目速览
// * @param businessId * @param businessId
// * @return * @return
// */ */
// BusinessBrowseVo browse(Integer businessId); BusinessBrowseVo browse(Integer businessId);
//
// /** /**
// * 查询所有项目名称(支持模糊查询) * 查询所有项目名称(支持模糊查询)
// * @return * @return
// */ */
// List<BusinessLikeProjectNameListVo> selectProjectName(BusinessListDto dto); List<BusinessLikeProjectNameListVo> selectProjectName(BusinessListDto dto);
/**
* 项目批量导入
*/
AjaxResult batchUpload(MultipartFile file);
/**
* 新增项目详情
*
* @param dto 项目详情
* @return 结果
*/
public boolean insertBusinessInfo(BusinessAddDto dto);
/**
* 修改项目详情
*
* @param businessInfo 项目详情
* @return 结果
*/
public int updateBusinessInfo(BusinessInfo businessInfo);
/**
* 批量删除项目详情
*
* @param ids 需要删除的项目详情主键集合
* @return 结果
*/
public int deleteBusinessInfoByIds(Long[] ids);
/**
* 删除项目详情信息
*
* @param id 项目详情主键
* @return 结果
*/
public int deleteBusinessInfoById(Long id);
int selectCountByStatusAndCustomerId(Integer status,String customerId);
// /**
// * 项目批量导入
// */
// AjaxResult batchUpload(MultipartFile file);
//
// /**
// * 新增项目详情
// *
// * @param dto 项目详情
// * @return 结果
// */
// public AjaxResult insertBusinessInfo(BusinessAddDto dto);
//
// /**
// * 修改项目详情
// *
// * @param businessInfo 项目详情
// * @return 结果
// */
// public int updateBusinessInfo(BusinessInfo businessInfo);
//
// /**
// * 批量删除项目详情
// *
// * @param ids 需要删除的项目详情主键集合
// * @return 结果
// */
// public int deleteBusinessInfoByIds(Long[] ids);
//
// /**
// * 删除项目详情信息
// *
// * @param id 项目详情主键
// * @return 结果
// */
// public int deleteBusinessInfoById(Long id);
//
// int selectCountByStatusAndCustomerId(Integer status,String customerId);
//
TableDataInfo<CustomerBusinessListVo> selectCustomerBusinessList(CustomerBusinessSearchDto dto, PageQuery pageQuery); TableDataInfo<CustomerBusinessListVo> selectCustomerBusinessList(CustomerBusinessSearchDto dto, PageQuery pageQuery);
} }
package com.dsk.biz.service;
import com.dsk.biz.domain.BusinessLabel;
import com.dsk.biz.domain.bo.BusinessIdDto;
import java.util.List;
/**
* 项目标签Service接口
*
* @date 2023-05-17
*/
public interface IBusinessLabelService
{
/**
* 查询项目标签
*
* @param id 项目标签主键
* @return 项目标签
*/
public BusinessLabel selectBusinessLabelById(Long id);
/**
* 查询项目标签列表
*
* @param businessLabel 项目标签
* @return 项目标签集合
*/
public List<BusinessLabel> selectBusinessLabelList(BusinessLabel businessLabel);
/**
* 新增项目标签
*
* @param businessLabel 项目标签
* @return 结果
*/
public int insertBusinessLabel(BusinessLabel businessLabel);
/**
* 修改项目标签
*
* @param businessLabel 项目标签
* @return 结果
*/
public int updateBusinessLabel(BusinessLabel businessLabel);
/**
* 批量删除项目标签
*
* @param ids 需要删除的项目标签主键集合
* @return 结果
*/
public int deleteBusinessLabelByIds(Long[] ids);
/**
* 删除项目标签信息
*
* @param dto 项目主键
* @return 结果
*/
public int deleteBusinessLabelById(BusinessIdDto dto);
}
package com.dsk.biz.service;
import com.dsk.biz.domain.bo.BusinessSearchDto;
import com.dsk.biz.domain.vo.BusinessAnalyzeVo;
import com.dsk.common.core.domain.AjaxResult;
import java.util.List;
import java.util.Map;
/**
* @author lcl
* @create 2023/8/14
*/
public interface IBusinessOverviewService {
Map<String, Object> statusStatistics(BusinessSearchDto dto);
List<BusinessAnalyzeVo> amountAnalyze(BusinessSearchDto dto);
List<BusinessAnalyzeVo> typeAnalyze(BusinessSearchDto dto);
List<BusinessAnalyzeVo> categoryAnalyze(BusinessSearchDto dto);
AjaxResult countGroupByProvince(Map<String,Object> object);
AjaxResult rangByMoney(Map<String,Object> object);
}
package com.dsk.biz.service;
import com.dsk.biz.domain.BusinessRelateCompany;
import com.dsk.biz.domain.bo.BusinessIdDto;
import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.page.TableDataInfo;
import java.util.List;
/**
* 项目关联单位Service接口
*
* @author lxl
* @date 2023-05-17
*/
public interface IBusinessRelateCompanyService
{
/**
* 查询项目关联单位
*
* @param id 项目关联单位主键
* @return 项目关联单位
*/
public BusinessRelateCompany selectBusinessRelateCompanyById(Long id);
/**
* 查询项目关联单位列表
*
* @param bo 项目关联单位
* @return 项目关联单位集合
*/
public TableDataInfo<BusinessRelateCompany> selectBusinessRelateCompanyList(BusinessRelateCompany bo, PageQuery pageQuery);
/**
* 新增项目关联单位
*
* @param businessRelateCompany 项目关联单位
* @return 结果
*/
public int insertBusinessRelateCompany(BusinessRelateCompany businessRelateCompany);
/**
* 修改项目关联单位
*
* @param businessRelateCompany 项目关联单位
* @return 结果
*/
public int updateBusinessRelateCompany(BusinessRelateCompany businessRelateCompany);
/**
* 批量删除项目关联单位
*
* @param ids 需要删除的项目关联单位主键集合
* @return 结果
*/
public int deleteBusinessRelateCompanyByIds(Long[] ids);
/**
* 删除项目关联单位信息
*
* @param id 项目关联单位主键
* @return 结果
*/
public int deleteBusinessRelateCompanyById(Long id);
/**
* 查询关联单位角色
*/
List<String> companyRoleList(BusinessIdDto dto);
}
package com.dsk.biz.service.impl;
import cn.hutool.core.bean.BeanException;
import cn.hutool.core.util.ObjectUtil;
import com.dsk.biz.domain.BusinessBacklog;
import com.dsk.biz.domain.bo.BusinessBacklogListDto;
import com.dsk.biz.domain.vo.BusinessBacklogListVo;
import com.dsk.biz.mapper.BusinessBacklogMapper;
import com.dsk.biz.service.IBusinessBacklogService;
import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.page.TableDataInfo;
import com.dsk.common.exception.base.BaseException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
/**
* 项目工作待办Service业务层处理
*
* @author lxl
* @date 2023-05-17
*/
@Service
@Slf4j
public class BusinessBacklogServiceImpl implements IBusinessBacklogService {
@Resource
private BusinessBacklogMapper businessBacklogMapper;
/**
* 查询项目工作待办
*
* @param id 项目工作待办主键
* @return 项目工作待办
*/
@Override
public BusinessBacklog selectBusinessBacklogById(Integer id) {
return businessBacklogMapper.selectBusinessBacklogById(id);
}
/**
* 查询项目工作待办列表
*
* @param dto 项目工作待办
* @return 项目工作待办
*/
@Override
public TableDataInfo<BusinessBacklogListVo> selectBusinessBacklogList(BusinessBacklogListDto dto, PageQuery pageQuery) {
if (ObjectUtil.isEmpty(dto.getBusinessId())) {
throw new BeanException("项目id不能为空!");
}
if (ObjectUtil.isEmpty(dto.getState())) {
throw new BeanException("工作代办状态不能为空!");
}
switch (dto.getState()) {
case 0:
dto.setStartTime(new Date());
break;
case 1:
break;
case 2:
dto.setState(0);
dto.setEndTime(new Date());
break;
default:
throw new BeanException("工作代办状态参数错误!");
}
return TableDataInfo.build(businessBacklogMapper.selectBusinessBacklogList(pageQuery.build(), dto));
}
/**
* 新增项目工作待办
*
* @param businessBacklog 项目工作待办
* @return 结果
*/
@Override
@Transactional
public int insertBusinessBacklog(BusinessBacklog businessBacklog) {
if (ObjectUtil.isNotEmpty(businessBacklog.getDueTime())) {
if (businessBacklog.getDueTime().before(new Date())) throw new BaseException("到期时间必须大于当前时间");
}
return businessBacklogMapper.insertBusinessBacklog(businessBacklog);
}
/**
* 修改项目工作待办
*
* @param businessBacklog 项目工作待办
* @return 结果
*/
@Override
@Transactional
public int updateBusinessBacklog(BusinessBacklog businessBacklog) {
if (ObjectUtil.isEmpty(businessBacklog.getId())) {
throw new BeanException("id不能为空!");
}
if (ObjectUtil.isEmpty(businessBacklog.getState())) {
throw new BeanException("状态不能为空!");
}
switch (businessBacklog.getState()) {
case 0:
businessBacklog.setFinishTime(null);
break;
case 1:
businessBacklog.setFinishTime(new Date());
break;
default:
throw new BeanException("状态参数错误!");
}
return businessBacklogMapper.updateBusinessBacklog(businessBacklog);
}
/**
* 批量删除项目工作待办
*
* @param ids 需要删除的项目工作待办主键
* @return 结果
*/
@Override
public int deleteBusinessBacklogByIds(Long[] ids) {
return businessBacklogMapper.deleteBusinessBacklogByIds(ids);
}
/**
* 删除项目工作待办信息
*
* @param id 项目工作待办主键
* @return 结果
*/
@Override
public int deleteBusinessBacklogById(Long id) {
return businessBacklogMapper.deleteBusinessBacklogById(id);
}
@Override
public Integer overdueCount(Integer businessId) {
return businessBacklogMapper.overdueCount(businessId);
}
}
package com.dsk.biz.service.impl;
import com.dsk.biz.domain.BusinessFollowRecord;
import com.dsk.biz.domain.bo.BusinessIdDto;
import com.dsk.biz.domain.bo.BusinessListDto;
import com.dsk.biz.domain.vo.BusinessListVo;
import com.dsk.biz.mapper.BusinessFollowRecordMapper;
import com.dsk.biz.service.IBusinessFollowRecordService;
import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.page.TableDataInfo;
import com.dsk.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
/**
* 项目跟进记录Service业务层处理
*
* @author lxl
* @date 2023-05-17
*/
@Service
public class BusinessFollowRecordServiceImpl implements IBusinessFollowRecordService
{
@Resource
private BusinessFollowRecordMapper businessFollowRecordMapper;
/**
* 查询项目跟进记录
*
* @param id 项目跟进记录主键
* @return 项目跟进记录
*/
@Override
public BusinessFollowRecord selectBusinessFollowRecordById(Long id)
{
return businessFollowRecordMapper.selectBusinessFollowRecordById(id);
}
@Override
public TableDataInfo<BusinessFollowRecord> selectBusinessFollowRecordList(BusinessIdDto dto, PageQuery pageQuery)
{
return TableDataInfo.build(businessFollowRecordMapper.selectBusinessFollowRecordList(pageQuery.build(),dto));
}
@Override
// @DataScope(userAlias = "u",deptAlias = "d")
public TableDataInfo<BusinessFollowRecord> allFollow(BusinessListDto dto, PageQuery pageQuery) {
//userId不传值,就查询全部
// if (dto.getUserId() == null) {
// Long deptId = SecurityUtils.getLoginUser().getDeptId();
// if (deptId == null) throw new BaseException("请登录");
// dto.setDeptId(deptId.intValue());
// }
return TableDataInfo.build(businessFollowRecordMapper.allFollow(pageQuery.build(),dto));
}
@Override
public List<BusinessFollowRecord> businessFollowRecordPaging(BusinessFollowRecord businessFollowRecord) {
return businessFollowRecordMapper.businessFollowRecordPaging(businessFollowRecord);
}
/**
* 新增项目跟进记录
*
* @param businessFollowRecord 项目跟进记录
* @return 结果
*/
@Override
@Transactional
public int insertBusinessFollowRecord(BusinessFollowRecord businessFollowRecord)
{
return businessFollowRecordMapper.insertBusinessFollowRecord(businessFollowRecord);
}
@Override
public List<BusinessListVo> selectRelateProject(Integer userId) {
return businessFollowRecordMapper.selectRelateProject(userId);
}
@Override
public List<String> selectRelateCompany(Integer userId) {
return businessFollowRecordMapper.selectRelateCompany(userId);
}
/**
* 修改项目跟进记录
*
* @param businessFollowRecord 项目跟进记录
* @return 结果
*/
@Override
public int updateBusinessFollowRecord(BusinessFollowRecord businessFollowRecord)
{
businessFollowRecord.setUpdateTime(DateUtils.getNowDate());
return businessFollowRecordMapper.updateBusinessFollowRecord(businessFollowRecord);
}
/**
* 批量删除项目跟进记录
*
* @param ids 需要删除的项目跟进记录主键
* @return 结果
*/
@Override
@Transactional
public int deleteBusinessFollowRecordByIds(Long[] ids)
{
return businessFollowRecordMapper.deleteBusinessFollowRecordByIds(ids);
}
/**
* 删除项目跟进记录信息
*
* @param id 项目跟进记录主键
* @return 结果
*/
@Override
public int deleteBusinessFollowRecordById(Long id)
{
return businessFollowRecordMapper.deleteBusinessFollowRecordById(id);
}
}
package com.dsk.biz.service.impl;
import com.dsk.biz.domain.BusinessLabel;
import com.dsk.biz.domain.bo.BusinessIdDto;
import com.dsk.biz.mapper.BusinessLabelMapper;
import com.dsk.biz.service.IBusinessLabelService;
import com.dsk.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
/**
* 项目标签Service业务层处理
*
* @date 2023-05-17
*/
@Service
public class BusinessLabelServiceImpl implements IBusinessLabelService
{
@Resource
private BusinessLabelMapper businessLabelMapper;
/**
* 查询项目标签
*
* @param id 项目标签主键
* @return 项目标签
*/
@Override
public BusinessLabel selectBusinessLabelById(Long id)
{
return businessLabelMapper.selectBusinessLabelById(id);
}
/**
* 查询项目标签列表
*
* @param businessLabel 项目标签
* @return 项目标签
*/
@Override
public List<BusinessLabel> selectBusinessLabelList(BusinessLabel businessLabel)
{
return businessLabelMapper.selectBusinessLabelList(businessLabel);
}
/**
* 新增项目标签
*
* @param businessLabel 项目标签
* @return 结果
*/
@Override
@Transactional
public int insertBusinessLabel(BusinessLabel businessLabel)
{
businessLabel.setCreateTime(DateUtils.getNowDate());
return businessLabelMapper.insertBusinessLabel(businessLabel);
}
/**
* 修改项目标签
*
* @param businessLabel 项目标签
* @return 结果
*/
@Override
public int updateBusinessLabel(BusinessLabel businessLabel)
{
businessLabel.setUpdateTime(DateUtils.getNowDate());
return businessLabelMapper.updateBusinessLabel(businessLabel);
}
/**
* 批量删除项目标签
*
* @param ids 需要删除的项目标签主键
* @return 结果
*/
@Override
public int deleteBusinessLabelByIds(Long[] ids)
{
return businessLabelMapper.deleteBusinessLabelByIds(ids);
}
/**
* 删除项目标签信息
*
* @param dto 项目主键
* @return 结果
*/
@Override
@Transactional
public int deleteBusinessLabelById(BusinessIdDto dto)
{
return businessLabelMapper.deleteBusinessLabelById(dto);
}
}
package com.dsk.biz.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.dsk.biz.domain.bo.BusinessSearchDto;
import com.dsk.biz.domain.vo.BusinessAnalyzeVo;
import com.dsk.biz.mapper.BusinessInfoMapper;
import com.dsk.biz.service.IBusinessOverviewService;
import com.dsk.common.annotation.DataColumn;
import com.dsk.common.annotation.DataPermission;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.utils.DskOpenApiUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author lcl
* @create 2023/8/14
*/
@Service
public class BusinessOverviewServiceImpl implements IBusinessOverviewService {
@Resource
private BusinessInfoMapper businessInfoMapper;
@Autowired
private DskOpenApiUtil dskOpenApiUtil;
@Override
@DataPermission({
@DataColumn(key = "deptName", value = "d.dept_id"),
@DataColumn(key = "userName", value = "u.user_id")
})
public Map<String, Object> statusStatistics(BusinessSearchDto dto) {
Map<String, Object> resultMap = new HashMap<>();
//总
resultMap.put("totalCount",businessInfoMapper.selectCountByStatus(dto));
//储备
dto.setStatus(0);
resultMap.put("reserveCount",businessInfoMapper.selectCountByStatus(dto));
//跟进
dto.setStatus(1);
resultMap.put("followUpCount",businessInfoMapper.selectCountByStatus(dto));
//中标(已合作)
dto.setStatus(2);
resultMap.put("bidCount",businessInfoMapper.selectCountByStatus(dto));
return resultMap;
}
@Override
@DataPermission({
@DataColumn(key = "deptName", value = "d.dept_id"),
@DataColumn(key = "userName", value = "u.user_id")
})
public List<BusinessAnalyzeVo> amountAnalyze(BusinessSearchDto dto) {
return businessInfoMapper.selectAmountAnalyze(dto);
}
@Override
@DataPermission({
@DataColumn(key = "deptName", value = "d.dept_id"),
@DataColumn(key = "userName", value = "u.user_id")
})
public List<BusinessAnalyzeVo> typeAnalyze(BusinessSearchDto dto) {
return businessInfoMapper.selectTypeAnalyze(dto);
}
@Override
@DataPermission({
@DataColumn(key = "deptName", value = "d.dept_id"),
@DataColumn(key = "userName", value = "u.user_id")
})
public List<BusinessAnalyzeVo> categoryAnalyze(BusinessSearchDto dto) {
return businessInfoMapper.selectCategoryAnalyze(dto);
}
@Override
public AjaxResult countGroupByProvince(Map<String,Object> object) {
Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/marketAnalysis/project/countGroupByProvince", object);
return BeanUtil.toBean(map, AjaxResult.class);
}
@Override
public AjaxResult rangByMoney(Map<String,Object> object) {
Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/marketAnalysis/project/rangByMoney", object);
return BeanUtil.toBean(map, AjaxResult.class);
}
}
package com.dsk.biz.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.dsk.biz.domain.BusinessRelateCompany;
import com.dsk.biz.domain.bo.BusinessIdDto;
import com.dsk.biz.dskService.EnterpriseService;
import com.dsk.biz.mapper.BusinessRelateCompanyMapper;
import com.dsk.biz.service.IBusinessRelateCompanyService;
import com.dsk.common.core.domain.PageQuery;
import com.dsk.common.core.page.TableDataInfo;
import com.dsk.common.exception.base.BaseException;
import com.dsk.common.utils.CheckUtils;
import org.apache.commons.collections4.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* 项目关联单位Service业务层处理
*
* @author lxl
* @date 2023-05-17
*/
@Service
public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyService {
@Resource
private BusinessRelateCompanyMapper businessRelateCompanyMapper;
@Autowired
private EnterpriseService enterpriseService;
/**
* 查询项目关联单位
*
* @param id 项目关联单位主键
* @return 项目关联单位
*/
@Override
public BusinessRelateCompany selectBusinessRelateCompanyById(Long id) {
return businessRelateCompanyMapper.selectBusinessRelateCompanyById(id);
}
/**
* 查询项目关联单位列表
*
* @param bo 项目关联单位
* @return 项目关联单位
*/
@Override
public TableDataInfo<BusinessRelateCompany> selectBusinessRelateCompanyList(BusinessRelateCompany bo, PageQuery pageQuery) {
return TableDataInfo.build(businessRelateCompanyMapper.selectBusinessRelateCompanyList(pageQuery.build(), bo));
}
/**
* 新增项目关联单位
*
* @param businessRelateCompany 项目关联单位
* @return 结果
*/
@Override
@Transactional
public int insertBusinessRelateCompany(BusinessRelateCompany businessRelateCompany) {
if (ObjectUtil.isNotEmpty(businessRelateCompany.getPhone()) && !CheckUtils.isPhone(businessRelateCompany.getPhone())) {
throw new BaseException("500", "请输入正确的电话号码");
}
//查询企业的城投id和建设库id
Map<String, Object> map = enterpriseService.getCidAndUipIdByCompanyName(businessRelateCompany.getCompanyName());
businessRelateCompany.setCompanyUipId(MapUtils.getString(map, "uipId", null));
businessRelateCompany.setCompanyId(MapUtils.getInteger(map, "companyId", null));
return businessRelateCompanyMapper.insertBusinessRelateCompany(businessRelateCompany);
}
/**
* 修改项目关联单位
*
* @param businessRelateCompany 项目关联单位
* @return 结果
*/
@Override
@Transactional
public int updateBusinessRelateCompany(BusinessRelateCompany businessRelateCompany) {
if (ObjectUtil.isNotEmpty(businessRelateCompany.getPhone()) && !CheckUtils.isPhone(businessRelateCompany.getPhone())) {
throw new BaseException("500", "请输入正确的电话号码");
}
//查询企业的城投id和建设库id
Map<String, Object> map = enterpriseService.getCidAndUipIdByCompanyName(businessRelateCompany.getCompanyName());
businessRelateCompany.setCompanyUipId(MapUtils.getString(map, "uipId", null));
businessRelateCompany.setCompanyId(MapUtils.getInteger(map, "companyId", null));
return businessRelateCompanyMapper.updateBusinessRelateCompany(businessRelateCompany);
}
/**
* 批量删除项目关联单位
*
* @param ids 需要删除的项目关联单位主键
* @return 结果
*/
@Override
public int deleteBusinessRelateCompanyByIds(Long[] ids) {
return businessRelateCompanyMapper.deleteBusinessRelateCompanyByIds(ids);
}
/**
* 删除项目关联单位信息
*
* @param id 项目关联单位主键
* @return 结果
*/
@Override
public int deleteBusinessRelateCompanyById(Long id) {
return businessRelateCompanyMapper.deleteBusinessRelateCompanyById(id);
}
@Override
public List<String> companyRoleList(BusinessIdDto dto) {
List<BusinessRelateCompany> roleList = businessRelateCompanyMapper.selectList(Wrappers.<BusinessRelateCompany>lambdaQuery()
.select(BusinessRelateCompany::getCompanyRole)
.eq(BusinessRelateCompany::getBusinessId, dto.getBusinessId())
.groupBy(BusinessRelateCompany::getCompanyRole)
.orderByDesc(BusinessRelateCompany::getCreateTime));
return roleList.stream().map(p -> p.getCompanyRole()).collect(Collectors.toList());
}
}
package com.dsk.biz.service.impl;
import com.dsk.biz.domain.bo.BusinessExcelDto;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
/**
* @author lxl
* @Description:
* @Date 2023/6/1 下午 4:30
**/
@Slf4j
@Service
public class ReadBusinessInfoExcel {
// 总行数
private int totalRows = 0;
// 总条数
private int totalCells = 0;
public int getTotalRows() {
return totalRows;
}
public void setTotalRows(int totalRows) {
this.totalRows = totalRows;
}
public int getTotalCells() {
return totalCells;
}
public void setTotalCells(int totalCells) {
this.totalCells = totalCells;
}
/**
* 读EXCEL文件,获取信息集合
*
* @param mFile
* @return
*/
public List<BusinessExcelDto> getExcelInfo(MultipartFile mFile) {
String fileName = mFile.getOriginalFilename();// 获取文件名
try {
// 验证文件名是否合格
if (!validateExcel(fileName)) return null;
// 根据文件名判断文件是2003版本还是2007版本
boolean isExcel2003 = true;
if (isExcel2007(fileName)) isExcel2003 = false;
return createExcel(mFile.getInputStream(), isExcel2003);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
/**
* 根据excel里面的内容读取信息
*
* @param is 输入流
* @param isExcel2003 excel是2003还是2007版本
* @return
*/
public List<BusinessExcelDto> createExcel(InputStream is, boolean isExcel2003) {
try {
Workbook wb = null;
// 当excel是2003时,创建excel2003
if (isExcel2003) {
wb = new HSSFWorkbook(is);
} else {
// 当excel是2007时,创建excel2007
wb = new XSSFWorkbook(is);
}
return readExcelValue(wb);// 读取Excel里面客户的信息
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
/**
* 读取Excel内容
*
* @param wb
* @return
*/
private List<BusinessExcelDto> readExcelValue(Workbook wb) {
//得到第一个shell
Sheet sheet = wb.getSheetAt(0);
//得到Excel的行数
this.totalRows = sheet.getPhysicalNumberOfRows();
//得到Excel的列数(前提是有行数)
if (totalRows > 1 && sheet.getRow(0) != null) {
this.totalCells = sheet.getRow(0).getPhysicalNumberOfCells();
}
// List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
ArrayList<BusinessExcelDto> list = new ArrayList<>();
//循环Excel行数
//
for (int r = 3; r < totalRows; r++) {
Row row = sheet.getRow(r);
if (row == null) {
continue;
}
//循环Excel的列
// Map<String, Object> map = new HashMap<String, Object>();
BusinessExcelDto businessExcelDto = new BusinessExcelDto();
for (int c = 0; c < this.totalCells; c++) {
Cell cell = row.getCell(c);
if (null != cell) {
//项目名称
if (c == 0) {
//如果是纯数字,比如你写的是25,cell.getNumericCellValue()获得是25.0,通过截取字符串去掉.0获得25
if (cell.getCellType() == CellType.NUMERIC) {
String name = String.valueOf(cell.getNumericCellValue());
businessExcelDto.setProjectName(name.substring(0, name.length() - 2 > 0 ? name.length() - 2 : 1));
} else {
businessExcelDto.setProjectName(cell.getStringCellValue());
}
//业主单位
} else if (c == 1) {
if (cell.getCellType() == CellType.NUMERIC) {
String company = String.valueOf(cell.getNumericCellValue());
businessExcelDto.setOwnerCompany(company.substring(0, company.length() - 2 > 0 ? company.length() - 2 : 1));
} else {
businessExcelDto.setOwnerCompany(cell.getStringCellValue());
}
//投资估算(万元)
} else if (c == 2) {
if (cell.getCellType() == CellType.NUMERIC) {
String amount = String.valueOf(cell.getNumericCellValue());
// businessExcelDto.setInvestmentAmount(amount.substring(0, amount.length() - 2 > 0 ? amount.length() - 2 : 1));
businessExcelDto.setInvestmentAmount(amount);
} else {
businessExcelDto.setInvestmentAmount(cell.getStringCellValue());
}
}
}
}
//添加到list
list.add(businessExcelDto);
}
log.info("项目批量导入Excel数据,{}",list);
return list;
}
/**
* 验证EXCEL文件
* @param filePath
* @return
*/
public boolean validateExcel(String filePath) {
if (filePath == null || !(isExcel2003(filePath) || isExcel2007(filePath))) {
log.info("文件不是excel格式");
return false;
}
return true;
}
// @描述:是否是2003的excel,返回true是2003
public static boolean isExcel2003(String filePath) {
return filePath.matches("^.+\\.(?i)(xls)$");
}
// @描述:是否是2007的excel,返回true是2007
public static boolean isExcel2007(String filePath) {
return filePath.matches("^.+\\.(?i)(xlsx)$");
}
}
<?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.dsk.biz.mapper.BusinessBacklogMapper">
<resultMap type="com.dsk.biz.domain.BusinessBacklog" id="BusinessBacklogResult">
<result property="id" column="id"/>
<result property="businessId" column="business_id"/>
<result property="target" column="target"/>
<result property="task" column="task"/>
<result property="finishTime" column="finish_time"/>
<result property="state" column="state"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="selectBusinessBacklogVo">
select id,
business_id,
target,
task,
finish_time,
due_time,
if(due_time &lt; now() and state = 0, 2 ,state) state,
create_time,
update_time
from business_backlog
</sql>
<select id="selectBusinessBacklogList" parameterType="com.dsk.biz.domain.bo.BusinessBacklogListDto"
resultType="com.dsk.biz.domain.vo.BusinessBacklogListVo">
<include refid="selectBusinessBacklogVo"/>
where business_id = #{dto.businessId}
<if test="dto.state != null "> and state = #{dto.state} </if>
<if test="dto.startTime != null "> and(due_time &gt;= #{dto.startTime} or due_time is null) </if>
<if test="dto.endTime != null "> and due_time &lt;= #{dto.endTime} </if>
ORDER BY create_time DESC
</select>
<select id="selectBusinessBacklogById" resultMap="BusinessBacklogResult">
<include refid="selectBusinessBacklogVo"/>
where id = #{id}
</select>
<insert id="insertBusinessBacklog" parameterType="com.dsk.biz.domain.BusinessBacklog"
useGeneratedKeys="true" keyProperty="id">
insert into business_backlog
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="businessId != null">business_id,</if>
<if test="target != null">target,</if>
<if test="task != null">task,</if>
<if test="dueTime != null">due_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="businessId != null">#{businessId},</if>
<if test="target != null">#{target},</if>
<if test="task != null">#{task},</if>
<if test="dueTime != null">#{dueTime},</if>
</trim>
</insert>
<update id="updateBusinessBacklog" parameterType="com.dsk.biz.domain.BusinessBacklog">
update business_backlog set finish_time = #{finishTime}, state = #{state} where id = #{id}
</update>
<delete id="deleteBusinessBacklogById" parameterType="Long">
delete
from business_backlog
where id = #{id}
</delete>
<delete id="deleteBusinessBacklogByIds" parameterType="String">
delete from business_backlog where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="overdueCount" resultType="java.lang.Integer">
select count(id) from business_backlog where business_id = #{businessId} and due_time &lt; now() and state = 0
</select>
</mapper>
<?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.dsk.biz.mapper.BusinessFollowRecordMapper">
<resultMap type="com.dsk.biz.domain.BusinessFollowRecord" id="BusinessFollowRecordResult">
<result property="id" column="id"/>
<result property="businessId" column="business_id"/>
<result property="userId" column="user_id"/>
<result property="visitPerson" column="visit_person"/>
<result property="position" column="position"/>
<result property="visitTime" column="visit_time"/>
<result property="nextVisitTime" column="next_visit_time"/>
<result property="recordInfo" column="record_info"/>
<result property="visitWay" column="visit_way"/>
<result property="creatTime" column="creat_time"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="selectBusinessFollowRecordVo">
select id,
business_id,
user_id,
visit_person,
position,
visit_time,
next_visit_time,
record_info,
visit_way,
creat_time,
update_time
from business_follow_record
</sql>
<select id="selectBusinessFollowRecordList" resultType="com.dsk.biz.domain.BusinessFollowRecord">
select f.*,u.nick_name as nickName
from business_follow_record f
left join sys_user u on f.user_id = u.user_id
where f.business_id = #{dto.businessId}
ORDER BY f.creat_time DESC
</select>
<select id="selectBusinessFollowRecordById" parameterType="Long" resultMap="BusinessFollowRecordResult">
<include refid="selectBusinessFollowRecordVo"/>
where id = #{id}
</select>
<select id="businessFollowRecordPaging" resultType="com.dsk.biz.domain.BusinessFollowRecord">
<include refid="selectBusinessFollowRecordVo"></include>
<where>
<if test="businessId != null ">and f.business_id = #{businessId}</if>
<if test="userId != null ">and f.user_id = #{userId}</if>
<if test="visitPerson != null and visitPerson != ''">and f.visit_person = #{visitPerson}</if>
<if test="position != null and position != ''">and f.position = #{position}</if>
<if test="visitTime != null ">and f.visit_time = #{visitTime}</if>
<if test="nextVisitTime != null ">and f.next_visit_time = #{nextVisitTime}</if>
<if test="recordInfo != null and recordInfo != ''">and f.record_info = #{recordInfo}</if>
<if test="visitWay != null and visitWay != ''">and f.visit_way = #{visitWay}</if>
<if test="creatTime != null ">and f.creat_time = #{creatTime}</if>
</where>
ORDER BY creat_time DESC
</select>
<select id="allFollow" resultType="com.dsk.biz.domain.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
left join sys_dept d on u.dept_id = d.dept_id
<where>
<if test="dto.userId != null"> and (f.user_id = #{dto.userId} or i.is_private = 1)</if>
<if test="dto.startTime != null and dto.startTime != '' "> and f.visit_time &gt;= #{dto.startTime} </if>
<if test="dto.endTime != null and dto.endTime != '' "> and f.visit_time &lt;= #{dto.endTime} </if>
${dto.params.dataScope}
</where>
ORDER BY f.visit_time DESC
</select>
<select id="selectRelateProject" resultType="com.dsk.biz.domain.vo.BusinessListVo">
select i.id,i.project_name as projectName
from business_info i
left join business_user u on u.business_id = i.id
where u.user_id = #{userId}
</select>
<select id="selectRelateCompany" resultType="java.lang.String">
select i.construction_unit
from business_info i
left join business_user u on u.business_id = i.id
where u.user_id = #{userId}
</select>
<insert id="insertBusinessFollowRecord" parameterType="com.dsk.biz.domain.BusinessFollowRecord" useGeneratedKeys="true"
keyProperty="id">
insert into business_follow_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="businessId != null">business_id,</if>
<if test="userId != null">user_id,</if>
<if test="visitPerson != null and visitPerson != ''">visit_person,</if>
<if test="position != null and position != ''">position,</if>
<if test="visitTime != null">visit_time,</if>
<if test="nextVisitTime != null">next_visit_time,</if>
<if test="recordInfo != null">record_info,</if>
<if test="visitWay != null">visit_way,</if>
<if test="creatTime != null">creat_time,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="businessId != null">#{businessId},</if>
<if test="userId != null">#{userId},</if>
<if test="visitPerson != null and visitPerson != ''">#{visitPerson},</if>
<if test="position != null and position != ''">#{position},</if>
<if test="visitTime != null">#{visitTime},</if>
<if test="nextVisitTime != null">#{nextVisitTime},</if>
<if test="recordInfo != null">#{recordInfo},</if>
<if test="visitWay != null">#{visitWay},</if>
<if test="creatTime != null">#{creatTime},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateBusinessFollowRecord" parameterType="com.dsk.biz.domain.BusinessFollowRecord">
update business_follow_record
<trim prefix="SET" suffixOverrides=",">
<if test="businessId != null">business_id = #{businessId},</if>
<if test="userId != null">user_id = #{userId},</if>
<if test="visitPerson != null and visitPerson != ''">visit_person = #{visitPerson},</if>
<if test="position != null and position != ''">position = #{position},</if>
<if test="visitTime != null">visit_time = #{visitTime},</if>
<if test="nextVisitTime != null">next_visit_time = #{nextVisitTime},</if>
<if test="recordInfo != null">record_info = #{recordInfo},</if>
<if test="visitWay != null">visit_way = #{visitWay},</if>
<if test="creatTime != null">creat_time = #{creatTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBusinessFollowRecordById" parameterType="Long">
delete
from business_follow_record
where id = #{id}
</delete>
<delete id="deleteBusinessFollowRecordByIds" parameterType="String">
delete from business_follow_record where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
<?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.dsk.biz.mapper.BusinessLabelMapper">
<resultMap type="com.dsk.biz.domain.BusinessLabel" id="BusinessLabelResult">
<result property="id" column="id"/>
<result property="businessId" column="business_id"/>
<result property="label" column="label"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="selectBusinessLabelVo">
select id, business_id, label, create_time, update_time
from business_label
</sql>
<select id="selectBusinessLabelList" parameterType="com.dsk.biz.domain.BusinessLabel"
resultMap="BusinessLabelResult">
<include refid="selectBusinessLabelVo"/>
<where>
<if test="businessId != null ">and business_id = #{businessId}</if>
<if test="label != null and label != ''">and label = #{label}</if>
</where>
</select>
<select id="selectBusinessLabelById" parameterType="Long" resultMap="BusinessLabelResult">
<include refid="selectBusinessLabelVo"/>
where id = #{id}
</select>
<insert id="insertBusinessLabel" parameterType="com.dsk.biz.domain.BusinessLabel"
useGeneratedKeys="true" keyProperty="id">
insert into business_label
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="businessId != null">business_id,</if>
<if test="label != null">label,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="businessId != null">#{businessId},</if>
<if test="label != null">#{label},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateBusinessLabel" parameterType="com.dsk.biz.domain.BusinessLabel">
update business_label
<trim prefix="SET" suffixOverrides=",">
<if test="businessId != null">business_id = #{businessId},</if>
<if test="label != null">label = #{label},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteBusinessLabelById">
delete
from business_label
where id = #{labelId}
</delete>
<delete id="deleteBusinessLabelByIds" parameterType="String">
delete from business_label where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
<?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.dsk.biz.mapper.BusinessRelateCompanyMapper">
<resultMap type="com.dsk.biz.domain.BusinessRelateCompany" id="BusinessRelateCompanyResult">
<result property="id" column="id"/>
<result property="businessId" column="business_id"/>
<result property="companyId" column="company_id"/>
<result property="companyName" column="company_name"/>
<result property="companyRole" column="company_role"/>
<result property="responsiblePerson" column="responsible_person"/>
<result property="phone" column="phone"/>
<result property="isProprietor" column="is_proprietor"/>
<result property="remark" column="remark"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<result property="depth" column="depth"/>
<result property="companyUipId" column="company_uip_id"/>
</resultMap>
<sql id="selectBusinessRelateCompanyVo">
select id,
business_id,
company_id,
company_name,
company_role,
responsible_person,
phone,
depth,
is_proprietor,
remark,
create_time,
update_time,
company_uip_id
from business_relate_company
</sql>
<select id="selectBusinessRelateCompanyList" parameterType="com.dsk.biz.domain.BusinessRelateCompany"
resultMap="BusinessRelateCompanyResult">
<include refid="selectBusinessRelateCompanyVo"/>
<where>
<if test="bo.businessId != null ">and business_id = #{bo.businessId}</if>
<if test="bo.companyId != null ">and company_id = #{bo.companyId}</if>
<if test="bo.companyName != null and bo.companyName != ''">and company_name like concat('%', #{bo.companyName},
'%')
</if>
<if test="bo.companyRole != null and bo.companyRole != ''">and company_role = #{bo.companyRole}</if>
<if test="bo.depth != null and bo.depth != ''">and depth = #{bo.depth}</if>
<if test="bo.responsiblePerson != null and bo.responsiblePerson != ''">and responsible_person = #{bo.responsiblePerson} </if>
<if test="bo.phone != null and bo.phone != ''">and phone = #{bo.phone}</if>
</where>
</select>
<select id="selectBusinessRelateCompanyById" parameterType="Long" resultMap="BusinessRelateCompanyResult">
<include refid="selectBusinessRelateCompanyVo"/>
where id = #{id}
</select>
<insert id="insertBusinessRelateCompany" parameterType="com.dsk.biz.domain.BusinessRelateCompany" useGeneratedKeys="true"
keyProperty="id">
insert into business_relate_company
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="businessId != null">business_id,</if>
<if test="companyId != null">company_id,</if>
<if test="companyName != null">company_name,</if>
<if test="depth != null">depth,</if>
<if test="companyRole != null">company_role,</if>
<if test="responsiblePerson != null">responsible_person,</if>
<if test="phone != null">phone,</if>
<if test="isProprietor != null">is_proprietor,</if>
<if test="remark != null and remark != '' ">remark,</if>
<if test="companyUipId != null">company_uip_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="businessId != null">#{businessId},</if>
<if test="companyId != null">#{companyId},</if>
<if test="companyName != null">#{companyName},</if>
<if test="depth != null">#{depth},</if>
<if test="companyRole != null">#{companyRole},</if>
<if test="responsiblePerson != null">#{responsiblePerson},</if>
<if test="phone != null">#{phone},</if>
<if test="isProprietor != null">#{isProprietor},</if>
<if test="remark != null and remark != ''">#{remark},</if>
<if test="companyUipId != null">#{companyUipId},</if>
</trim>
</insert>
<update id="updateBusinessRelateCompany" parameterType="com.dsk.biz.domain.BusinessRelateCompany">
update business_relate_company
<set>
<if test="companyId != null">company_id = #{companyId},</if>
<if test="companyUipId != null">company_uip_id = #{companyUipId},</if>
<if test="companyName != null">company_name = #{companyName},</if>
<if test="depth != null">depth = #{depth},</if>
<if test="companyRole != null">company_role = #{companyRole},</if>
<if test="responsiblePerson != null">responsible_person = #{responsiblePerson},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="remark != null">remark = #{remark},</if>
</set>
where id = #{id}
</update>
<delete id="deleteBusinessRelateCompanyById" parameterType="Long">
delete
from business_relate_company
where id = #{id}
</delete>
<delete id="deleteBusinessRelateCompanyByIds" parameterType="String">
delete from business_relate_company where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectByProprietor" resultType="com.dsk.biz.domain.BusinessRelateCompany">
<include refid="selectBusinessRelateCompanyVo"/>
where business_id = #{businessId} and is_proprietor = 1
</select>
</mapper>
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<if test="dto.endTime != null and dto.endTime != '' "> and cfr.visit_time &lt;= #{dto.endTime} </if> <if test="dto.endTime != null and dto.endTime != '' "> and cfr.visit_time &lt;= #{dto.endTime} </if>
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
<if test="ew.getCustomSqlSegment != null and ew.getCustomSqlSegment != '' "> ${ew.getCustomSqlSegment}</if> <if test="ew.getCustomSqlSegment != null and ew.getCustomSqlSegment != '' "> ${ew.getCustomSqlSegment}</if>
<if test="params.dataScope != null and params.dataScope != '' "> ${params.dataScope}</if> <if test="dto.params.dataScope != null and params.dataScope != '' "> ${dto.params.dataScope}</if>
</where> </where>
order by cfr.visit_time desc order by cfr.visit_time desc
</select> </select>
......
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