Commit 6a672e0d authored by zhaobiyan's avatar zhaobiyan

Merge branch 'master-fix' into 'master'

订单业绩业务修改

See merge request !7
parents 0e786af8 1c7b383b
-- 兰博明添加的业务字段与表补充sql脚本
alter table `ecw_order`
add column `has_consignee` bit(1) DEFAULT b'1' COMMENT '是否有收货人,1-是,0-否';
alter table `ecw_order`
add column `yeji_create_date` datetime DEFAULT NULL COMMENT '订单业绩产生时间';
alter table `ecw_order`
add column `yeji_type` int DEFAULT NULL COMMENT '业绩类型,1是新客户业绩,0是老客户业绩';
alter table `ecw_order`
add column `cal_v_value` decimal(15,2) DEFAULT NULL COMMENT '根据体积或重量计算出的V值';
CREATE TABLE `compare_air_customer_result` (
`id` bigint NOT NULL AUTO_INCREMENT,
`number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'name',
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'name',
`phone` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'phone',
`old_customer_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'old_customerName',
`customer_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'customerName',
`enter_open_sea_time` datetime DEFAULT NULL COMMENT '入公海时间',
`creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`type` varchar(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT 'type',
PRIMARY KEY (`id`)
) ENGINE=InnoDB COMMENT='客户比对表结果表';
CREATE TABLE `customer_old_new_tmp` (
`id` int NOT NULL AUTO_INCREMENT,
`old_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`old_id` int DEFAULT NULL,
`new_number` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`new_id` int DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB ;
CREATE TABLE `ecw_vz` (
`id` int NOT NULL AUTO_INCREMENT,
`title_zh` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '中文名称',
`title_en` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '英文名称',
`fuhao` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '单位符号',
`vz` float DEFAULT NULL COMMENT 'v值',
`status` tinyint(1) DEFAULT '0' COMMENT '0显示 1不显示',
`aorder` int DEFAULT NULL COMMENT '排序',
`create_time` datetime DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
`creator` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`updater` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`deleted` tinyint(1) DEFAULT '0' COMMENT '0显示 1不显示',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB ROW_FORMAT=DYNAMIC COMMENT='计量单位表';
-- 新增订单产生业绩时归属客户状态
alter table `ecw_order`
add column `is_in_open_sea` tinyint DEFAULT '0' COMMENT '是否公海客户',
...@@ -624,4 +624,7 @@ public class OrderDO extends BaseDO { ...@@ -624,4 +624,7 @@ public class OrderDO extends BaseDO {
private BigDecimal calVValue; private BigDecimal calVValue;
@ApiModelProperty(value = "是否在公海")
private Boolean isInOpenSea;
} }
...@@ -527,6 +527,9 @@ public class OrderBackInfoDto { ...@@ -527,6 +527,9 @@ public class OrderBackInfoDto {
@ApiModelProperty(value = "是否有收货人,1-是,0-否") @ApiModelProperty(value = "是否有收货人,1-是,0-否")
private Boolean hasConsignee = true; private Boolean hasConsignee = true;
@ApiModelProperty(value = "是否在公海")
private Boolean isInOpenSea;
public void setExceptionReason(String exceptionReason) { public void setExceptionReason(String exceptionReason) {
this.exceptionReason = exceptionReason; this.exceptionReason = exceptionReason;
if (StringUtils.isNotBlank(exceptionReason) && Objects.nonNull(this.lang)) { if (StringUtils.isNotBlank(exceptionReason) && Objects.nonNull(this.lang)) {
......
...@@ -383,6 +383,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -383,6 +383,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (Objects.nonNull(customerDO) && if (Objects.nonNull(customerDO) &&
Objects.nonNull(customerDO.getIsShowTidanPrice())) { Objects.nonNull(customerDO.getIsShowTidanPrice())) {
order.setDisplayBillLadingPrice(customerDO.getIsShowTidanPrice()); order.setDisplayBillLadingPrice(customerDO.getIsShowTidanPrice());
order.setIsInOpenSea(customerDO.getIsInOpenSea());
} }
} }
} }
...@@ -1029,6 +1030,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -1029,6 +1030,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2 //发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
if (consignorDO != null) { if (consignorDO != null) {
order.setCustomerId(orderConsignorDO.getCustomerId()); order.setCustomerId(orderConsignorDO.getCustomerId());
order.setIsInOpenSea(consignorDO.getIsInOpenSea());
order.setSalesmanId(consignorDO.getCustomerService() != null ? consignorDO.getCustomerService() : 0); order.setSalesmanId(consignorDO.getCustomerService() != null ? consignorDO.getCustomerService() : 0);
} }
...@@ -1043,22 +1045,27 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -1043,22 +1045,27 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
//如果是发货人付款且关联报价单,业绩归属发货人 --层级3 第一个 //如果是发货人付款且关联报价单,业绩归属发货人 --层级3 第一个
order.setCustomerId(orderConsignorDO.getCustomerId()); order.setCustomerId(orderConsignorDO.getCustomerId());
order.setIsInOpenSea(consignorDO.getIsInOpenSea());
order.setSalesmanId(consignorDO.getCustomerService() != null ? consignorDO.getCustomerService() : 0); order.setSalesmanId(consignorDO.getCustomerService() != null ? consignorDO.getCustomerService() : 0);
} else if (order.getDrawee() == 1 && consignorDO.getDefaultPay()) {// 如果是发货人付款且档案设置默认付运费 --层级4 第一个 } else if (order.getDrawee() == 1 && consignorDO.getDefaultPay()) {// 如果是发货人付款且档案设置默认付运费 --层级4 第一个
order.setCustomerId(orderConsignorDO.getCustomerId()); order.setCustomerId(orderConsignorDO.getCustomerId());
order.setIsInOpenSea(consignorDO.getIsInOpenSea());
order.setSalesmanId(consignorDO.getCustomerService()); order.setSalesmanId(consignorDO.getCustomerService());
} else { } else {
//都不符合,归属收货人 //都不符合,归属收货人
order.setCustomerId(orderConsigneeDO.getCustomerId() != null ? orderConsigneeDO.getCustomerId() : 0); order.setCustomerId(orderConsigneeDO.getCustomerId() != null ? orderConsigneeDO.getCustomerId() : 0);
order.setIsInOpenSea(consigneeDO.getIsInOpenSea());
order.setSalesmanId(consigneeDO.getCustomerService() != null ? consigneeDO.getCustomerService() : 0); order.setSalesmanId(consigneeDO.getCustomerService() != null ? consigneeDO.getCustomerService() : 0);
} }
} else if (order.getDrawee() == 2) { } else if (order.getDrawee() == 2) {
//收货人付款 层级5 第一个 //收货人付款 层级5 第一个
if (consigneeDO != null) { if (consigneeDO != null) {
order.setCustomerId(orderConsigneeDO.getCustomerId()); order.setCustomerId(orderConsigneeDO.getCustomerId());
order.setIsInOpenSea(consigneeDO.getIsInOpenSea());
order.setSalesmanId(consigneeDO.getCustomerService()); order.setSalesmanId(consigneeDO.getCustomerService());
} else { } else {
order.setCustomerId(0L);
order.setSalesmanId(0L); order.setSalesmanId(0L);
} }
} else if (order.getDrawee() == 3) { } else if (order.getDrawee() == 3) {
...@@ -1075,21 +1082,26 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -1075,21 +1082,26 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (CollectionUtil.isNotEmpty(offerBackVOList) && (order.getDrawee() == 3 && freight == 1)) {//层级3 第二个 订单关联报价单 && 自定义付款 且发货人付运费 if (CollectionUtil.isNotEmpty(offerBackVOList) && (order.getDrawee() == 3 && freight == 1)) {//层级3 第二个 订单关联报价单 && 自定义付款 且发货人付运费
order.setCustomerId(orderConsignorDO.getCustomerId()); order.setCustomerId(orderConsignorDO.getCustomerId());
order.setIsInOpenSea(consignorDO.getIsInOpenSea());
order.setSalesmanId(consignorDO.getCustomerService()); order.setSalesmanId(consignorDO.getCustomerService());
} else if (CollectionUtil.isNotEmpty(offerBackVOList) && (order.getDrawee() == 3 && clearanceFee == 1)) {//层级3 第三个 订单关联报价单 && 自定义付款 且发货人付清关费 } else if (CollectionUtil.isNotEmpty(offerBackVOList) && (order.getDrawee() == 3 && clearanceFee == 1)) {//层级3 第三个 订单关联报价单 && 自定义付款 且发货人付清关费
order.setCustomerId(orderConsignorDO.getCustomerId()); order.setCustomerId(orderConsignorDO.getCustomerId());
order.setIsInOpenSea(consignorDO.getIsInOpenSea());
order.setSalesmanId(consignorDO.getCustomerService()); order.setSalesmanId(consignorDO.getCustomerService());
} else if (consignorDO.getDefaultPay() && (order.getDrawee() == 3 && freight == 1)) { //层级4 第二个 发货人档案设置默认付运费 且发货人付运费 业绩归属 发货人 } else if (consignorDO.getDefaultPay() && (order.getDrawee() == 3 && freight == 1)) { //层级4 第二个 发货人档案设置默认付运费 且发货人付运费 业绩归属 发货人
order.setCustomerId(orderConsignorDO.getCustomerId()); order.setCustomerId(orderConsignorDO.getCustomerId());
order.setIsInOpenSea(consignorDO.getIsInOpenSea());
order.setSalesmanId(consignorDO.getCustomerService()); order.setSalesmanId(consignorDO.getCustomerService());
} else if (consignorDO.getDefaultPay() && (order.getDrawee() == 3 && clearanceFee == 1)) {// 层级4 第三个 发货人档案设置默认付运费 且发货人付清关费 业绩归属发货人 } else if (consignorDO.getDefaultPay() && (order.getDrawee() == 3 && clearanceFee == 1)) {// 层级4 第三个 发货人档案设置默认付运费 且发货人付清关费 业绩归属发货人
order.setCustomerId(orderConsignorDO.getCustomerId()); order.setCustomerId(orderConsignorDO.getCustomerId());
order.setIsInOpenSea(consignorDO.getIsInOpenSea());
order.setSalesmanId(consignorDO.getCustomerService()); order.setSalesmanId(consignorDO.getCustomerService());
} else { } else {
order.setCustomerId(orderConsigneeDO.getCustomerId() != null ? orderConsigneeDO.getCustomerId() : 0); order.setCustomerId(orderConsigneeDO.getCustomerId() != null ? orderConsigneeDO.getCustomerId() : 0);
order.setIsInOpenSea(consigneeDO.getIsInOpenSea());
order.setSalesmanId(consigneeDO.getCustomerService() != null ? consigneeDO.getCustomerService() : 0); order.setSalesmanId(consigneeDO.getCustomerService() != null ? consigneeDO.getCustomerService() : 0);
} }
...@@ -1111,6 +1123,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -1111,6 +1123,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
} else { } else {
//业绩归属收货人 //业绩归属收货人
order.setCustomerId(orderConsigneeDO.getCustomerId() != null ? orderConsigneeDO.getCustomerId() : 0); order.setCustomerId(orderConsigneeDO.getCustomerId() != null ? orderConsigneeDO.getCustomerId() : 0);
order.setIsInOpenSea(consigneeDO.getIsInOpenSea());
order.setSalesmanId(consigneeDO.getCustomerService() != null ? consigneeDO.getCustomerService() : 0); order.setSalesmanId(consigneeDO.getCustomerService() != null ? consigneeDO.getCustomerService() : 0);
} }
...@@ -1137,6 +1150,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -1137,6 +1150,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (consignorDO != null && !consignorDO.getNoConsignee() && !order.getHasConsignee()) {//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2 if (consignorDO != null && !consignorDO.getNoConsignee() && !order.getHasConsignee()) {//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
if (consignorDO != null) { if (consignorDO != null) {
order.setCustomerId(orderConsignorDO.getCustomerId()); order.setCustomerId(orderConsignorDO.getCustomerId());
order.setIsInOpenSea(consignorDO.getIsInOpenSea());
order.setSalesmanId(consignorDO.getCustomerService() != null ? consignorDO.getCustomerService() : 0); order.setSalesmanId(consignorDO.getCustomerService() != null ? consignorDO.getCustomerService() : 0);
} }
...@@ -1147,13 +1161,16 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -1147,13 +1161,16 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (order.getDrawee() == 1 && createReqVO.getOfferId() != null) {//如果是发货人付款且关联报价单,业绩归属发货人 --层级3 第一个 if (order.getDrawee() == 1 && createReqVO.getOfferId() != null) {//如果是发货人付款且关联报价单,业绩归属发货人 --层级3 第一个
order.setCustomerId(orderConsignorDO.getCustomerId()); order.setCustomerId(orderConsignorDO.getCustomerId());
order.setIsInOpenSea(consignorDO.getIsInOpenSea());
order.setSalesmanId(consignorDO.getCustomerService() != null ? consignorDO.getCustomerService() : 0); order.setSalesmanId(consignorDO.getCustomerService() != null ? consignorDO.getCustomerService() : 0);
} else if (order.getDrawee() == 1 && consignorDO.getDefaultPay()) {// 如果是发货人付款且档案设置默认付运费 --层级4 第一个 } else if (order.getDrawee() == 1 && consignorDO.getDefaultPay()) {// 如果是发货人付款且档案设置默认付运费 --层级4 第一个
order.setCustomerId(orderConsignorDO.getCustomerId()); order.setCustomerId(orderConsignorDO.getCustomerId());
order.setIsInOpenSea(consignorDO.getIsInOpenSea());
order.setSalesmanId(consignorDO.getCustomerService()); order.setSalesmanId(consignorDO.getCustomerService());
} else { } else {
order.setCustomerId(orderConsigneeDO.getCustomerId() != null ? orderConsigneeDO.getCustomerId() : 0); order.setCustomerId(orderConsigneeDO.getCustomerId() != null ? orderConsigneeDO.getCustomerId() : 0);
order.setIsInOpenSea(consigneeDO.getIsInOpenSea());
order.setSalesmanId(consigneeDO.getCustomerService() != null ? consigneeDO.getCustomerService() : 0); order.setSalesmanId(consigneeDO.getCustomerService() != null ? consigneeDO.getCustomerService() : 0);
// order.setCustomerId(0L); // order.setCustomerId(0L);
// order.setSalesmanId(0L); // order.setSalesmanId(0L);
...@@ -1161,6 +1178,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -1161,6 +1178,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
} else if (order.getDrawee() == 2) {//收货人付款 层级5 第一个 } else if (order.getDrawee() == 2) {//收货人付款 层级5 第一个
if (consigneeDO != null) { if (consigneeDO != null) {
order.setCustomerId(orderConsigneeDO.getCustomerId()); order.setCustomerId(orderConsigneeDO.getCustomerId());
order.setIsInOpenSea(consigneeDO.getIsInOpenSea());
order.setSalesmanId(consigneeDO.getCustomerService()); order.setSalesmanId(consigneeDO.getCustomerService());
} else { } else {
//没有收货人 //没有收货人
...@@ -1183,22 +1201,27 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -1183,22 +1201,27 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (createReqVO.getOfferId() != null && (order.getDrawee() == 3 && freight == 1)) {//层级3 第二个 订单关联报价单 && 自定义付款 且发货人付运费 if (createReqVO.getOfferId() != null && (order.getDrawee() == 3 && freight == 1)) {//层级3 第二个 订单关联报价单 && 自定义付款 且发货人付运费
order.setCustomerId(orderConsignorDO.getCustomerId()); order.setCustomerId(orderConsignorDO.getCustomerId());
order.setIsInOpenSea(consignorDO.getIsInOpenSea());
order.setSalesmanId(consignorDO.getCustomerService()); order.setSalesmanId(consignorDO.getCustomerService());
} else if (createReqVO.getOfferId() != null && (order.getDrawee() == 3 && clearanceFee == 1)) {//层级3 第三个 订单关联报价单 && 自定义付款 且发货人付清关费 } else if (createReqVO.getOfferId() != null && (order.getDrawee() == 3 && clearanceFee == 1)) {//层级3 第三个 订单关联报价单 && 自定义付款 且发货人付清关费
order.setCustomerId(orderConsignorDO.getCustomerId()); order.setCustomerId(orderConsignorDO.getCustomerId());
order.setIsInOpenSea(consignorDO.getIsInOpenSea());
order.setSalesmanId(consignorDO.getCustomerService()); order.setSalesmanId(consignorDO.getCustomerService());
} else if (consignorDO.getDefaultPay() && (order.getDrawee() == 3 && freight == 1)) { //层级4 第二个 发货人档案设置默认付运费 且发货人付运费 业绩归属 发货人 } else if (consignorDO.getDefaultPay() && (order.getDrawee() == 3 && freight == 1)) { //层级4 第二个 发货人档案设置默认付运费 且发货人付运费 业绩归属 发货人
order.setCustomerId(orderConsignorDO.getCustomerId()); order.setCustomerId(orderConsignorDO.getCustomerId());
order.setIsInOpenSea(consignorDO.getIsInOpenSea());
order.setSalesmanId(consignorDO.getCustomerService()); order.setSalesmanId(consignorDO.getCustomerService());
} else if (consignorDO.getDefaultPay() && (order.getDrawee() == 3 && clearanceFee == 1)) {// 层级4 第三个 发货人档案设置默认付运费 且发货人付清关费 业绩归属发货人 } else if (consignorDO.getDefaultPay() && (order.getDrawee() == 3 && clearanceFee == 1)) {// 层级4 第三个 发货人档案设置默认付运费 且发货人付清关费 业绩归属发货人
order.setCustomerId(orderConsignorDO.getCustomerId()); order.setCustomerId(orderConsignorDO.getCustomerId());
order.setIsInOpenSea(consignorDO.getIsInOpenSea());
order.setSalesmanId(consignorDO.getCustomerService()); order.setSalesmanId(consignorDO.getCustomerService());
} else { } else {
//去掉层级5、6 ,以上不符合的都归收货人 //去掉层级5、6 ,以上不符合的都归收货人
order.setCustomerId(orderConsigneeDO.getCustomerId() != null ? orderConsigneeDO.getCustomerId() : 0); order.setCustomerId(orderConsigneeDO.getCustomerId() != null ? orderConsigneeDO.getCustomerId() : 0);
order.setIsInOpenSea(consigneeDO.getIsInOpenSea());
order.setSalesmanId(consigneeDO.getCustomerService() != null ? consigneeDO.getCustomerService() : 0); order.setSalesmanId(consigneeDO.getCustomerService() != null ? consigneeDO.getCustomerService() : 0);
} }
...@@ -1208,6 +1231,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -1208,6 +1231,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
} else { } else {
//业绩归收货人 //业绩归收货人
order.setCustomerId(orderConsigneeDO.getCustomerId() != null ? orderConsigneeDO.getCustomerId() : 0); order.setCustomerId(orderConsigneeDO.getCustomerId() != null ? orderConsigneeDO.getCustomerId() : 0);
order.setIsInOpenSea(consigneeDO.getIsInOpenSea());
order.setSalesmanId(consigneeDO.getCustomerService() != null ? consigneeDO.getCustomerService() : 0); order.setSalesmanId(consigneeDO.getCustomerService() != null ? consigneeDO.getCustomerService() : 0);
} }
...@@ -1235,12 +1259,14 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -1235,12 +1259,14 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (Objects.nonNull(order.getType()) && order.getType().contains("2")) {//层级1 if (Objects.nonNull(order.getType()) && order.getType().contains("2")) {//层级1
// 海外仓归属发货人 // 海外仓归属发货人
order.setCustomerId(orderConsignorDO.getCustomerId()); order.setCustomerId(orderConsignorDO.getCustomerId());
order.setIsInOpenSea(consignorDO.getIsInOpenSea());
order.setSalesmanId(consignorDO.getCustomerService() != null ? consignorDO.getCustomerService() : 0); order.setSalesmanId(consignorDO.getCustomerService() != null ? consignorDO.getCustomerService() : 0);
customerType = 1; customerType = 1;
} else { } else {
if (consignorDO != null && !consignorDO.getNoConsignee() && !order.getHasConsignee()) {//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2 if (consignorDO != null && !consignorDO.getNoConsignee() && !order.getHasConsignee()) {//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
if (consignorDO != null) { if (consignorDO != null) {
order.setCustomerId(orderConsignorDO.getCustomerId()); order.setCustomerId(orderConsignorDO.getCustomerId());
order.setIsInOpenSea(consignorDO.getIsInOpenSea());
order.setSalesmanId(consignorDO.getCustomerService() != null ? consignorDO.getCustomerService() : 0); order.setSalesmanId(consignorDO.getCustomerService() != null ? consignorDO.getCustomerService() : 0);
customerType = 1; customerType = 1;
} }
...@@ -1252,15 +1278,18 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -1252,15 +1278,18 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (order.getDrawee() == 1 && offerId != null) {//如果是发货人付款且关联报价单,业绩归属发货人 --层级3 第一个 if (order.getDrawee() == 1 && offerId != null) {//如果是发货人付款且关联报价单,业绩归属发货人 --层级3 第一个
order.setCustomerId(orderConsignorDO.getCustomerId()); order.setCustomerId(orderConsignorDO.getCustomerId());
order.setIsInOpenSea(consignorDO.getIsInOpenSea());
order.setSalesmanId(consignorDO.getCustomerService() != null ? consignorDO.getCustomerService() : 0); order.setSalesmanId(consignorDO.getCustomerService() != null ? consignorDO.getCustomerService() : 0);
customerType = 1; customerType = 1;
} else if (order.getDrawee() == 1 && consignorDO.getDefaultPay()) {// 如果是发货人付款且档案设置默认付运费 --层级4 第一个 } else if (order.getDrawee() == 1 && consignorDO.getDefaultPay()) {// 如果是发货人付款且档案设置默认付运费 --层级4 第一个
order.setCustomerId(orderConsignorDO.getCustomerId()); order.setCustomerId(orderConsignorDO.getCustomerId());
order.setIsInOpenSea(consignorDO.getIsInOpenSea());
order.setSalesmanId(consignorDO.getCustomerService()); order.setSalesmanId(consignorDO.getCustomerService());
customerType = 1; customerType = 1;
} else { } else {
order.setCustomerId(orderConsigneeDO.getCustomerId() != null ? orderConsigneeDO.getCustomerId() : 0); order.setCustomerId(orderConsigneeDO.getCustomerId() != null ? orderConsigneeDO.getCustomerId() : 0);
order.setIsInOpenSea(consigneeDO.getIsInOpenSea());
order.setSalesmanId(consigneeDO.getCustomerService() != null ? consigneeDO.getCustomerService() : 0); order.setSalesmanId(consigneeDO.getCustomerService() != null ? consigneeDO.getCustomerService() : 0);
customerType = 2; customerType = 2;
// order.setCustomerId(0L); // order.setCustomerId(0L);
...@@ -1269,6 +1298,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -1269,6 +1298,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
} else if (order.getDrawee() == 2) {//收货人付款 层级5 第一个 } else if (order.getDrawee() == 2) {//收货人付款 层级5 第一个
if (consigneeDO != null) { if (consigneeDO != null) {
order.setCustomerId(orderConsigneeDO.getCustomerId()); order.setCustomerId(orderConsigneeDO.getCustomerId());
order.setIsInOpenSea(consigneeDO.getIsInOpenSea());
order.setSalesmanId(consigneeDO.getCustomerService()); order.setSalesmanId(consigneeDO.getCustomerService());
customerType = 1; customerType = 1;
} else { } else {
...@@ -1291,26 +1321,31 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -1291,26 +1321,31 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (offerId != null && (order.getDrawee() == 3 && freight == 1)) {//层级3 第二个 订单关联报价单 && 自定义付款 且发货人付运费 if (offerId != null && (order.getDrawee() == 3 && freight == 1)) {//层级3 第二个 订单关联报价单 && 自定义付款 且发货人付运费
order.setCustomerId(orderConsignorDO.getCustomerId()); order.setCustomerId(orderConsignorDO.getCustomerId());
order.setIsInOpenSea(consignorDO.getIsInOpenSea());
order.setSalesmanId(consignorDO.getCustomerService()); order.setSalesmanId(consignorDO.getCustomerService());
customerType = 1; customerType = 1;
} else if (offerId != null && (order.getDrawee() == 3 && clearanceFee == 1)) {//层级3 第三个 订单关联报价单 && 自定义付款 且发货人付清关费 } else if (offerId != null && (order.getDrawee() == 3 && clearanceFee == 1)) {//层级3 第三个 订单关联报价单 && 自定义付款 且发货人付清关费
order.setCustomerId(orderConsignorDO.getCustomerId()); order.setCustomerId(orderConsignorDO.getCustomerId());
order.setIsInOpenSea(consignorDO.getIsInOpenSea());
order.setSalesmanId(consignorDO.getCustomerService()); order.setSalesmanId(consignorDO.getCustomerService());
customerType = 1; customerType = 1;
} else if (consignorDO.getDefaultPay() && (order.getDrawee() == 3 && freight == 1)) { //层级4 第二个 发货人档案设置默认付运费 且发货人付运费 业绩归属 发货人 } else if (consignorDO.getDefaultPay() && (order.getDrawee() == 3 && freight == 1)) { //层级4 第二个 发货人档案设置默认付运费 且发货人付运费 业绩归属 发货人
order.setCustomerId(orderConsignorDO.getCustomerId()); order.setCustomerId(orderConsignorDO.getCustomerId());
order.setIsInOpenSea(consignorDO.getIsInOpenSea());
order.setSalesmanId(consignorDO.getCustomerService()); order.setSalesmanId(consignorDO.getCustomerService());
customerType = 1; customerType = 1;
} else if (consignorDO.getDefaultPay() && (order.getDrawee() == 3 && clearanceFee == 1)) {// 层级4 第三个 发货人档案设置默认付运费 且发货人付清关费 业绩归属发货人 } else if (consignorDO.getDefaultPay() && (order.getDrawee() == 3 && clearanceFee == 1)) {// 层级4 第三个 发货人档案设置默认付运费 且发货人付清关费 业绩归属发货人
order.setCustomerId(orderConsignorDO.getCustomerId()); order.setCustomerId(orderConsignorDO.getCustomerId());
order.setIsInOpenSea(consignorDO.getIsInOpenSea());
order.setSalesmanId(consignorDO.getCustomerService()); order.setSalesmanId(consignorDO.getCustomerService());
customerType = 1; customerType = 1;
} else { } else {
//去掉层级5、6 ,以上不符合的都归收货人 //去掉层级5、6 ,以上不符合的都归收货人
order.setCustomerId(orderConsigneeDO.getCustomerId() != null ? orderConsigneeDO.getCustomerId() : 0); order.setCustomerId(orderConsigneeDO.getCustomerId() != null ? orderConsigneeDO.getCustomerId() : 0);
order.setIsInOpenSea(consigneeDO.getIsInOpenSea());
order.setSalesmanId(consigneeDO.getCustomerService() != null ? consigneeDO.getCustomerService() : 0); order.setSalesmanId(consigneeDO.getCustomerService() != null ? consigneeDO.getCustomerService() : 0);
customerType = 2; customerType = 2;
...@@ -1322,6 +1357,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -1322,6 +1357,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
} else { } else {
//业绩归收货人 //业绩归收货人
order.setCustomerId(orderConsigneeDO.getCustomerId() != null ? orderConsigneeDO.getCustomerId() : 0); order.setCustomerId(orderConsigneeDO.getCustomerId() != null ? orderConsigneeDO.getCustomerId() : 0);
order.setIsInOpenSea(consigneeDO.getIsInOpenSea());
order.setSalesmanId(consigneeDO.getCustomerService() != null ? consigneeDO.getCustomerService() : 0); order.setSalesmanId(consigneeDO.getCustomerService() != null ? consigneeDO.getCustomerService() : 0);
customerType = 2; customerType = 2;
...@@ -2158,6 +2194,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -2158,6 +2194,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
CustomerDO customerDO = customerService.getById(updateObj.getCustomerId()); CustomerDO customerDO = customerService.getById(updateObj.getCustomerId());
if (Objects.nonNull(customerDO) && Objects.nonNull(customerDO.getIsShowTidanPrice())) { if (Objects.nonNull(customerDO) && Objects.nonNull(customerDO.getIsShowTidanPrice())) {
updateObj.setDisplayBillLadingPrice(customerDO.getIsShowTidanPrice()); updateObj.setDisplayBillLadingPrice(customerDO.getIsShowTidanPrice());
updateObj.setIsInOpenSea(customerDO.getIsInOpenSea());
} }
} }
} }
......
...@@ -148,24 +148,28 @@ public class TargetLogServiceImpl extends AbstractService<TargetLogMapper, Targe ...@@ -148,24 +148,28 @@ public class TargetLogServiceImpl extends AbstractService<TargetLogMapper, Targe
return; return;
} }
OrderBackInfoDto info = orderQueryService.info(orderId); OrderBackInfoDto info = orderQueryService.info(orderId);
if (info != null && info.getSalesmanId()!=null && info.getSalesmanId()>0L) {//客户经理 if (info.getIsInOpenSea()){
Long customerId = 0L; // 订单归属客户产生业绩时在公海池,不添加业绩日志
if (info.getType().contains("2")) {//海外仓归属发货人 return;
customerId = info.getConsignorVO().getCustomerId(); }
} else { // if (info != null && info.getSalesmanId()!=null && info.getSalesmanId()>0L) {//客户经理
if (info.getIsCargoControl()) {//非海外控货归属发货人 // Long customerId = info.getCustomerId();
customerId = info.getConsignorVO().getCustomerId(); // if (info.getType().contains("2")) {//海外仓归属发货人
} else { // customerId = info.getConsignorVO().getCustomerId();
if (info.getDrawee() == 1) {//非海外非控货 付款人为发货人 归属发货人 // } else {
customerId = info.getConsignorVO().getCustomerId(); // if (info.getIsCargoControl()) {//非海外控货归属发货人
} else { //非海外非控货 付款人为其他 归属收货人 // customerId = info.getConsignorVO().getCustomerId();
customerId = info.getConsigneeVO().getCustomerId(); // } else {
} // if (info.getDrawee() == 1) {//非海外非控货 付款人为发货人 归属发货人
} // customerId = info.getConsignorVO().getCustomerId();
} // } else { //非海外非控货 付款人为其他 归属收货人
// customerId = info.getConsigneeVO().getCustomerId();
// }
// }
// }
TargetLogDO targetLogDO = new TargetLogDO(); TargetLogDO targetLogDO = new TargetLogDO();
targetLogDO.setOrderId(orderId); targetLogDO.setOrderId(orderId);
targetLogDO.setCustomerId(customerId); targetLogDO.setCustomerId(info.getCustomerId());
targetLogDO.setUserId(info.getSalesmanId()); targetLogDO.setUserId(info.getSalesmanId());
targetLogDO.setAchievementTime(achievementTime); targetLogDO.setAchievementTime(achievementTime);
if (info.getTransportId() == 3) { if (info.getTransportId() == 3) {
...@@ -178,6 +182,6 @@ public class TargetLogServiceImpl extends AbstractService<TargetLogMapper, Targe ...@@ -178,6 +182,6 @@ public class TargetLogServiceImpl extends AbstractService<TargetLogMapper, Targe
targetLogDO.setType(type); targetLogDO.setType(type);
targetLogMapper.insert(targetLogDO); targetLogMapper.insert(targetLogDO);
// customerService.updateCustomerIsNewToOld(customerId); // customerService.updateCustomerIsNewToOld(customerId);
} // }
} }
} }
...@@ -583,6 +583,10 @@ public class OrderBackVO { ...@@ -583,6 +583,10 @@ public class OrderBackVO {
private List<OrderItemDO> orderItemDOList; private List<OrderItemDO> orderItemDOList;
@ApiModelProperty(value = "是否在公海")
private Boolean isInOpenSea;
public void setExternalWarehouseJson(String externalWarehouseJson) { public void setExternalWarehouseJson(String externalWarehouseJson) {
this.externalWarehouseJson = externalWarehouseJson; this.externalWarehouseJson = externalWarehouseJson;
if (StringUtils.isNotBlank(externalWarehouseJson)) { if (StringUtils.isNotBlank(externalWarehouseJson)) {
......
...@@ -352,6 +352,9 @@ public class OrderBaseVO { ...@@ -352,6 +352,9 @@ public class OrderBaseVO {
@ApiModelProperty(value = "是否显示提单金额") @ApiModelProperty(value = "是否显示提单金额")
private Boolean displayBillLadingPrice; private Boolean displayBillLadingPrice;
@ApiModelProperty(value = "是否在公海")
private Boolean isInOpenSea;
public void setExceptionReason(String exceptionReason) { public void setExceptionReason(String exceptionReason) {
this.exceptionReason = StringUtils.isNotBlank(exceptionReason) ? I18nMessage.getMessage(exceptionReason) : exceptionReason; this.exceptionReason = StringUtils.isNotBlank(exceptionReason) ? I18nMessage.getMessage(exceptionReason) : exceptionReason;
} }
......
...@@ -283,6 +283,10 @@ public class OrderExcelVO { ...@@ -283,6 +283,10 @@ public class OrderExcelVO {
@ApiModelProperty(value = "关联订单状态") @ApiModelProperty(value = "关联订单状态")
private List<GuanLianOrderStatusVO> guanLianOrderStatusVOList; private List<GuanLianOrderStatusVO> guanLianOrderStatusVOList;
@ExcelIgnore
@ApiModelProperty(value = "是否在公海")
private Boolean isInOpenSea;
public void setWarehouseInInfo(String warehouseInInfo) { public void setWarehouseInInfo(String warehouseInInfo) {
this.warehouseInInfo = warehouseInInfo; this.warehouseInInfo = warehouseInInfo;
if (StringUtils.isNotBlank(warehouseInInfo)) { if (StringUtils.isNotBlank(warehouseInInfo)) {
......
...@@ -521,6 +521,10 @@ public class OrderQueryVO { ...@@ -521,6 +521,10 @@ public class OrderQueryVO {
private Integer asStatus; private Integer asStatus;
@ApiModelProperty(value = "是否在公海")
private Boolean isInOpenSea;
public void setStatus(Integer status) { public void setStatus(Integer status) {
this.status = status; this.status = status;
this.asStatus = status; this.asStatus = status;
......
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