代码包名修改
This commit is contained in:
parent
56fdaf47b9
commit
6b9a1d135a
5
pom.xml
5
pom.xml
@ -362,6 +362,11 @@
|
||||
<artifactId>pusong-demo</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.pusong</groupId>
|
||||
<artifactId>pusong-business</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 工作流模块 -->
|
||||
<dependency>
|
||||
|
@ -79,7 +79,11 @@
|
||||
<groupId>com.pusong</groupId>
|
||||
<artifactId>pusong-demo</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 主业务模块 -->
|
||||
<dependency>
|
||||
<groupId>com.pusong</groupId>
|
||||
<artifactId>pusong-business</artifactId>
|
||||
</dependency>
|
||||
<!-- 工作流模块 -->
|
||||
<dependency>
|
||||
<groupId>com.pusong</groupId>
|
||||
|
@ -15,6 +15,7 @@
|
||||
<module>pusong-job</module>
|
||||
<module>pusong-system</module>
|
||||
<module>pusong-workflow</module>
|
||||
<module>pusong-business</module>
|
||||
</modules>
|
||||
|
||||
<artifactId>pusong-modules</artifactId>
|
||||
|
108
pusong-modules/pusong-business/pom.xml
Normal file
108
pusong-modules/pusong-business/pom.xml
Normal file
@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.pusong</groupId>
|
||||
<artifactId>pusong-modules</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>pusong-business</artifactId>
|
||||
|
||||
<description>
|
||||
主要业务模块
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- 通用工具-->
|
||||
<dependency>
|
||||
<groupId>com.pusong</groupId>
|
||||
<artifactId>pusong-common-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.pusong</groupId>
|
||||
<artifactId>pusong-common-doc</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--短信模块<dependency>
|
||||
<groupId>com.pusong</groupId>
|
||||
<artifactId>pusong-common-sms</artifactId>
|
||||
</dependency>-->
|
||||
|
||||
<!-- 邮件模块<dependency>
|
||||
<groupId>com.pusong</groupId>
|
||||
<artifactId>pusong-common-mail</artifactId>
|
||||
</dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>com.pusong</groupId>
|
||||
<artifactId>pusong-common-redis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.pusong</groupId>
|
||||
<artifactId>pusong-common-idempotent</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.pusong</groupId>
|
||||
<artifactId>pusong-common-mybatis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.pusong</groupId>
|
||||
<artifactId>pusong-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.pusong</groupId>
|
||||
<artifactId>pusong-common-excel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.pusong</groupId>
|
||||
<artifactId>pusong-common-security</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.pusong</groupId>
|
||||
<artifactId>pusong-common-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- <dependency>
|
||||
<groupId>com.pusong</groupId>
|
||||
<artifactId>pusong-common-ratelimiter</artifactId>
|
||||
</dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>com.pusong</groupId>
|
||||
<artifactId>pusong-common-translation</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.pusong</groupId>
|
||||
<artifactId>pusong-common-sensitive</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.pusong</groupId>
|
||||
<artifactId>pusong-common-encrypt</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.pusong</groupId>
|
||||
<artifactId>pusong-common-tenant</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.pusong</groupId>
|
||||
<artifactId>pusong-common-websocket</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
@ -0,0 +1,124 @@
|
||||
package com.pusong.business.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.pusong.business.domain.bo.PsCustomCallbackBo;
|
||||
import com.pusong.business.domain.bo.PsCustomPriceBo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.pusong.common.idempotent.annotation.RepeatSubmit;
|
||||
import com.pusong.common.log.annotation.Log;
|
||||
import com.pusong.common.web.core.BaseController;
|
||||
import com.pusong.common.mybatis.core.page.PageQuery;
|
||||
import com.pusong.common.core.domain.R;
|
||||
import com.pusong.common.core.validate.AddGroup;
|
||||
import com.pusong.common.core.validate.EditGroup;
|
||||
import com.pusong.common.log.enums.BusinessType;
|
||||
import com.pusong.common.excel.utils.ExcelUtil;
|
||||
import com.pusong.business.domain.vo.PsCustomInfoVo;
|
||||
import com.pusong.business.domain.bo.PsCustomInfoBo;
|
||||
import com.pusong.business.service.IPsCustomInfoService;
|
||||
import com.pusong.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 客户基本信息
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2024-07-25
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/business/customInfo")
|
||||
public class PsCustomController extends BaseController {
|
||||
|
||||
private final IPsCustomInfoService psCustomInfoService;
|
||||
/**
|
||||
* 查询登陆人下所有的客户名称和id
|
||||
*/
|
||||
@SaCheckPermission("business:customInfo:list")
|
||||
@GetMapping("/listByLoginUser")
|
||||
public R<List<PsCustomInfoVo>> listByLoginUser() {
|
||||
return R.ok(psCustomInfoService.listByLoginUser());
|
||||
}
|
||||
/**
|
||||
* 查询客户信息列表
|
||||
*/
|
||||
@SaCheckPermission("business:customInfo:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<PsCustomInfoVo> list(PsCustomInfoBo bo, PageQuery pageQuery) {
|
||||
return psCustomInfoService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
/**
|
||||
* 新增客户基本信息
|
||||
*/
|
||||
@SaCheckPermission("business:customInfo:add")
|
||||
@Log(title = "新增客户基本信息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody PsCustomInfoBo bo) {
|
||||
return toAjax(psCustomInfoService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改客户基本信息
|
||||
*/
|
||||
@SaCheckPermission("business:customInfo:edit")
|
||||
@Log(title = "客户基本信息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody PsCustomInfoBo bo) {
|
||||
return toAjax(psCustomInfoService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增客户报价金额
|
||||
*/
|
||||
@SaCheckPermission("business:customInfo:edit")
|
||||
@Log(title = "新增客户报价金额", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/insertPrice")
|
||||
public R<Void> insertPrice(@Validated(AddGroup.class) @RequestBody List<PsCustomPriceBo> bos) {
|
||||
return toAjax(psCustomInfoService.insertPiceByBo(bos));
|
||||
}
|
||||
/**
|
||||
* 新增客户回访记录
|
||||
*/
|
||||
@SaCheckPermission("business:customInfo:edit")
|
||||
@Log(title = "新增客户回访记录", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/insertCallback")
|
||||
public R<Void> insertCallback(@Validated(AddGroup.class) @RequestBody List<PsCustomCallbackBo> bos) {
|
||||
return toAjax(psCustomInfoService.insertCallbackByBo(bos));
|
||||
}
|
||||
|
||||
/**
|
||||
* 状态变更
|
||||
*
|
||||
* @param id 主键串
|
||||
* @param type 操作类型 1移入公海 2拉黑
|
||||
*/
|
||||
@SaCheckPermission("business:customInfo:edit")
|
||||
@Log(title = "客户状态变更操作", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/updateStatus")
|
||||
public R<Void> updateStatus(@NotEmpty(message = "主键不能为空") @PathVariable Long id,
|
||||
@NotEmpty(message = "操作类型不能为空") @PathVariable Integer type) {
|
||||
return toAjax(psCustomInfoService.updateCustomerStatus(id, type));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出客户基本信息列表
|
||||
*/
|
||||
@SaCheckPermission("business:customInfo:export")
|
||||
@Log(title = "客户基本信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(PsCustomInfoBo bo, HttpServletResponse response) {
|
||||
List<PsCustomInfoVo> list = psCustomInfoService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "客户基本信息", PsCustomInfoVo.class, response);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1 @@
|
||||
package com.pusong.business.controller;
|
@ -0,0 +1,51 @@
|
||||
package com.pusong.business.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.pusong.common.tenant.core.TenantEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 客户基本信息对象 ps_custom_info
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2024-07-25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("ps_custom_callback")
|
||||
public class PsCustomCallback extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 客户id
|
||||
*/
|
||||
private Long customId;
|
||||
|
||||
/**
|
||||
* 回访内容
|
||||
*/
|
||||
private String callbackContent;
|
||||
|
||||
/**
|
||||
* 2逻辑删除 0 默认有效
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
package com.pusong.business.domain;
|
||||
|
||||
import com.pusong.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 客户基本信息对象 ps_custom_info
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2024-07-25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("ps_custom_info")
|
||||
public class PsCustomInfo extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 客户名称
|
||||
*/
|
||||
private String customName;
|
||||
|
||||
/**
|
||||
* 客户电话客户电话(多个用英文逗号分割)
|
||||
*/
|
||||
private String customMobile;
|
||||
|
||||
/**
|
||||
* 客户来源
|
||||
*/
|
||||
private String customSource;
|
||||
|
||||
/**
|
||||
* 客户联系地址
|
||||
*/
|
||||
private String customAdressDetail;
|
||||
|
||||
/**
|
||||
* 所属客户经理
|
||||
*/
|
||||
private Long customManager;
|
||||
|
||||
/**
|
||||
* 客户级别
|
||||
*/
|
||||
private String customLevel;
|
||||
|
||||
/**
|
||||
* 客户状态
|
||||
*/
|
||||
private String customStatus;
|
||||
|
||||
/**
|
||||
* 介绍人-仅支持本司内客户
|
||||
*/
|
||||
private Long customIntroducer;
|
||||
|
||||
/**
|
||||
* 拉黑标识 1是0否
|
||||
*/
|
||||
private String black;
|
||||
|
||||
|
||||
/**
|
||||
* 2逻辑删除 0 默认有效
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.pusong.business.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.pusong.common.tenant.core.TenantEntity;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 客户基本信息对象 ps_custom_info
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2024-07-25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("ps_custom_price")
|
||||
public class PsCustomPrice extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 客户id
|
||||
*/
|
||||
private Long customId;
|
||||
|
||||
/**
|
||||
* 报价批次
|
||||
*/
|
||||
private Integer priceBatch;
|
||||
|
||||
/**
|
||||
* 服务项目
|
||||
*/
|
||||
private String serviceProject;
|
||||
|
||||
/**
|
||||
* 服务金额
|
||||
*/
|
||||
private BigDecimal servicePrice;
|
||||
|
||||
/**
|
||||
* 2逻辑删除 0 默认有效
|
||||
*/
|
||||
@TableLogic
|
||||
private Integer delFlag;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.pusong.business.domain.bo;
|
||||
|
||||
import com.pusong.business.domain.PsCustomCallback;
|
||||
import com.pusong.business.domain.PsCustomInfo;
|
||||
import com.pusong.common.core.validate.AddGroup;
|
||||
import com.pusong.common.mybatis.core.domain.BaseEntity;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 客户基本信息对象 ps_custom_info
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2024-07-25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = PsCustomCallback.class, reverseConvertGenerate = false)
|
||||
public class PsCustomCallbackBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 客户id
|
||||
*/
|
||||
@NotBlank(message = "客户id不能为空",groups = {AddGroup.class})
|
||||
private Long customId;
|
||||
|
||||
/**
|
||||
* 回访内容
|
||||
*/
|
||||
@NotBlank(message = "服务项目不能为空",groups = {AddGroup.class})
|
||||
private String callbackContent;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
package com.pusong.business.domain.bo;
|
||||
|
||||
import com.pusong.business.domain.PsCustomInfo;
|
||||
import com.pusong.common.core.validate.AddGroup;
|
||||
import com.pusong.common.core.validate.EditGroup;
|
||||
import com.pusong.common.mybatis.core.domain.BaseEntity;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
/**
|
||||
* 客户基本信息业务对象 ps_custom_info
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2024-07-25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = PsCustomInfo.class, reverseConvertGenerate = false)
|
||||
public class PsCustomInfoBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotNull(message = "不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 客户名称
|
||||
*/
|
||||
@NotBlank(message = "客户名称不能为空",groups = { EditGroup.class, AddGroup.class })
|
||||
@Length(max = 50)
|
||||
private String customName;
|
||||
/**
|
||||
* 客户电话客户电话(多个用英文逗号分割)
|
||||
*/
|
||||
@NotBlank(message = "客户电话客户电话",groups = { EditGroup.class, AddGroup.class })
|
||||
@Length(max = 500)
|
||||
private String customMobile;
|
||||
/**
|
||||
* 客户来源
|
||||
*/
|
||||
@NotBlank(message = "客户来源不能为空")
|
||||
private String customSource;
|
||||
|
||||
|
||||
/**
|
||||
* 所属销售经理
|
||||
*/
|
||||
@NotNull(message = "所属客户经理名称不能为空")
|
||||
private String customManagerName;
|
||||
|
||||
/**
|
||||
* 客户级别
|
||||
*/
|
||||
@NotBlank(message = "客户级别不能为空")
|
||||
private String customLevel;
|
||||
|
||||
|
||||
/**
|
||||
* 介绍人-仅支持本司内客户
|
||||
*/
|
||||
@NotNull(message = "介绍人姓名")
|
||||
private String customIntroducerName;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package com.pusong.business.domain.bo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.pusong.business.domain.PsCustomInfo;
|
||||
import com.pusong.common.core.validate.AddGroup;
|
||||
import com.pusong.common.core.validate.EditGroup;
|
||||
import com.pusong.common.mybatis.core.domain.BaseEntity;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 客户报价信息对象 ps_custom_Price
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2024-07-25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = PsCustomInfo.class, reverseConvertGenerate = false)
|
||||
public class PsCustomPriceBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 客户id
|
||||
*/
|
||||
@NotBlank(message = "客户id不能为空",groups = {AddGroup.class})
|
||||
private Long customId;
|
||||
|
||||
/**
|
||||
* 报价批次
|
||||
*/
|
||||
private Integer priceBatch;
|
||||
|
||||
/**
|
||||
* 服务项目
|
||||
*/
|
||||
@NotBlank(message = "服务项目不能为空",groups = {AddGroup.class})
|
||||
private String serviceProject;
|
||||
|
||||
/**
|
||||
* 服务金额
|
||||
*/
|
||||
@NotBlank(message = "服务项目报价不能为空",groups = {AddGroup.class})
|
||||
private BigDecimal servicePrice;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1 @@
|
||||
package com.pusong.business.domain.bo;
|
@ -0,0 +1 @@
|
||||
package com.pusong.demo.domain;
|
@ -0,0 +1,51 @@
|
||||
package com.pusong.business.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.pusong.business.domain.PsCustomPrice;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 客户基本信息对象 ps_custom_info
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2024-07-25
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = PsCustomPrice.class)
|
||||
public class PsCustomCallbackVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 2L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
|
||||
/**
|
||||
* 客户id
|
||||
*/
|
||||
private Long customId;
|
||||
|
||||
/**
|
||||
* 回访内容
|
||||
*/
|
||||
private String callbackContent;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
private Date createTime;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,138 @@
|
||||
package com.pusong.business.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.pusong.business.domain.PsCustomInfo;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.pusong.common.excel.annotation.ExcelDictFormat;
|
||||
import com.pusong.common.excel.convert.ExcelDictConvert;
|
||||
import com.pusong.common.translation.annotation.Translation;
|
||||
import com.pusong.common.translation.constant.TransConstant;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 客户基本信息视图对象 ps_custom_info
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2024-07-25
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = PsCustomInfo.class)
|
||||
public class PsCustomInfoVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 客户名称
|
||||
*/
|
||||
@ExcelProperty(value = "客户名称")
|
||||
private String customName;
|
||||
|
||||
/**
|
||||
* 客户电话客户电话(多个用英文逗号分割)
|
||||
*/
|
||||
@ExcelProperty(value = "客户电话(多个用英文逗号分割)")
|
||||
private String customMobile;
|
||||
|
||||
/**
|
||||
* 客户来源
|
||||
*/
|
||||
@ExcelProperty(value = "客户来源", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "custom_source")
|
||||
private String customSource;
|
||||
|
||||
/**
|
||||
* 客户联系地址
|
||||
*/
|
||||
@ExcelProperty(value = "客户联系地址")
|
||||
private String customAdressDetail;
|
||||
|
||||
/**
|
||||
* 所属客户经理
|
||||
*/
|
||||
@ExcelProperty(value = "所属客户经理id")
|
||||
private String customManager;
|
||||
/**
|
||||
* 所属客户经理
|
||||
*/
|
||||
@ExcelProperty(value = "所属客户经理姓名")
|
||||
private String customManagerName;
|
||||
|
||||
/**
|
||||
* 客户级别
|
||||
*/
|
||||
@ExcelProperty(value = "客户级别", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "custom_level")
|
||||
private String customLevel;
|
||||
|
||||
/**
|
||||
* 客户状态
|
||||
*/
|
||||
@ExcelProperty(value = "客户状态", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "customer_status")
|
||||
private String customStatus;
|
||||
|
||||
/**
|
||||
* 介绍人-仅支持本司内客户
|
||||
*/
|
||||
@ExcelProperty(value = "介绍人-仅支持本司内客户")
|
||||
private Long customIntroducer;
|
||||
|
||||
/**
|
||||
* 介绍人姓名-仅支持本司内客户
|
||||
*/
|
||||
@ExcelProperty(value = "介绍人姓名-仅支持本司内客户")
|
||||
private String customIntroducerName;
|
||||
|
||||
/**
|
||||
* 拉黑标识
|
||||
*/
|
||||
@ExcelProperty(value = "拉黑标识")
|
||||
private String black;
|
||||
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ExcelProperty(value = "创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@ExcelProperty(value = "修改时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 总报价金额
|
||||
*/
|
||||
@ExcelProperty(value = "总报价金额")
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 报价金额DTO
|
||||
*/
|
||||
private List<PsCustomPriceVo> psCustomPriceVo;
|
||||
|
||||
/**
|
||||
* 回访记录DTO
|
||||
*/
|
||||
private List<PsCustomCallbackVo> psCustomCallbackVo;
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.pusong.business.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.pusong.business.domain.PsCustomInfo;
|
||||
import com.pusong.business.domain.PsCustomPrice;
|
||||
import com.pusong.common.tenant.core.TenantEntity;
|
||||
import com.pusong.common.translation.annotation.Translation;
|
||||
import com.pusong.common.translation.constant.TransConstant;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 客户基本信息对象 ps_custom_info
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2024-07-25
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = PsCustomPrice.class)
|
||||
public class PsCustomPriceVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 2L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long customId;
|
||||
/**
|
||||
* 报价批次
|
||||
*/
|
||||
private Integer priceBatch;
|
||||
|
||||
/**
|
||||
* 服务项目
|
||||
*/
|
||||
@Translation(type = TransConstant.DICT_TYPE_TO_LABEL,other = "service_project")
|
||||
private String serviceProject;
|
||||
|
||||
/**
|
||||
* 服务金额
|
||||
*/
|
||||
private BigDecimal servicePrice;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.pusong.business.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum CustomerStatusEnum {
|
||||
|
||||
INIT("1","初始化"),
|
||||
PUBLIC("2","进入公海");
|
||||
private String code;
|
||||
private String text;
|
||||
}
|
@ -0,0 +1 @@
|
||||
package com.pusong.business.listener;
|
@ -0,0 +1,20 @@
|
||||
package com.pusong.business.mapper;
|
||||
|
||||
|
||||
import com.pusong.business.domain.PsCustomCallback;
|
||||
import com.pusong.business.domain.PsCustomPrice;
|
||||
import com.pusong.business.domain.vo.PsCustomCallbackVo;
|
||||
import com.pusong.business.domain.vo.PsCustomPriceVo;
|
||||
import com.pusong.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 客户基本信息Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2024-07-25
|
||||
*/
|
||||
public interface PsCustomCallbackMapper extends BaseMapperPlus<PsCustomCallback, PsCustomCallbackVo> {
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package com.pusong.business.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pusong.business.domain.PsCustomInfo;
|
||||
import com.pusong.business.domain.vo.PsCustomInfoVo;
|
||||
import com.pusong.common.mybatis.annotation.DataColumn;
|
||||
import com.pusong.common.mybatis.annotation.DataPermission;
|
||||
import com.pusong.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 客户基本信息Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2024-07-25
|
||||
*/
|
||||
public interface PsCustomInfoMapper extends BaseMapperPlus<PsCustomInfo, PsCustomInfoVo> {
|
||||
|
||||
@DataPermission({
|
||||
@DataColumn(key = "deptName", value = "dept_id"),
|
||||
@DataColumn(key = "userName", value = "user_id")
|
||||
})
|
||||
List<PsCustomInfo> selectList(@Param(Constants.WRAPPER) Wrapper<PsCustomInfo> queryWrapper);
|
||||
|
||||
@DataPermission({
|
||||
@DataColumn(key = "deptName", value = "create_dept"),
|
||||
@DataColumn(key = "userName", value = "create_by")
|
||||
})
|
||||
Page<PsCustomInfoVo> selectPageCustomerList(@Param("page") Page<PsCustomInfo> page, @Param(Constants.WRAPPER) Wrapper<PsCustomInfo> queryWrapper);
|
||||
|
||||
@DataPermission({
|
||||
@DataColumn(key = "deptName", value = "create_dept"),
|
||||
@DataColumn(key = "userName", value = "create_by")
|
||||
})
|
||||
List<PsCustomInfoVo> selectPageCustomerList( @Param(Constants.WRAPPER) Wrapper<PsCustomInfo> queryWrapper);
|
||||
//
|
||||
// @DataPermission({
|
||||
// @DataColumn(key = "deptName", value = "u.dept_id"),
|
||||
// @DataColumn(key = "userName", value = "u.user_id")
|
||||
// })
|
||||
// Page<SysUserVo> selectPageUserList(@Param("page") Page<SysUser> page, @Param(Constants.WRAPPER) Wrapper<SysUser> queryWrapper);
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.pusong.business.mapper;
|
||||
|
||||
|
||||
import com.pusong.business.domain.PsCustomPrice;
|
||||
import com.pusong.business.domain.vo.PsCustomPriceVo;
|
||||
import com.pusong.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 客户基本信息Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2024-07-25
|
||||
*/
|
||||
public interface PsCustomPriceMapper extends BaseMapperPlus<PsCustomPrice, PsCustomPriceVo> {
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1 @@
|
||||
package com.pusong.demo.mapper;
|
@ -0,0 +1,85 @@
|
||||
package com.pusong.business.service;
|
||||
|
||||
import com.pusong.business.domain.PsCustomCallback;
|
||||
import com.pusong.business.domain.bo.PsCustomCallbackBo;
|
||||
import com.pusong.business.domain.bo.PsCustomPriceBo;
|
||||
import com.pusong.business.domain.vo.PsCustomInfoVo;
|
||||
import com.pusong.business.domain.bo.PsCustomInfoBo;
|
||||
import com.pusong.common.mybatis.core.page.TableDataInfo;
|
||||
import com.pusong.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 客户基本信息Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2024-07-25
|
||||
*/
|
||||
public interface IPsCustomInfoService {
|
||||
|
||||
/**
|
||||
* 查询登陆人下所有的客户名称和id
|
||||
* @return 客户id和姓名
|
||||
*/
|
||||
List<PsCustomInfoVo> listByLoginUser();
|
||||
/**
|
||||
* 分页查询客户基本信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 客户基本信息分页列表
|
||||
*/
|
||||
TableDataInfo<PsCustomInfoVo> queryPageList(PsCustomInfoBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的客户基本信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 客户基本信息列表
|
||||
*/
|
||||
List<PsCustomInfoVo> queryList(PsCustomInfoBo bo);
|
||||
|
||||
/**
|
||||
* 新增客户基本信息
|
||||
*
|
||||
* @param bo 客户基本信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(PsCustomInfoBo bo);
|
||||
|
||||
/**
|
||||
* 修改客户基本信息
|
||||
*
|
||||
* @param bo 客户基本信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(PsCustomInfoBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除客户基本信息信息
|
||||
*
|
||||
* @param id 主键id
|
||||
* @param type 操作类型
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean updateCustomerStatus(Long id, Integer type);
|
||||
|
||||
|
||||
/**
|
||||
* 新增客户报价信息
|
||||
*
|
||||
* @param bos 客户报价信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertPiceByBo(List<PsCustomPriceBo> bos);
|
||||
|
||||
/**
|
||||
* 新增客户回访记录
|
||||
*
|
||||
* @param bos 客户回访记录
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertCallbackByBo(List<PsCustomCallbackBo> bos);
|
||||
}
|
@ -0,0 +1,231 @@
|
||||
package com.pusong.business.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.pusong.business.domain.PsCustomCallback;
|
||||
import com.pusong.business.domain.PsCustomPrice;
|
||||
import com.pusong.business.domain.bo.PsCustomCallbackBo;
|
||||
import com.pusong.business.domain.bo.PsCustomPriceBo;
|
||||
import com.pusong.business.domain.vo.PsCustomCallbackVo;
|
||||
import com.pusong.business.domain.vo.PsCustomPriceVo;
|
||||
import com.pusong.business.enums.CustomerStatusEnum;
|
||||
import com.pusong.business.mapper.PsCustomCallbackMapper;
|
||||
import com.pusong.business.mapper.PsCustomPriceMapper;
|
||||
import com.pusong.common.core.utils.MapstructUtils;
|
||||
import com.pusong.common.core.utils.StringUtils;
|
||||
import com.pusong.common.mybatis.core.page.TableDataInfo;
|
||||
import com.pusong.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.pusong.common.satoken.utils.LoginHelper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.pusong.business.domain.bo.PsCustomInfoBo;
|
||||
import com.pusong.business.domain.vo.PsCustomInfoVo;
|
||||
import com.pusong.business.domain.PsCustomInfo;
|
||||
import com.pusong.business.mapper.PsCustomInfoMapper;
|
||||
import com.pusong.business.service.IPsCustomInfoService;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 客户基本信息Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2024-07-25
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class PsCustomInfoServiceImpl implements IPsCustomInfoService {
|
||||
|
||||
private final PsCustomInfoMapper baseMapper;
|
||||
private final PsCustomPriceMapper priceMapper;
|
||||
private final PsCustomCallbackMapper callbackMapper;
|
||||
|
||||
/**
|
||||
* 查询登陆人下所有的客户名称和id
|
||||
* @return 客户id和姓名
|
||||
*/
|
||||
@Override
|
||||
public List<PsCustomInfoVo> listByLoginUser() {
|
||||
//查询客户基本信息
|
||||
List<PsCustomInfoVo> list = baseMapper.selectVoList(new QueryWrapper<PsCustomInfo>().select("id","custom_name")
|
||||
.lambda().eq(PsCustomInfo::getDelFlag, 0));
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询客户基本信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 客户基本信息分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<PsCustomInfoVo> queryPageList(PsCustomInfoBo bo, PageQuery pageQuery) {
|
||||
//查询客户基本信息
|
||||
Wrapper<PsCustomInfo> lqw = buildQueryWrapper(bo);
|
||||
Page<PsCustomInfoVo> result = baseMapper.selectPageCustomerList(pageQuery.build(), lqw);
|
||||
if(CollectionUtils.isEmpty(result.getRecords())){
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
List<Long> ids = result.getRecords().stream().map(PsCustomInfoVo::getId).collect(Collectors.toList());
|
||||
|
||||
//查询报价金额详细
|
||||
List<PsCustomPriceVo> pices = priceMapper.selectVoList(Wrappers.<PsCustomPrice>lambdaQuery()
|
||||
.in(PsCustomPrice::getCustomId,ids).eq(PsCustomPrice::getDelFlag,0));
|
||||
Map<Long, List<PsCustomPriceVo>> id_piceMap = new HashMap<>();
|
||||
if(CollectionUtils.isNotEmpty(pices)){
|
||||
//分组
|
||||
id_piceMap = pices.stream().collect((Collectors.groupingBy(PsCustomPriceVo::getCustomId)));
|
||||
//排序
|
||||
id_piceMap.forEach((k,v)->{
|
||||
v = v.stream().sorted(Comparator.comparingInt(PsCustomPriceVo::getPriceBatch)).collect(Collectors.toList());
|
||||
});
|
||||
}
|
||||
|
||||
//查询回访记录详细
|
||||
List<PsCustomCallbackVo> callbacks = callbackMapper.selectVoList(Wrappers.<PsCustomCallback>lambdaQuery()
|
||||
.in(PsCustomCallback::getCustomId, ids)
|
||||
.eq(PsCustomCallback::getDelFlag, 0)
|
||||
.orderByDesc(PsCustomCallback::getCreateTime));
|
||||
Map<Long, List<PsCustomCallbackVo>> id_callbackMap = new HashMap<>();
|
||||
if(CollectionUtils.isNotEmpty(callbacks)){
|
||||
//分组
|
||||
id_callbackMap = callbacks.stream().collect((Collectors.groupingBy(PsCustomCallbackVo::getCustomId)));
|
||||
}
|
||||
for (PsCustomInfoVo info : result.getRecords()) {
|
||||
//装填回访记录vo
|
||||
info.setPsCustomCallbackVo(id_callbackMap.get(info.getId()));
|
||||
//装填报价金额vo
|
||||
info.setPsCustomPriceVo(id_piceMap.get(info.getId()));
|
||||
}
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的客户基本信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 客户基本信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<PsCustomInfoVo> queryList(PsCustomInfoBo bo) {
|
||||
Wrapper<PsCustomInfo> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectPageCustomerList(lqw);
|
||||
}
|
||||
|
||||
private Wrapper<PsCustomInfo> buildQueryWrapper(PsCustomInfoBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
QueryWrapper<PsCustomInfo> qw = Wrappers.query();
|
||||
//客户信息表条件
|
||||
qw.like( "info.del_flag", 0);//删除标志
|
||||
qw.like(StringUtils.isNotBlank(bo.getCustomName()), "info.custom_name", bo.getCustomName());//姓名
|
||||
qw.eq(StringUtils.isNotBlank(bo.getCustomSource()), "info.custom_source", bo.getCustomSource());//来源
|
||||
qw.eq(StringUtils.isNotBlank(bo.getCustomLevel()), "info.custom_level", bo.getCustomLevel());//客户级别
|
||||
qw.like(StringUtils.isNotBlank(bo.getCustomMobile()), "info.custom_mobile", bo.getCustomMobile());//客户级别
|
||||
//用户信息表条件
|
||||
qw.like(StringUtils.isNotBlank(bo.getCustomManagerName()), "use.custom_manager", bo.getCustomManagerName());//销售经理名称
|
||||
//关联客户信息表条件
|
||||
qw.eq(StringUtils.isNotBlank(bo.getCustomIntroducerName()), "psinfo.custom_introducer", bo.getCustomIntroducerName());//介绍人姓名
|
||||
qw.orderByDesc("info.create_time");//创建时间排序
|
||||
return qw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增客户基本信息
|
||||
*
|
||||
* @param bo 客户基本信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(PsCustomInfoBo bo) {
|
||||
PsCustomInfo add = MapstructUtils.convert(bo, PsCustomInfo.class);
|
||||
validEntityBeforeSave(add);
|
||||
//客户经理就是登录用户
|
||||
add.setCustomManager(LoginHelper.getUserId());
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改客户基本信息
|
||||
*
|
||||
* @param bo 客户基本信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(PsCustomInfoBo bo) {
|
||||
PsCustomInfo update = MapstructUtils.convert(bo, PsCustomInfo.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(PsCustomInfo entity){
|
||||
//TODO 校验状态
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除客户基本信息信息
|
||||
*
|
||||
* @param id 主键id
|
||||
* @param type 操作类型
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateCustomerStatus(Long id, Integer type) {
|
||||
PsCustomInfo psCustomInfo = baseMapper.selectById(id);
|
||||
if(true){
|
||||
//todo 校验原数据状态是否可以更改
|
||||
}
|
||||
switch (type){
|
||||
case 1://移入公海
|
||||
psCustomInfo.setCustomStatus(CustomerStatusEnum.PUBLIC.getCode());
|
||||
break;
|
||||
case 2://拉黑
|
||||
psCustomInfo.setBlack("1");
|
||||
break;
|
||||
}
|
||||
|
||||
return baseMapper.updateById(psCustomInfo) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增客户报价信息
|
||||
*
|
||||
* @param bos 客户报价信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertPiceByBo(List<PsCustomPriceBo> bos) {
|
||||
List<PsCustomPrice> adds = MapstructUtils.convert(bos, PsCustomPrice.class);
|
||||
PsCustomPrice price = priceMapper.selectById(new QueryWrapper<PsCustomPrice>().select("max(price_batch)")
|
||||
.lambda().eq(PsCustomPrice::getDelFlag, 0).eq(PsCustomPrice::getCustomId, bos.get(0).getCustomId()));
|
||||
adds.forEach(add->{
|
||||
add.setPriceBatch((price != null && price.getPriceBatch() != null) ? price.getPriceBatch() + 1 : 1);
|
||||
});
|
||||
|
||||
return priceMapper.insertBatch(adds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增客户回访记录
|
||||
*
|
||||
* @param bos 客户回访记录
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertCallbackByBo(List<PsCustomCallbackBo> bos){
|
||||
List<PsCustomCallback> adds = MapstructUtils.convert(bos, PsCustomCallback.class);
|
||||
return callbackMapper.insertBatch(adds);
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
package com.pusong.demo.service.impl;
|
@ -0,0 +1 @@
|
||||
package com.pusong.demo.service;
|
BIN
pusong-modules/pusong-business/src/main/resources/excel/单列表.xlsx
Normal file
BIN
pusong-modules/pusong-business/src/main/resources/excel/单列表.xlsx
Normal file
Binary file not shown.
Binary file not shown.
BIN
pusong-modules/pusong-business/src/main/resources/excel/多列表.xlsx
Normal file
BIN
pusong-modules/pusong-business/src/main/resources/excel/多列表.xlsx
Normal file
Binary file not shown.
@ -0,0 +1,8 @@
|
||||
<?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.pusong.business.mapper.PsCustomCallbackMapper">
|
||||
|
||||
|
||||
</mapper>
|
@ -0,0 +1,17 @@
|
||||
<?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.pusong.business.mapper.PsCustomInfoMapper">
|
||||
|
||||
|
||||
<select id="selectPageCustomerList" resultType="com.pusong.business.domain.vo.PsCustomInfoVo">
|
||||
SELECT info.*
|
||||
, usr.nick_name as custom_manager_name
|
||||
,psinfo.custom_introducer as custom_introducer_name
|
||||
FROM ps_custom_info info
|
||||
left join sys_user usr on info.custom_manager = usr.user_id and usr.del_flag = 0
|
||||
left join ps_custom_info psinfo on info.custom_introducer = psinfo.id and psinfo.del_flag = 0
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
@ -0,0 +1,8 @@
|
||||
<?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.pusong.business.mapper.PsCustomPriceMapper">
|
||||
|
||||
|
||||
</mapper>
|
@ -0,0 +1,3 @@
|
||||
java包使用 `.` 分割 resource 目录使用 `/` 分割
|
||||
<br>
|
||||
此文件目的 防止文件夹粘连找不到 `xml` 文件
|
Loading…
Reference in New Issue
Block a user