Commit f35fee70 authored by lixiaolei's avatar lixiaolei

submit

parent 93f7d516
......@@ -42,7 +42,7 @@ public class BusinessBacklogController extends BaseController
private IBusinessBacklogService businessBacklogService;
/**
* 查询项目工作待办列表
* 分页查询项目工作待办列表
*/
// @PreAuthorize("@ss.hasPermi('system:backlog:list')")
@GetMapping("/list")
......
......@@ -36,7 +36,7 @@ public class BusinessContactsController extends BaseController
private IBusinessContactsService businessContactsService;
/**
* 查询项目联系人列表
* 分页查询项目联系人列表
*/
// @PreAuthorize("@ss.hasPermi('system:contacts:list')")
@GetMapping("/list")
......
......@@ -36,15 +36,13 @@ public class BusinessFollowRecordController extends BaseController
private IBusinessFollowRecordService businessFollowRecordService;
/**
* 查询项目跟进记录列表
* 根据项目id查询项目跟进记录
*/
// @PreAuthorize("@ss.hasPermi('system:record:list')")
@GetMapping("/list")
public TableDataInfo list(BusinessFollowRecord businessFollowRecord)
@GetMapping("/list/{businessId}")
public AjaxResult list(@PathVariable Integer businessId)
{
startPage();
List<BusinessFollowRecord> list = businessFollowRecordService.selectBusinessFollowRecordList(businessFollowRecord);
return getDataTable(list);
return success(businessFollowRecordService.selectBusinessFollowRecordList(businessId));
}
/**
......@@ -58,6 +56,18 @@ public class BusinessFollowRecordController extends BaseController
return toAjax(businessFollowRecordService.insertBusinessFollowRecord(businessFollowRecord));
}
/**
* 分页查询项目跟进记录
*/
// @PreAuthorize("@ss.hasPermi('system:record:list')")
// @GetMapping("/list")
// public TableDataInfo list(BusinessFollowRecord businessFollowRecord)
// {
// startPage();
// List<BusinessFollowRecord> list = businessFollowRecordService.selectBusinessFollowRecordList(businessFollowRecord);
// return getDataTable(list);
// }
// /**
// * 导出项目跟进记录列表
// */
......
......@@ -6,6 +6,7 @@ import com.dsk.common.core.domain.entity.BusinessInfo;
import com.dsk.common.dtos.BusinessInfoDto;
import com.dsk.system.domain.BusinessAddDto;
import com.dsk.system.domain.BusinessListDto;
import com.dsk.system.domain.vo.BusinessBrowseVo;
import com.dsk.system.domain.vo.BusinessListVo;
import com.dsk.system.service.IBusinessInfoService;
import org.springframework.security.access.prepost.PreAuthorize;
......@@ -37,7 +38,7 @@ public class BusinessInfoController extends BaseController
// @PreAuthorize("@ss.hasPermi('system:info:list')")
@PostMapping("/query/project")
public AjaxResult queryprojectName(@RequestBody BusinessListDto dto){
return AjaxResult.success(businessInfoService.queryprojectName(dto));
return AjaxResult.success(businessInfoService.selectProjectName(dto));
}
/**
......@@ -53,12 +54,32 @@ public class BusinessInfoController extends BaseController
}
/**
* 删除项目详情
* 查询项目速览
*/
// @PreAuthorize("@ss.hasPermi('system:info:list')")
@GetMapping("/browse/{businessId}")
public AjaxResult browse(@PathVariable Integer id)
{
return success(businessInfoService.browse(id));
}
/**
* 获取项目建设内容
*/
// @PreAuthorize("@ss.hasPermi('system:info:query')")
@GetMapping(value = "/construction/{id}")
public AjaxResult getConstruction(@PathVariable("id") Integer id)
{
return success(businessInfoService.getConstruction(id));
}
/**
* 删除项目列表
*/
// @PreAuthorize("@ss.hasPermi('system:info:remove')")
// @Log(title = "项目详情", businessType = BusinessType.DELETE)
@DeleteMapping("/remove/{ids}")
public AjaxResult remove(@RequestParam(value = "ids",required=false) Long[] ids)
public AjaxResult remove(@PathVariable(value = "ids",required=false) Long[] ids)
{
return toAjax(businessInfoService.deleteBusinessInfoByIds(ids));
}
......@@ -77,14 +98,24 @@ public class BusinessInfoController extends BaseController
/**
* 修改项目详情
*/
@PreAuthorize("@ss.hasPermi('system:info:edit')")
@Log(title = "项目详情", businessType = BusinessType.UPDATE)
// @PreAuthorize("@ss.hasPermi('system:info:edit')")
// @Log(title = "项目详情", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
public AjaxResult edit(@RequestBody BusinessInfo businessInfo)
{
return toAjax(businessInfoService.updateBusinessInfo(businessInfo));
}
// /**
// * 获取项目详情详细信息
// */
// @PreAuthorize("@ss.hasPermi('system:info:query')")
// @GetMapping(value = "/{id}")
// public AjaxResult getInfo(@PathVariable("id") Integer id)
// {
// return success(businessInfoService.selectBusinessInfoById(id));
// }
// /**
// * 导出项目详情列表
// */
......@@ -97,14 +128,5 @@ public class BusinessInfoController extends BaseController
// ExcelUtil<BusinessInfo> util = new ExcelUtil<BusinessInfo>(BusinessInfo.class);
// util.exportExcel(response, list, "项目详情数据");
// }
//
// /**
// * 获取项目详情详细信息
// */
// @PreAuthorize("@ss.hasPermi('system:info:query')")
// @GetMapping(value = "/{id}")
// public AjaxResult getInfo(@PathVariable("id") Long id)
// {
// return success(businessInfoService.selectBusinessInfoById(id));
// }
}
......@@ -67,6 +67,17 @@ public class BusinessRelateCompanyController extends BaseController
return toAjax(businessRelateCompanyService.insertBusinessRelateCompany(businessRelateCompany));
}
/**
* 修改项目关联单位
*/
// @PreAuthorize("@ss.hasPermi('system:company:edit')")
// @Log(title = "项目关联单位", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
public AjaxResult edit(@RequestBody BusinessRelateCompany businessRelateCompany)
{
return toAjax(businessRelateCompanyService.updateBusinessRelateCompany(businessRelateCompany));
}
// /**
// * 导出项目关联单位列表
// */
......@@ -90,17 +101,6 @@ public class BusinessRelateCompanyController extends BaseController
// return success(businessRelateCompanyService.selectBusinessRelateCompanyById(id));
// }
// /**
// * 修改项目关联单位
// */
// @PreAuthorize("@ss.hasPermi('system:company:edit')")
// @Log(title = "项目关联单位", businessType = BusinessType.UPDATE)
// @PutMapping
// public AjaxResult edit(@RequestBody BusinessRelateCompany businessRelateCompany)
// {
// return toAjax(businessRelateCompanyService.updateBusinessRelateCompany(businessRelateCompany));
// }
//
// /**
// * 删除项目关联单位
......
......@@ -3,11 +3,14 @@ package com.dsk.common.core.domain.entity;
import java.util.Date;
import com.dsk.common.core.domain.BaseEntity;
import com.dsk.common.utils.CheckUtils;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.dsk.common.annotation.Excel;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import javax.validation.constraints.Pattern;
/**
* 项目联系人对象 business_contacts
*
......
......@@ -33,30 +33,6 @@ public class BusinessFollowRecord extends BaseEntity
@Excel(name = "用户昵称")
private Integer userName;
public Integer getUserName() {
return userName;
}
public String getVisitPerson() {
return visitPerson;
}
public String getPosition() {
return position;
}
public void setUserName(Integer userName) {
this.userName = userName;
}
public void setVisitPerson(String visitPerson) {
this.visitPerson = visitPerson;
}
public void setPosition(String position) {
this.position = position;
}
/** 拜访对象 */
@Excel(name = "拜访对象")
private String visitPerson;
......@@ -88,6 +64,30 @@ public class BusinessFollowRecord extends BaseEntity
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date creatTime;
public Integer getUserName() {
return userName;
}
public String getVisitPerson() {
return visitPerson;
}
public String getPosition() {
return position;
}
public void setUserName(Integer userName) {
this.userName = userName;
}
public void setVisitPerson(String visitPerson) {
this.visitPerson = visitPerson;
}
public void setPosition(String position) {
this.position = position;
}
public void setId(Integer id)
{
this.id = id;
......
......@@ -31,12 +31,12 @@ public class BusinessInfo extends BaseEntity
@Excel(name = "项目名称")
private String projectName;
/** 总投金额 */
@Excel(name = "总投金额")
/** 总投金额(万元) */
@Excel(name = "总投金额(万元)")
private Double investmentAmount;
/** 资金来源(万元) */
@Excel(name = "资金来源(万元)")
/** 资金来源 */
@Excel(name = "资金来源")
private String amountSource;
/** 计划招标时间 */
......
......@@ -2,6 +2,8 @@ package com.dsk.common.core.domain.entity;
import com.dsk.common.annotation.Excel;
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;
......@@ -11,6 +13,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
* @author lxl
* @date 2023-05-17
*/
@Data
@NoArgsConstructor
public class BusinessLabel extends BaseEntity
{
private static final long serialVersionUID = 1L;
......@@ -26,34 +30,6 @@ public class BusinessLabel extends BaseEntity
@Excel(name = "标签")
private String label;
public void setId(Integer id)
{
this.id = id;
}
public Integer getId()
{
return id;
}
public void setBusinessId(Integer businessId)
{
this.businessId = businessId;
}
public Integer getBusinessId()
{
return businessId;
}
public void setLabel(String label)
{
this.label = label;
}
public String getLabel()
{
return label;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
......@@ -64,4 +40,8 @@ public class BusinessLabel extends BaseEntity
.append("updateTime", getUpdateTime())
.toString();
}
public BusinessLabel(Integer businessId) {
this.businessId = businessId;
}
}
......@@ -2,15 +2,22 @@ package com.dsk.common.core.domain.entity;
import com.dsk.common.annotation.Excel;
import com.dsk.common.core.domain.BaseEntity;
import com.dsk.common.utils.CheckUtils;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import javax.validation.constraints.Pattern;
/**
* 项目关联单位对象 business_relate_company
*
* @author lxl
* @date 2023-05-17
*/
@Data
@NoArgsConstructor
public class BusinessRelateCompany extends BaseEntity
{
private static final long serialVersionUID = 1L;
......@@ -46,78 +53,6 @@ public class BusinessRelateCompany extends BaseEntity
@Excel(name = "对接深度/竞争力度")
private String depth;
public String getDepth() {
return depth;
}
public void setDepth(String depth) {
this.depth = depth;
}
public void setId(Integer id)
{
this.id = id;
}
public Integer getId()
{
return id;
}
public void setBusinessId(Integer businessId)
{
this.businessId = businessId;
}
public Integer getBusinessId()
{
return businessId;
}
public void setCompanyId(Integer companyId)
{
this.companyId = companyId;
}
public Integer getCompanyId()
{
return companyId;
}
public void setCompanyName(String companyName)
{
this.companyName = companyName;
}
public String getCompanyName()
{
return companyName;
}
public void setCompanyRole(String companyRole)
{
this.companyRole = companyRole;
}
public String getCompanyRole()
{
return companyRole;
}
public void setResponsiblePerson(String responsiblePerson)
{
this.responsiblePerson = responsiblePerson;
}
public String getResponsiblePerson()
{
return responsiblePerson;
}
public void setPhone(String phone)
{
this.phone = phone;
}
public String getPhone()
{
return phone;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
......@@ -140,4 +75,8 @@ public class BusinessRelateCompany extends BaseEntity
this.companyName = companyName;
this.companyRole = companyRole;
}
public BusinessRelateCompany(Integer businessId) {
this.businessId = businessId;
}
}
package com.dsk.system.domain.vo;
import com.dsk.common.core.domain.entity.BusinessRelateCompany;
import lombok.Data;
import java.util.List;
/**
* @author lxl
* @Description:
......@@ -10,5 +13,90 @@ import lombok.Data;
@Data
public class BusinessBrowseVo {
/**
* 项目名称
*/
private String projectName;
/**
* 项目名称
*/
private Integer isPrivate;
/**
* 项目类型
*/
private String projectType;
/**
* 项目类别
*/
private String projectCategory;
/**
* 投资估算
*/
private Double investmentAmount;
/**
* 省
*/
private String provinceName;
/**
* 市
*/
private String cityName;
/**
* 区
*/
private String districtName;
/**
* 商务团队
*/
private String team;
/**
* 项目阶段
*/
private String projectStage;
/**
* 项目级别
*/
private String projectLevel;
/**
* 项目标签
*/
private List<String> labelList;
/**
* 关键企业
*/
private List<BusinessRelateCompany> relateCompany;
/**
* 联系人统计
*/
private Integer contactsCount;
/**
* 跟进记录统计
*/
private Integer followRecordCount;
/**
* 工作待办统计
*/
private Integer backlogCount;
/**
* 相关企业统计
*/
private Integer relateCompanyCount;
}
......@@ -21,12 +21,20 @@ public interface BusinessFollowRecordMapper
public BusinessFollowRecord selectBusinessFollowRecordById(Long id);
/**
* 查询项目跟进记录列表
* 分页查询项目跟进记录列表
*
* @param businessFollowRecord 项目跟进记录
* @return 项目跟进记录集合
*/
public List<BusinessFollowRecord> selectBusinessFollowRecordList(BusinessFollowRecord businessFollowRecord);
public List<BusinessFollowRecord> businessFollowRecordPaging(BusinessFollowRecord businessFollowRecord);
/**
* 根据项目id查询项目跟进记录
*
* @param businessId 项目id
* @return 项目跟进记录集合
*/
public List<BusinessFollowRecord> selectBusinessFollowRecordList(Integer businessId);
/**
* 新增项目跟进记录
......
......@@ -5,6 +5,7 @@ import com.dsk.common.core.domain.entity.BusinessInfo;
import com.dsk.system.domain.BusinessListDto;
import com.dsk.system.domain.customer.dto.CustomerBusinessSearchDto;
import com.dsk.system.domain.customer.vo.CustomerBusinessListVo;
import com.dsk.system.domain.vo.BusinessBrowseVo;
import com.dsk.system.domain.vo.BusinessListVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -26,13 +27,21 @@ public interface BusinessInfoMapper extends BaseMapper<BusinessInfo>
* @param id 项目详情主键
* @return 项目详情
*/
public BusinessInfo selectBusinessInfoById(Long id);
public BusinessInfo selectBusinessInfoById(Integer id);
/**
* 查询项目建设内容
*
* @param id 项目详情主键
* @return
*/
BusinessInfo getConstruction(Integer id);
/**
* 查询所有项目名称(支持模糊查询)
* @return
*/
List<String> queryprojectName(BusinessListDto dto);
List<String> selectProjectName(BusinessListDto dto);
/**
* 查询项目详情列表
......@@ -74,6 +83,15 @@ public interface BusinessInfoMapper extends BaseMapper<BusinessInfo>
*/
public int deleteBusinessInfoByIds(Long[] ids);
/**
* 根据项目统计
* @param business
* @return
*/
BusinessBrowseVo selectTotal(Integer business);
int selectCountByStatusAndCustomerId(@Param("status") Integer status,@Param("customerId") String customerId);
List<CustomerBusinessListVo> selectCustomerBusinessList(CustomerBusinessSearchDto dto);
......
......@@ -21,12 +21,20 @@ public interface IBusinessFollowRecordService
public BusinessFollowRecord selectBusinessFollowRecordById(Long id);
/**
* 查询项目跟进记录列表
* 根据项目id查询项目跟进记录
*
* @param businessId 项目跟进记录
* @return 项目跟进记录集合
*/
public List<BusinessFollowRecord> selectBusinessFollowRecordList(Integer businessId);
/**
* 分页查询项目跟进记录列表
*
* @param businessFollowRecord 项目跟进记录
* @return 项目跟进记录集合
*/
public List<BusinessFollowRecord> selectBusinessFollowRecordList(BusinessFollowRecord businessFollowRecord);
public List<BusinessFollowRecord> businessFollowRecordPaging(BusinessFollowRecord businessFollowRecord);
/**
* 新增项目跟进记录
......
......@@ -2,11 +2,11 @@ package com.dsk.system.service;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.core.domain.entity.BusinessInfo;
import com.dsk.common.dtos.BusinessInfoDto;
import com.dsk.system.domain.BusinessAddDto;
import com.dsk.system.domain.BusinessListDto;
import com.dsk.system.domain.customer.dto.CustomerBusinessSearchDto;
import com.dsk.system.domain.customer.vo.CustomerBusinessListVo;
import com.dsk.system.domain.vo.BusinessBrowseVo;
import com.dsk.system.domain.vo.BusinessListVo;
import java.util.List;
......@@ -25,7 +25,15 @@ public interface IBusinessInfoService
* @param id 项目详情主键
* @return 项目详情
*/
public BusinessInfo selectBusinessInfoById(Long id);
public BusinessInfo selectBusinessInfoById(Integer id);
/**
* 查询项目建设内容
*
* @param id 项目详情主键
* @return
*/
BusinessInfo getConstruction(Integer id);
/**
* 查询项目详情列表
......@@ -35,11 +43,18 @@ public interface IBusinessInfoService
*/
public List<BusinessListVo> selectBusinessInfoList(BusinessListDto dto);
/**
* 查询项目速览
* @param businessId
* @return
*/
BusinessBrowseVo browse(Integer businessId);
/**
* 查询所有项目名称(支持模糊查询)
* @return
*/
List<String> queryprojectName(BusinessListDto dto);
List<String> selectProjectName(BusinessListDto dto);
/**
* 新增项目详情
......
......@@ -6,6 +6,7 @@ import com.dsk.system.mapper.BusinessBacklogMapper;
import com.dsk.system.service.IBusinessBacklogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
......@@ -52,6 +53,7 @@ public class BusinessBacklogServiceImpl implements IBusinessBacklogService
* @return 结果
*/
@Override
@Transactional
public int insertBusinessBacklog(BusinessBacklog businessBacklog)
{
businessBacklog.setCreateTime(DateUtils.getNowDate());
......@@ -67,6 +69,7 @@ public class BusinessBacklogServiceImpl implements IBusinessBacklogService
* @return 结果
*/
@Override
@Transactional
public int updateBusinessBacklog(BusinessBacklog businessBacklog)
{
businessBacklog.setUpdateTime(DateUtils.getNowDate());
......
......@@ -3,11 +3,14 @@ package com.dsk.system.service.impl;
import java.util.List;
import com.dsk.common.core.domain.entity.BusinessContacts;
import com.dsk.common.exception.base.BaseException;
import com.dsk.common.utils.CheckUtils;
import com.dsk.common.utils.DateUtils;
import com.dsk.system.mapper.BusinessContactsMapper;
import com.dsk.system.service.IBusinessContactsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* 项目联系人Service业务层处理
......@@ -52,8 +55,10 @@ public class BusinessContactsServiceImpl implements IBusinessContactsService
* @return 结果
*/
@Override
@Transactional
public int insertBusinessContacts(BusinessContacts businessContacts)
{
if(!CheckUtils.isPhone(businessContacts.getPhone())) throw new BaseException("500","请输入正确的手机号码");
return businessContactsMapper.insertBusinessContacts(businessContacts);
}
......@@ -64,8 +69,10 @@ public class BusinessContactsServiceImpl implements IBusinessContactsService
* @return 结果
*/
@Override
@Transactional
public int updateBusinessContacts(BusinessContacts businessContacts)
{
if(!CheckUtils.isPhone(businessContacts.getPhone())) throw new BaseException("500","请输入正确的手机号码");
businessContacts.setUpdateTime(DateUtils.getNowDate());
return businessContactsMapper.updateBusinessContacts(businessContacts);
}
......
......@@ -8,6 +8,7 @@ import com.dsk.system.mapper.BusinessFollowRecordMapper;
import com.dsk.system.service.IBusinessFollowRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* 项目跟进记录Service业务层处理
......@@ -33,16 +34,15 @@ public class BusinessFollowRecordServiceImpl implements IBusinessFollowRecordSer
return businessFollowRecordMapper.selectBusinessFollowRecordById(id);
}
/**
* 查询项目跟进记录列表
*
* @param businessFollowRecord 项目跟进记录
* @return 项目跟进记录
*/
@Override
public List<BusinessFollowRecord> selectBusinessFollowRecordList(BusinessFollowRecord businessFollowRecord)
public List<BusinessFollowRecord> selectBusinessFollowRecordList(Integer businessId)
{
return businessFollowRecordMapper.selectBusinessFollowRecordList(businessFollowRecord);
return businessFollowRecordMapper.selectBusinessFollowRecordList(businessId);
}
@Override
public List<BusinessFollowRecord> businessFollowRecordPaging(BusinessFollowRecord businessFollowRecord) {
return businessFollowRecordMapper.businessFollowRecordPaging(businessFollowRecord);
}
/**
......@@ -52,6 +52,7 @@ public class BusinessFollowRecordServiceImpl implements IBusinessFollowRecordSer
* @return 结果
*/
@Override
@Transactional
public int insertBusinessFollowRecord(BusinessFollowRecord businessFollowRecord)
{
return businessFollowRecordMapper.insertBusinessFollowRecord(businessFollowRecord);
......
......@@ -2,10 +2,12 @@ package com.dsk.system.service.impl;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import cn.hutool.core.bean.BeanUtil;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.core.domain.entity.BusinessInfo;
import com.dsk.common.core.domain.entity.BusinessLabel;
import com.dsk.common.core.domain.entity.BusinessRelateCompany;
import com.dsk.common.core.domain.entity.BusinessUser;
import com.dsk.common.dtos.BusinessInfoDto;
......@@ -15,8 +17,10 @@ import com.dsk.system.domain.BusinessAddDto;
import com.dsk.system.domain.BusinessListDto;
import com.dsk.system.domain.customer.dto.CustomerBusinessSearchDto;
import com.dsk.system.domain.customer.vo.CustomerBusinessListVo;
import com.dsk.system.domain.vo.BusinessBrowseVo;
import com.dsk.system.domain.vo.BusinessListVo;
import com.dsk.system.mapper.BusinessInfoMapper;
import com.dsk.system.mapper.BusinessLabelMapper;
import com.dsk.system.mapper.BusinessRelateCompanyMapper;
import com.dsk.system.mapper.BusinessUserMapper;
import com.dsk.system.service.IBusinessInfoService;
......@@ -40,6 +44,8 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
private BusinessUserMapper businessUserMapper;
@Resource
private BusinessRelateCompanyMapper businessRelateCompanyMapper;
@Resource
private BusinessLabelMapper businessLabelMapper;
/**
* 查询项目详情
......@@ -48,10 +54,15 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
* @return 项目详情
*/
@Override
public BusinessInfo selectBusinessInfoById(Long id) {
public BusinessInfo selectBusinessInfoById(Integer id) {
return businessInfoMapper.selectBusinessInfoById(id);
}
@Override
public BusinessInfo getConstruction(Integer id) {
return businessInfoMapper.getConstruction(id);
}
/**
* 查询项目详情列表
*
......@@ -64,8 +75,26 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
}
@Override
public List<String> queryprojectName(BusinessListDto dto) {
return businessInfoMapper.queryprojectName(dto);
public BusinessBrowseVo browse(Integer businessId) {
BusinessBrowseVo businessBrowseVo = new BusinessBrowseVo();
//查询项目基本信息
BusinessInfo businessInfo = businessInfoMapper.selectBusinessInfoById(businessId);
BeanUtil.copyProperties(businessInfo,businessBrowseVo);
//查询项目标签
businessBrowseVo.setLabelList(businessLabelMapper.selectBusinessLabelList(new BusinessLabel(businessId)).stream().map(p -> p.getLabel()).collect(Collectors.toList()));
//查询关键企业
businessBrowseVo.setRelateCompany(businessRelateCompanyMapper.selectBusinessRelateCompanyList(new BusinessRelateCompany(businessId)));
BusinessBrowseVo total = businessInfoMapper.selectTotal(businessId);
businessBrowseVo.setBacklogCount(total.getBacklogCount());
businessBrowseVo.setContactsCount(total.getContactsCount());
businessBrowseVo.setFollowRecordCount(total.getFollowRecordCount());
businessBrowseVo.setRelateCompanyCount(total.getRelateCompanyCount());
return businessBrowseVo;
}
@Override
public List<String> selectProjectName(BusinessListDto dto) {
return businessInfoMapper.selectProjectName(dto);
}
/**
......@@ -102,7 +131,9 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
* @return 结果
*/
@Override
public int updateBusinessInfo(BusinessInfo businessInfo) {
@Transactional
public int updateBusinessInfo(BusinessInfo businessInfo)
{
businessInfo.setUpdateTime(DateUtils.getNowDate());
return businessInfoMapper.updateBusinessInfo(businessInfo);
}
......@@ -114,6 +145,7 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
* @return 结果
*/
@Override
@Transactional
public int deleteBusinessInfoByIds(Long[] ids) {
return businessInfoMapper.deleteBusinessInfoByIds(ids);
}
......
......@@ -9,6 +9,7 @@ import com.dsk.system.mapper.BusinessLabelMapper;
import com.dsk.system.service.IBusinessLabelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* 项目标签Service业务层处理
......@@ -53,6 +54,7 @@ public class BusinessLabelServiceImpl implements IBusinessLabelService
* @return 结果
*/
@Override
@Transactional
public int insertBusinessLabel(BusinessLabel businessLabel)
{
businessLabel.setCreateTime(DateUtils.getNowDate());
......@@ -91,6 +93,7 @@ public class BusinessLabelServiceImpl implements IBusinessLabelService
* @return 结果
*/
@Override
@Transactional
public int deleteBusinessLabelById(BusinessIdDto dto)
{
return businessLabelMapper.deleteBusinessLabelById(dto);
......
......@@ -4,12 +4,16 @@ import java.util.List;
import java.util.stream.Collectors;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.core.domain.entity.BusinessRelateCompany;
import com.dsk.common.exception.base.BaseException;
import com.dsk.common.utils.CheckUtils;
import com.dsk.common.utils.DateUtils;
import com.dsk.system.domain.BusinessIdDto;
import com.dsk.system.mapper.BusinessRelateCompanyMapper;
import com.dsk.system.service.IBusinessRelateCompanyService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
......@@ -56,8 +60,10 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS
* @return 结果
*/
@Override
@Transactional
public int insertBusinessRelateCompany(BusinessRelateCompany businessRelateCompany)
{
if(!CheckUtils.isPhone(businessRelateCompany.getPhone())) throw new BaseException("500","请输入正确的手机号码");
businessRelateCompany.setCreateTime(DateUtils.getNowDate());
return businessRelateCompanyMapper.insertBusinessRelateCompany(businessRelateCompany);
}
......@@ -69,8 +75,10 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS
* @return 结果
*/
@Override
@Transactional
public int updateBusinessRelateCompany(BusinessRelateCompany businessRelateCompany)
{
if(!CheckUtils.isPhone(businessRelateCompany.getPhone())) throw new BaseException("500","请输入正确的手机号码");
businessRelateCompany.setUpdateTime(DateUtils.getNowDate());
return businessRelateCompanyMapper.updateBusinessRelateCompany(businessRelateCompany);
}
......
......@@ -43,6 +43,7 @@
<if test="accendant != null and accendant != ''">and accendant = #{accendant}</if>
<if test="creatTime != null ">and creat_time = #{creatTime}</if>
</where>
order by creat_time desc
</select>
<select id="selectBusinessContactsById" parameterType="Long" resultMap="BusinessContactsResult">
......
......@@ -33,10 +33,20 @@
from business_follow_record
</sql>
<select id="selectBusinessFollowRecordList" parameterType="com.dsk.common.core.domain.entity.BusinessFollowRecord">
<select id="selectBusinessFollowRecordList" resultType="com.dsk.common.core.domain.entity.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 = #{businessId}
ORDER BY create_time DESC
</select>
<select id="selectBusinessFollowRecordById" parameterType="Long" resultMap="BusinessFollowRecordResult">
<include refid="selectBusinessFollowRecordVo"/>
where id = #{id}
</select>
<select id="businessFollowRecordPaging" resultType="com.dsk.common.core.domain.entity.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>
......@@ -51,11 +61,6 @@
ORDER BY create_time DESC
</select>
<select id="selectBusinessFollowRecordById" parameterType="Long" resultMap="BusinessFollowRecordResult">
<include refid="selectBusinessFollowRecordVo"/>
where id = #{id}
</select>
<insert id="insertBusinessFollowRecord" parameterType="com.dsk.common.core.domain.entity.BusinessFollowRecord" useGeneratedKeys="true"
keyProperty="id">
insert into business_follow_record
......
......@@ -121,7 +121,7 @@
ORDER BY i.create_time DESC
</select>
<select id="queryprojectName" resultType="java.lang.String">
<select id="selectProjectName" resultType="java.lang.String">
SELECT *
FROM
(SELECT project_name as name FROM business_info) AS bu
......@@ -132,11 +132,26 @@
</where>
</select>
<select id="selectBusinessInfoById" parameterType="Long" resultMap="BusinessInfoResult">
<select id="selectBusinessInfoById" parameterType="integer" resultMap="BusinessInfoResult">
<include refid="selectBusinessInfoVo"/>
where id = #{id}
</select>
<select id="selectTotal" resultType="com.dsk.system.domain.vo.BusinessBrowseVo">
SELECT
count(DISTINCT c.id) contactsCount,
count(DISTINCT f.id) followRecordCount,
count(DISTINCT b.id) backlogCount,
count(DISTINCT r.id) relateCompanyCount
FROM
business_info i
LEFT JOIN business_contacts c on c.business_id = i.id
LEFT JOIN business_follow_record f on f.business_id = i.id
LEFT JOIN business_backlog b on b.business_id = i.id
LEFT JOIN business_relate_company r on r.business_id = i.id
WHERE i.id = #{business}
</select>
<insert id="insertBusinessInfo" parameterType="com.dsk.common.core.domain.entity.BusinessInfo" useGeneratedKeys="true" keyProperty="id">
insert into business_info
<trim prefix="(" suffix=")" suffixOverrides=",">
......@@ -255,4 +270,16 @@
<if test="status != null "> and bi.status = #{status}</if>
order by bi.create_time desc
</select>
<select id="getConstruction" resultType="com.dsk.common.core.domain.entity.BusinessInfo">
select
investment_amount,
amount_source,
plan_bid_time,
plan_start_time,
plan_complete_time,
build_property,
project_details
from business_info
where id = #{id}
</select>
</mapper>
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