Commit 34cf5e93 authored by Administrator's avatar Administrator

Merge branch 'release' into 'jd_dev'

Release代码合并入jd分支20241211

See merge request !41
parents 86b3a649 6fc4f7b8
......@@ -37,6 +37,13 @@ public interface CustomerFollowupConvert {
*/
CustomerFollowupBackVO convert(CustomerFollowupDO bean);
/***
* 实体转返回VO
* @param bean
* @return
*/
CustomerFollowupParentVO convertParent(CustomerFollowupDO bean);
/***
* 实体列表转返回VO列表
* @param list
......
package cn.iocoder.yudao.module.customer.dal.dataobject.customerFollowup;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import java.util.*;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import org.springframework.format.annotation.DateTimeFormat;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
/**
* 客户跟进 DO
......@@ -113,6 +117,8 @@ public class CustomerFollowupDO extends BaseDO {
@TableField(exist = false)
private String customerNumber;
@TableField(exist = false)
private String customerName;
@TableField(exist = false)
private String offerNumber;
//creator_name
@TableField(exist = false)
......@@ -124,8 +130,15 @@ public class CustomerFollowupDO extends BaseDO {
@TableField(exist = false)
private String followUserName;
@TableField(exist = false)
@ApiModelProperty(value = "客户来源")
private String customerSource;
@TableField(exist = false)
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "客户创建时间")
private Date customerCreateTime;
@ApiModelProperty(value = "联系人电话")
@TableField(exist = false)
......
package cn.iocoder.yudao.module.customer.service.customerFollowup;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.iocoder.yudao.framework.apollo.core.event.Order.OrderNumberLogEvent;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
......
......@@ -6,6 +6,7 @@ import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;
/**
* 客户 Base VO,提供给添加、修改、详细的子 VO 使用
......@@ -117,7 +118,8 @@ public class CustomerBaseVO {
@ApiModelProperty(value = "付款人姓名")
private String payerName;
@ApiModelProperty(value = "主营产品类别分组")
private List<CustomerProductTypeGroupVO> products;
}
......@@ -309,6 +309,9 @@ public class CustomerDetailRespVO extends CustomerBaseVO {
@ApiModelProperty(value = "选中的主营产品类型")
private List<ProductTypeRespVO> productTypeList;
@ApiModelProperty(value = "主营产品类别分组")
private List<CustomerProductTypeGroupVO> products;
@ApiModelProperty(value = "付款人姓名")
private String payerName;
......
package cn.iocoder.yudao.module.customer.vo.customer.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
@ApiModel("客户主营商品类型分组")
public class CustomerProductTypeGroupVO {
@ApiModelProperty("主营类别id")
private Long typeId;
@ApiModelProperty("主营产品ids")
private List<Long> productIds;
}
......@@ -251,4 +251,14 @@ public class CustomerRespVO extends CustomerBaseVO {
// offerId
@ApiModelProperty(value = "报价单ID")
private Long offerId;
// 最近发货订单的发货时间
@ApiModelProperty(value = "最近发货订单的发货时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date lastLoadOrderLoadTime;
// 最近发货订单id
@ApiModelProperty(value = "最近发货订单id")
private Long lastLoadOrderId;
}
......@@ -52,6 +52,20 @@ public class CustomerFollowupBackVO {
@ApiModelProperty(value = "客户编号")
private String customerNumber;
@ExcelProperty("客户名称")
@ApiModelProperty(value = "客户名称")
private String customerName;
@ExcelProperty("客户来源")
@ApiModelProperty(value = "客户来源")
private String customerSource;
@ExcelProperty("客户创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "客户创建时间")
private Date customerCreateTime;
// 联系人id
@ApiModelProperty(value = "联系人id")
private Long contactId;
......@@ -72,9 +86,6 @@ public class CustomerFollowupBackVO {
@ApiModelProperty("部门名称")
private String deptName;
@ExcelProperty(value = "跟进方式", converter = DictConvert.class)
@DictFormat("customer_followup_method")
@ApiModelProperty(value = "跟进类型 字典customer_followup_type")
......@@ -97,6 +108,7 @@ public class CustomerFollowupBackVO {
@ExcelProperty("下次跟进时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "下次跟进时间")
private Date nextTime;
......@@ -141,6 +153,7 @@ public class CustomerFollowupBackVO {
@ExcelProperty("最后更新时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "更新时间")
private Date updateTime;
......@@ -154,5 +167,8 @@ public class CustomerFollowupBackVO {
@ApiModelProperty(value = "联系人电话")
private String contactPhone;
@ApiModelProperty(value = "上级跟进详情")
private CustomerFollowupParentVO parentVO;
}
package cn.iocoder.yudao.module.customer.vo.customerFollowup;
import cn.iocoder.yudao.framework.excel.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.convert.DictConvert;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
/**
* 客户跟进 Response VO
* @author yanghao
*/
@Data
@ApiModel("管理后台-上级客户跟进详情 VO")
public class CustomerFollowupParentVO {
@ApiModelProperty(value = "主键", required = true)
private Long id;
@ExcelProperty("编号")
@ApiModelProperty(value = "编号")
private String number;
@ExcelProperty(value = "跟进类型", converter = DictConvert.class)
@DictFormat("customer_followup_type")
@ApiModelProperty(value = "跟进类型 字典customer_followup_type")
private Integer followType;
@ExcelProperty(value = "销售阶段", converter = DictConvert.class)
@DictFormat("sale_stage")
@ApiModelProperty(value = "销售阶段 字典sale_stage")
private Integer saleStage;
@ApiModelProperty(value = "报价单")
private Long offerId;
@ExcelProperty("报价单")
@ApiModelProperty(value = "报价单编号")
private String offerNumber;
@ExcelProperty("跟进时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "跟进时间")
private Date followTime;
@ApiModelProperty(value = "客户编号")
private Long customerId;
@ExcelProperty("客户编号")
@ApiModelProperty(value = "客户编号")
private String customerNumber;
@ExcelProperty("客户名称")
@ApiModelProperty(value = "客户名称")
private String customerName;
@ExcelProperty("客户来源")
@ApiModelProperty(value = "客户来源")
private String customerSource;
@ExcelProperty("客户创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "客户创建时间")
private Date customerCreateTime;
// 联系人id
@ApiModelProperty(value = "联系人id")
private Long contactId;
@ExcelProperty("联系人")
@ApiModelProperty(value = "联系人")
private String contactName;
@ApiModelProperty(value = "客户经理/跟进业务员id")
private Long followUserId;
@ApiModelProperty("客户经理")
private String followUserName;
@ApiModelProperty(value = "客户经理/跟进业务员所属部门id")
private Long deptId;
@ApiModelProperty("部门名称")
private String deptName;
@ExcelProperty(value = "跟进方式", converter = DictConvert.class)
@DictFormat("customer_followup_method")
@ApiModelProperty(value = "跟进类型 字典customer_followup_type")
private Integer followMethod;
@ExcelProperty("目的")
@ApiModelProperty(value = "目的")
private String purpose;
@ExcelProperty(value = "结果", converter = DictConvert.class)
@DictFormat("customer_followup_result_type")
@ApiModelProperty(value = "跟进结果 字典customer_followup_result_type")
private Integer resultType;
@ExcelProperty("跟进情况")
@ApiModelProperty(value = "客户反馈")
private String feedback;
@ExcelProperty("下次跟进时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "下次跟进时间")
private Date nextTime;
@ExcelProperty("下次跟进计划")
@ApiModelProperty(value = "下次跟进计划")
private String nextPlan;
@ExcelProperty("关联跟进纪录")
@ApiModelProperty(value = "上一级跟进单号")
private String parentNumber;
@ApiModelProperty(value = "上一级跟进单ID")
private String parentId;
@ExcelProperty(value = "提交状态", converter = DictConvert.class)
@DictFormat("customer_followup_status")
@ApiModelProperty(value = "状态 字典customer_followup_status")
private Integer status;
//creator_name
@ExcelProperty("创建人")
@ApiModelProperty(value = "创建人名称")
private String creatorName;
@ExcelProperty("创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "创建时间", required = true)
private Date createTime;
// updater_name
@ExcelProperty("最后更新人")
@ApiModelProperty(value = "更新人名称")
private String updaterName;
@ExcelProperty("最后更新时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "附件 多个以逗号分隔")
private String attatchment;
@ExcelProperty("联系人电话")
@ApiModelProperty(value = "联系人电话")
private String contactPhone;
}
......@@ -118,18 +118,28 @@ public class CustomerFollowupQueryVO extends PageParam {
@ApiModelProperty(value = "跟进状态,下拉多选")
private List<Integer> statuses;
@ApiModelProperty(value = "客户经理/跟进业务员ids")
private List<Long> followUserIds;
@ApiModelProperty(value = "联系人电话")
private String contactPhone;
@ApiModelProperty(value = "客户名称")
private String customerName;
@ApiModelProperty(value = "操作用户的所属权限部门ID列表")
private List<Long> deptIdList;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "开始客户创建时间")
private Date beginCustomerCreateTime;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "结束客户创建时间")
private Date endCustomerCreateTime;
@ApiModelProperty(value = "客户来源")
private List<Integer> customerSourceList;
}
......@@ -89,11 +89,20 @@
<if test="query.contactPhone != null and query.contactPhone != '' ">
AND concat('+', g.area_code, g.phone_new, '') LIKE concat('%', concat( #{query.contactPhone}, '%' ))
</if>
<!-- 客户相关查询条件 -->
<if test="query.customerNumber != null and query.customerNumber != '' ">
AND b.number LIKE concat('%', concat( #{query.customerNumber}, '%' ))
</if>
<if test="query.customerName != null and query.customerName != '' ">
AND b.name LIKE concat('%', concat( #{query.customerName}, '%' ))
</if>
<if test="query.customerSourceList != null and query.customerSourceList.size() > 0">
AND b.source in
<foreach item='item' index="index" collection='query.customerSourceList' open='(' separator=',' close=')'>#{item}</foreach>
</if>
<if test="query.beginCustomerCreateTime!= null and query.endCustomerCreateTime!= null">
AND b.create_time BETWEEN #{query.beginCustomerCreateTime} AND #{query.endCustomerCreateTime}
</if>
<if test="query.offerNumber != null and query.offerNumber != '' ">
AND c.number LIKE concat('%', concat( #{query.offerNumber}, '%' ))
</if>
......@@ -101,8 +110,14 @@
<select id="selectPage1" resultType="cn.iocoder.yudao.module.customer.dal.dataobject.customerFollowup.CustomerFollowupDO">
select a.*, b.number as customer_number, c.number as offer_number,
d.nickname as creator_name, e.nickname as updater_name,
select a.*,
b.number as customer_number,
b.name as customer_name,
b.source as customer_source,
b.create_time as customer_create_time,
c.number as offer_number,
d.nickname as creator_name,
e.nickname as updater_name,
f.nickname as follow_user_name,
concat('+', g.area_code, g.phone_new) as contact_phone
from ecw_customer_followup a
......
......@@ -15,6 +15,8 @@ import cn.iocoder.yudao.module.system.enums.ErrorCodeConstants;
import cn.iocoder.yudao.module.system.enums.download.DownloadTypeEnum;
import cn.iocoder.yudao.module.system.enums.permission.DataScopeEnum;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
......@@ -120,7 +122,18 @@ public class CustomerFollowupController {
// @PreAuthorize("@ss.hasPermission('customer:followup:query')")
public CommonResult<PageResult<CustomerFollowupBackVO>> getFollowupPage(@Valid CustomerFollowupQueryVO query, PageVO page) {
PageResult<CustomerFollowupDO> pageResult = followupService.getFollowupPage(query, page);
return success(CustomerFollowupConvert.INSTANCE.convertPage(pageResult));
PageResult<CustomerFollowupBackVO> backVOPageResult = CustomerFollowupConvert.INSTANCE.convertPage(pageResult);
if (CollectionUtil.isNotEmpty(backVOPageResult.getList())){
for (CustomerFollowupBackVO followupBackVO : backVOPageResult.getList()) {
if (StringUtils.isNotBlank(followupBackVO.getParentNumber())){
CustomerFollowupDO followupDO = followupService.getOne(new LambdaQueryWrapper<CustomerFollowupDO>().eq(CustomerFollowupDO::getParentNumber, followupBackVO.getParentNumber()).orderByDesc(CustomerFollowupDO::getId).last("limit 1"));
if (Objects.nonNull(followupDO)){
followupBackVO.setParentVO(CustomerFollowupConvert.INSTANCE.convertParent(followupDO));
}
}
}
}
return success(backVOPageResult);
}
@GetMapping("/data/space/page")
......@@ -140,7 +153,18 @@ public class CustomerFollowupController {
}
addDataScopeQuery(query, loginUser, roleRespDTOS);
PageResult<CustomerFollowupDO> pageResult = followupService.getFollowupPage(query, page);
return success(CustomerFollowupConvert.INSTANCE.convertPage(pageResult));
PageResult<CustomerFollowupBackVO> backVOPageResult = CustomerFollowupConvert.INSTANCE.convertPage(pageResult);
if (CollectionUtil.isNotEmpty(backVOPageResult.getList())){
for (CustomerFollowupBackVO followupBackVO : backVOPageResult.getList()) {
if (StringUtils.isNotBlank(followupBackVO.getParentNumber())){
CustomerFollowupDO followupDO = followupService.getOne(new LambdaQueryWrapper<CustomerFollowupDO>().eq(CustomerFollowupDO::getParentNumber, followupBackVO.getParentNumber()).orderByDesc(CustomerFollowupDO::getId).last("limit 1"));
if (Objects.nonNull(followupDO)){
followupBackVO.setParentVO(CustomerFollowupConvert.INSTANCE.convertParent(followupDO));
}
}
}
}
return success(backVOPageResult);
}
@GetMapping("/data/space/export-excel")
......
......@@ -146,10 +146,12 @@ public interface WarehouseMapper extends BaseMapperX<WarehouseDO> {
"w.title_en as warehouseTitleEn,",
"w.title_fr as warehouseTitleFr,",
"r1.id as guojia,",
"r1.sort as guojiaSort,",
"r1.title_zh as guojiaName,",
"r1.title_en as guojiaNameEn,",
"r1.title_fr as guojiaNameFr,",
"r2.id as shi, ",
"r2.sort as shiSort, ",
"r2.title_zh as shiName, ",
"r2.title_en as shiNameEn, ",
"r2.title_fr as shiNameFr ",
......
......@@ -577,6 +577,7 @@ public class WarehouseServiceImpl implements WarehouseService {
v.setShi(m.getKey());
List<WarehouseTreeVO> warehouseList = m.getValue();
WarehouseTreeVO warehouseTreeVO = warehouseList.get(0);
v.setShiSort(warehouseTreeVO.getShiSort());
v.setShiName(warehouseTreeVO.getShiName());
v.setShiNameEn(warehouseTreeVO.getShiNameEn());
v.setShiNameFr(warehouseTreeVO.getShiNameFr());
......@@ -584,9 +585,10 @@ public class WarehouseServiceImpl implements WarehouseService {
v.setGuojiaNameFr(warehouseTreeVO.getGuojiaNameFr());
v.setGuojiaName(warehouseTreeVO.getGuojiaName());
v.setGuojia(warehouseTreeVO.getGuojia());
v.setGuojiaSort(warehouseTreeVO.getGuojiaSort());
shiVOList.add(v);
}
vo.setShiList(shiVOList);
vo.setShiList(shiVOList.stream().sorted(Comparator.comparing(WarehouseTreeVO::getShiSort)).collect(Collectors.toList()));
Map<Long, List<WarehouseTreeVO>> guojiaMap = shiVOList.stream()
.collect(Collectors.groupingBy(WarehouseTreeVO::getGuojia));
List<WarehouseTreeVO> guojiaList = new ArrayList<>();
......@@ -598,9 +600,10 @@ public class WarehouseServiceImpl implements WarehouseService {
v.setGuojiaNameEn(warehouseTreeVO.getGuojiaNameEn());
v.setGuojiaNameFr(warehouseTreeVO.getGuojiaNameFr());
v.setGuojiaName(warehouseTreeVO.getGuojiaName());
v.setGuojiaSort(warehouseTreeVO.getGuojiaSort());
guojiaList.add(v);
}
vo.setGuojiaList(guojiaList);
vo.setGuojiaList(guojiaList.stream().sorted(Comparator.comparing(WarehouseTreeVO::getGuojiaSort)).collect(Collectors.toList()));
return vo;
}
......
......@@ -12,6 +12,8 @@ public class WarehouseTreeVO {
@ApiModelProperty("国家区域id")
private Long guojia;
@ApiModelProperty("国家排序")
private Integer guojiaSort;
@ApiModelProperty("国家中文名称")
private String guojiaName ;
@ApiModelProperty("国家英文名称")
......@@ -20,6 +22,8 @@ public class WarehouseTreeVO {
private String guojiaNameFr ;
@ApiModelProperty("城市区域id")
private Long shi;
@ApiModelProperty("城市排序")
private Integer shiSort;
@ApiModelProperty("城市中文名称")
private String shiName;
@ApiModelProperty("城市英文名称")
......@@ -35,6 +39,8 @@ public class WarehouseTreeVO {
@ApiModelProperty("仓库法文名称")
private String warehouseTitleFr;
@ApiModelProperty("排序")
private Integer sort;
@ApiModelProperty(value = "子元素", example = "true")
private List<WarehouseTreeVO> children;
......
......@@ -4,6 +4,7 @@ public enum OrderShipmentLog {
PRELOAD_ADD("添加预装"),
PRELOAD_REMOVE("移出预装单"),
TALLY("理货"),
TALLY_PATCH("理货补单"),
CABINET_SPLIT_REQUEST("提交装柜拆单申请"),
CABINET_SPLIT_RESULT_FAIL("提交装柜拆单失败"),
CABINET_SPLIT_RESULT_SUCCESS("提交装柜拆单通过"),
......
......@@ -404,7 +404,7 @@ public class BoxPreloadGoodsServiceImpl extends AbstractService<BoxPreloadGoodsM
}
//生成提单号
boxService.generateBillLadingNo(shipmentId, false, false);
boxService.addOrderLog(orderIdList, OrderShipmentLog.CABINET_PATCH, "");
boxService.addOrderLog(orderIdList, createReqVO.getIsTally() == 0 ? OrderShipmentLog.CABINET_PATCH : OrderShipmentLog.TALLY_PATCH, "");
} else {
for (Long oId : orderIdList) {
boxService.updateOrderStatus(oId, null, null,
......@@ -2515,7 +2515,7 @@ public class BoxPreloadGoodsServiceImpl extends AbstractService<BoxPreloadGoodsM
//生成提单号
boxService.generateBillLadingNo(shipmentId, true, false);
boxService.addOrderLog(orderIdList, OrderShipmentLog.MERGE_PATCH, "");
boxService.addOrderLog(orderIdList, createReqVO.getIsTally() == 0 ? OrderShipmentLog.MERGE_PATCH : OrderShipmentLog.TALLY_PATCH, "");
} else {
for (Long oId : orderIdList) {
boxService.updateOrderStatus(oId, null, null,
......@@ -2856,7 +2856,7 @@ public class BoxPreloadGoodsServiceImpl extends AbstractService<BoxPreloadGoodsM
OrderApprovalTypeCheckEvent guanLianApprovalTypeCheckEvent = new OrderApprovalTypeCheckEvent(o.getOrderId(), null, null, Arrays.asList(6, 11, 13, 14, 22, 23), false);
applicationContext.publishEvent(guanLianApprovalTypeCheckEvent);
return guanLianApprovalTypeCheckEvent.getResult();
}else {
} else {
// 关联单有异常或未完成入仓
return true;
}
......
......@@ -28,6 +28,9 @@ public class BoxPreloadGoodsCreateReqVO {
@ApiModelProperty(value = "是否是补单,0-不是,1-是")
private Integer isCover = 0;
@ApiModelProperty(value = "是否是理货补单,0-不是,1-是")
private Integer isTally = 0;
@ApiModelProperty(value = "关联关系,1-不校验互斥, 2-不校验关联")
private Integer relationStatus;
......
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