Commit 6c62347d authored by caixingbing's avatar caixingbing
parents 7d041a28 0828d84e
......@@ -58,9 +58,9 @@ public class BusinessInfoController extends BaseController
*/
// @PreAuthorize("@ss.hasPermi('system:info:list')")
@GetMapping("/browse/{businessId}")
public AjaxResult browse(@PathVariable Integer id)
public AjaxResult browse(@PathVariable Integer businessId)
{
return success(businessInfoService.browse(id));
return success(businessInfoService.browse(businessId));
}
/**
......@@ -74,14 +74,14 @@ public class BusinessInfoController extends BaseController
}
/**
* 删除项目列表
* 删除项目
*/
// @PreAuthorize("@ss.hasPermi('system:info:remove')")
// @Log(title = "项目详情", businessType = BusinessType.DELETE)
@DeleteMapping("/remove/{ids}")
public AjaxResult remove(@PathVariable(value = "ids",required=false) Long[] ids)
public AjaxResult remove(@PathVariable(value = "ids",required=false) Long id)
{
return toAjax(businessInfoService.deleteBusinessInfoByIds(ids));
return toAjax(businessInfoService.deleteBusinessInfoById(id));
}
/**
......
package com.dsk.web.controller.customer;
import com.dsk.common.annotation.Log;
import com.dsk.common.annotation.RepeatSubmit;
import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.core.domain.entity.SysRole;
import com.dsk.common.core.page.TableDataInfo;
import com.dsk.common.enums.BusinessType;
import com.dsk.common.utils.poi.ExcelUtil;
import com.dsk.system.domain.customer.Customer;
import com.dsk.system.domain.customer.dto.CustomerBusinessSearchDto;
import com.dsk.system.domain.customer.dto.CustomerSearchDto;
import com.dsk.system.service.ICustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
/**
* 客户相关
......@@ -30,7 +38,7 @@ public class CustomerController extends BaseController {
*/
@PreAuthorize("@ss.hasPermi('customer:list')")
@GetMapping("/list")
public TableDataInfo selectPageList(CustomerSearchDto dto){
public TableDataInfo selectPageList(CustomerSearchDto dto) {
startPage();
return getDataTable(baseService.selectList(dto));
}
......@@ -40,7 +48,7 @@ public class CustomerController extends BaseController {
*/
@PreAuthorize("@ss.hasPermi('customer:info')")
@GetMapping("/{customerId}")
public AjaxResult info(@PathVariable("customerId") String customerId){
public AjaxResult info(@PathVariable("customerId") String customerId) {
return AjaxResult.success(baseService.info(customerId));
}
......@@ -50,7 +58,7 @@ public class CustomerController extends BaseController {
@PreAuthorize("@ss.hasPermi('customer:add')")
@PostMapping()
@RepeatSubmit
public AjaxResult add(@RequestBody Customer customer){
public AjaxResult add(@RequestBody Customer customer) {
return AjaxResult.success(baseService.add(customer));
}
......@@ -60,7 +68,7 @@ public class CustomerController extends BaseController {
@PreAuthorize("@ss.hasPermi('customer:edit')")
@PutMapping()
@RepeatSubmit
public AjaxResult edit(@RequestBody Customer customer){
public AjaxResult edit(@RequestBody Customer customer) {
return AjaxResult.success(baseService.edit(customer));
}
......@@ -68,7 +76,7 @@ public class CustomerController extends BaseController {
* 获取个人客户列表
*/
@GetMapping("/user/list")
public AjaxResult userList(){
public AjaxResult userList() {
return AjaxResult.success(baseService.selectUserList());
}
......@@ -77,9 +85,15 @@ public class CustomerController extends BaseController {
*/
// @PreAuthorize("@ss.hasPermi('customer:business:list')")
@GetMapping("/business/list")
public TableDataInfo businessList(CustomerBusinessSearchDto dto){
public TableDataInfo businessList(CustomerBusinessSearchDto dto) {
startPage();
return getDataTable(baseService.selectBusinessList(dto));
}
@Log(title = "客户数据导入", businessType = BusinessType.IMPORT)
//@PreAuthorize("@ss.hasPermi('customer:importData')")
@PostMapping("/importData")
public AjaxResult importData(@RequestPart("file") MultipartFile file) throws Exception {
return AjaxResult.success(baseService.importData(new ExcelUtil<>(Customer.class).importExcel(file.getInputStream(), 3)));
}
}
......@@ -3,15 +3,13 @@ package com.dsk.web.controller.search.controller;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.dtos.ComposeQueryDto;
import com.dsk.web.controller.search.service.BusinessOpportunityRadarService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
* 模糊查企业
* 查企业
* @author Administrator
*
*/
......@@ -24,11 +22,18 @@ public class CompanySearchController {
BusinessOpportunityRadarService opportunityRadarService;
/*
* 土地交易
* 模糊查询企业名称
*/
@RequestMapping("/index")
public AjaxResult landMarketPage(@RequestBody ComposeQueryDto compose) {
return opportunityRadarService.enterprisePage(compose);
}
/*
* 完全匹配企业名称
*/
@GetMapping("/findByName/{keyword}")
public AjaxResult findByName(@PathVariable String keyword) {
return opportunityRadarService.enterpriseByName(keyword);
}
}
......@@ -19,4 +19,6 @@ public interface BusinessOpportunityRadarService {
AjaxResult establishmentPage(ComposeQueryDto compose);
AjaxResult enterprisePage(ComposeQueryDto compose);
AjaxResult enterpriseByName(String keyword);
}
......@@ -10,6 +10,7 @@ import com.dsk.web.controller.search.service.MarketAnalysisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
/**
......@@ -51,7 +52,15 @@ public class BusinessOpportunityRadarServiceImpl implements BusinessOpportunityR
@Override
public AjaxResult enterprisePage(ComposeQueryDto compose) {
Map<String, Object> map = dskOpenApiUtil.requestBody("/api/nationzj/enterprice/index", BeanUtil.beanToMap(compose, false, false));
Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/enterprice/index", BeanUtil.beanToMap(compose, false, false));
return BeanUtil.toBean(map, AjaxResult.class);
}
@Override
public AjaxResult enterpriseByName(String keyword){
Map<String,Object> params = new HashMap<>();
params.put("keyword",keyword);
Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/enterprice/findByName", params);
return BeanUtil.toBean(map, AjaxResult.class);
}
}
......@@ -193,6 +193,11 @@ xss:
dsk:
open:
endPoint: sandbox.openapi.jiansheku.com
accessKeyId: aec7b3ff2e8b48e79a7e2c463ce21912
# endPoint: sandbox.openapi.jiansheku.com
# accessKeyId: aec7b3ff2e8b48e79a7e2c463ce21912
# accessKeySecret: ee8a53c7ea04eb3ac311406c8f56f95b
# protocol: https
endPoint: 120.27.13.145:8865
accessKeyId: aec7b3ff2y2q8x6t49a7e2c463ce21912
accessKeySecret: ee8a53c7ea04eb3ac311406c8f56f95b
protocol: http
......@@ -15,6 +15,7 @@ public class DskOpenApiConfig {
public String accessKeyId;
public String accessKeySecret;
public String endPoint;
public String protocol;
public String getAccessKeyId() {
return accessKeyId;
......@@ -39,4 +40,12 @@ public class DskOpenApiConfig {
public void setEndPoint(String endPoint) {
this.endPoint = endPoint;
}
}
\ No newline at end of file
public String getProtocol() {
return protocol;
}
public void setProtocol(String protocol) {
this.protocol = protocol;
}
}
......@@ -102,10 +102,6 @@ public class BusinessInfo extends BaseEntity
@Excel(name = "项目类别")
private String projectCategory;
/** 商务团队 */
@Excel(name = "商务团队")
private String team;
/** 0 仅自己可见,1 他人可见 */
@Excel(name = "0 仅自己可见,1 他人可见")
private Integer isPrivate;
......@@ -313,15 +309,7 @@ public class BusinessInfo extends BaseEntity
{
return projectCategory;
}
public void setTeam(String team)
{
this.team = team;
}
public String getTeam()
{
return team;
}
public void setIsPrivate(Integer isPrivate)
{
this.isPrivate = isPrivate;
......@@ -354,7 +342,6 @@ public class BusinessInfo extends BaseEntity
.append("districtId", getDistrictId())
.append("projectType", getProjectType())
.append("projectCategory", getProjectCategory())
.append("team", getTeam())
.append("isPrivate", getIsPrivate())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
......
......@@ -48,7 +48,7 @@ public class DskOpenApiUtil {
public Map<String,Object> requestForm(String path, Map<String, Object> bodyMap){
return request(path, bodyMap, "form");
}
/**
* <b>开放平台统一请求</b>
* @param path 请求路径
......@@ -59,7 +59,7 @@ public class DskOpenApiUtil {
public Map<String,Object> request(String path, Map<String, Object> bodyMap, String reqBodyType){
try {
AccClient.init(new Config(dskOpenApiConfig.accessKeyId, dskOpenApiConfig.accessKeySecret)
.setEndpoint(dskOpenApiConfig.endPoint));
.setEndpoint(dskOpenApiConfig.endPoint).setProtocol(dskOpenApiConfig.protocol));
Map<String, ?> res = AccClient.request(reqBodyType, path, bodyMap);
if(!res.containsKey("headers") || !res.containsKey("body")) {
throw new RuntimeException(String.format("请求无返回:path=%s",path));
......@@ -109,4 +109,4 @@ public class DskOpenApiUtil {
return new TableDataInfo((List<?>) list, count);
}
}
\ No newline at end of file
}
This diff is collapsed.
* {
padding: 0;
margin: 0;
}
div,
dl,
dt,
dd,
form,
h1,
h2,
h3,
h4,
h5,
h6,
img,
ol,
ul,
li,
table,
th,
td,
p,
span,
a {
border: 0;
}
img,
input {
border: none;
vertical-align: middle;
background: none;
outline: none;
}
html {
height: 100%;
box-sizing: border-box;
}
body {
height: 100%;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
}
ul,
ol {
list-style-type: none;
}
th,
td,
input {
font-size: 12px;
}
h3 {
font-size: 14px;
}
s,
i,
em {
font-style: normal;
text-decoration: none;
}
button {
border: none;
cursor: pointer;
font-size: 12px;
background-color: transparent;
}
select {
border-width: 1px;
_zoom: 1;
border-style: solid;
padding-top: 2px;
font-size: 12px;
}
.clear {
clear: both;
font-size: 1px;
height: 0;
visibility: hidden;
line-height: 0;
}
.clearfix:after {
content: "";
display: block;
clear: both;
}
.clearfix {
zoom: 1;
}
.float_left {
float: left;
}
.float_right {
float: right;
}
.el-input {
width: 100%;
}
.el-input .el-input__inner {
width: 100%;
height: 34px;
line-height: 34px;
background: #ffffff;
border: 1px solid #e0e0e0;
border-radius: 2px;
box-sizing: border-box;
}
.el-input__icon {
line-height: 34px;
}
.el-dropdown-link .el-input {
width: 100%;
}
.el-dropdown-link .el-input__inner {
width: 100%;
}
.el-input--suffix .el-input__inner {
padding-right: 15px;
}
.el-select .el-input.is-focus .el-input__inner,
.el-input.is-active .el-input__inner,
.el-input__inner:focus,
.el-select .el-input__inner:focus,
.el-range-editor.is-active:focus-within {
border-color: #3181fa;
}
.el-popper[x-placement^=top] {
margin-bottom: 12px;
}
.el-select-dropdown .popper__arrow {
display: none;
}
.el-popper .popper__arrow {
display: none;
}
.select-popper {
text-align: center;
display: inline-block;
position: relative;
color: #333333;
font-size: 14px;
cursor: pointer;
margin-right: 24px;
}
.select-popper .select-popper-img {
width: 24px;
height: 12px;
position: absolute;
top: -10px;
right: 2px;
}
.select-popper .el-select__tags,
.select-popper .el-cascader__tags,
.select-popper .el-input__suffix {
display: none;
}
.select-popper:hover {
color: #0381fa;
}
.select-popper-active {
color: #0381fa;
}
.select-popper-title {
padding: 4px 6px;
}
.select-popper-title .colorhover {
color: #0381fa;
}
.select-popper::-webkit-scrollbar-thumb {
background-color: #a1a3a9;
border-radius: 6px;
}
.select-popper::-webkit-scrollbar {
width: 6px;
height: 6px;
}
.select-popper::-webkit-scrollbar-track {
background: #fff;
}
.select-popper::-webkit-scrollbar-corner {
background: #fff;
}
.select-popper .el-select {
width: 100%;
}
.cascader-region {
position: absolute;
left: 0;
top: 0px;
opacity: 0;
line-height: 16px;
}
.cascader-region .el-input {
width: 100%;
line-height: 16px;
}
.cascader-region .el-input .el-input__inner {
width: 100%;
height: 16px !important;
}
.content_item .select-caret {
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
line-height: 16px;
font-weight: 400;
color: #333333;
cursor: pointer;
position: relative;
}
.content_item .select-popper:hover .select-caret {
color: #0074E5;
}
.content_item .select-caret:focus {
border: none;
outline: none;
}
.content_item .geduan{
width: 100%;
height: 0px;
opacity: 1;
border: 1px solid #EFEFEF;
margin: 16px 0px;
}
.content_item .search-new {
width: 100%;
padding-bottom: 16px;
}
.content_item .search-new span:last-child {
display: inline-block;
width: 80px;
text-align: center;
color: #5B5B5B;
line-height: 32px;
cursor: pointer;
border-radius: 2px 2px 2px 2px;
border: 1px solid #D4D4D4;
opacity: 1;
}
.content_item .search-new span:first-child {
margin-right: 12px;
display: inline-block;
width: 80px;
text-align: center;
cursor: pointer;
background: #0089ff;
color: #fff;
line-height: 34px;
border-radius: 2px 2px 2px 2px;
opacity: 1;
}
.content_item .search-new span:first-child:hover {
background: #0080FF;
}
.content_item .search-new span:last-child:hover {
background: #f5faff;
color: #0081FF;
border-color: #0081FF;
}
* {
padding: 0;
margin: 0;
}
div,
dl,
dt,
dd,
form,
h1,
h2,
h3,
h4,
h5,
h6,
img,
ol,
ul,
li,
table,
th,
td,
p,
span,
a {
border: 0;
}
img,
input {
border: none;
vertical-align: middle;
background: none;
outline: none;
}
html {
height: 100%;
box-sizing: border-box;
}
body {
height: 100%;
-moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
}
ul,
ol {
list-style-type: none;
}
th,
td,
input {
font-size: 12px;
}
h3 {
font-size: 14px;
}
s,
i,
em {
font-style: normal;
text-decoration: none;
}
button {
border: none;
cursor: pointer;
font-size: 12px;
background-color: transparent;
}
select {
border-width: 1px;
_zoom: 1;
border-style: solid;
padding-top: 2px;
font-size: 12px;
}
.clear {
clear: both;
font-size: 1px;
height: 0;
visibility: hidden;
line-height: 0;
}
.clearfix:after {
content: "";
display: block;
clear: both;
}
.clearfix {
zoom: 1;
}
.float_left {
float: left;
}
.float_right {
float: right;
}
......@@ -20,6 +20,7 @@
</template>
<script>
import debtProject from "./components/debtProject/index.vue";
import "@/assets/styles/public.css";
export default {
name: 'radar',
components: { debtProject },
......@@ -87,7 +88,7 @@
</script>
<style lang="scss" scoped>
@import "~@/assets/styles/public.scss";
.app-container {
margin: 12px 24px;
padding: 0;
......@@ -116,7 +117,7 @@
.app-container .combined-title .title-right {
display: flex;
width: 1044px;
width: 100%;
position: relative;
height: 40px;
}
......@@ -150,7 +151,7 @@
height: 1px;
background-color: #EEEEEE;
position: absolute;
bottom: 0px;
bottom: -1px;
left: 0;
z-index: 1;
}
......@@ -168,7 +169,7 @@
.tab div {
cursor: pointer;
color: #666666;
font-size: 14px;
font-size: 16px;
text-align: center;
margin-right: 32px;
line-height: 40px;
......
package com.dsk.system.domain.customer;
import com.baomidou.mybatisplus.annotation.*;
import com.dsk.common.annotation.Excel;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.context.annotation.Import;
import java.io.Serializable;
import java.util.Date;
......@@ -30,6 +32,7 @@ public class Customer implements Serializable {
/**
* 客户名称(企业名称)
*/
@Excel(name = "企业名称")
private String companyName;
/**
* 法定代表人
......@@ -39,6 +42,10 @@ public class Customer implements Serializable {
* 注册资本
*/
private String registerCapital;
/**
* 注册地址
*/
private String registerAddress;
/**
* 社会统一信用代码
*/
......@@ -52,9 +59,13 @@ public class Customer implements Serializable {
*/
private String companyLevel;
/**
* 信用等级(credit_level_type)
* 企业主体评级(credit_level_type)
*/
private String creditLevel;
/**
* 客户等级(customer_level_type)
*/
private String customerLevel;
/**
* 上级公司(控股单位)
*/
......
......@@ -35,9 +35,13 @@ public class CustomerListVo {
*/
private String legalPerson;
/**
* 注册资本(字符串)
* 注册资本
*/
private String registerCapital;
/**
* 注册地址
*/
private String registerAddress;
/**
* 社会统一信用代码
*/
......@@ -54,6 +58,10 @@ public class CustomerListVo {
* 信用等级
*/
private String creditLevel;
/**
* 客户等级
*/
private String customerLevel;
/**
* 上级公司
*/
......
......@@ -98,5 +98,10 @@ public class BusinessBrowseVo {
*/
private Integer relateCompanyCount;
/**
* 相关企业统计
*/
private Integer fileCount;
}
......@@ -44,12 +44,12 @@ public interface BusinessBacklogMapper
public int updateBusinessBacklog(BusinessBacklog businessBacklog);
/**
* 删除项目工作待办
* 根据项目id删除项目工作待办
*
* @param id 项目工作待办主键
* @param businessId 项目id主键
* @return 结果
*/
public int deleteBusinessBacklogById(Long id);
public int deleteBacklogByBusinessId(Long businessId);
/**
* 批量删除项目工作待办
......
......@@ -47,10 +47,10 @@ public interface BusinessContactsMapper
/**
* 删除项目联系人
*
* @param id 项目联系人主键
* @param businessId 项目联系人主键
* @return 结果
*/
public int deleteBusinessContactsById(Long id);
public int deleteBusinessContactsByBusinessId(Long businessId);
/**
* 批量删除项目联系人
......
......@@ -53,12 +53,12 @@ public interface BusinessFollowRecordMapper
public int updateBusinessFollowRecord(BusinessFollowRecord businessFollowRecord);
/**
* 删除项目跟进记录
* 根据项目id删除项目跟进记录
*
* @param id 项目跟进记录主键
* @param businessId 项目主键id
* @return 结果
*/
public int deleteBusinessFollowRecordById(Long id);
public int deleteBusinessFollowRecordByBusinessId(Long businessId);
/**
* 批量删除项目跟进记录
......
......@@ -84,7 +84,7 @@ public interface BusinessInfoMapper extends BaseMapper<BusinessInfo>
public int deleteBusinessInfoByIds(Long[] ids);
/**
* 根据项目统计
* 统计项目相关的信息数量
* @param business
* @return
*/
......
......@@ -53,6 +53,14 @@ public interface BusinessLabelMapper
*/
public int deleteBusinessLabelById(BusinessIdDto dto);
/**
* 根据项目id删除项目标签
*
* @param businessId 项目主键
* @return 结果
*/
public int deleteBusinessLabelByBusinessId(Long businessId);
/**
* 批量删除项目标签
*
......
......@@ -2,7 +2,6 @@ package com.dsk.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dsk.common.core.domain.entity.BusinessRelateCompany;
import com.dsk.system.domain.customer.CustomerDecisionChain;
import java.util.List;
......@@ -52,7 +51,7 @@ public interface BusinessRelateCompanyMapper extends BaseMapper<BusinessRelateCo
* @param id 项目关联单位主键
* @return 结果
*/
public int deleteBusinessRelateCompanyById(Long id);
public int deleteRelateCompanyByBusinessId(Long id);
/**
* 批量删除项目关联单位
......
......@@ -19,6 +19,14 @@ public interface BusinessUserMapper
*/
public BusinessUser selectBusinessUserById(Long id);
/**
* 根据项目id查询项目的创建者
*
* @param businessId 项目id主键
* @return 项目创建者名称
*/
String selectCreatorBybusinessId(Integer businessId);
/**
* 查询项目用户关联列表
*
......@@ -44,12 +52,12 @@ public interface BusinessUserMapper
public int updateBusinessUser(BusinessUser businessUser);
/**
* 删除项目用户关联
* 根据项目id删除项目用户关联
*
* @param id 项目用户关联主键
* @param businessId 项目用户关联主键
* @return 结果
*/
public int deleteBusinessUserById(Long id);
public int deleteBusinessUserByBusinessId(Long businessId);
/**
* 批量删除项目用户关联
......
......@@ -29,4 +29,6 @@ public interface ICustomerService {
List<CustomerBusinessListVo> selectBusinessList(CustomerBusinessSearchDto dto);
List<String> importData(List<Customer> customerList);
}
......@@ -97,6 +97,6 @@ public class BusinessBacklogServiceImpl implements IBusinessBacklogService
@Override
public int deleteBusinessBacklogById(Long id)
{
return businessBacklogMapper.deleteBusinessBacklogById(id);
return businessBacklogMapper.deleteBacklogByBusinessId(id);
}
}
......@@ -98,6 +98,6 @@ public class BusinessContactsServiceImpl implements IBusinessContactsService
@Override
public int deleteBusinessContactsById(Long id)
{
return businessContactsMapper.deleteBusinessContactsById(id);
return businessContactsMapper.deleteBusinessContactsByBusinessId(id);
}
}
......@@ -92,6 +92,6 @@ public class BusinessFollowRecordServiceImpl implements IBusinessFollowRecordSer
@Override
public int deleteBusinessFollowRecordById(Long id)
{
return businessFollowRecordMapper.deleteBusinessFollowRecordById(id);
return businessFollowRecordMapper.deleteBusinessFollowRecordByBusinessId(id);
}
}
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.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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;
import com.dsk.common.utils.DateUtils;
import com.dsk.common.utils.SecurityUtils;
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.mapper.*;
import com.dsk.system.service.IBusinessInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -46,6 +40,12 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
private BusinessRelateCompanyMapper businessRelateCompanyMapper;
@Resource
private BusinessLabelMapper businessLabelMapper;
@Resource
private BusinessBacklogMapper businessBacklogMapper;
@Resource
private BusinessContactsMapper businessContactsMapper;
@Resource
private BusinessFollowRecordMapper businessFollowRecordMapper;
/**
* 查询项目详情
......@@ -80,10 +80,15 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
//查询项目基本信息
BusinessInfo businessInfo = businessInfoMapper.selectBusinessInfoById(businessId);
BeanUtil.copyProperties(businessInfo,businessBrowseVo);
//查询商务团队
String team = "";
team = businessUserMapper.selectCreatorBybusinessId(businessId);
businessBrowseVo.setTeam(team);
//查询项目标签
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());
......@@ -117,7 +122,7 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
//新增用户-项目关系信息
int addbusinessUser = businessUserMapper.insertBusinessUser(new BusinessUser(businessInfo.getId(), deptId.intValue(), dto.getUserId(), 1));
//新增项目-关联企业信息
int addRelateCompany = businessRelateCompanyMapper.insertBusinessRelateCompany(new BusinessRelateCompany(businessInfo.getId(), dto.getCompanyId(), dto.getOwnerCompany(), "业主"));
int addRelateCompany = businessRelateCompanyMapper.insertBusinessRelateCompany(new BusinessRelateCompany(businessInfo.getId(), dto.getCompanyId(), dto.getOwnerCompany(), "业主单位"));
return addbusinessUser > 0 && addRelateCompany > 0 ? AjaxResult.success() : AjaxResult.error();
}
return AjaxResult.error();
......@@ -157,8 +162,25 @@ public class BusinessInfoServiceImpl implements IBusinessInfoService {
* @return 结果
*/
@Override
@Transactional
public int deleteBusinessInfoById(Long id) {
return businessInfoMapper.deleteBusinessInfoById(id);
int removeBusiness = businessInfoMapper.deleteBusinessInfoById(id);
if (removeBusiness > 0) {
//删除用户关联项目
businessUserMapper.deleteBusinessUserByBusinessId(id);
//删除项目关联单位
businessRelateCompanyMapper.deleteRelateCompanyByBusinessId(id);
//删除项目关联工作待办
businessBacklogMapper.deleteBacklogByBusinessId(id);
//删除项目关联联系人
businessContactsMapper.deleteBusinessContactsByBusinessId(id);
//删除项目跟进记录
businessFollowRecordMapper.deleteBusinessFollowRecordByBusinessId(id);
//删除项目标签
businessLabelMapper.deleteBusinessLabelByBusinessId(id);
return 1;
}
return 0;
}
/**
......
......@@ -4,7 +4,6 @@ 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;
......@@ -104,7 +103,7 @@ public class BusinessRelateCompanyServiceImpl implements IBusinessRelateCompanyS
@Override
public int deleteBusinessRelateCompanyById(Long id)
{
return businessRelateCompanyMapper.deleteBusinessRelateCompanyById(id);
return businessRelateCompanyMapper.deleteRelateCompanyByBusinessId(id);
}
@Override
......
......@@ -92,6 +92,6 @@ public class BusinessUserServiceImpl implements IBusinessUserService
@Override
public int deleteBusinessUserById(Long id)
{
return businessUserMapper.deleteBusinessUserById(id);
return businessUserMapper.deleteBusinessUserByBusinessId(id);
}
}
......@@ -3,7 +3,9 @@ package com.dsk.system.service.impl;
import cn.hutool.core.bean.BeanException;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.exception.ServiceException;
import com.dsk.common.utils.DskOpenApiUtil;
import com.dsk.common.utils.SecurityUtils;
import com.dsk.system.domain.customer.Customer;
import com.dsk.system.domain.customer.CustomerUser;
......@@ -16,13 +18,17 @@ import com.dsk.system.mapper.CustomerMapper;
import com.dsk.system.mapper.CustomerUserMapper;
import com.dsk.system.service.IBusinessInfoService;
import com.dsk.system.service.ICustomerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 客户信息表(Customer)表服务实现类
......@@ -30,6 +36,7 @@ import java.util.List;
* @author makejava
* @since 2023-05-16 09:27:57
*/
@Slf4j
@Service
public class CustomerServiceImpl implements ICustomerService {
......@@ -39,6 +46,8 @@ public class CustomerServiceImpl implements ICustomerService {
private CustomerUserMapper customerUserMapper;
@Autowired
private IBusinessInfoService businessInfoService;
@Autowired
private DskOpenApiUtil dskOpenApiUtil;
@Override
public List<CustomerListVo> selectList(CustomerSearchDto dto) {
......@@ -108,4 +117,34 @@ public class CustomerServiceImpl implements ICustomerService {
dto.setUserId(SecurityUtils.getUserId());
return businessInfoService.selectCustomerBusinessList(dto);
}
@Override
public List<String> importData(List<Customer> customerList) {
List<String> resultList = new ArrayList<>();
for (Customer customer : customerList) {
if (ObjectUtils.isEmpty(customer.getCompanyName())) {
continue;
}
try {
//TODO 名称查询企业信息
this.add(customer);
} catch (Exception e) {
resultList.add(customer.getCompanyName().concat(e.getMessage()));
}
}
return resultList;
}
private Map<String, Object> enterpriseByName(String keyword) {
try {
Map<String, Object> params = new HashMap<>();
params.put("keyword", keyword);
Map<String, Object> map = dskOpenApiUtil.requestBody("/nationzj/enterprice/findByName", params);
return (Map<String, Object>) map.get("data");
} catch (Exception e) {
log.error("企业名称匹配企业信息失败:" + keyword);
return null;
}
}
}
......@@ -82,10 +82,10 @@
where id = #{id}
</update>
<delete id="deleteBusinessBacklogById" parameterType="Long">
<delete id="deleteBacklogByBusinessId" parameterType="Long">
delete
from business_backlog
where id = #{id}
where business_id = #{businessId}
</delete>
<delete id="deleteBusinessBacklogByIds" parameterType="String">
......
......@@ -93,10 +93,10 @@
where id = #{id}
</update>
<delete id="deleteBusinessContactsById" parameterType="Long">
<delete id="deleteBusinessContactsByBusinessId" parameterType="Long">
delete
from business_contacts
where id = #{id}
where business_id = #{businessId}
</delete>
<delete id="deleteBusinessContactsByIds" parameterType="String">
......
......@@ -107,10 +107,10 @@
where id = #{id}
</update>
<delete id="deleteBusinessFollowRecordById" parameterType="Long">
<delete id="deleteBusinessFollowRecordByBusinessId" parameterType="Long">
delete
from business_follow_record
where id = #{id}
where business_id = #{businessId}
</delete>
<delete id="deleteBusinessFollowRecordByIds" parameterType="String">
......
......@@ -24,7 +24,6 @@
<result property="districtId" column="district_id"/>
<result property="projectType" column="project_type"/>
<result property="projectCategory" column="project_category"/>
<result property="team" column="team"/>
<result property="isPrivate" column="is_private"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
......@@ -52,7 +51,6 @@
district_id,
project_type,
project_category,
team,
is_private,
create_time,
update_time,
......@@ -173,7 +171,6 @@
<if test="districtId != null">district_id,</if>
<if test="projectType != null">project_type,</if>
<if test="projectCategory != null">project_category,</if>
<if test="team != null">team,</if>
<if test="isPrivate != null">is_private,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
......@@ -199,7 +196,6 @@
<if test="districtId != null">#{districtId},</if>
<if test="projectType != null">#{projectType},</if>
<if test="projectCategory != null">#{projectCategory},</if>
<if test="team != null">#{team},</if>
<if test="isPrivate != null">#{isPrivate},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
......@@ -229,7 +225,6 @@
<if test="districtId != null">district_id = #{districtId},</if>
<if test="projectType != null">project_type = #{projectType},</if>
<if test="projectCategory != null">project_category = #{projectCategory},</if>
<if test="team != null">team = #{team},</if>
<if test="isPrivate != null">is_private = #{isPrivate},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
......
......@@ -71,4 +71,9 @@
#{id}
</foreach>
</delete>
<delete id="deleteBusinessLabelByBusinessId">
delete
from business_label
where business_id = #{businessId}
</delete>
</mapper>
\ No newline at end of file
......@@ -97,10 +97,10 @@
where id = #{id}
</update>
<delete id="deleteBusinessRelateCompanyById" parameterType="Long">
<delete id="deleteRelateCompanyByBusinessId" parameterType="Long">
delete
from business_relate_company
where id = #{id}
where business_id = #{businessId}
</delete>
<delete id="deleteBusinessRelateCompanyByIds" parameterType="String">
......
......@@ -33,6 +33,12 @@
<include refid="selectBusinessUserVo"/>
where id = #{id}
</select>
<select id="selectCreatorBybusinessId" resultType="java.lang.String">
select u.nick_name
from business_user b
left join sys_user u on u.user_id = b.user_id
where b.is_founder = 1 and business_id =#{businessId}
</select>
<insert id="insertBusinessUser" parameterType="com.dsk.common.core.domain.entity.BusinessUser" useGeneratedKeys="true" keyProperty="id">
insert into business_user
......@@ -67,10 +73,10 @@
where id = #{id}
</update>
<delete id="deleteBusinessUserById" parameterType="Long">
<delete id="deleteBusinessUserByBusinessId" parameterType="Long">
delete
from business_user
where id = #{id}
where business_id = #{businessId} and is_founder = 1
</delete>
<delete id="deleteBusinessUserByIds" parameterType="String">
......
......@@ -3,9 +3,9 @@
<mapper namespace="com.dsk.system.mapper.CustomerMapper">
<sql id="Base_Bean">
ct.customer_id, ct.company_id, ct.company_name, ct.legal_person, ct.credit_code,
ct.register_capital, ct.company_nature, ct.company_level, ct.credit_level, ct.super_company,
ct.is_on, ct.is_major, ct.company_attribute, ct.main_business, ct.business_scope,
ct.customer_id, ct.company_id, ct.company_name, ct.legal_person, ct.credit_code,ct.register_capital,
ct.register_address, ct.company_nature, ct.company_level, ct.credit_level, ct.super_company,
ct.is_on, ct.is_major, ct.company_attribute, ct.main_business, ct.business_scope, ct.customer_level,
ct.business_characteristic, ct.decision_chain, ct.bid_characteristic, ct.performance_characteristic,
ct.other_ms_characteistic, ct.create_id, ct.create_time, ct.update_id, ct.update_time
</sql>
......
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