Commit 9b0ea614 authored by lcl's avatar lcl

添加客户决策链条相关功能

parent 0dd2ff6d
......@@ -2,7 +2,6 @@ package com.dsk.web.controller.customer;
import com.dsk.common.core.controller.BaseController;
import com.dsk.system.service.ICustomerService;
import com.dsk.system.service.impl.CustomerServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -14,7 +13,7 @@ import org.springframework.web.bind.annotation.RestController;
* @create 2023/5/16
*/
@RestController
@RequestMapping("/system/config")
@RequestMapping("/customer")
public class CustomerController extends BaseController {
@Autowired
......
package com.dsk.web.controller.customer;
import com.dsk.common.core.controller.BaseController;
import com.dsk.common.core.domain.AjaxResult;
import com.dsk.common.core.page.TableDataInfo;
import com.dsk.system.domain.CustomerDecisionChain;
import com.dsk.system.domain.dto.CustomerDecisionChainSearchDto;
import com.dsk.system.service.ICustomerDecisionChainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
/**
* 客户决策链条
* @author lcl
* @create 2023/5/16
*/
@RestController
@RequestMapping("/customer/decision/chain")
public class CustomerDecisionChainController extends BaseController {
@Autowired
private ICustomerDecisionChainService baseService;
/**
* 获取客户决策链条列表
*/
@PreAuthorize("@ss.hasPermi('customer:decision:chain:list')")
@GetMapping("/list")
public TableDataInfo selectPageList(CustomerDecisionChainSearchDto dto){
startPage();
return getDataTable(baseService.selectList(dto));
}
/**
* 添加客户决策链条
*/
@PreAuthorize("@ss.hasPermi('customer:decision:chain:add')")
@PostMapping()
public AjaxResult add(CustomerDecisionChain customerDecisionChain){
return AjaxResult.success(baseService.insert(customerDecisionChain));
}
/**
* 编辑客户决策链条
*/
@PreAuthorize("@ss.hasPermi('customer:decision:chain:edit')")
@PutMapping()
public AjaxResult edit(CustomerDecisionChain customerDecisionChain){
return AjaxResult.success(baseService.update(customerDecisionChain));
}
/**
* 删除客户决策链条
*/
@PreAuthorize("@ss.hasPermi('customer:decision:chain:del')")
@DeleteMapping("/{id}")
public AjaxResult del(@PathVariable("id") Long id){
return AjaxResult.success(baseService.deleteById(id));
}
}
package com.dsk.system.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
......@@ -13,10 +17,13 @@ import java.util.Date;
* @since 2023-05-16 09:27:55
*/
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("customer")
public class Customer implements Serializable {
private static final long serialVersionUID = 824383302173350532L;
@TableId(value = "customer_id",type = IdType.ASSIGN_UUID)
private String customerId;
/**
* jsk企业id
......@@ -74,6 +81,26 @@ public class Customer implements Serializable {
* 经营范围
*/
private String businessScope;
/**
* 商务条件特点
*/
private String businessCharacteristic;
/**
* 决策链条
*/
private String decisionChain;
/**
* 招投标流程特点
*/
private String bidCharacteristic;
/**
* 履约阶段特点
*/
private String performanceCharacteristic;
/**
* 其它管理体系特点
*/
private String otherMsCharacteistic;
/**
* 最后跟进时间
*/
......
package com.dsk.system.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
* 客户决策链条(CustomerDecisionChain)实体类
*
* @author makejava
* @since 2023-05-16 15:33:45
*/
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("customer_decision_chain")
public class CustomerDecisionChain implements Serializable {
private static final long serialVersionUID = 990085082282249053L;
@TableId(value = "id",type = IdType.AUTO)
private Long id;
/**
* 客户id
*/
private String customerId;
/**
* 姓名
*/
private String name;
/**
* 角色
*/
private String role;
/**
* 公司/机关(工作单位)
*/
private String workUnit;
/**
* 职位
*/
private String position;
/**
* 联系方式
*/
private String contactInformation;
/**
* 备注
*/
private String remark;
private Date createTime;
private Long updateId;
private Date updateTime;
}
package com.dsk.system.domain.dto;
import lombok.Data;
/**
* @author lcl
* @create 2023/5/16
*/
@Data
public class CustomerDecisionChainSearchDto {
/**
* 客户id
*/
private String customerId;
}
package com.dsk.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dsk.system.domain.CustomerDecisionChain;
import org.apache.ibatis.annotations.Mapper;
/**
* 客户决策链条(CustomerDecisionChain)表数据库访问层
*
* @author makejava
* @since 2023-05-16 15:33:46
*/
@Mapper
public interface CustomerDecisionChainMapper extends BaseMapper<CustomerDecisionChain> {
}
package com.dsk.system.service;
import com.dsk.system.domain.CustomerDecisionChain;
import com.dsk.system.domain.dto.CustomerDecisionChainSearchDto;
import java.util.List;
/**
* 客户决策链条(CustomerDecisionChain)表服务接口
*
* @author makejava
* @since 2023-05-16 15:33:45
*/
public interface ICustomerDecisionChainService {
/**
* 查询数据列表
*/
List<CustomerDecisionChain> selectList(CustomerDecisionChainSearchDto dto);
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
CustomerDecisionChain selectById(Long id);
/**
* 新增数据
*
* @param customerDecisionChain 实例对象
* @return 实例对象
*/
boolean insert(CustomerDecisionChain customerDecisionChain);
/**
* 修改数据
*
* @param customerDecisionChain 实例对象
* @return 实例对象
*/
boolean update(CustomerDecisionChain customerDecisionChain);
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
boolean deleteById(Long id);
}
package com.dsk.system.service.impl;
import cn.hutool.core.bean.BeanException;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.dsk.common.utils.SecurityUtils;
import com.dsk.system.domain.CustomerDecisionChain;
import com.dsk.system.domain.dto.CustomerDecisionChainSearchDto;
import com.dsk.system.mapper.CustomerDecisionChainMapper;
import com.dsk.system.service.ICustomerDecisionChainService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import javax.annotation.Resource;
import java.util.List;
/**
* 客户决策链条(CustomerDecisionChain)表服务实现类
*
* @author makejava
* @since 2023-05-16 15:33:45
*/
@Slf4j
@Service
public class CustomerDecisionChainServiceImpl implements ICustomerDecisionChainService {
@Resource
private CustomerDecisionChainMapper baseMapper;
@Override
public List<CustomerDecisionChain> selectList(CustomerDecisionChainSearchDto dto) {
return baseMapper.selectList(Wrappers.<CustomerDecisionChain>lambdaQuery()
.eq(CustomerDecisionChain::getCustomerId,dto.getCustomerId()));
}
/**
* 通过ID查询单条数据
*
* @param id 主键
* @return 实例对象
*/
@Override
public CustomerDecisionChain selectById(Long id) {
return baseMapper.selectById(id);
}
/**
* 新增数据
*
* @param customerDecisionChain 实例对象
* @return 实例对象
*/
@Override
public boolean insert(CustomerDecisionChain customerDecisionChain) {
verifyParameter(customerDecisionChain);
return baseMapper.insert(customerDecisionChain) > 0;
}
/**
* 修改数据
*
* @param customerDecisionChain 实例对象
* @return 实例对象
*/
@Override
public boolean update(CustomerDecisionChain customerDecisionChain) {
if(ObjectUtils.isEmpty(customerDecisionChain.getId())) throw new BeanException("id不能为空!");
verifyParameter(customerDecisionChain);
return baseMapper.updateById(customerDecisionChain) > 0;
}
/**
* 通过主键删除数据
*
* @param id 主键
* @return 是否成功
*/
@Override
public boolean deleteById(Long id) {
return baseMapper.deleteById(id) > 0;
}
/**
* 参数验证
* @param customerDecisionChain
*/
private void verifyParameter(CustomerDecisionChain customerDecisionChain){
if(ObjectUtils.isEmpty(customerDecisionChain.getCustomerId())) throw new BeanException("客户id不能为空!");
customerDecisionChain.setUpdateId(SecurityUtils.getUserId());
}
}
<?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.system.mapper.CustomerDecisionChainMapper">
<resultMap type="com.dsk.system.domain.CustomerDecisionChain" id="CustomerDecisionChainMap">
<result property="id" column="id" jdbcType="INTEGER"/>
<result property="customerId" column="customer_id" jdbcType="VARCHAR"/>
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="role" column="role" jdbcType="VARCHAR"/>
<result property="workUnit" column="work_unit" jdbcType="VARCHAR"/>
<result property="position" column="position" jdbcType="VARCHAR"/>
<result property="contactInformation" column="contact_information" jdbcType="VARCHAR"/>
<result property="remark" column="remark" jdbcType="VARCHAR"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateId" column="update_id" jdbcType="INTEGER"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
</resultMap>
</mapper>
......@@ -2,29 +2,6 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.dsk.system.mapper.CustomerMapper">
<resultMap type="com.dsk.system.domain.Customer" id="CustomerMap">
<result property="customerId" column="customer_id" jdbcType="VARCHAR"/>
<result property="companyId" column="company_id" jdbcType="INTEGER"/>
<result property="companyName" column="company_name" jdbcType="VARCHAR"/>
<result property="legalPerson" column="legal_person" jdbcType="VARCHAR"/>
<result property="registerCapitalStr" column="register_capital_str" jdbcType="VARCHAR"/>
<result property="registerCapital" column="register_capital" jdbcType="NUMERIC"/>
<result property="companyNature" column="company_nature" jdbcType="VARCHAR"/>
<result property="companyLevel" column="company_level" jdbcType="VARCHAR"/>
<result property="creditLevel" column="credit_level" jdbcType="VARCHAR"/>
<result property="superCompany" column="super_company" jdbcType="VARCHAR"/>
<result property="isOn" column="is_on" jdbcType="INTEGER"/>
<result property="isMajor" column="is_major" jdbcType="INTEGER"/>
<result property="companyAttribute" column="company_attribute" jdbcType="VARCHAR"/>
<result property="mainBusiness" column="main_business" jdbcType="VARCHAR"/>
<result property="businessScope" column="business_scope" jdbcType="VARCHAR"/>
<result property="lastFollowTime" column="last_follow_time" jdbcType="TIMESTAMP"/>
<result property="createId" column="create_id" jdbcType="INTEGER"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="updateId" column="update_id" jdbcType="INTEGER"/>
<result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
</resultMap>
</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