客户管理代码
This commit is contained in:
@@ -31,7 +31,9 @@ import com.yxt.common.core.vo.PagerVo;
|
|||||||
import com.yxt.customer.biz.crmcustomerfile.*;
|
import com.yxt.customer.biz.crmcustomerfile.*;
|
||||||
import com.yxt.customer.biz.crmfile.CrmFileDto;
|
import com.yxt.customer.biz.crmfile.CrmFileDto;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
@@ -59,12 +61,19 @@ public class CrmCustomerFileRest {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private CrmCustomerFileService crmCustomerFileService;
|
private CrmCustomerFileService crmCustomerFileService;
|
||||||
|
|
||||||
|
/**
|
||||||
// public ResultBean<PagerVo<CrmCustomerFileVo>> listPage(@RequestBody PagerQuery<CrmCustomerFileQuery> pq) {
|
* 客户资料初始化分页查询列表
|
||||||
// ResultBean rb = ResultBean.fireFail();
|
*
|
||||||
// PagerVo<CrmCustomerFileVo> pv = crmCustomerFileService.listPageVo(pq);
|
* @param pq
|
||||||
// return rb.success().setData(pv);
|
* @return
|
||||||
// }
|
*/
|
||||||
|
@ApiOperation("根据条件分页查询数据的列表")
|
||||||
|
@PostMapping("/listPage")
|
||||||
|
public ResultBean<PagerVo<CrmCustomerFileVo>> listPage(@RequestBody PagerQuery<CrmCustomerFileQuery> pq) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
PagerVo<CrmCustomerFileVo> pv = crmCustomerFileService.listPageVo(pq);
|
||||||
|
return rb.success().setData(pv);
|
||||||
|
}
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// public ResultBean saveCustomerFile(String staffName, String staffSid, String sid, List<CrmFileDto> crmFileDtos) {
|
// public ResultBean saveCustomerFile(String staffName, String staffSid, String sid, List<CrmFileDto> crmFileDtos) {
|
||||||
|
|||||||
@@ -60,7 +60,87 @@ public class CrmCustomerTempRest {
|
|||||||
return rb.success().setData(pv);
|
return rb.success().setData(pv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据条件分页查询数据的列表")
|
||||||
|
@PostMapping("/listPage")
|
||||||
|
public ResultBean<PagerVo<CrmCustomerTempVo>> listPage(@RequestBody PagerQuery<CrmCustomerTempQuery> pq) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
PagerVo<CrmCustomerTempVo> pv = crmCustomerTempService.listPageVo(pq);
|
||||||
|
return rb.success().setData(pv);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据客户编码查询客户")
|
||||||
|
@GetMapping("/selectByCustomerNo")
|
||||||
|
public ResultBean<CrmCustomerTemp> selectByCustomerNo(@RequestParam("customerNo") String customerNo) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
CrmCustomerTemp crmCustomerTemp = crmCustomerTempService.selectByCustomerNo(customerNo);
|
||||||
|
return rb.success().setData(crmCustomerTemp);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("保存")
|
||||||
|
@PostMapping("/saveEntity")
|
||||||
|
public ResultBean saveEntity(@RequestBody CrmCustomerTemp temp) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
crmCustomerTempService.saveEntity(temp);
|
||||||
|
return rb.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* pc潜在客户的批量删除
|
||||||
|
*
|
||||||
|
* @param sid
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation("删除记录")
|
||||||
|
@DeleteMapping("/del")
|
||||||
|
public ResultBean del(@RequestBody String[] sid){
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
crmCustomerTempService.delBySids(sid);
|
||||||
|
return rb.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据客户编码查询客户")
|
||||||
|
@GetMapping("/fetchBySid")
|
||||||
|
public ResultBean<CrmCustomerTemp> fetchBySid(@RequestParam("sid") String sid) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
CrmCustomerTemp crmCustomerTemp = crmCustomerTempService.fetchBySid(sid);
|
||||||
|
return rb.success().setData(crmCustomerTemp);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改")
|
||||||
|
@PostMapping("/updateEntity")
|
||||||
|
public ResultBean updateEntity(@RequestBody CrmCustomerTemp temp) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
crmCustomerTempService.updateById(temp);
|
||||||
|
return rb.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加运营情况信息时/添加跟进记录查询客户是否存在
|
||||||
|
*
|
||||||
|
* @param customerSid
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation("添加运营情况信息时/添加跟进记录查询客户是否存在")
|
||||||
|
@GetMapping("/selBySid")
|
||||||
|
public int selBySid(@RequestParam("customerSid") String customerSid) {
|
||||||
|
return crmCustomerTempService.selBySid(customerSid);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加运营情况信息时/添加跟进记录查询客户是否存在
|
||||||
|
*
|
||||||
|
* @param customerSid
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation("添加运营情况信息时/添加跟进记录查询客户是否存在")
|
||||||
|
@PostMapping("/selBySid")
|
||||||
|
public int updateRemindAndByCustomerSid(@RequestParam(value = "customerSid", required = false) String customerSid,
|
||||||
|
@RequestParam(value = "remind_day", required = false) String remind_day,
|
||||||
|
@RequestParam(value = "remind_remark", required = false) String remind_remark,
|
||||||
|
@RequestParam(value = "isOnRemind", required = false) String isOnRemind,
|
||||||
|
@RequestParam(value = "isOnRemindkey", required = false) String isOnRemindkey,
|
||||||
|
@RequestParam(value = "follow_state", required = false) String follow_state) {
|
||||||
|
return crmCustomerTempService.updateRemindAndByCustomerSid(customerSid, remind_day, remind_remark, isOnRemind, isOnRemindkey, follow_state);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ package com.yxt.customer.apiadmin;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.yxt.common.base.utils.PagerUtil;
|
import com.yxt.common.base.utils.PagerUtil;
|
||||||
|
import com.yxt.common.base.utils.StringUtils;
|
||||||
import com.yxt.common.core.query.PagerQuery;
|
import com.yxt.common.core.query.PagerQuery;
|
||||||
import com.yxt.common.core.result.ResultBean;
|
import com.yxt.common.core.result.ResultBean;
|
||||||
import com.yxt.common.core.vo.PagerVo;
|
import com.yxt.common.core.vo.PagerVo;
|
||||||
@@ -37,6 +38,8 @@ import io.swagger.annotations.ApiOperation;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Project: anrui-crm(客户信息) <br/>
|
* Project: anrui-crm(客户信息) <br/>
|
||||||
* File: CrmFileFeignFallback.java <br/>
|
* File: CrmFileFeignFallback.java <br/>
|
||||||
@@ -111,4 +114,35 @@ public class CrmFileRest {
|
|||||||
public ResultBean deleteFilesOss(@RequestParam("fullPath") String fullPath) {
|
public ResultBean deleteFilesOss(@RequestParam("fullPath") String fullPath) {
|
||||||
return crmFileService.deleteFilesOss(fullPath);
|
return crmFileService.deleteFilesOss(fullPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("附件保存")
|
||||||
|
@PostMapping("/saveCommonAppendix")
|
||||||
|
ResultBean saveCommonAppendix(@RequestParam(value = "linkSid") String linkSid, @RequestBody List<PcCommonAppendixDto> list){
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
crmFileService.saveCommonAppendix(linkSid, list);
|
||||||
|
return rb.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("PC端保存/修改附件")
|
||||||
|
@PostMapping("/saveOrUpdatePcAppendix")
|
||||||
|
public ResultBean saveOrUpdatePcAppendix(@RequestBody PcCommonAppendixDto dto, @RequestParam("sid") String sid, @RequestParam("staffSid") String staffSid, @RequestParam("attachType") String attachType){
|
||||||
|
if(StringUtils.isBlank(attachType)){
|
||||||
|
attachType = CommonAttachTypeEnum.CONTRACT.getAttachType();
|
||||||
|
}
|
||||||
|
int i = crmFileService.saveOrUpdatePcAppendix(dto,sid,staffSid,attachType);
|
||||||
|
if (i == 0) {
|
||||||
|
return new ResultBean().fail().setMsg("保存失败");
|
||||||
|
}
|
||||||
|
return new ResultBean().success().setMsg("保存成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation(value = "批量删除文件")
|
||||||
|
@PostMapping("/deleteFiles")
|
||||||
|
ResultBean deleteFiles(@RequestParam(value = "linkSid") String linkSid){
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
int i = crmFileService.deleteFiles(linkSid);
|
||||||
|
return rb.success().setMsg("删除成功");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,20 @@
|
|||||||
package com.yxt.customer.apiadmin;
|
package com.yxt.customer.apiadmin;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.yxt.common.base.utils.DateUtils;
|
import com.yxt.common.base.utils.DateUtils;
|
||||||
import com.yxt.common.base.utils.PagerUtil;
|
import com.yxt.common.base.utils.PagerUtil;
|
||||||
import com.yxt.common.core.query.PagerQuery;
|
import com.yxt.common.core.query.PagerQuery;
|
||||||
import com.yxt.common.core.result.ResultBean;
|
import com.yxt.common.core.result.ResultBean;
|
||||||
import com.yxt.common.core.vo.PagerVo;
|
import com.yxt.common.core.vo.PagerVo;
|
||||||
|
import com.yxt.customer.biz.crmcustomer.CrmCustomerTemp;
|
||||||
import com.yxt.customer.biz.crmvisit.*;
|
import com.yxt.customer.biz.crmvisit.*;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -39,4 +40,50 @@ import java.util.Map;
|
|||||||
@RequestMapping("v1/crmvisit")
|
@RequestMapping("v1/crmvisit")
|
||||||
public class CrmVisitRest {
|
public class CrmVisitRest {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CrmVisitService crmVisitService;
|
||||||
|
|
||||||
|
@ApiOperation("保存")
|
||||||
|
@PostMapping("/saveEntity")
|
||||||
|
public boolean saveEntity(@RequestBody CrmVisit visit) {
|
||||||
|
return crmVisitService.save(visit);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 客户跟进记录分页列表
|
||||||
|
*
|
||||||
|
* @param pagerQuery 查询条件
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@ApiOperation("客户跟进记录分页列表")
|
||||||
|
@PostMapping("/pageList")
|
||||||
|
public IPage<CrmVisitVo> pageList(PagerQuery<CrmVisitQuery> pagerQuery) {
|
||||||
|
return crmVisitService.pagerList(pagerQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("Pc查看详情及修改回显")
|
||||||
|
@GetMapping("/fetchSid/{sid}")
|
||||||
|
public ResultBean<CrmVisitVo> fetchSid(@PathVariable("sid") String sid){
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
ResultBean<CrmVisitVo> vo = crmVisitService.selVisitVo(sid);
|
||||||
|
return rb.success().setData(vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("修改")
|
||||||
|
@PostMapping("/update")
|
||||||
|
public int update(@RequestBody CrmVisitDto dto, @PathVariable("sid") String sid) {
|
||||||
|
return crmVisitService.updateVisit(dto,sid);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("删除记录")
|
||||||
|
@DeleteMapping("/del")
|
||||||
|
public ResultBean del(@RequestBody String[] ids){
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
crmVisitService.delBySids(ids);
|
||||||
|
return rb.success();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import lombok.Data;
|
|||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
@ApiModel(value = "潜在客户信息", description = "潜在客户信息")
|
@ApiModel(value = "潜在客户信息", description = "潜在客户信息")
|
||||||
@TableName("crm_customer_temp")
|
@TableName("crm_customer")
|
||||||
@Data
|
@Data
|
||||||
public class CrmCustomerTemp extends BaseEntity {
|
public class CrmCustomerTemp extends BaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|||||||
@@ -29,4 +29,11 @@ import java.util.Map;
|
|||||||
public interface CrmCustomerTempMapper extends BaseMapper<CrmCustomerTemp> {
|
public interface CrmCustomerTempMapper extends BaseMapper<CrmCustomerTemp> {
|
||||||
|
|
||||||
IPage<SalesCustomerVo> chooseCustomerList(IPage<CrmCustomerTemp> page, @Param(Constants.WRAPPER)QueryWrapper<CrmCustomerTemp> qw);
|
IPage<SalesCustomerVo> chooseCustomerList(IPage<CrmCustomerTemp> page, @Param(Constants.WRAPPER)QueryWrapper<CrmCustomerTemp> qw);
|
||||||
|
|
||||||
|
IPage<CrmCustomerTempVo> selectPageVo(IPage<CrmCustomerTemp> page, @Param(Constants.WRAPPER) QueryWrapper<CrmCustomerTemp> qw);
|
||||||
|
|
||||||
|
CrmCustomerTemp selectByCustomerNo(@Param("customerNo") String customerNo);
|
||||||
|
|
||||||
|
int selBySid(String customerSid);
|
||||||
|
int updateRemindAndByCustomerSid(@Param("customerSid") String customerSid, @Param("remind_day") String remind_day, @Param("remind_remark") String remind_remark, @Param("isOnRemind") String isOnRemind, @Param("isOnRemindkey") String isOnRemindkey, @Param("follow_state") String follow_state);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,5 +10,33 @@
|
|||||||
${ew.sqlSegment}
|
${ew.sqlSegment}
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectPageVo" resultType="com.yxt.customer.biz.crmcustomer.CrmCustomerTempVo">
|
||||||
|
SELECT cct.*,
|
||||||
|
(SELECT COUNT(*)
|
||||||
|
FROM crm_visit cvi
|
||||||
|
WHERE cct.sid = cvi.customerSid) gjcounts
|
||||||
|
FROM crm_customer cct
|
||||||
|
<where>
|
||||||
|
${ew.sqlSegment}
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
<select id="selectByCustomerNo" resultType="com.yxt.customer.biz.crmcustomer.CrmCustomerTemp">
|
||||||
|
select *
|
||||||
|
from crm_customer
|
||||||
|
where customerNo = #{customerNo}
|
||||||
|
</select>
|
||||||
|
<select id="selBySid" resultType="java.lang.Integer">
|
||||||
|
select count(*)
|
||||||
|
from crm_customer
|
||||||
|
where sid = #{customerSid}
|
||||||
|
</select>
|
||||||
|
<update id="updateRemindAndByCustomerSid">
|
||||||
|
UPDATE crm_customer
|
||||||
|
SET remind_day = #{remind_day},
|
||||||
|
remind_remark = #{remind_remark},
|
||||||
|
isOnRemind = #{isOnRemind},
|
||||||
|
isOnRemindkey=#{isOnRemindkey},
|
||||||
|
follow_state = #{follow_state}
|
||||||
|
WHERE sid = #{customerSid}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -0,0 +1,67 @@
|
|||||||
|
package com.yxt.customer.biz.crmcustomer;
|
||||||
|
|
||||||
|
|
||||||
|
import com.yxt.common.core.query.Query;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Project: anrui-crm(客户管理) <br/>
|
||||||
|
* File: CrmCustomerTempQuery.java <br/>
|
||||||
|
* Class: com.yxt.anrui.crm.api.crmcustomertemp.CrmCustomerTempQuery <br/>
|
||||||
|
* Description: 潜在客户信息 查询条件. <br/>
|
||||||
|
* Copyright: Copyright (c) 2011 <br/>
|
||||||
|
* Company: https://gitee.com/liuzp315 <br/>
|
||||||
|
* Makedate: 2022-01-12 11:21:16 <br/>
|
||||||
|
*
|
||||||
|
* @author liupopo
|
||||||
|
* @version 1.0
|
||||||
|
* @since 1.0
|
||||||
|
*/
|
||||||
|
@ApiModel(value = "潜在客户信息 查询条件", description = "潜在客户信息 查询条件")
|
||||||
|
@Data
|
||||||
|
public class CrmCustomerTempQuery implements Query {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "组织全路径")
|
||||||
|
private String orgSidPath;
|
||||||
|
|
||||||
|
@ApiModelProperty("客户类型key(自然人/法人)")
|
||||||
|
private String customerTypeKey;
|
||||||
|
|
||||||
|
@ApiModelProperty("客户级别(意向客户/准客户/成交客户/集团内销/黑名单客户)")
|
||||||
|
private String levelKey;
|
||||||
|
|
||||||
|
@ApiModelProperty("客户名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty("联系电话")
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
@ApiModelProperty("提醒开始日期")
|
||||||
|
private String remindStartDay;
|
||||||
|
|
||||||
|
@ApiModelProperty("提醒结束日期")
|
||||||
|
private String remindEndDay;
|
||||||
|
|
||||||
|
@ApiModelProperty("业务员sid")
|
||||||
|
private String staffSid;
|
||||||
|
|
||||||
|
@ApiModelProperty("用户sid")
|
||||||
|
private String userSid;
|
||||||
|
|
||||||
|
@ApiModelProperty("客户sid")
|
||||||
|
private List<String> customerSidList;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建开始日期")
|
||||||
|
private String createStartDate;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建结束日期")
|
||||||
|
private String createEndDate;
|
||||||
|
|
||||||
|
@ApiModelProperty("销售专员")
|
||||||
|
private String staffName;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -65,4 +65,68 @@ public class CrmCustomerTempService extends MybatisBaseService<CrmCustomerTempMa
|
|||||||
return p;
|
return p;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private QueryWrapper<CrmCustomerTemp> createQueryWrapper(CrmCustomerTempQuery query) {
|
||||||
|
// todo: 这里根据具体业务调整查询条件
|
||||||
|
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
||||||
|
QueryWrapper<CrmCustomerTemp> qw = new QueryWrapper<>();
|
||||||
|
|
||||||
|
if (StringUtils.isNotBlank(query.getCustomerTypeKey())) {
|
||||||
|
qw.eq("cct.customerTypeKey", query.getCustomerTypeKey());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StringUtils.isNotBlank(query.getName())) {
|
||||||
|
qw.like("cct.name", query.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StringUtils.isNotBlank(query.getLevelKey())) {
|
||||||
|
qw.eq("cct.levelKey", query.getLevelKey());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StringUtils.isNotBlank(query.getMobile())) {
|
||||||
|
qw.like("cct.mobile", query.getMobile());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (StringUtils.isNotBlank(query.getStaffSid())) {
|
||||||
|
qw.eq("cct.staffSid", query.getStaffSid());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (query.getCustomerSidList() != null && query.getCustomerSidList().size() > 0) {
|
||||||
|
qw.notIn("cct.sid", query.getCustomerSidList());
|
||||||
|
}
|
||||||
|
|
||||||
|
String remindStartDay = query.getRemindStartDay();
|
||||||
|
String remindEndDay = query.getRemindEndDay();
|
||||||
|
qw.apply(StringUtils.isNotBlank(remindStartDay), "date_format (cct.remind_day,'%Y-%m-%d') >= date_format('" + remindStartDay + "','%Y-%m-%d')").
|
||||||
|
apply(StringUtils.isNotBlank(remindEndDay), "date_format (cct.remind_day,'%Y-%m-%d') <= date_format('" + remindEndDay + "','%Y-%m-%d')"
|
||||||
|
);
|
||||||
|
return qw;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PagerVo<CrmCustomerTempVo> listPageVo(PagerQuery<CrmCustomerTempQuery> pq) {
|
||||||
|
CrmCustomerTempQuery query = pq.getParams();
|
||||||
|
QueryWrapper<CrmCustomerTemp> qw = createQueryWrapper(query);
|
||||||
|
IPage<CrmCustomerTemp> page = PagerUtil.queryToPage(pq);
|
||||||
|
IPage<CrmCustomerTempVo> pagging = baseMapper.selectPageVo(page, qw);
|
||||||
|
PagerVo<CrmCustomerTempVo> p = PagerUtil.pageToVo(pagging, null);
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public CrmCustomerTemp selectByCustomerNo(String customerNo) {
|
||||||
|
return baseMapper.selectByCustomerNo(customerNo);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void saveEntity(CrmCustomerTemp temp) {
|
||||||
|
baseMapper.insert(temp);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int selBySid(String customerSid) {
|
||||||
|
return baseMapper.selBySid(customerSid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int updateRemindAndByCustomerSid(String customerSid, String remind_day, String remind_remark, String isOnRemind, String isOnRemindkey, String follow_state) {
|
||||||
|
return baseMapper.updateRemindAndByCustomerSid(customerSid, remind_day, remind_remark, isOnRemind, isOnRemindkey, follow_state);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,192 @@
|
|||||||
|
package com.yxt.customer.biz.crmcustomer;
|
||||||
|
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.yxt.common.core.vo.Vo;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Project: anrui-crm(客户管理) <br/>
|
||||||
|
* File: CrmCustomerTempVo.java <br/>
|
||||||
|
* Class: com.yxt.anrui.crm.api.crmcustomertemp.CrmCustomerTempVo <br/>
|
||||||
|
* Description: 潜在客户信息 视图数据对象. <br/>
|
||||||
|
* Copyright: Copyright (c) 2011 <br/>
|
||||||
|
* Company: https://gitee.com/liuzp315 <br/>
|
||||||
|
* Makedate: 2022-01-12 11:21:16 <br/>
|
||||||
|
*
|
||||||
|
* @author liupopo
|
||||||
|
* @version 1.0
|
||||||
|
* @since 1.0
|
||||||
|
*/
|
||||||
|
@ApiModel(value = "潜在客户信息 视图数据对象", description = "潜在客户信息 视图数据对象")
|
||||||
|
@Data
|
||||||
|
public class CrmCustomerTempVo implements Vo {
|
||||||
|
|
||||||
|
@ApiModelProperty("潜在客户sid")
|
||||||
|
private String sid;
|
||||||
|
|
||||||
|
@ApiModelProperty("分公司名称")
|
||||||
|
private String createOrgName;
|
||||||
|
|
||||||
|
@ApiModelProperty("业务员名称")
|
||||||
|
private String staffName;
|
||||||
|
|
||||||
|
@ApiModelProperty("部门名称")
|
||||||
|
private String deptName;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建人sid")
|
||||||
|
private String createBySid;
|
||||||
|
|
||||||
|
@ApiModelProperty("登记日期")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty("客户编号(部门编码+客户类型(1位,0个人,1企业)+部门内部流水号(6位))")
|
||||||
|
private String customerNo;
|
||||||
|
|
||||||
|
@ApiModelProperty("客户类型(自然人/法人)")
|
||||||
|
private String customerType;
|
||||||
|
|
||||||
|
@ApiModelProperty("客户类型key")
|
||||||
|
private String customerTypeKey;
|
||||||
|
|
||||||
|
@ApiModelProperty("客户分类(个人:司机/个体老板/其他。企业:企业型客户/一级经销商/二级经销商/终端物流客户)")
|
||||||
|
private String customerClass;
|
||||||
|
|
||||||
|
@ApiModelProperty("客户分类key")
|
||||||
|
private String customerClassKey;
|
||||||
|
|
||||||
|
@ApiModelProperty("客户来源(公司资源/自主开发/交接客户/转介绍客户/集团内销)")
|
||||||
|
private String source;
|
||||||
|
|
||||||
|
@ApiModelProperty("客户来源key")
|
||||||
|
private String sourceKey;
|
||||||
|
|
||||||
|
@ApiModelProperty("客户级别(意向客户/准客户/成交客户/集团内销/黑名单客户)")
|
||||||
|
private String level;
|
||||||
|
|
||||||
|
@ApiModelProperty("客户级别key")
|
||||||
|
private String levelKey;
|
||||||
|
|
||||||
|
@ApiModelProperty("客户名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty("证件类型key")
|
||||||
|
private String certificateTypeKey;
|
||||||
|
|
||||||
|
@ApiModelProperty("证件类型(个人为身份证/企业为营业执照)")
|
||||||
|
private String certificateType;
|
||||||
|
|
||||||
|
@ApiModelProperty("证件号码(个人为身份证号/企业为统一社会信用代码)")
|
||||||
|
private String IDNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty("证件有效期")
|
||||||
|
private String endDate;
|
||||||
|
|
||||||
|
@ApiModelProperty("行政区划代码(省)")
|
||||||
|
private String address_province;
|
||||||
|
|
||||||
|
@ApiModelProperty("行政区划代码(市)")
|
||||||
|
private String address_city;
|
||||||
|
|
||||||
|
@ApiModelProperty("行政区划代码(县)")
|
||||||
|
private String address_county;
|
||||||
|
|
||||||
|
@ApiModelProperty("省")
|
||||||
|
private String province;
|
||||||
|
|
||||||
|
@ApiModelProperty("市")
|
||||||
|
private String city;
|
||||||
|
|
||||||
|
@ApiModelProperty("县")
|
||||||
|
private String county;
|
||||||
|
|
||||||
|
@ApiModelProperty("客户地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@ApiModelProperty("邮编")
|
||||||
|
private String zipCode;
|
||||||
|
|
||||||
|
@ApiModelProperty("电子邮箱")
|
||||||
|
private String e_mail;
|
||||||
|
|
||||||
|
@ApiModelProperty("联系人")
|
||||||
|
private String contacts;
|
||||||
|
|
||||||
|
@ApiModelProperty("联系电话")
|
||||||
|
private String mobile;
|
||||||
|
|
||||||
|
@ApiModelProperty("紧急联系电话")
|
||||||
|
private String emergencyContact;
|
||||||
|
|
||||||
|
@ApiModelProperty("紧急联系电话")
|
||||||
|
private String emergencyMobile;
|
||||||
|
|
||||||
|
@ApiModelProperty("微信号码")
|
||||||
|
private String weixin;
|
||||||
|
|
||||||
|
@ApiModelProperty("业务人员sid")
|
||||||
|
private String staffSid;
|
||||||
|
|
||||||
|
@ApiModelProperty("创建组织sid")
|
||||||
|
private String createOrgSid;
|
||||||
|
|
||||||
|
@ApiModelProperty("性别")
|
||||||
|
private String sex;
|
||||||
|
|
||||||
|
@ApiModelProperty("性别key")
|
||||||
|
private String sexKey;
|
||||||
|
|
||||||
|
@ApiModelProperty("客户生日")
|
||||||
|
private String birthday;
|
||||||
|
|
||||||
|
@ApiModelProperty("所在公司名称")
|
||||||
|
private String companyName;
|
||||||
|
|
||||||
|
@ApiModelProperty("跟进状态key")
|
||||||
|
private String follow_state_key;
|
||||||
|
|
||||||
|
@ApiModelProperty("跟进状态")
|
||||||
|
private String follow_state;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否开启提醒key(1开启,0不开启)")
|
||||||
|
private String isOnRemindkey;
|
||||||
|
|
||||||
|
@ApiModelProperty("是否开启提醒(1开启,0不开启)")
|
||||||
|
private String isOnRemind;
|
||||||
|
|
||||||
|
@ApiModelProperty("提醒日期")
|
||||||
|
private String remind_day;
|
||||||
|
|
||||||
|
@ApiModelProperty("提醒备注")
|
||||||
|
private String remind_remark;
|
||||||
|
|
||||||
|
@ApiModelProperty("客户头像")
|
||||||
|
private String customerPhoto;
|
||||||
|
|
||||||
|
@ApiModelProperty("见面方式key")
|
||||||
|
private String visitWayKey;
|
||||||
|
|
||||||
|
@ApiModelProperty("见面方式(到店/电话/拜访)")
|
||||||
|
private String visitWay;
|
||||||
|
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String remarks;
|
||||||
|
|
||||||
|
@ApiModelProperty("意向车型数量")
|
||||||
|
private String yxcounts;
|
||||||
|
|
||||||
|
@ApiModelProperty("跟进记录数量")
|
||||||
|
private String gjcounts;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private String useOrgSid;
|
||||||
|
private String customerOrgSid;
|
||||||
|
private String customerOrgName;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -61,4 +61,33 @@ import java.util.List;
|
|||||||
public class CrmCustomerFileService extends MybatisBaseService<CrmCustomerFileMapper, CrmCustomerFile> {
|
public class CrmCustomerFileService extends MybatisBaseService<CrmCustomerFileMapper, CrmCustomerFile> {
|
||||||
|
|
||||||
|
|
||||||
|
private QueryWrapper<CrmCustomerFile> createQueryWrapper(CrmCustomerFileQuery query) {
|
||||||
|
// todo: 这里根据具体业务调整查询条件
|
||||||
|
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
||||||
|
QueryWrapper<CrmCustomerFile> qw = new QueryWrapper<>();
|
||||||
|
|
||||||
|
qw.eq("linkSid", query.getCustomerSid());
|
||||||
|
if (StringUtils.isNotBlank(query.getFileName())) {
|
||||||
|
qw.like("fileName", query.getFileName());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(query.getAttachType())) {
|
||||||
|
qw.like("attachType", query.getAttachType());
|
||||||
|
}
|
||||||
|
return qw;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PagerVo<CrmCustomerFileVo> listPageVo(PagerQuery<CrmCustomerFileQuery> pq) {
|
||||||
|
QueryWrapper<CrmCustomerFile> qw = createQueryWrapper(pq.getParams());
|
||||||
|
IPage<CrmCustomerFile> page = PagerUtil.queryToPage(pq);
|
||||||
|
IPage<CrmCustomerFileVo> pagging = baseMapper.selectPageVo(page, qw);
|
||||||
|
PagerVo<CrmCustomerFileVo> p = PagerUtil.pageToVo(pagging, null);
|
||||||
|
// List<CrmCustomerFileVo> records = p.getRecords();
|
||||||
|
// if (records.size() == 0) {
|
||||||
|
// fetchByDataTypeKey(pq.getParams().getCustomerSid());
|
||||||
|
// IPage<CrmCustomerFileVo> paging = baseMapper.selectPageVo(page, qw);
|
||||||
|
// PagerVo<CrmCustomerFileVo> g = PagerUtil.pageToVo(paging, null);
|
||||||
|
// return g;
|
||||||
|
// }
|
||||||
|
return p;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.yxt.customer.biz.crmfile;
|
||||||
|
|
||||||
|
|
||||||
|
import com.yxt.common.core.vo.Vo;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Project: anrui-base(安瑞基础信息模块) <br/>
|
||||||
|
* File: CommonAppendixVo.java <br/>
|
||||||
|
* Class: com.yxt.anrui.base.api.commonappendix.CommonAppendixVo <br/>
|
||||||
|
* Description: 公共附件表 视图数据对象. <br/>
|
||||||
|
* Copyright: Copyright (c) 2011 <br/>
|
||||||
|
* Company: https://gitee.com/liuzp315 <br/>
|
||||||
|
* Makedate: 2021-10-28 08:59:25 <br/>
|
||||||
|
*
|
||||||
|
* @author liupopo
|
||||||
|
* @version 1.0
|
||||||
|
* @since 1.0
|
||||||
|
*/
|
||||||
|
@ApiModel(value = "公共附件表 视图数据对象", description = "公共附件表 视图数据对象")
|
||||||
|
@Data
|
||||||
|
public class CommonAppendixVo implements Vo {
|
||||||
|
|
||||||
|
@ApiModelProperty("sid")
|
||||||
|
private String sid;
|
||||||
|
|
||||||
|
@ApiModelProperty("上传人姓名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty("文件名")
|
||||||
|
private String fileName;
|
||||||
|
|
||||||
|
@ApiModelProperty("文件类型")
|
||||||
|
private String fileType;
|
||||||
|
|
||||||
|
@ApiModelProperty("关联业务对象sid")
|
||||||
|
private String linkSid;
|
||||||
|
|
||||||
|
@ApiModelProperty("附件类型")
|
||||||
|
private String attachType;
|
||||||
|
|
||||||
|
@ApiModelProperty("文件大小")
|
||||||
|
private String fileSize;
|
||||||
|
|
||||||
|
@ApiModelProperty("文件的路径")
|
||||||
|
private String filePath;
|
||||||
|
|
||||||
|
@ApiModelProperty("文件的路径")
|
||||||
|
private String fileUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty("备注")
|
||||||
|
private String remarks;
|
||||||
|
|
||||||
|
@ApiModelProperty("上传人sid")
|
||||||
|
private String createBySid;
|
||||||
|
|
||||||
|
@ApiModelProperty("上传时间")
|
||||||
|
// @DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private String createTime;
|
||||||
|
}
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
package com.yxt.customer.biz.crmfile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author dimengzhe
|
||||||
|
* @Date 2022/2/12 10:13
|
||||||
|
* @Description 附件类型枚举
|
||||||
|
*/
|
||||||
|
public enum CommonAttachTypeEnum {
|
||||||
|
/**
|
||||||
|
* 附件类型:
|
||||||
|
* 1、0001:合同,
|
||||||
|
* 2、0002:人行征信,
|
||||||
|
* 3、0003:开票申请附件,
|
||||||
|
* 4、0004:跟进记录的材料
|
||||||
|
* 5、0005:家访照片
|
||||||
|
* 6、0006_1:贷款人证明文_担保人人行征信查询授权书(原件)
|
||||||
|
* 7、0006_2:贷款人证明文_贷款人人行征信查询授权书(手持)
|
||||||
|
* 8、0006_3:贷款人证明文_配偶人行征信查询授权书(原件)
|
||||||
|
* 9、0006_4:贷款人证明文_配偶人行征信查询授权书(手持)
|
||||||
|
* 10、0006_5:贷款人证明文_配偶数据查询授权书
|
||||||
|
* 11、0006_6:贷款人证明文_征信查询报告(有效期:3个月以内)
|
||||||
|
* 12、0006_7:贷款人证明文_贷款人及配偶居住证明
|
||||||
|
* 13、0007_1:担保人文件_担保人人行征信查询授权书(原件)
|
||||||
|
* 14、0007_2:担保人文件_担保人人行征信查询授权书(手持)
|
||||||
|
* 15、0008:资产证明
|
||||||
|
* 16、0009_01:放款文件_家访照片
|
||||||
|
* 17、0009_02:放款文件_交车照片
|
||||||
|
* 18、0009_03:放款文件_车辆合格证
|
||||||
|
* 19、0009_04:放款文件_挂车合格证
|
||||||
|
* 20、0009_05:放款文件_新车全车照片
|
||||||
|
* 21、0009_06:放款文件_挂车照片
|
||||||
|
* 22、0009_07:放款文件_新车发动机号照片
|
||||||
|
* 23、0009_08:放款文件_新车车架号照片
|
||||||
|
* 24、0009_09:放款文件_挂车车架号照片
|
||||||
|
* 25、0009_10:放款文件_放款文件其它资料
|
||||||
|
* 26、0009_11:放款文件_首付款证明
|
||||||
|
*/
|
||||||
|
CONTRACT("0001", "合同"),
|
||||||
|
CONTRACT_UPLOAD("0001_1", "合同下载"),
|
||||||
|
CREDIT("0002", "人行征信"),
|
||||||
|
INVOICE("0003", "开票申请附件"),
|
||||||
|
INVOICE_KHKPSQS("0003_1", "客户开票申请书"),
|
||||||
|
INVOICE_CLDJHT("0003_2", "车辆登记合同"),
|
||||||
|
INVOICE_KPXXQRS("0003_3", "开票信息确认书"),
|
||||||
|
WITNESS("0004", "跟进记录的材料"),
|
||||||
|
ADVANCE_GIN("0005", "提前开票附件"),
|
||||||
|
ADVANCE_KHKPSQS("0005_1", "客户开票申请书"),
|
||||||
|
ADVANCE_CLDJHT("0005_2", "车辆登记合同"),
|
||||||
|
ADVANCE_KPXXQRS("0005_3", "开票信息确认书"),
|
||||||
|
CUSTOMER_FILE("0006", "客户资料附件"),
|
||||||
|
ARREARS("0007", "欠款提车附件"),
|
||||||
|
SCENESIGN("0008", "现场签署附件"),
|
||||||
|
PAYMENT_VOUCHER("0009", "打款凭证附件"),
|
||||||
|
REMITTAN_CECONFIRMATION("0010", "汇款确认书附件"),
|
||||||
|
SEAL_APPLY("0011", "盖章附件"),
|
||||||
|
BILL_APPLICAYION("0012", "开票申请附件"),
|
||||||
|
MANUFACTOR_SUB("0013", "厂商认款附件"),
|
||||||
|
MANUFACTOR_RETWARE("0014", "厂家退库车辆附件"),
|
||||||
|
SHUNTINGINVOICINAPPLY("0015", "调车开票附件"),
|
||||||
|
OUTSOURCINGAPPLY("0016", "外采申请附件"),
|
||||||
|
INBOUNDAPPLY("0017", "入账申请附件"),
|
||||||
|
VEHBUYBLANK("0018", "车辆买断附件");
|
||||||
|
/**
|
||||||
|
* 附件类型
|
||||||
|
*/
|
||||||
|
private final String attachType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代号
|
||||||
|
*/
|
||||||
|
private final String mark;
|
||||||
|
|
||||||
|
CommonAttachTypeEnum(String attachType, String mark) {
|
||||||
|
this.attachType = attachType;
|
||||||
|
this.mark = mark;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAttachType() {
|
||||||
|
return attachType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMark() {
|
||||||
|
return mark;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -75,4 +75,10 @@ public interface CrmFileMapper extends BaseMapper<CrmFile> {
|
|||||||
int fetchByFilePath(String str);
|
int fetchByFilePath(String str);
|
||||||
|
|
||||||
void deleteByLinkSidAndAttachType(@Param("sid") String sid, @Param("key") String key);
|
void deleteByLinkSidAndAttachType(@Param("sid") String sid, @Param("key") String key);
|
||||||
|
|
||||||
|
List<CommonAppendixVo> selByLinkSid(String sid);
|
||||||
|
|
||||||
|
@Delete("DELETE FROM crm_file WHERE linkSid = #{linkSid}")
|
||||||
|
int deleteFiles(String linkSid);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,4 +54,9 @@
|
|||||||
from crm_file
|
from crm_file
|
||||||
where filePath = #{str}
|
where filePath = #{str}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selByLinkSid" resultType="com.yxt.customer.biz.crmfile.CommonAppendixVo">
|
||||||
|
select *
|
||||||
|
from crm_file
|
||||||
|
where linkSid = #{sid}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -35,8 +35,12 @@ import com.yxt.common.base.utils.StringUtils;
|
|||||||
import com.yxt.common.core.query.PagerQuery;
|
import com.yxt.common.core.query.PagerQuery;
|
||||||
import com.yxt.common.core.result.ResultBean;
|
import com.yxt.common.core.result.ResultBean;
|
||||||
import com.yxt.common.core.vo.PagerVo;
|
import com.yxt.common.core.vo.PagerVo;
|
||||||
|
import com.yxt.customer.biz.crmvisit.CrmVisitService;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
@@ -61,7 +65,8 @@ public class CrmFileService extends MybatisBaseService<CrmFileMapper, CrmFile> {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private FileUploadComponent fileUploadComponent;
|
private FileUploadComponent fileUploadComponent;
|
||||||
|
@Autowired
|
||||||
|
private CrmVisitService crmVisitService;
|
||||||
public PagerVo<CrmFile> listPage(PagerQuery<CrmFileQuery> pq) {
|
public PagerVo<CrmFile> listPage(PagerQuery<CrmFileQuery> pq) {
|
||||||
CrmFileQuery query = pq.getParams();
|
CrmFileQuery query = pq.getParams();
|
||||||
QueryWrapper<CrmFile> qw = createQueryWrapper(query);
|
QueryWrapper<CrmFile> qw = createQueryWrapper(query);
|
||||||
@@ -237,4 +242,62 @@ public class CrmFileService extends MybatisBaseService<CrmFileMapper, CrmFile> {
|
|||||||
public void deleteByLinkSidAndAttachType(String sid, String key) {
|
public void deleteByLinkSidAndAttachType(String sid, String key) {
|
||||||
baseMapper.deleteByLinkSidAndAttachType(sid,key);
|
baseMapper.deleteByLinkSidAndAttachType(sid,key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int saveOrUpdatePcAppendix(PcCommonAppendixDto dto, String sid, String staffSid,String attachType) {
|
||||||
|
int z = 0;
|
||||||
|
if (dto != null) {
|
||||||
|
CrmFile commonAppendix = new CrmFile();
|
||||||
|
dto.fillEntity(commonAppendix);
|
||||||
|
String filePath = dto.getFilePath();
|
||||||
|
String a = fileUploadComponent.getUrlPrefix();
|
||||||
|
System.out.println("a============" + a);
|
||||||
|
if (filePath.indexOf(fileUploadComponent.getUrlPrefix()) > -1) {
|
||||||
|
filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), "");
|
||||||
|
}
|
||||||
|
commonAppendix.setFilePath(filePath);
|
||||||
|
commonAppendix.setLinkSid(sid);
|
||||||
|
commonAppendix.setCreateBySid(staffSid);
|
||||||
|
commonAppendix.setCreateTime(new Date());
|
||||||
|
commonAppendix.setAttachType(attachType);
|
||||||
|
save(commonAppendix);
|
||||||
|
z++;
|
||||||
|
}
|
||||||
|
return z;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int deleteFiles(String linkSid) {
|
||||||
|
int i = baseMapper.deleteFiles(linkSid);
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void saveCommonAppendix(String linkSid, List<PcCommonAppendixDto> list) {
|
||||||
|
String s = "";
|
||||||
|
for (PcCommonAppendixDto pcCommonAppendixDto : list) {
|
||||||
|
CrmFile commonAppendix = new CrmFile();
|
||||||
|
commonAppendix.setLinkSid(linkSid);
|
||||||
|
commonAppendix.setFileName(pcCommonAppendixDto.getFileName());
|
||||||
|
commonAppendix.setFileType(pcCommonAppendixDto.getFileType());
|
||||||
|
commonAppendix.setFileSize(pcCommonAppendixDto.getFileSize());
|
||||||
|
commonAppendix.setAttachType(CommonAttachTypeEnum.WITNESS.getAttachType());
|
||||||
|
commonAppendix.setFilePath(pcCommonAppendixDto.getFilePath().replace(fileUploadComponent.getUrlPrefix(), ""));
|
||||||
|
s += commonAppendix.getFilePath()+",";
|
||||||
|
save(commonAppendix);
|
||||||
|
}
|
||||||
|
s = s.substring(0, s.length() - 1);
|
||||||
|
crmVisitService.updateAppendixUrl(s,linkSid);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<CommonAppendixVo> selByLinkSid(String sid) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
List<CommonAppendixVo> list = baseMapper.selByLinkSid(sid);
|
||||||
|
String path = "";
|
||||||
|
for (CommonAppendixVo commonAppendixVo : list) {
|
||||||
|
String filePath = commonAppendixVo.getFilePath();
|
||||||
|
String urlPrefix = fileUploadComponent.getUrlPrefix();
|
||||||
|
path = urlPrefix + filePath;
|
||||||
|
commonAppendixVo.setFileUrl(path);
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package com.yxt.customer.biz.crmfile;
|
||||||
|
|
||||||
|
import com.yxt.common.core.dto.Dto;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description
|
||||||
|
* @Author liuguohui
|
||||||
|
* @Date 2021/11/22
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class PcCommonAppendixDto implements Dto {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 2211027947432178940L;
|
||||||
|
@ApiModelProperty("上传人sid")
|
||||||
|
private String createBySid;
|
||||||
|
@ApiModelProperty("上传人")
|
||||||
|
private String name;
|
||||||
|
@ApiModelProperty("文件名")
|
||||||
|
private String fileName;
|
||||||
|
@ApiModelProperty("文件类型")
|
||||||
|
private String fileType;
|
||||||
|
@ApiModelProperty("文件大小")
|
||||||
|
private String fileSize;
|
||||||
|
@ApiModelProperty("文件的路径")
|
||||||
|
private String filePath;
|
||||||
|
}
|
||||||
@@ -35,8 +35,7 @@
|
|||||||
cv.isOnRemind,
|
cv.isOnRemind,
|
||||||
<!--提醒日期-->
|
<!--提醒日期-->
|
||||||
cv.remind_day,
|
cv.remind_day,
|
||||||
cv.remind_day_key,
|
cv.remind_day_key
|
||||||
(SELECT COUNT(*) FROM crm_vehicledemand cve WHERE cve.customerSid = cv.customerSid and cve.states = 1) xqcounts
|
|
||||||
FROM crm_visit cv
|
FROM crm_visit cv
|
||||||
${ew.customSqlSegment}
|
${ew.customSqlSegment}
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -1,8 +1,21 @@
|
|||||||
package com.yxt.customer.biz.crmvisit;
|
package com.yxt.customer.biz.crmvisit;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.yxt.common.base.service.MybatisBaseService;
|
import com.yxt.common.base.service.MybatisBaseService;
|
||||||
|
import com.yxt.common.base.utils.PagerUtil;
|
||||||
|
import com.yxt.common.core.query.PagerQuery;
|
||||||
|
import com.yxt.common.core.result.ResultBean;
|
||||||
|
import com.yxt.customer.biz.crmfile.CommonAppendixVo;
|
||||||
|
import com.yxt.customer.biz.crmfile.CrmFileService;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Project: anrui-crm(客户管理) <br/>
|
* Project: anrui-crm(客户管理) <br/>
|
||||||
* File: CrmVisitService.java <br/>
|
* File: CrmVisitService.java <br/>
|
||||||
@@ -19,4 +32,72 @@ import org.springframework.stereotype.Service;
|
|||||||
@Service
|
@Service
|
||||||
public class CrmVisitService extends MybatisBaseService<CrmVisitMapper, CrmVisit> {
|
public class CrmVisitService extends MybatisBaseService<CrmVisitMapper, CrmVisit> {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CrmFileService crmFileService;
|
||||||
|
|
||||||
|
public void saveEntity(CrmVisit visit) {
|
||||||
|
baseMapper.insert(visit);
|
||||||
|
}
|
||||||
|
|
||||||
|
public IPage<CrmVisitVo> pagerList(PagerQuery<CrmVisitQuery> pagerQuery) {
|
||||||
|
IPage<CrmVisitQuery> page = PagerUtil.queryToPage(pagerQuery);
|
||||||
|
QueryWrapper<CrmVisitVo> qw = buildQueryWrapper(pagerQuery.getParams());
|
||||||
|
return baseMapper.pagerList(page, qw);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public ResultBean<CrmVisitVo> selVisitVo(String sid) {
|
||||||
|
ResultBean rb = ResultBean.fireFail();
|
||||||
|
CrmVisitVo vo = baseMapper.selVisitVo(sid);
|
||||||
|
if (vo != null) {
|
||||||
|
List<CommonAppendixVo> listResultBeanData = crmFileService.selByLinkSid(sid);
|
||||||
|
if (!listResultBeanData.isEmpty()) {
|
||||||
|
List list = new ArrayList();
|
||||||
|
for (int i = 0; i < listResultBeanData.size(); i++) {
|
||||||
|
CommonAppendixVo commonAppendixVo = listResultBeanData.get(i);
|
||||||
|
CrmCommonAppendixVo crmCommonAppendixVo = new CrmCommonAppendixVo();
|
||||||
|
BeanUtil.copyProperties(commonAppendixVo, crmCommonAppendixVo);
|
||||||
|
list.add(crmCommonAppendixVo);
|
||||||
|
}
|
||||||
|
// vo.setList(list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return rb.success().setData(vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构造查询条件
|
||||||
|
*
|
||||||
|
* @param pagerQuery 查询条件
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private QueryWrapper<CrmVisitVo> buildQueryWrapper(CrmVisitQuery pagerQuery) {
|
||||||
|
QueryWrapper<CrmVisitVo> qw = new QueryWrapper<>();
|
||||||
|
if (pagerQuery != null) {
|
||||||
|
if (StringUtils.isNotBlank(pagerQuery.getCustomerSid())) {//客户sid
|
||||||
|
qw.eq("cv.customerSid", pagerQuery.getCustomerSid());
|
||||||
|
}
|
||||||
|
String start_follow_time = pagerQuery.getStart_follow_time();
|
||||||
|
String end_follow_time = pagerQuery.getEnd_follow_time();
|
||||||
|
qw.apply(com.yxt.common.base.utils.StringUtils.isNotEmpty(start_follow_time), "date_format (cv.follow_time,'%Y-%m-%d') >= date_format('" + start_follow_time + "','%Y-%m-%d')").
|
||||||
|
apply(com.yxt.common.base.utils.StringUtils.isNotEmpty(end_follow_time), "date_format (cv.follow_time,'%Y-%m-%d') <= date_format('" + end_follow_time + "','%Y-%m-%d')"
|
||||||
|
);
|
||||||
|
if (StringUtils.isNotBlank(pagerQuery.getFollow_state_key())) {//跟进状态
|
||||||
|
qw.eq("cv.follow_state_key", pagerQuery.getFollow_state_key());
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(pagerQuery.getFollow_form_key())) {//跟进形式
|
||||||
|
qw.eq("cv.follow_form_key", pagerQuery.getFollow_form_key());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return qw;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateAppendixUrl(String s, String sid) {
|
||||||
|
baseMapper.updateAppendixUrl(s, sid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int updateVisit(CrmVisitDto dto, String sid) {
|
||||||
|
int i = updateBySid(dto.toMap(), sid);
|
||||||
|
return i;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user