Commit 63966d86 authored by zhengyi's avatar zhengyi

Merge branch 'release-fix' into dev

parents 7c6ad1c3 d2c62bfd
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
Target Server Version : 80031 (8.0.31) Target Server Version : 80031 (8.0.31)
File Encoding : 65001 File Encoding : 65001
Date: 15/08/2024 11:04:17 Date: 06/09/2024 11:23:57
*/ */
SET NAMES utf8mb4; SET NAMES utf8mb4;
...@@ -23,6 +23,7 @@ SET FOREIGN_KEY_CHECKS = 0; ...@@ -23,6 +23,7 @@ SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE IF EXISTS `score_rule`; DROP TABLE IF EXISTS `score_rule`;
CREATE TABLE `score_rule` ( CREATE TABLE `score_rule` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键', `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
`code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '规则编号',
`type` int NOT NULL COMMENT '指标类型', `type` int NOT NULL COMMENT '指标类型',
`title_zh` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '规则标题中文', `title_zh` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '规则标题中文',
`title_en` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '规则标题英文', `title_en` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL COMMENT '规则标题英文',
...@@ -46,6 +47,6 @@ CREATE TABLE `score_rule` ( ...@@ -46,6 +47,6 @@ CREATE TABLE `score_rule` (
`updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者', `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
PRIMARY KEY (`id`) USING BTREE PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 42 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC; ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = DYNAMIC;
SET FOREIGN_KEY_CHECKS = 1; SET FOREIGN_KEY_CHECKS = 1;
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
Target Server Version : 80031 (8.0.31) Target Server Version : 80031 (8.0.31)
File Encoding : 65001 File Encoding : 65001
Date: 15/08/2024 11:17:08 Date: 06/09/2024 11:26:34
*/ */
SET NAMES utf8mb4; SET NAMES utf8mb4;
...@@ -23,6 +23,7 @@ SET FOREIGN_KEY_CHECKS = 0; ...@@ -23,6 +23,7 @@ SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE IF EXISTS `ecw_reward_redeem`; DROP TABLE IF EXISTS `ecw_reward_redeem`;
CREATE TABLE `ecw_reward_redeem` ( CREATE TABLE `ecw_reward_redeem` (
`id` bigint NOT NULL COMMENT '主键', `id` bigint NOT NULL COMMENT '主键',
`redemption_number` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '兑换记录编号',
`member_id` bigint NOT NULL COMMENT '会员id', `member_id` bigint NOT NULL COMMENT '会员id',
`reward_id` bigint NOT NULL COMMENT '礼品id', `reward_id` bigint NOT NULL COMMENT '礼品id',
`status` int NULL DEFAULT NULL COMMENT '兑换状态', `status` int NULL DEFAULT NULL COMMENT '兑换状态',
......
...@@ -82,6 +82,44 @@ VALUES (1, '1', '等待消息', 'Waiting for message', 'customer_followup_result ...@@ -82,6 +82,44 @@ VALUES (1, '1', '等待消息', 'Waiting for message', 'customer_followup_result
-- ----------------------------
-- Table structure for ecw_customer_followup
-- ----------------------------
DROP TABLE IF EXISTS `ecw_customer_followup`;
CREATE TABLE `ecw_customer_followup` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
`number` varchar(64) NULL DEFAULT NULL COMMENT '编号',
`parent_number` varchar(64) NULL DEFAULT NULL COMMENT '上一级跟进单号',
`status` int NULL DEFAULT NULL COMMENT '状态 字典customer_followup_status',
`customer_id` bigint NULL DEFAULT NULL COMMENT '客户编号',
`offer_id` bigint NULL DEFAULT NULL COMMENT '报价单',
`follow_type` tinyint NULL DEFAULT NULL COMMENT '跟进类型 字典customer_followup_type',
`follow_time` datetime NULL DEFAULT NULL COMMENT '跟进时间',
`contact_name` varchar(63) NULL DEFAULT NULL COMMENT '联系人',
`follow_method` tinyint NULL DEFAULT NULL COMMENT '跟进方式 字典customer_followup_method',
`follow_user_id` bigint NULL DEFAULT NULL COMMENT '客户经理/跟进业务员id',
`purpose` varchar(512) NULL DEFAULT NULL COMMENT '目的',
`result_type` tinyint NULL DEFAULT NULL COMMENT '跟进结果 字典customer_followup_result_type',
`feedback` varchar(2048) NULL DEFAULT NULL COMMENT '客户反馈',
`attatchment` varchar(2048) NULL DEFAULT NULL COMMENT '附件 多个以逗号分隔',
`next_time` datetime NULL DEFAULT NULL COMMENT '下次跟进时间',
`next_plan` varchar(2048) NULL DEFAULT NULL COMMENT '下次跟进计划',
`creator` varchar(63) NOT NULL DEFAULT '' COMMENT '创建者',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updater` varchar(63) NULL DEFAULT '' COMMENT '更新者',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除',
PRIMARY KEY (`id`)
) ENGINE = InnoDB AUTO_INCREMENT = 1 COMMENT = '客户跟进表';
-- 下面为刷新数据的sql
-- 更新客户角色 -- 更新客户角色
update ecw_customer set roles = '2' where FIND_IN_SET(2, type) != 0; update ecw_customer set roles = '2' where FIND_IN_SET(2, type) != 0;
update ecw_customer set roles = '3' where FIND_IN_SET(3, type) != 0; update ecw_customer set roles = '3' where FIND_IN_SET(3, type) != 0;
...@@ -96,3 +134,15 @@ update ecw_customer a ...@@ -96,3 +134,15 @@ update ecw_customer a
set a.customer_service_confirmed_time = b.maxtime set a.customer_service_confirmed_time = b.maxtime
where a.deleted = 0; where a.deleted = 0;
-- 刷新客户跟进数据
insert into ecw_customer_followup(id, number, parent_number, `status`, customer_id, offer_id, follow_type, follow_time, contact_name,
follow_method, follow_user_id, purpose, result_type, feedback, attatchment,
next_time, next_plan, creator, create_time, updater, update_time, deleted)
select null, null, null, 1, customer_id, null, 1, follow_time, contact_name, follow_method, follow_user_id, null, 1,
CONCAT('【客户反馈:】\r\n', feedback, '\r\n\r\n【处理结果:】\r\n', result),
null, null, null, creator, create_time, updater, update_time, deleted
from ecw_customer_follow;
-- 更新客户跟进编号
update ecw_customer_followup set number = CONCAT('GJ', 2024000000 + id);
...@@ -5,3 +5,10 @@ INSERT INTO `system_dict_data` (`sort`, `value`, `label`, `label_en`, `dict_type ...@@ -5,3 +5,10 @@ INSERT INTO `system_dict_data` (`sort`, `value`, `label`, `label_en`, `dict_type
VALUES (23, '23', '设置默认付款', 'Set Customer Default Pay', 'customer_operate_type', 0, 'default', '', NULL, '1', now(), '115', now(), b'0'); VALUES (23, '23', '设置默认付款', 'Set Customer Default Pay', 'customer_operate_type', 0, 'default', '', NULL, '1', now(), '115', now(), b'0');
INSERT INTO `system_dict_data` (`sort`, `value`, `label`, `label_en`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) INSERT INTO `system_dict_data` (`sort`, `value`, `label`, `label_en`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
VALUES (24, '24', '设置默认开票', 'Set Customer Default Billing', 'customer_operate_type', 0, 'default', '', NULL, '1', now(), '115', now(), b'0'); VALUES (24, '24', '设置默认开票', 'Set Customer Default Billing', 'customer_operate_type', 0, 'default', '', NULL, '1', now(), '115', now(), b'0');
INSERT INTO `system_dict_data` (`sort`, `value`, `label`, `label_en`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
VALUES (25, '25', '新增跟进纪录', 'Create Customer Followup', 'customer_operate_type', 0, 'default', '', NULL, '1', now(), '115', now(), b'0');
INSERT INTO `system_dict_data` (`sort`, `value`, `label`, `label_en`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
VALUES (26, '26', '编辑跟进纪录', 'Update Customer Followup', 'customer_operate_type', 0, 'default', '', NULL, '1', now(), '115', now(), b'0');
INSERT INTO `system_dict_data` (`sort`, `value`, `label`, `label_en`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`)
VALUES (27, '27', '提交跟进纪录', 'Commit Customer Followup', 'customer_operate_type', 0, 'default', '', NULL, '1', now(), '115', now(), b'0');
...@@ -12,6 +12,11 @@ alter table `ecw_order_consignee` ...@@ -12,6 +12,11 @@ alter table `ecw_order_consignee`
alter table `ecw_order` alter table `ecw_order`
add column `pick_state` tinyint DEFAULT 0 COMMENT '提货状态:0 未提货 1 部分提货 2 已提货'; add column `pick_state` tinyint DEFAULT 0 COMMENT '提货状态:0 未提货 1 部分提货 2 已提货';
alter table `ecw_order` alter table `ecw_order`
add column `pick_ratio` int DEFAULT 0 COMMENT '提货率'; add column `pick_ratio` decimal(5,2) DEFAULT '0.00' COMMENT '提货率';
alter table `ecw_order` alter table `ecw_order`
add column `pick_num` int DEFAULT 0 COMMENT '提货箱数'; add column `pick_num` int DEFAULT 0 COMMENT '提货箱数';
\ No newline at end of file
-- 批量刷新订单提货数量、提货率、提货状态
update ecw_order t LEFT JOIN (select a.order_id,sum(a.pick_num) as pickNum from ecw_order_pickup a where a.deleted=0 GROUP BY a.order_id) t1 on t.order_no=t1.order_id set t.pick_num=t1.pickNum,t.pick_ratio=ROUND(t1.pickNum/t.sum_num,2)*100,t.pick_state=(case when t1.pickNum is null then 0 when t1.pickNum=t.sum_num then 3 else 2 end);
-- 已提货和部分提货的订单批量刷新订单主状态
update ecw_order t set t.`status`=16 where t.`status` in (20,21);
\ No newline at end of file
...@@ -291,28 +291,25 @@ ...@@ -291,28 +291,25 @@
<dependency> <dependency>
<groupId>com.googlecode.libphonenumber</groupId> <groupId>com.googlecode.libphonenumber</groupId>
<artifactId>geocoder</artifactId> <artifactId>geocoder</artifactId>
<version>2.205</version> <version>2.238</version>
</dependency> </dependency>
<!-- 国际号码库-手机号格式校验 --> <!-- 国际号码库-手机号格式校验 -->
<dependency> <dependency>
<groupId>com.googlecode.libphonenumber</groupId> <groupId>com.googlecode.libphonenumber</groupId>
<artifactId>libphonenumber</artifactId> <artifactId>libphonenumber</artifactId>
<version>8.13.11</version> <version>8.13.44</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.googlecode.libphonenumber</groupId> <groupId>com.googlecode.libphonenumber</groupId>
<artifactId>prefixmapper</artifactId> <artifactId>prefixmapper</artifactId>
<version>2.205</version> <version>2.238</version>
</dependency> </dependency>
<!-- 国际号码库-运营商查询 --> <!-- 国际号码库-运营商查询 -->
<dependency> <dependency>
<groupId>com.googlecode.libphonenumber</groupId> <groupId>com.googlecode.libphonenumber</groupId>
<artifactId>carrier</artifactId> <artifactId>carrier</artifactId>
<version>1.195</version> <version>1.228</version>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>
package cn.iocoder.yudao.framework.common.util.validation; package cn.iocoder.yudao.framework.common.util.validation;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ReUtil; import cn.hutool.core.util.ReUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.dict.core.dto.DictDataRespDTO;
import cn.iocoder.yudao.framework.dict.core.util.DictFrameworkUtils;
import com.google.i18n.phonenumbers.NumberParseException; import com.google.i18n.phonenumbers.NumberParseException;
import com.google.i18n.phonenumbers.PhoneNumberToCarrierMapper; import com.google.i18n.phonenumbers.PhoneNumberToCarrierMapper;
import com.google.i18n.phonenumbers.PhoneNumberUtil; import com.google.i18n.phonenumbers.PhoneNumberUtil;
...@@ -10,10 +13,13 @@ import com.google.i18n.phonenumbers.Phonenumber.PhoneNumber; ...@@ -10,10 +13,13 @@ import com.google.i18n.phonenumbers.Phonenumber.PhoneNumber;
import com.google.i18n.phonenumbers.geocoding.PhoneNumberOfflineGeocoder; import com.google.i18n.phonenumbers.geocoding.PhoneNumberOfflineGeocoder;
import lombok.Data; import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.apache.commons.lang3.StringUtils; import lombok.extern.log4j.Log4j2;
import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Objects;
@Log4j2
public class PhoneUtil { public class PhoneUtil {
private static PhoneNumberUtil phoneNumberUtil = PhoneNumberUtil.getInstance(); private static PhoneNumberUtil phoneNumberUtil = PhoneNumberUtil.getInstance();
...@@ -139,13 +145,47 @@ public class PhoneUtil { ...@@ -139,13 +145,47 @@ public class PhoneUtil {
if (mc.length != 2) { if (mc.length != 2) {
return false; return false;
} }
String code = mc[0]; // 国家区号 String code = mc[0]; // 国家区号
String mobile = mc[1]; // 手机号 String mobile = mc[1]; // 手机号
if (StrUtil.isBlank(code) || StrUtil.isBlank(mobile)) {
return false;
}
if (!mobile.matches("^[0-9]*$") || !code.matches("^[0-9]*$")) { if (!mobile.matches("^[0-9]*$") || !code.matches("^[0-9]*$")) {
// 纯数字校验 // 纯数字校验
return false; return false;
} }
switch (code) {
// 字典中获取验证规则
String rule = null;
try {
List<DictDataRespDTO> dtos = DictFrameworkUtils.listDictDatasFromCache("phone_number_rule");
if (CollUtil.isNotEmpty(dtos)) {
DictDataRespDTO dto = dtos.stream().filter(d -> d.getValue().trim().equals(code.trim())).findFirst().orElseGet(null);
if (Objects.nonNull(dto)) {
// 优先获取中文
rule = dto.getLabel();
if (StrUtil.isBlank(rule)) {
// 中文不存在,再获取英文
rule = dto.getLabelEn();
}
}
}
}
catch (Exception e) {
log.error(String.format("获取手机号规则失败, code: %s, mobile: %s->", code, mobile), e);
}
if (StrUtil.isNotBlank(rule)) {
log.info(String.format("获取手机号规则成功, code: %s, mobile: %s, rule: %s", code, mobile, rule));
return mobile.matches(rule);
}
// 通用验证
return checkPhoneNumber(mobile, code);
/*switch (code) {
case "86": case "86":
// 中国 // 中国
if (!mobile.matches("1[23456789]\\d{9}") if (!mobile.matches("1[23456789]\\d{9}")
...@@ -174,7 +214,7 @@ public class PhoneUtil { ...@@ -174,7 +214,7 @@ public class PhoneUtil {
} }
return checkPhoneNumber(mobile, code); return checkPhoneNumber(mobile, code);
} }
return true; return true;*/
} }
...@@ -210,6 +250,8 @@ public class PhoneUtil { ...@@ -210,6 +250,8 @@ public class PhoneUtil {
System.out.println(phone2+" Formatted number2: " + formattedNumber2); System.out.println(phone2+" Formatted number2: " + formattedNumber2);
String number2 = PhoneNumberUtil.normalizeDiallableCharsOnly(phone2); String number2 = PhoneNumberUtil.normalizeDiallableCharsOnly(phone2);
System.out.println(phone2+" Formatted number2: " + number2); System.out.println(phone2+" Formatted number2: " + number2);
System.out.println("15219293930".matches("1[23456789]\\d{9}"));
// //
// System.out.println("formatPhone1 234:8035875722>>>>"+PhoneUtil.formatPhone("234:8035875722"));; // System.out.println("formatPhone1 234:8035875722>>>>"+PhoneUtil.formatPhone("234:8035875722"));;
......
...@@ -2,8 +2,6 @@ package cn.iocoder.yudao.framework.common.validation; ...@@ -2,8 +2,6 @@ package cn.iocoder.yudao.framework.common.validation;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.common.util.validation.PhoneUtil; import cn.iocoder.yudao.framework.common.util.validation.PhoneUtil;
import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils;
import javax.validation.ConstraintValidator; import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext; import javax.validation.ConstraintValidatorContext;
...@@ -16,7 +14,7 @@ public class MobileCodeValidator implements ConstraintValidator<MobileCode, Stri ...@@ -16,7 +14,7 @@ public class MobileCodeValidator implements ConstraintValidator<MobileCode, Stri
@Override @Override
public boolean isValid(String value, ConstraintValidatorContext context) { public boolean isValid(String value, ConstraintValidatorContext context) {
// 如果手机号为空,默认不校验,即校验通过 // 如果手机号为空,默认不校验,即校验通过
if (StrUtil.isEmpty(value)) { if (StrUtil.isBlank(value)) {
return true; return true;
} }
// 校验手机 // 校验手机
......
...@@ -4,6 +4,8 @@ import cn.iocoder.yudao.framework.dict.core.dto.DictDataRespDTO; ...@@ -4,6 +4,8 @@ import cn.iocoder.yudao.framework.dict.core.dto.DictDataRespDTO;
import cn.iocoder.yudao.framework.dict.core.service.DictDataFrameworkService; import cn.iocoder.yudao.framework.dict.core.service.DictDataFrameworkService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import java.util.List;
/** /**
* 字典工具类 * 字典工具类
*/ */
...@@ -29,4 +31,12 @@ public class DictFrameworkUtils { ...@@ -29,4 +31,12 @@ public class DictFrameworkUtils {
return service.parseDictDataFromCacheWithMultiLang(type, multiLangLabel); return service.parseDictDataFromCacheWithMultiLang(type, multiLangLabel);
} }
/**
* 获得指定类型的字典数据,从缓存中
* @param type 字典类型
* @return 字典数据列表
*/
public static List<DictDataRespDTO> listDictDatasFromCache(String type) {
return service.listDictDatasFromCache(type);
}
} }
...@@ -518,4 +518,9 @@ public class CustomerDO extends BaseDO { ...@@ -518,4 +518,9 @@ public class CustomerDO extends BaseDO {
private String countryName; private String countryName;
// competitorNames
@TableField(exist = false)
private String competitorNames;
} }
...@@ -9,8 +9,14 @@ import javax.annotation.Resource; ...@@ -9,8 +9,14 @@ import javax.annotation.Resource;
import cn.iocoder.yudao.framework.i18n.core.I18nMessage; import cn.iocoder.yudao.framework.i18n.core.I18nMessage;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils; import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.customer.dal.dataobject.customer.CustomerDO; import cn.iocoder.yudao.module.customer.dal.dataobject.customer.CustomerDO;
import cn.iocoder.yudao.module.customer.dal.mysql.customer.CustomerMapper;
import cn.iocoder.yudao.module.customer.service.customerOperateLog.CustomerOperateLogService;
import cn.iocoder.yudao.module.customer.vo.customerOperateLog.CustomerOperateLogCreateReqVO;
import cn.iocoder.yudao.module.ecw.enums.CustomerFollowupStatusEnum; import cn.iocoder.yudao.module.ecw.enums.CustomerFollowupStatusEnum;
import cn.iocoder.yudao.module.ecw.enums.CustomerOperateTypeEnum;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
...@@ -36,6 +42,13 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu ...@@ -36,6 +42,13 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu
@Resource @Resource
private CustomerFollowupMapper followupMapper; private CustomerFollowupMapper followupMapper;
@Resource
private CustomerOperateLogService customerOperateLogService;
@Resource
private CustomerMapper customerMapper;
/** /**
* 跟进单编号生成方式:GJ+年份+六位数字,按年份累计 * 跟进单编号生成方式:GJ+年份+六位数字,按年份累计
* @return * @return
...@@ -66,6 +79,31 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu ...@@ -66,6 +79,31 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu
// 插入 // 插入
CustomerFollowupDO followup = CustomerFollowupConvert.INSTANCE.convert(createReqVO); CustomerFollowupDO followup = CustomerFollowupConvert.INSTANCE.convert(createReqVO);
followupMapper.insert(followup); followupMapper.insert(followup);
Long customerId = createReqVO.getCustomerId();
if (customerId != null) {
CustomerDO customer = customerMapper.selectById(customerId);
if (customer == null) {
// 插入日志
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
//保存客户捞取记录
CustomerOperateLogCreateReqVO customerOperateLogCreateReqVO = new CustomerOperateLogCreateReqVO()
.setOperator(loginUser == null ? null : loginUser.getId())
.setOperatorName(loginUser == null ? null : loginUser.getNickname())
.setCustomerId(customer.getId())
.setNumber(customer.getNumber())
.setName(customer.getName())
.setNewCustomerService(customer.getCustomerService())
.setOldCustomerService(customer.getCustomerService())
.setOldEstimateEnterOpenSeaTime(customer.getEstimateEnterOpenSeaTime())
.setNewEstimateEnterOpenSeaTime(customer.getEstimateEnterOpenSeaTime())
.setOperateType(CustomerOperateTypeEnum.FOLLOWUP_CREATE.getValue())
.setRemark("新增跟进纪录" + (CustomerFollowupStatusEnum.UnCommited.getValue().equals(createReqVO.getStatus()) ? "" : ",并提交"));
customerOperateLogService.createOperateLog(customerOperateLogCreateReqVO);
}
}
// 返回 // 返回
return followup.getId(); return followup.getId();
} }
...@@ -84,6 +122,30 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu ...@@ -84,6 +122,30 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu
// 更新 // 更新
CustomerFollowupDO updateObj = CustomerFollowupConvert.INSTANCE.convert(updateReqVO); CustomerFollowupDO updateObj = CustomerFollowupConvert.INSTANCE.convert(updateReqVO);
followupMapper.updateById(updateObj); followupMapper.updateById(updateObj);
Long customerId = updateReqVO.getCustomerId();
if (customerId != null) {
CustomerDO customer = customerMapper.selectById(customerId);
if (customer == null) {
// 插入日志
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
//保存客户捞取记录
CustomerOperateLogCreateReqVO customerOperateLogCreateReqVO = new CustomerOperateLogCreateReqVO()
.setOperator(loginUser == null ? null : loginUser.getId())
.setOperatorName(loginUser == null ? null : loginUser.getNickname())
.setCustomerId(customer.getId())
.setNumber(customer.getNumber())
.setName(customer.getName())
.setNewCustomerService(customer.getCustomerService())
.setOldCustomerService(customer.getCustomerService())
.setOldEstimateEnterOpenSeaTime(customer.getEstimateEnterOpenSeaTime())
.setNewEstimateEnterOpenSeaTime(customer.getEstimateEnterOpenSeaTime())
.setOperateType(CustomerOperateTypeEnum.FOLLOWUP_UPDATE.getValue())
.setRemark("更新跟进纪录" + (CustomerFollowupStatusEnum.UnCommited.getValue().equals(updateReqVO.getStatus()) ? "" : ",并提交"));
customerOperateLogService.createOperateLog(customerOperateLogCreateReqVO);
}
}
} }
@Override @Override
...@@ -94,8 +156,39 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu ...@@ -94,8 +156,39 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu
if (customerFollowupDO == null) { if (customerFollowupDO == null) {
throw exception(FOLLOWUP_NOT_EXISTS); throw exception(FOLLOWUP_NOT_EXISTS);
} }
if (CustomerFollowupStatusEnum.Commited.getValue().equals(customerFollowupDO.getStatus())) {
throw exception(FOLLOWUP_ALREADY_SUBMITTED);
}
customerFollowupDO.setStatus(updateStatusReqVO.getStatus()); customerFollowupDO.setStatus(updateStatusReqVO.getStatus());
followupMapper.updateById(customerFollowupDO); followupMapper.updateById(customerFollowupDO);
Long customerId = customerFollowupDO.getCustomerId();
if (customerId != null) {
CustomerDO customer = customerMapper.selectById(customerId);
if (customer == null) {
// 插入日志
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
//保存客户捞取记录
CustomerOperateLogCreateReqVO customerOperateLogCreateReqVO = new CustomerOperateLogCreateReqVO()
.setOperator(loginUser == null ? null : loginUser.getId())
.setOperatorName(loginUser == null ? null : loginUser.getNickname())
.setCustomerId(customer.getId())
.setNumber(customer.getNumber())
.setName(customer.getName())
.setNewCustomerService(customer.getCustomerService())
.setOldCustomerService(customer.getCustomerService())
.setOldEstimateEnterOpenSeaTime(customer.getEstimateEnterOpenSeaTime())
.setNewEstimateEnterOpenSeaTime(customer.getEstimateEnterOpenSeaTime())
.setOperateType(CustomerOperateTypeEnum.FOLLOWUP_COMMIT.getValue())
.setRemark("提交跟进纪录");
customerOperateLogService.createOperateLog(customerOperateLogCreateReqVO);
}
}
} }
@Override @Override
......
...@@ -3,16 +3,20 @@ package cn.iocoder.yudao.module.customer.vo.customer.vo; ...@@ -3,16 +3,20 @@ package cn.iocoder.yudao.module.customer.vo.customer.vo;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
@ApiModel("管理后台 - 客户 Response VO") import javax.validation.constraints.NotNull;
@ApiModel("管理后台 - 客户合并 Req VO")
@Data @Data
@ToString(callSuper = true) @ToString(callSuper = true)
public class CustomerMerge { public class CustomerMerge {
@ApiModelProperty(value = "id1")
@ApiModelProperty(value = "被保留的客户id")
@NotNull(message = "被保留的客户id不能为空")
private Long id1; private Long id1;
@ApiModelProperty(value = "id2") @ApiModelProperty(value = "被删除的客户id")
@NotNull(message = "被删除的客户id不能为空")
private Long id2; private Long id2;
} }
...@@ -193,4 +193,26 @@ public class CustomerRespVO extends CustomerBaseVO { ...@@ -193,4 +193,26 @@ public class CustomerRespVO extends CustomerBaseVO {
private Date updateTime; private Date updateTime;
@ApiModelProperty(value = "推介人")
private Long promoter;
/**
* 客户来源
* <p>
* 枚举 {@link TODO customer_source 对应的类}
*/
@ApiModelProperty(value = "客户来源 字典customer_source")
private Integer source;
/**
* 客户角色
* <p>
* 枚举 {@link TODO customer_role 字典}
*/
@ApiModelProperty(value = "客户角色(逗号分隔的) customer_role 字典")
private String roles;
} }
...@@ -17,7 +17,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ ...@@ -17,7 +17,6 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
@ApiModel("管理后台 - 客户跟进 Response VO") @ApiModel("管理后台 - 客户跟进 Response VO")
public class CustomerFollowupBackVO { public class CustomerFollowupBackVO {
@ExcelProperty("主键")
@ApiModelProperty(value = "主键", required = true) @ApiModelProperty(value = "主键", required = true)
private Long id; private Long id;
...@@ -25,60 +24,61 @@ public class CustomerFollowupBackVO { ...@@ -25,60 +24,61 @@ public class CustomerFollowupBackVO {
@ApiModelProperty(value = "编号") @ApiModelProperty(value = "编号")
private String number; private String number;
@ExcelProperty("上一级跟进单号")
@ApiModelProperty(value = "上一级跟进单号")
private String parentNumber;
@ExcelProperty(value = "状态", converter = DictConvert.class)
@DictFormat("customer_followup_status")
@ApiModelProperty(value = "状态 字典customer_followup_status")
private Integer status;
@ApiModelProperty(value = "客户编号")
private Long customerId;
@ApiModelProperty(value = "报价单")
private Long offerId;
@ExcelProperty(value = "跟进类型", converter = DictConvert.class) @ExcelProperty(value = "跟进类型", converter = DictConvert.class)
@DictFormat("customer_followup_type") @DictFormat("customer_followup_type")
@ApiModelProperty(value = "跟进类型 字典customer_followup_type") @ApiModelProperty(value = "跟进类型 字典customer_followup_type")
private Integer followType; private Integer followType;
@ApiModelProperty(value = "报价单")
private Long offerId;
@ExcelProperty("报价单")
@ApiModelProperty(value = "报价单编号")
private String offerNumber;
@ExcelProperty("跟进时间") @ExcelProperty("跟进时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "跟进时间") @ApiModelProperty(value = "跟进时间")
private Date followTime; private Date followTime;
@ApiModelProperty(value = "客户编号")
private Long customerId;
@ExcelProperty("客户编号")
@ApiModelProperty(value = "客户编号")
private String customerNumber;
@ExcelProperty("联系人") @ExcelProperty("联系人")
@ApiModelProperty(value = "联系人") @ApiModelProperty(value = "联系人")
private String contactName; private String contactName;
//TODO 联系方式
@ApiModelProperty(value = "客户经理/跟进业务员id")
private Long followUserId;
@ExcelProperty("客户经理")
private String followUserName;
@ExcelProperty(value = "跟进方式", converter = DictConvert.class) @ExcelProperty(value = "跟进方式", converter = DictConvert.class)
@DictFormat("customer_followup_method") @DictFormat("customer_followup_method")
@ApiModelProperty(value = "跟进类型 字典customer_followup_type") @ApiModelProperty(value = "跟进类型 字典customer_followup_type")
private Integer followMethod; private Integer followMethod;
@ExcelProperty("客户经理/跟进业务员id")
@ApiModelProperty(value = "客户经理/跟进业务员id")
private Long followUserId;
@ExcelProperty("目的") @ExcelProperty("目的")
@ApiModelProperty(value = "目的") @ApiModelProperty(value = "目的")
private String purpose; private String purpose;
@ExcelProperty(value = "跟进结果", converter = DictConvert.class) @ExcelProperty(value = "结果", converter = DictConvert.class)
@DictFormat("customer_followup_result_type") @DictFormat("customer_followup_result_type")
@ApiModelProperty(value = "跟进结果 字典customer_followup_result_type") @ApiModelProperty(value = "跟进结果 字典customer_followup_result_type")
private Integer resultType; private Integer resultType;
@ExcelProperty("客户反馈") @ExcelProperty("跟进情况")
@ApiModelProperty(value = "客户反馈") @ApiModelProperty(value = "客户反馈")
private String feedback; private String feedback;
@ExcelProperty("附件 多个以逗号分隔")
@ApiModelProperty(value = "附件 多个以逗号分隔")
private String attatchment;
@ExcelProperty("下次跟进时间") @ExcelProperty("下次跟进时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
...@@ -89,31 +89,44 @@ public class CustomerFollowupBackVO { ...@@ -89,31 +89,44 @@ public class CustomerFollowupBackVO {
@ApiModelProperty(value = "下次跟进计划") @ApiModelProperty(value = "下次跟进计划")
private String nextPlan; private String nextPlan;
@ExcelProperty("关联跟进纪录")
@ApiModelProperty(value = "上一级跟进单号")
private String parentNumber;
@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("创建时间") @ExcelProperty("创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "创建时间", required = true) @ApiModelProperty(value = "创建时间", required = true)
private Date createTime; private Date createTime;
@ExcelProperty("更新时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ExcelProperty("客户编号")
@ApiModelProperty(value = "客户编号")
private String customerNumber;
@ExcelProperty("报价单")
@ApiModelProperty(value = "报价单编号")
private String offerNumber;
//creator_name
@ExcelProperty("创建人id")
@ApiModelProperty(value = "创建人名称")
private String creatorName;
// updater_name // updater_name
@ExcelProperty("更新人id") @ExcelProperty("最后更新人")
@ApiModelProperty(value = "更新人名称") @ApiModelProperty(value = "更新人名称")
private String updaterName; private String updaterName;
@ExcelProperty("最后更新时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "附件 多个以逗号分隔")
private String attatchment;
} }
...@@ -39,12 +39,14 @@ ...@@ -39,12 +39,14 @@
<select id="selectPage1" resultType="cn.iocoder.yudao.module.customer.dal.dataobject.customerFollowup.CustomerFollowupDO"> <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, select a.*, b.number as customer_number, c.number as offer_number,
d.nickname as creator_name, e.nickname as updater_name d.nickname as creator_name, e.nickname as updater_name,
f.nickname as follow_user_name
from ecw_customer_followup a from ecw_customer_followup a
left join ecw_customer b on a.customer_id = b.id left join ecw_customer b on a.customer_id = b.id
left join ecw_offer c on a.offer_id = c.offer_id left join ecw_offer c on a.offer_id = c.offer_id
left join system_user d on a.creator = d.id left join system_user d on a.creator = d.id
left join system_user e on a.updater = e.id left join system_user e on a.updater = e.id
left join system_user f on a.follow_user_id = f.id
WHERE 1=1 AND a.deleted = 0 WHERE 1=1 AND a.deleted = 0
......
...@@ -682,7 +682,7 @@ ...@@ -682,7 +682,7 @@
<if test="query.leNumYearly != null"> <if test="query.leNumYearly != null">
AND contact.num_yearly <![CDATA[ <= ]]> #{query.leNumYearly} AND contact.num_yearly <![CDATA[ <= ]]> #{query.leNumYearly}
</if> </if>
<if test="query.leNumYearly != null"> <if test="query.eqNumYearly != null">
AND contact.num_yearly = #{query.leNumYearly} AND contact.num_yearly = #{query.leNumYearly}
</if> </if>
......
...@@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.customer.controller.admin.customer; ...@@ -2,7 +2,6 @@ package cn.iocoder.yudao.module.customer.controller.admin.customer;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
...@@ -25,7 +24,6 @@ import cn.iocoder.yudao.module.customer.dal.dataobject.customer.complaint.Custom ...@@ -25,7 +24,6 @@ import cn.iocoder.yudao.module.customer.dal.dataobject.customer.complaint.Custom
import cn.iocoder.yudao.module.customer.dal.dataobject.customer.follow.CustomerFollowDO; import cn.iocoder.yudao.module.customer.dal.dataobject.customer.follow.CustomerFollowDO;
import cn.iocoder.yudao.module.customer.dal.dataobject.customerBank.CustomerBankDO; import cn.iocoder.yudao.module.customer.dal.dataobject.customerBank.CustomerBankDO;
import cn.iocoder.yudao.module.customer.dal.dataobject.customerContacts.CustomerContactsDO; import cn.iocoder.yudao.module.customer.dal.dataobject.customerContacts.CustomerContactsDO;
import cn.iocoder.yudao.module.customer.dal.dataobject.customerLevelLog.CustomerLevelLogDO;
import cn.iocoder.yudao.module.customer.dal.mysql.customerDetail.CustomerDetailMapper; import cn.iocoder.yudao.module.customer.dal.mysql.customerDetail.CustomerDetailMapper;
import cn.iocoder.yudao.module.customer.dto.CustomerDelayApprovalInfoDto; import cn.iocoder.yudao.module.customer.dto.CustomerDelayApprovalInfoDto;
import cn.iocoder.yudao.module.customer.dto.CustomerExportReqDTO; import cn.iocoder.yudao.module.customer.dto.CustomerExportReqDTO;
...@@ -372,33 +370,22 @@ public class CustomerController { ...@@ -372,33 +370,22 @@ public class CustomerController {
// 客户投诉,品牌授权都迁移到保留客户中,其他信息不会迁移, // 客户投诉,品牌授权都迁移到保留客户中,其他信息不会迁移,
// 如需要维护非主客户的客户档案信息到保留客户中,请先维护好再操作 // 如需要维护非主客户的客户档案信息到保留客户中,请先维护好再操作
if (par.getId1() == null) { CustomerDO customerDO1 = customerService.getById(par.getId1());
return success(false);
}
if (par.getId2() == null) {
return success(false);
}
CustomerDO customerDO1 =
customerService.getById(par.getId1());
if (customerDO1 == null) { if (customerDO1 == null) {
throw exception(new ErrorCode(0, "保留客户未查询到")); throw exception(ErrorCodeConstants.CUSTOMER_SAVED_NOT_EXISTS);
} }
if (customerDO1.getCustomerService() == null) { if (customerDO1.getCustomerService() == null) {
throw exception(new ErrorCode(0, "保留客户的客户经理为空")); throw exception(ErrorCodeConstants.CUSTOMER_SAVED_CUSTOMER_SERVICE_IS_NULL);
} }
CustomerDO customerDO2 = CustomerDO customerDO2 = customerService.getById(par.getId2());
customerService.getById(par.getId2());
if (customerDO2 == null) { if (customerDO2 == null) {
throw exception(new ErrorCode(0, "被合并客户未查询到")); throw exception(ErrorCodeConstants.CUSTOMER_DELETED_NOT_EXISTS);
} }
if (customerDO2.getCustomerService() == null) { if (customerDO2.getCustomerService() == null) {
throw exception(new ErrorCode(0, "被合并客户客户经理为空")); throw exception(ErrorCodeConstants.CUSTOMER_DELETED_CUSTOMER_SERVICE_IS_NULL);
} }
if (customerDO1.getCustomerService() != customerDO2.getCustomerService()) { if (customerDO1.getCustomerService() != customerDO2.getCustomerService()) {
throw exception(new ErrorCode(0, throw exception(ErrorCodeConstants.CUSTOMER_MERGE_CUSTOMER_SERVICE_NOT_SAME);
"保留客户和被合并客户客户经理不相同"));
} }
Long loginUserId = SecurityFrameworkUtils.getLoginUserId(); Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
...@@ -571,6 +558,8 @@ public class CustomerController { ...@@ -571,6 +558,8 @@ public class CustomerController {
for (CustomerContactsDO d : cuscontactList2 for (CustomerContactsDO d : cuscontactList2
) { ) {
d.setCustomerId(customerDO1.getId()); d.setCustomerId(customerDO1.getId());
//被合并的客户联系人,默认为非默认
d.setIsDefault(0);
d.setUpdateTime(new Date()); d.setUpdateTime(new Date());
d.setUpdater(String.valueOf(loginUserId)); d.setUpdater(String.valueOf(loginUserId));
customerContactsService.updateById(d); customerContactsService.updateById(d);
......
...@@ -4,13 +4,13 @@ import cn.iocoder.yudao.framework.apollo.core.event.Customer.ReceiveCustomerCalT ...@@ -4,13 +4,13 @@ import cn.iocoder.yudao.framework.apollo.core.event.Customer.ReceiveCustomerCalT
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.delivery.entity.EcwVz; import cn.iocoder.yudao.module.delivery.entity.EcwVz;
import cn.iocoder.yudao.module.delivery.entity.EcwVzPageReq; import cn.iocoder.yudao.module.delivery.entity.EcwVzPageReq;
import cn.iocoder.yudao.module.delivery.entity.deptex.zTest; //import cn.iocoder.yudao.module.delivery.entity.deptex.zTest;
import cn.iocoder.yudao.module.delivery.listener.TestEvent; import cn.iocoder.yudao.module.delivery.listener.TestEvent;
import cn.iocoder.yudao.module.delivery.service.EcwVzService; import cn.iocoder.yudao.module.delivery.service.EcwVzService;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.delivery.service.OrderServiceExt; import cn.iocoder.yudao.module.delivery.service.OrderServiceExt;
import cn.iocoder.yudao.module.delivery.service.ZTestService; //import cn.iocoder.yudao.module.delivery.service.ZTestService;
import cn.iocoder.yudao.module.order.dal.dataobject.order.OrderDO; import cn.iocoder.yudao.module.order.dal.dataobject.order.OrderDO;
import cn.iocoder.yudao.module.order.service.order.OrderService; import cn.iocoder.yudao.module.order.service.order.OrderService;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
...@@ -47,9 +47,9 @@ public class EcwVzController { ...@@ -47,9 +47,9 @@ public class EcwVzController {
*/ */
@Resource @Resource
private EcwVzService ecwVzService; private EcwVzService ecwVzService;
//
@Resource // @Resource
private ZTestService zTestService; // private ZTestService zTestService;
@Autowired @Autowired
private OrderService orderService; private OrderService orderService;
...@@ -160,7 +160,7 @@ public class EcwVzController { ...@@ -160,7 +160,7 @@ public class EcwVzController {
*/ */
zTest m = new zTest(); // zTest m = new zTest();
orderService.UpdateOrderYeJiType((long) 1, 1); orderService.UpdateOrderYeJiType((long) 1, 1);
...@@ -168,15 +168,15 @@ public class EcwVzController { ...@@ -168,15 +168,15 @@ public class EcwVzController {
ReceiveCustomerCalTypeEvent e = new ReceiveCustomerCalTypeEvent(); ReceiveCustomerCalTypeEvent e = new ReceiveCustomerCalTypeEvent();
e.setCustomerId((long) 49345); e.setCustomerId((long) 49345);
if (orderServiceExt.IsHavingOrder(e) == 0) { // if (orderServiceExt.IsHavingOrder(e) == 0) {
m.setTestname("无业绩"); // m.setTestname("无业绩");
m.setCreatedate(new Date()); // m.setCreatedate(new Date());
zTestService.save(m); // zTestService.save(m);
} else { // } else {
m.setTestname("有业绩"); // m.setTestname("有业绩");
m.setCreatedate(new Date()); // m.setCreatedate(new Date());
zTestService.save(m); // zTestService.save(m);
} // }
return success(true); return success(true);
} }
......
package cn.iocoder.yudao.module.delivery.entity.deptex; //package cn.iocoder.yudao.module.delivery.entity.deptex;
//
import com.baomidou.mybatisplus.annotation.TableName; //import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; //import lombok.Data;
import lombok.EqualsAndHashCode; //import lombok.EqualsAndHashCode;
//
import java.util.Date; //import java.util.Date;
//
@TableName("z_test") //@TableName("z_test")
@Data //@Data
public class zTest { //public class zTest {
//
private Long id; // private Long id;
private String testname; // private String testname;
//
private Date createdate; // private Date createdate;
} //}
...@@ -2,9 +2,9 @@ package cn.iocoder.yudao.module.delivery.listener; ...@@ -2,9 +2,9 @@ package cn.iocoder.yudao.module.delivery.listener;
import cn.iocoder.yudao.framework.apollo.core.event.Customer.CalculateCustomerTypeEvent; import cn.iocoder.yudao.framework.apollo.core.event.Customer.CalculateCustomerTypeEvent;
import cn.iocoder.yudao.module.customer.service.customer.CustomerService; import cn.iocoder.yudao.module.customer.service.customer.CustomerService;
import cn.iocoder.yudao.module.delivery.entity.deptex.zTest; //import cn.iocoder.yudao.module.delivery.entity.deptex.zTest;
import cn.iocoder.yudao.module.delivery.service.OrderServiceExt; import cn.iocoder.yudao.module.delivery.service.OrderServiceExt;
import cn.iocoder.yudao.module.delivery.service.ZTestService; //import cn.iocoder.yudao.module.delivery.service.ZTestService;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener; import org.springframework.context.event.EventListener;
...@@ -23,8 +23,8 @@ public class CalculateCustomerType { ...@@ -23,8 +23,8 @@ public class CalculateCustomerType {
@Resource @Resource
private CustomerService customerService; private CustomerService customerService;
@Resource // @Resource
private ZTestService zTestService; // private ZTestService zTestService;
@Resource @Resource
...@@ -37,7 +37,7 @@ public class CalculateCustomerType { ...@@ -37,7 +37,7 @@ public class CalculateCustomerType {
@EventListener(CalculateCustomerTypeEvent.class) @EventListener(CalculateCustomerTypeEvent.class)
public void CalculateCustomerTypePushEvent( public void CalculateCustomerTypePushEvent(
CalculateCustomerTypeEvent event) { CalculateCustomerTypeEvent event) {
zTest m=new zTest(); // zTest m=new zTest();
String sMsg="计算开始"+event.getCustomerId(); String sMsg="计算开始"+event.getCustomerId();
if (event.getNewCustomerService() == event.getOldCustomerService()) { if (event.getNewCustomerService() == event.getOldCustomerService()) {
//新客户经理和老客户经理是同一客户经理 //新客户经理和老客户经理是同一客户经理
...@@ -66,9 +66,9 @@ public class CalculateCustomerType { ...@@ -66,9 +66,9 @@ public class CalculateCustomerType {
sMsg+=",新老不一致"; sMsg+=",新老不一致";
customerService.updateCustomerNewOrOld(event.getCustomerId(), true); customerService.updateCustomerNewOrOld(event.getCustomerId(), true);
} }
m.setTestname(sMsg); // m.setTestname(sMsg);
m.setCreatedate(new Date()); // m.setCreatedate(new Date());
zTestService.save(m); // zTestService.save(m);
} }
/* /*
......
...@@ -3,9 +3,9 @@ package cn.iocoder.yudao.module.delivery.listener; ...@@ -3,9 +3,9 @@ package cn.iocoder.yudao.module.delivery.listener;
import cn.iocoder.yudao.framework.apollo.core.event.Order.CalculateOrderVValueEvent; import cn.iocoder.yudao.framework.apollo.core.event.Order.CalculateOrderVValueEvent;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.delivery.entity.EcwVz; import cn.iocoder.yudao.module.delivery.entity.EcwVz;
import cn.iocoder.yudao.module.delivery.entity.deptex.zTest; //import cn.iocoder.yudao.module.delivery.entity.deptex.zTest;
import cn.iocoder.yudao.module.delivery.service.EcwVzService; import cn.iocoder.yudao.module.delivery.service.EcwVzService;
import cn.iocoder.yudao.module.delivery.service.ZTestService; //import cn.iocoder.yudao.module.delivery.service.ZTestService;
import cn.iocoder.yudao.module.order.dal.dataobject.order.OrderDO; import cn.iocoder.yudao.module.order.dal.dataobject.order.OrderDO;
import cn.iocoder.yudao.module.order.service.order.OrderService; import cn.iocoder.yudao.module.order.service.order.OrderService;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
...@@ -35,26 +35,26 @@ public class CalculateOrderVValueListener { ...@@ -35,26 +35,26 @@ public class CalculateOrderVValueListener {
@Autowired @Autowired
private EcwVzService ecwVzService; private EcwVzService ecwVzService;
@Resource // @Resource
private ZTestService zTestService; // private ZTestService zTestService;
@EventListener(CalculateOrderVValueEvent.class) @EventListener(CalculateOrderVValueEvent.class)
public void CalculateOrderVValuePushEvent( public void CalculateOrderVValuePushEvent(
CalculateOrderVValueEvent event) { CalculateOrderVValueEvent event) {
zTest m = new zTest(); // zTest m = new zTest();
String sMsg = "计算V值"; String sMsg = "计算V值";
OrderDO orderDO = orderService.getById(event.getOrderId()); OrderDO orderDO = orderService.getById(event.getOrderId());
if (orderDO == null) { if (orderDO == null) {
throw exception(ORDER_NOT_EXISTS); throw exception(ORDER_NOT_EXISTS);
} }
if (orderDO.getRucangTime() == null) { // if (orderDO.getRucangTime() == null) {
sMsg += ",订单入仓时间为空,暂不处理。"; // sMsg += ",订单入仓时间为空,暂不处理。";
m.setTestname(sMsg); // m.setTestname(sMsg);
m.setCreatedate(new Date()); // m.setCreatedate(new Date());
zTestService.save(m); // zTestService.save(m);
return; // return;
} // }
//订单状态为已入仓之后的状态,其他状态是否排除,后续和客户确认,先按此逻辑处理 //订单状态为已入仓之后的状态,其他状态是否排除,后续和客户确认,先按此逻辑处理
int nS = orderDO.getStatus(); int nS = orderDO.getStatus();
...@@ -103,9 +103,9 @@ public class CalculateOrderVValueListener { ...@@ -103,9 +103,9 @@ public class CalculateOrderVValueListener {
sMsg += ",未入仓"; sMsg += ",未入仓";
} }
m.setTestname(sMsg); // m.setTestname(sMsg);
m.setCreatedate(new Date()); // m.setCreatedate(new Date());
zTestService.save(m); // zTestService.save(m);
} }
} }
...@@ -4,8 +4,8 @@ import cn.iocoder.yudao.framework.apollo.core.event.Customer.CalculateCustomerTy ...@@ -4,8 +4,8 @@ import cn.iocoder.yudao.framework.apollo.core.event.Customer.CalculateCustomerTy
import cn.iocoder.yudao.framework.apollo.core.event.Order.CalculateOrderYeJiTypeEvent; import cn.iocoder.yudao.framework.apollo.core.event.Order.CalculateOrderYeJiTypeEvent;
import cn.iocoder.yudao.module.customer.dal.dataobject.customer.CustomerDO; import cn.iocoder.yudao.module.customer.dal.dataobject.customer.CustomerDO;
import cn.iocoder.yudao.module.customer.service.customer.CustomerService; import cn.iocoder.yudao.module.customer.service.customer.CustomerService;
import cn.iocoder.yudao.module.delivery.entity.deptex.zTest; //import cn.iocoder.yudao.module.delivery.entity.deptex.zTest;
import cn.iocoder.yudao.module.delivery.service.ZTestService; //import cn.iocoder.yudao.module.delivery.service.ZTestService;
import cn.iocoder.yudao.module.order.dal.dataobject.order.OrderDO; import cn.iocoder.yudao.module.order.dal.dataobject.order.OrderDO;
import cn.iocoder.yudao.module.order.service.order.OrderService; import cn.iocoder.yudao.module.order.service.order.OrderService;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
...@@ -35,15 +35,15 @@ public class CalculateOrderYeJiTypeListener { ...@@ -35,15 +35,15 @@ public class CalculateOrderYeJiTypeListener {
@Autowired @Autowired
private CustomerService customerService; private CustomerService customerService;
//
@Resource // @Resource
private ZTestService zTestService; // private ZTestService zTestService;
@EventListener(CalculateOrderYeJiTypeEvent.class) @EventListener(CalculateOrderYeJiTypeEvent.class)
public void CalculateOrderYeJiTypePushEvent( public void CalculateOrderYeJiTypePushEvent(
CalculateOrderYeJiTypeEvent event) { CalculateOrderYeJiTypeEvent event) {
zTest m=new zTest(); // zTest m=new zTest();
String sMsg="计算业绩类型"+event.getCustomerId(); String sMsg="计算业绩类型"+event.getCustomerId();
OrderDO orderDO = orderService.getById(event.getOrderId()); OrderDO orderDO = orderService.getById(event.getOrderId());
...@@ -55,10 +55,10 @@ public class CalculateOrderYeJiTypeListener { ...@@ -55,10 +55,10 @@ public class CalculateOrderYeJiTypeListener {
CustomerDO customerDO = customerService.getById(event.getCustomerId()); CustomerDO customerDO = customerService.getById(event.getCustomerId());
if (customerDO == null) { if (customerDO == null) {
//throw exception(CUSTOMER_NOT_EXISTS); //throw exception(CUSTOMER_NOT_EXISTS);
sMsg+=",客户不存在先不计算业绩类型"; // sMsg+=",客户不存在先不计算业绩类型";
m.setTestname(sMsg); // m.setTestname(sMsg);
m.setCreatedate(new Date()); // m.setCreatedate(new Date());
zTestService.save(m); // zTestService.save(m);
return; return;
} }
...@@ -74,9 +74,9 @@ public class CalculateOrderYeJiTypeListener { ...@@ -74,9 +74,9 @@ public class CalculateOrderYeJiTypeListener {
orderService.UpdateOrderYeJiType(event.getOrderId(), isNew); orderService.UpdateOrderYeJiType(event.getOrderId(), isNew);
m.setTestname(sMsg); // m.setTestname(sMsg);
m.setCreatedate(new Date()); // m.setCreatedate(new Date());
zTestService.save(m); // zTestService.save(m);
} }
} }
...@@ -2,10 +2,10 @@ package cn.iocoder.yudao.module.delivery.listener; ...@@ -2,10 +2,10 @@ package cn.iocoder.yudao.module.delivery.listener;
import cn.iocoder.yudao.framework.apollo.core.event.Customer.ReceiveCustomerCalTypeEvent; import cn.iocoder.yudao.framework.apollo.core.event.Customer.ReceiveCustomerCalTypeEvent;
import cn.iocoder.yudao.module.customer.service.customer.CustomerService; import cn.iocoder.yudao.module.customer.service.customer.CustomerService;
import cn.iocoder.yudao.module.delivery.entity.deptex.zTest; //import cn.iocoder.yudao.module.delivery.entity.deptex.zTest;
import cn.iocoder.yudao.module.delivery.service.Impl.OrderServiceExtImpl; import cn.iocoder.yudao.module.delivery.service.Impl.OrderServiceExtImpl;
import cn.iocoder.yudao.module.delivery.service.OrderServiceExt; import cn.iocoder.yudao.module.delivery.service.OrderServiceExt;
import cn.iocoder.yudao.module.delivery.service.ZTestService; //import cn.iocoder.yudao.module.delivery.service.ZTestService;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener; import org.springframework.context.event.EventListener;
...@@ -28,8 +28,8 @@ public class ReceiveCustomerCalTypeListener { ...@@ -28,8 +28,8 @@ public class ReceiveCustomerCalTypeListener {
@Resource @Resource
private OrderServiceExt orderServiceExt; private OrderServiceExt orderServiceExt;
@Resource // @Resource
private ZTestService zTestService; // private ZTestService zTestService;
@EventListener(ReceiveCustomerCalTypeEvent.class) @EventListener(ReceiveCustomerCalTypeEvent.class)
public void CalculateCustomerTypePushEvent( public void CalculateCustomerTypePushEvent(
...@@ -37,7 +37,7 @@ public class ReceiveCustomerCalTypeListener { ...@@ -37,7 +37,7 @@ public class ReceiveCustomerCalTypeListener {
//CustomerServiceImpl confirmCustomer 函数中触发事件 客户经理直接确认接收 //CustomerServiceImpl confirmCustomer 函数中触发事件 客户经理直接确认接收
//CustomerServiceImpl receiveCustomer 函数中触发,移交,系统分配,接收时判断 //CustomerServiceImpl receiveCustomer 函数中触发,移交,系统分配,接收时判断
//CustomerServiceImpl updateCustomer 函数中触发,完善客户信息 //CustomerServiceImpl updateCustomer 函数中触发,完善客户信息
zTest m=new zTest(); // zTest m=new zTest();
String sMsg="接收客户"+event.getCustomerId(); String sMsg="接收客户"+event.getCustomerId();
if (event.getIsNew() == true) { if (event.getIsNew() == true) {
//移交接收前是新客户 //移交接收前是新客户
...@@ -58,9 +58,9 @@ public class ReceiveCustomerCalTypeListener { ...@@ -58,9 +58,9 @@ public class ReceiveCustomerCalTypeListener {
//维持老客户不变,可不做任何逻辑操作 //维持老客户不变,可不做任何逻辑操作
sMsg+=",老客户"; sMsg+=",老客户";
} }
m.setTestname(sMsg); // m.setTestname(sMsg);
m.setCreatedate(new Date()); // m.setCreatedate(new Date());
zTestService.save(m); // zTestService.save(m);
} }
/* /*
......
package cn.iocoder.yudao.module.delivery.mapper; //package cn.iocoder.yudao.module.delivery.mapper;
//
import cn.iocoder.yudao.module.delivery.entity.deptex.zTest; //import cn.iocoder.yudao.module.delivery.entity.deptex.zTest;
import org.apache.ibatis.annotations.Insert; //import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options; //import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select; //import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update; //import org.apache.ibatis.annotations.Update;
//
import java.util.List; //import java.util.List;
//
/* ///*
用注解实现简单的功能 // 用注解实现简单的功能
*/ // */
public interface MyTest { //public interface MyTest {
// 查询所有商品类型 // // 查询所有商品类型
@Select("select * from z_test") // @Select("select * from z_test")
public List<zTest> selectAll(); // public List<zTest> selectAll();
//
// 根据类型编号查询商品类型 // // 根据类型编号查询商品类型
@Select("select * from z_test where id = #{id}") // @Select("select * from z_test where id = #{id}")
zTest selectById(int id); // zTest selectById(int id);
//
// 添加商品类型 // // 添加商品类型
@Insert("insert into z_test(name) values(#{name})") // @Insert("insert into z_test(name) values(#{name})")
@Options(useGeneratedKeys = true, keyProperty = "id") // @Options(useGeneratedKeys = true, keyProperty = "id")
public int add(zTest type); // public int add(zTest type);
//
// 更新商品类型 // // 更新商品类型
@Update("update z_test set name = #{name} where id = #{id}") // @Update("update z_test set name = #{name} where id = #{id}")
public int update(zTest type); // public int update(zTest type);
} //}
package cn.iocoder.yudao.module.delivery.mapper; //package cn.iocoder.yudao.module.delivery.mapper;
//
import cn.iocoder.yudao.module.delivery.entity.deptex.zTest; //import cn.iocoder.yudao.module.delivery.entity.deptex.zTest;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; //import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper; //import org.apache.ibatis.annotations.Mapper;
//
@Mapper //@Mapper
public interface ZTestMapper extends BaseMapper<zTest> { //public interface ZTestMapper extends BaseMapper<zTest> {
} //}
package cn.iocoder.yudao.module.delivery.service.Impl; //package cn.iocoder.yudao.module.delivery.service.Impl;
//
import cn.iocoder.yudao.module.delivery.entity.deptex.zTest; ////import cn.iocoder.yudao.module.delivery.entity.deptex.zTest;
import cn.iocoder.yudao.module.delivery.mapper.ZTestMapper; //import cn.iocoder.yudao.module.delivery.mapper.ZTestMapper;
import cn.iocoder.yudao.module.delivery.service.ZTestService; ////import cn.iocoder.yudao.module.delivery.service.ZTestService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; //import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service; //import org.springframework.stereotype.Service;
//
@Service("ZTestService") //@Service("ZTestService")
public class ZTestImpl extends ServiceImpl<ZTestMapper, zTest> implements ZTestService { //public class ZTestImpl extends ServiceImpl<ZTestMapper, zTest> implements ZTestService {
//
//
} //}
package cn.iocoder.yudao.module.delivery.service; //package cn.iocoder.yudao.module.delivery.service;
//
import cn.iocoder.yudao.module.delivery.entity.deptex.zTest; //import cn.iocoder.yudao.module.delivery.entity.deptex.zTest;
import com.baomidou.mybatisplus.extension.service.IService; //import com.baomidou.mybatisplus.extension.service.IService;
//
public interface ZTestService extends IService<zTest> { //public interface ZTestService extends IService<zTest> {
} //}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.delivery.mapper.ZTestMapper">
</mapper>
...@@ -135,6 +135,32 @@ public interface WarehouseMapper extends BaseMapperX<WarehouseDO> { ...@@ -135,6 +135,32 @@ public interface WarehouseMapper extends BaseMapperX<WarehouseDO> {
}) })
List<WarehouseTreeRegionVO> getWarehouseTreeRegionList(@Param("tradeType") Integer tradeType); List<WarehouseTreeRegionVO> getWarehouseTreeRegionList(@Param("tradeType") Integer tradeType);
@ResultType(WarehouseTreeVO.class)
@Select({
"<script>",
"SELECT",
"w.id as warehouseId,",
"w.title_zh as warehouseTitleZh,",
"w.title_en as warehouseTitleEn,",
"r1.id as guojia,",
"r1.title_zh as guojiaName,",
"r1.title_en as guojiaNameEn,",
"r2.id as shi, ",
"r2.title_zh as shiName, ",
"r2.title_en as shiNameEn ",
"FROM ecw_warehouse w ",
"LEFT JOIN ecw_region r1 ",
"ON w.guojia = r1.id ",
"LEFT JOIN ecw_region r2 ",
"ON w.shi = r2.id ",
"WHERE w.deleted = 0 AND w.`status` =0 ",
"<when test= 'tradeType != null'>",
"AND trade_type =#{tradeType}",
"</when>",
"</script>"
})
List<WarehouseTreeVO> getWarehouseTreeList(@Param("tradeType") Integer tradeType);
@ResultType(List.class) @ResultType(List.class)
@Select({ @Select({
"<script>", "<script>",
......
...@@ -172,4 +172,8 @@ public interface WarehouseService { ...@@ -172,4 +172,8 @@ public interface WarehouseService {
List<WarehouseTreeRegionVO> getWarehouseTreeRegionList(Integer tradeType); List<WarehouseTreeRegionVO> getWarehouseTreeRegionList(Integer tradeType);
List<WarehouseTreeRegionVO> getRegionList(Integer type, String regionId, String destCountryId, String objectiveId, String destWarehouseId); List<WarehouseTreeRegionVO> getRegionList(Integer type, String regionId, String destCountryId, String objectiveId, String destWarehouseId);
List<WarehouseTreeVO> getWarehouseTreeList(Integer tradeType);
} }
...@@ -27,6 +27,8 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; ...@@ -27,6 +27,8 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.redisson.api.RLock; import org.redisson.api.RLock;
import org.redisson.api.RedissonClient; import org.redisson.api.RedissonClient;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
...@@ -60,6 +62,7 @@ public class WarehouseServiceImpl implements WarehouseService { ...@@ -60,6 +62,7 @@ public class WarehouseServiceImpl implements WarehouseService {
private DictDataApi dictDataApi; private DictDataApi dictDataApi;
@Override @Override
@CacheEvict(cacheNames = "jd:warehouse:tree", key = "'all'")
public Long createWarehouse(WarehouseCreateReqVO createReqVO) { public Long createWarehouse(WarehouseCreateReqVO createReqVO) {
// 插入 // 插入
WarehouseDO warehouse = WarehouseConvert.INSTANCE.convert(createReqVO); WarehouseDO warehouse = WarehouseConvert.INSTANCE.convert(createReqVO);
...@@ -70,6 +73,7 @@ public class WarehouseServiceImpl implements WarehouseService { ...@@ -70,6 +73,7 @@ public class WarehouseServiceImpl implements WarehouseService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@CacheEvict(cacheNames = "jd:warehouse:tree", key = "'all'")
public void updateWarehouse(WarehouseUpdateReqVO updateReqVO) { public void updateWarehouse(WarehouseUpdateReqVO updateReqVO) {
Long id = updateReqVO.getId(); Long id = updateReqVO.getId();
// 校验存在 // 校验存在
...@@ -507,6 +511,42 @@ public class WarehouseServiceImpl implements WarehouseService { ...@@ -507,6 +511,42 @@ public class WarehouseServiceImpl implements WarehouseService {
return warehouseLineMapper.getStartInfoAndDestInfoByLineId(lineId); return warehouseLineMapper.getStartInfoAndDestInfoByLineId(lineId);
} }
@Override
@Cacheable(cacheNames = "jd:warehouse:tree", key = "'all'")
public List<WarehouseTreeVO> getWarehouseTreeList(Integer tradeType) {
List<WarehouseTreeVO> list = warehouseMapper.getWarehouseTreeList(tradeType);
Map<Long, List<WarehouseTreeVO>> shiMap = list.stream()
.collect(Collectors.groupingBy(WarehouseTreeVO::getShi));
List<WarehouseTreeVO> shiVOList = new ArrayList<>();
for (Map.Entry<Long, List<WarehouseTreeVO>> m : shiMap.entrySet()) {
WarehouseTreeVO v = new WarehouseTreeVO();
v.setShi(m.getKey());
List<WarehouseTreeVO> warehouseList = m.getValue();
v.setChildren(warehouseList);
WarehouseTreeVO warehouseTreeVO = warehouseList.get(0);
v.setShiName(warehouseTreeVO.getShiName());
v.setShiNameEn(warehouseTreeVO.getShiNameEn());
v.setGuojiaNameEn(warehouseTreeVO.getGuojiaNameEn());
v.setGuojiaName(warehouseTreeVO.getGuojiaName());
v.setGuojia(warehouseTreeVO.getGuojia());
shiVOList.add(v);
}
Map<Long, List<WarehouseTreeVO>> guojiaMap = shiVOList.stream()
.collect(Collectors.groupingBy(WarehouseTreeVO::getGuojia));
List<WarehouseTreeVO> guojiaList = new ArrayList<>();
for (Map.Entry<Long, List<WarehouseTreeVO>> entry : guojiaMap.entrySet()) {
WarehouseTreeVO v = new WarehouseTreeVO();
v.setGuojia(entry.getKey());
List<WarehouseTreeVO> shiWarehouseList = entry.getValue();
v.setChildren(shiWarehouseList);
WarehouseTreeVO warehouseTreeVO = shiWarehouseList.get(0);
v.setGuojiaNameEn(warehouseTreeVO.getGuojiaNameEn());
v.setGuojiaName(warehouseTreeVO.getGuojiaName());
guojiaList.add(v);
}
return guojiaList;
}
@Override @Override
public List<WarehouseTreeRegionVO> getWarehouseTreeRegionList(Integer tradeType) { public List<WarehouseTreeRegionVO> getWarehouseTreeRegionList(Integer tradeType) {
List<WarehouseTreeRegionVO> list = warehouseMapper.getWarehouseTreeRegionList(tradeType); List<WarehouseTreeRegionVO> list = warehouseMapper.getWarehouseTreeRegionList(tradeType);
...@@ -529,7 +569,7 @@ public class WarehouseServiceImpl implements WarehouseService { ...@@ -529,7 +569,7 @@ public class WarehouseServiceImpl implements WarehouseService {
@Override @Override
public List<WarehouseTreeRegionVO> getRegionList(Integer type, String regionId, String destCountryId, String objectiveId, String destWarehouseId) { public List<WarehouseTreeRegionVO> getRegionList(Integer type, String regionId, String destCountryId, String objectiveId, String destWarehouseId) {
if (regionId.equals("")) { if (StringUtils.isBlank(regionId)) {
return new ArrayList(); return new ArrayList();
} }
List<WarehouseTreeRegionVO> list = List<WarehouseTreeRegionVO> list =
......
package cn.iocoder.yudao.module.depository.vo.warehouse;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
@ApiModel("仓库区域树形值")
public class WarehouseTreeVO {
@ApiModelProperty("国家区域id")
private Long guojia;
@ApiModelProperty("国家中文名称")
private String guojiaName ;
@ApiModelProperty("国家英文名称")
private String guojiaNameEn ;
@ApiModelProperty("城市区域id")
private Long shi;
@ApiModelProperty("城市中文名称")
private String shiName;
@ApiModelProperty("城市英文名称")
private String shiNameEn;
@ApiModelProperty("仓库id")
private Long warehouseId;
@ApiModelProperty("仓库中文名称")
private String warehouseTitleZh;
@ApiModelProperty("仓库英文名称")
private String warehouseTitleEn;
@ApiModelProperty(value = "子元素", example = "true")
private List<WarehouseTreeVO> children;
}
...@@ -100,6 +100,15 @@ public class WarehouseController { ...@@ -100,6 +100,15 @@ public class WarehouseController {
return success(list); return success(list);
} }
@GetMapping("/getWarehouseTreeList")
@ApiOperation("获取仓库区域树形列表")
@ApiImplicitParam(name = "tradeType", value = "进出口类型,1-进口,2-出口", required = false, example = "1", dataTypeClass = Integer.class)
public CommonResult<List<WarehouseTreeVO>> getWarehouseTreeList(Integer tradeType){
List<WarehouseTreeVO> list = warehouseService.getWarehouseTreeList(tradeType);
return success(list);
}
@GetMapping("/getRegionList") @GetMapping("/getRegionList")
public CommonResult<List<WarehouseTreeRegionVO>> getRegionList( public CommonResult<List<WarehouseTreeRegionVO>> getRegionList(
@RequestParam(value = "type", required = false) Integer type, @RequestParam(value = "type", required = false) Integer type,
......
...@@ -18,6 +18,7 @@ import cn.iocoder.yudao.module.depository.dal.dataobject.warehouse.WarehouseLine ...@@ -18,6 +18,7 @@ import cn.iocoder.yudao.module.depository.dal.dataobject.warehouse.WarehouseLine
import cn.iocoder.yudao.module.ecw.service.region.RegionService; import cn.iocoder.yudao.module.ecw.service.region.RegionService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
...@@ -175,6 +176,31 @@ public class AppWarehouseController { ...@@ -175,6 +176,31 @@ public class AppWarehouseController {
return success(idList); return success(idList);
} }
@GetMapping("/getWarehouseTreeList")
@ApiOperation("获取仓库区域树形列表")
@ApiImplicitParam(name = "tradeType", value = "进出口类型,1-进口,2-出口", required = false, example = "1", dataTypeClass = Integer.class)
public CommonResult<List<WarehouseTreeVO>> getWarehouseTreeList(Integer tradeType){
List<WarehouseTreeVO> list = warehouseService.getWarehouseTreeList(tradeType);
return success(list);
}
@GetMapping("/getRegionList")
public CommonResult<List<WarehouseTreeRegionVO>> getRegionList(@RequestParam(value = "type", required = false) Integer type,
String regionId,String destCountryId,
String objectiveId ,String destWarehouseId){
List<WarehouseTreeRegionVO> list =
warehouseService.getRegionList(
type,
regionId,
destCountryId,
objectiveId,
destWarehouseId);
return success(list);
}
@PostMapping("/deptList") @PostMapping("/deptList")
@ApiOperation("部门列表") @ApiOperation("部门列表")
public CommonResult<List<DeptWarehouseBaseVO>> deptList(@RequestBody DeptWarehouseBaseVO requestVo) { public CommonResult<List<DeptWarehouseBaseVO>> deptList(@RequestBody DeptWarehouseBaseVO requestVo) {
......
...@@ -54,6 +54,10 @@ public enum CustomerOperateTypeEnum { ...@@ -54,6 +54,10 @@ public enum CustomerOperateTypeEnum {
CHANGE_DEFAULT_BILLING(24, "设置默认开票"), CHANGE_DEFAULT_BILLING(24, "设置默认开票"),
FOLLOWUP_CREATE(25, "新增跟进纪录"),
FOLLOWUP_UPDATE(26, "编辑跟进纪录"),
FOLLOWUP_COMMIT(27, "提交跟进纪录"),
DELETE(100, "删除"), DELETE(100, "删除"),
......
...@@ -177,5 +177,16 @@ public interface ErrorCodeConstants { ...@@ -177,5 +177,16 @@ public interface ErrorCodeConstants {
ErrorCode CUSTOMER_DELAY_APPROVAL_MORE_THEN_ONE = new ErrorCode (1004006037,"customer.delay.approval.times.more.then.one") ; ErrorCode CUSTOMER_DELAY_APPROVAL_MORE_THEN_ONE = new ErrorCode (1004006037,"customer.delay.approval.times.more.then.one") ;
ErrorCode CUSTOMER_SAVED_NOT_EXISTS = new ErrorCode(1004006038, "customer.saved.not.exists");
ErrorCode CUSTOMER_DELETED_NOT_EXISTS = new ErrorCode(1004006039, "customer.deleted.not.exists");
ErrorCode CUSTOMER_SAVED_CUSTOMER_SERVICE_IS_NULL = new ErrorCode(1004006040, "customer.saved.customer.service.is.null");
ErrorCode CUSTOMER_DELETED_CUSTOMER_SERVICE_IS_NULL = new ErrorCode(1004006041, "customer.deleted.customer.service.is.null");
ErrorCode CUSTOMER_MERGE_CUSTOMER_SERVICE_NOT_SAME = new ErrorCode(1004006042, "customer.merge.customer.service.not.same");
} }
...@@ -40,7 +40,6 @@ public class AppRegionController { ...@@ -40,7 +40,6 @@ public class AppRegionController {
@GetMapping("/get") @GetMapping("/get")
@ApiOperation("获得区域设置") @ApiOperation("获得区域设置")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
@PreAuthorize("@ss.hasPermission('ecw:region:query')")
public CommonResult<RegionRespVO> getRegion(@RequestParam("id") Long id) { public CommonResult<RegionRespVO> getRegion(@RequestParam("id") Long id) {
RegionDO region = regionService.getRegion(id); RegionDO region = regionService.getRegion(id);
return success(RegionConvert.INSTANCE.convert(region)); return success(RegionConvert.INSTANCE.convert(region));
...@@ -50,7 +49,7 @@ public class AppRegionController { ...@@ -50,7 +49,7 @@ public class AppRegionController {
@GetMapping("/list") @GetMapping("/list")
@ApiOperation("获得区域设置列表") @ApiOperation("获得区域设置列表")
@PreAuthenticated // @PreAuthenticated
public CommonResult<List<RegionRespVO>> getRegionList(RegionListReqVO reqVO) { public CommonResult<List<RegionRespVO>> getRegionList(RegionListReqVO reqVO) {
List<RegionDO> list = regionService.getSimpleDepts(reqVO); List<RegionDO> list = regionService.getSimpleDepts(reqVO);
list.sort(Comparator.comparing(RegionDO::getSort)); list.sort(Comparator.comparing(RegionDO::getSort));
...@@ -59,7 +58,7 @@ public class AppRegionController { ...@@ -59,7 +58,7 @@ public class AppRegionController {
@GetMapping("/page") @GetMapping("/page")
@ApiOperation("获得区域设置分页") @ApiOperation("获得区域设置分页")
@PreAuthenticated // @PreAuthenticated
public CommonResult<PageResult<RegionRespVO>> getRegionPage(@Valid RegionPageReqVO pageVO) { public CommonResult<PageResult<RegionRespVO>> getRegionPage(@Valid RegionPageReqVO pageVO) {
PageResult<RegionDO> pageResult = regionService.getRegionPage(pageVO); PageResult<RegionDO> pageResult = regionService.getRegionPage(pageVO);
return success(RegionConvert.INSTANCE.convertPage(pageResult)); return success(RegionConvert.INSTANCE.convertPage(pageResult));
...@@ -68,7 +67,7 @@ public class AppRegionController { ...@@ -68,7 +67,7 @@ public class AppRegionController {
@GetMapping("/getTree") @GetMapping("/getTree")
@ApiOperation("获得区域子列表") @ApiOperation("获得区域子列表")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
@PreAuthenticated // @PreAuthenticated
public CommonResult<RegionRespVO> getTree(@RequestParam("id") Long id) { public CommonResult<RegionRespVO> getTree(@RequestParam("id") Long id) {
List<RegionDO> list = regionService.getByParent(id); List<RegionDO> list = regionService.getByParent(id);
List<RegionRespVO> dataList = RegionConvert.INSTANCE.convertList(list); List<RegionRespVO> dataList = RegionConvert.INSTANCE.convertList(list);
...@@ -83,7 +82,7 @@ public class AppRegionController { ...@@ -83,7 +82,7 @@ public class AppRegionController {
@GetMapping("/getListTree") @GetMapping("/getListTree")
@ApiOperation("获得区域设置列表") @ApiOperation("获得区域设置列表")
@PreAuthenticated // @PreAuthenticated
public CommonResult<List<RegionRespVO>> listTree(RegionListReqVO reqVO) { public CommonResult<List<RegionRespVO>> listTree(RegionListReqVO reqVO) {
List<RegionDO> list = regionService.getSimpleDepts(reqVO); List<RegionDO> list = regionService.getSimpleDepts(reqVO);
list.sort(Comparator.comparing(RegionDO::getSort)); list.sort(Comparator.comparing(RegionDO::getSort));
...@@ -108,7 +107,7 @@ public class AppRegionController { ...@@ -108,7 +107,7 @@ public class AppRegionController {
@GetMapping("/getCityList") @GetMapping("/getCityList")
@ApiOperation("获得区域城市列表") @ApiOperation("获得区域城市列表")
@PreAuthenticated // @PreAuthenticated
public CommonResult<List<RegionRespVO>> getCityList() { public CommonResult<List<RegionRespVO>> getCityList() {
List<RegionDO> cityList = regionService.getCityList(); List<RegionDO> cityList = regionService.getCityList();
return success(RegionConvert.INSTANCE.convertList(cityList)); return success(RegionConvert.INSTANCE.convertList(cityList));
...@@ -116,7 +115,7 @@ public class AppRegionController { ...@@ -116,7 +115,7 @@ public class AppRegionController {
@GetMapping("/getTradeCityList") @GetMapping("/getTradeCityList")
@ApiOperation("获得始发、目的城市列表") @ApiOperation("获得始发、目的城市列表")
@PreAuthenticated // @PreAuthenticated
public CommonResult<List<RegionRespVO>> getTradeCityList(TradeRegionListReqVO reqVO) { public CommonResult<List<RegionRespVO>> getTradeCityList(TradeRegionListReqVO reqVO) {
if (Objects.nonNull(reqVO.getChannelId())){ if (Objects.nonNull(reqVO.getChannelId())){
// 如果有渠道信息,则查询可出目的地国家下的目的地城市 // 如果有渠道信息,则查询可出目的地国家下的目的地城市
......
...@@ -538,7 +538,7 @@ public class OrderDO extends BaseDO { ...@@ -538,7 +538,7 @@ public class OrderDO extends BaseDO {
private Integer pickState; private Integer pickState;
@ApiModelProperty(value = "'提货率'") @ApiModelProperty(value = "'提货率'")
private String pickRatio; private BigDecimal pickRatio;
@ApiModelProperty(value = "'提货箱数'") @ApiModelProperty(value = "'提货箱数'")
private Integer pickNum; private Integer pickNum;
......
...@@ -534,7 +534,7 @@ public class OrderBackInfoDto { ...@@ -534,7 +534,7 @@ public class OrderBackInfoDto {
private Integer pickState; private Integer pickState;
@ApiModelProperty(value = "'提货率'") @ApiModelProperty(value = "'提货率'")
private Integer pickRatio; private BigDecimal pickRatio;
@ApiModelProperty(value = "'提货箱数'") @ApiModelProperty(value = "'提货箱数'")
private Integer pickNum; private Integer pickNum;
......
package cn.iocoder.yudao.module.order.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
@AllArgsConstructor
@Getter
public enum PickStateEnum {
unpick(0,"待提货"),
picking(1,"提货中"),
partPick(2,"部分提货"),
picked(3,"已提货");
private Integer pickState;
private String pickStateStr;
}
...@@ -11,9 +11,9 @@ import cn.iocoder.yudao.module.order.service.order.OrderBusinessService; ...@@ -11,9 +11,9 @@ import cn.iocoder.yudao.module.order.service.order.OrderBusinessService;
import cn.iocoder.yudao.module.order.service.order.OrderQueryService; import cn.iocoder.yudao.module.order.service.order.OrderQueryService;
import cn.iocoder.yudao.module.order.service.orderException.OrderExceptionService; import cn.iocoder.yudao.module.order.service.orderException.OrderExceptionService;
import cn.iocoder.yudao.module.order.vo.orderException.OrderExceptionResultHandlerVo; import cn.iocoder.yudao.module.order.vo.orderException.OrderExceptionResultHandlerVo;
import cn.iocoder.yudao.module.product.dal.dataobject.coupon.zTest3; //import cn.iocoder.yudao.module.product.dal.dataobject.coupon.zTest3;
import cn.iocoder.yudao.module.product.dal.dataobject.product.ProductPriceDO; import cn.iocoder.yudao.module.product.dal.dataobject.product.ProductPriceDO;
import cn.iocoder.yudao.module.product.dal.mysql.coupon.ZTestMapper3; //import cn.iocoder.yudao.module.product.dal.mysql.coupon.ZTestMapper3;
import cn.iocoder.yudao.module.product.vo.productPrice.ClearancePriceEvent; import cn.iocoder.yudao.module.product.vo.productPrice.ClearancePriceEvent;
import cn.iocoder.yudao.module.product.vo.productPrice.HandleData; import cn.iocoder.yudao.module.product.vo.productPrice.HandleData;
import cn.iocoder.yudao.module.product.vo.productPrice.HandleExceptionEvent; import cn.iocoder.yudao.module.product.vo.productPrice.HandleExceptionEvent;
...@@ -44,8 +44,8 @@ public class ProductPriceExceptionHandleListener { ...@@ -44,8 +44,8 @@ public class ProductPriceExceptionHandleListener {
private final OrderExceptionService orderExceptionService; private final OrderExceptionService orderExceptionService;
private final OrderBusinessService orderBusinessService; private final OrderBusinessService orderBusinessService;
@Resource // @Resource
private ZTestMapper3 zTestMapper; // private ZTestMapper3 zTestMapper;
@EventListener(HandleExceptionEvent.class) @EventListener(HandleExceptionEvent.class)
@Async @Async
...@@ -65,10 +65,10 @@ public class ProductPriceExceptionHandleListener { ...@@ -65,10 +65,10 @@ public class ProductPriceExceptionHandleListener {
public void orderOtherFeeEvent(HandleData event) { public void orderOtherFeeEvent(HandleData event) {
List<ProductPriceDO> priceList = event.getNeedHandleList(); List<ProductPriceDO> priceList = event.getNeedHandleList();
zTest3 m=new zTest3(); // zTest3 m=new zTest3();
m.setTestname("开始处理价格异常。"); // m.setTestname("开始处理价格异常。");
m.setCreatedate(new Date()); // m.setCreatedate(new Date());
zTestMapper.insert(m); // zTestMapper.insert(m);
//ecw_product_price //ecw_product_price
//找出符合条件的订单 //找出符合条件的订单
...@@ -125,10 +125,10 @@ public class ProductPriceExceptionHandleListener { ...@@ -125,10 +125,10 @@ public class ProductPriceExceptionHandleListener {
} }
else else
{ {
m=new zTest3(); // m=new zTest3();
m.setTestname("exceptionDOList 为空"); // m.setTestname("exceptionDOList 为空");
m.setCreatedate(new Date()); // m.setCreatedate(new Date());
zTestMapper.insert(m); // zTestMapper.insert(m);
} }
//只要有价格就处理清关费未报价异常 //只要有价格就处理清关费未报价异常
......
...@@ -77,6 +77,7 @@ import cn.iocoder.yudao.module.product.enums.FeeTypeEnum; ...@@ -77,6 +77,7 @@ import cn.iocoder.yudao.module.product.enums.FeeTypeEnum;
import cn.iocoder.yudao.module.product.param.ProdConditionParam; import cn.iocoder.yudao.module.product.param.ProdConditionParam;
import cn.iocoder.yudao.module.product.service.product.ProductAttrService; import cn.iocoder.yudao.module.product.service.product.ProductAttrService;
import cn.iocoder.yudao.module.product.service.product.ProductService; import cn.iocoder.yudao.module.product.service.product.ProductService;
import cn.iocoder.yudao.module.product.vo.coupon.CouponInfoVO;
import cn.iocoder.yudao.module.system.api.user.AdminUserApi; import cn.iocoder.yudao.module.system.api.user.AdminUserApi;
import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO;
import cn.iocoder.yudao.module.wealth.dal.dataobject.receivable.ReceivableDO; import cn.iocoder.yudao.module.wealth.dal.dataobject.receivable.ReceivableDO;
...@@ -2307,9 +2308,9 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order ...@@ -2307,9 +2308,9 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
OrderConsigneeDO orderConsigneeDO = orderConsigneeService.getOne(new LambdaQueryWrapper<OrderConsigneeDO>().eq(OrderConsigneeDO::getOrderId, orderDO.getOrderId()).orderByDesc(OrderConsigneeDO::getId).last("limit 1")); OrderConsigneeDO orderConsigneeDO = orderConsigneeService.getOne(new LambdaQueryWrapper<OrderConsigneeDO>().eq(OrderConsigneeDO::getOrderId, orderDO.getOrderId()).orderByDesc(OrderConsigneeDO::getId).last("limit 1"));
this.costCalculation(userId, orderDO, this.costCalculation(userId, orderDO,
orderConsignorDO.getCustomerId(), orderConsignorDO.getCustomerId(),
Objects.isNull(orderConsigneeDO)? 0L : orderConsigneeDO.getCustomerId(), Objects.isNull(orderConsigneeDO) ? 0L : orderConsigneeDO.getCustomerId(),
orderConsignorDO.getCustomerContactsId(), orderConsignorDO.getCustomerContactsId(),
Objects.isNull(orderConsigneeDO)? 0L : orderConsigneeDO.getCustomerContactsId(), Objects.isNull(orderConsigneeDO) ? 0L : orderConsigneeDO.getCustomerContactsId(),
orderItemDOList, 50); orderItemDOList, 50);
this.addOrderOperateLog(orderDO.getOrderId(), this.addOrderOperateLog(orderDO.getOrderId(),
"有活动更新订单计价", null); "有活动更新订单计价", null);
...@@ -3448,6 +3449,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order ...@@ -3448,6 +3449,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
* 20 强制重订价格 30 空运订单每日定时更新价格 * 20 强制重订价格 30 空运订单每日定时更新价格
* 40 订单异常处理完成更新计价 * 40 订单异常处理完成更新计价
* 50 更新订单优惠信息 * 50 更新订单优惠信息
* 51 检查订单优惠信息,并在当前优惠信息不满足条件后匹配新的优惠信息
* @return 该运输方式下的报价商品列表信息 * @return 该运输方式下的报价商品列表信息
*/ */
private CalculationItemFeeDto insertOrderItemDOList(String userId, private CalculationItemFeeDto insertOrderItemDOList(String userId,
...@@ -3730,7 +3732,15 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order ...@@ -3730,7 +3732,15 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
param.setOrgClearanceFeePrice(orderItemDO.getOriginalClearanceFreight()); param.setOrgClearanceFeePrice(orderItemDO.getOriginalClearanceFreight());
param.setClearanceFeeCurrency(Objects.isNull(orderItemDO.getClearanceFreightCurrency()) ? null : Integer.valueOf(String.valueOf(orderItemDO.getClearanceFreightCurrency()))); param.setClearanceFeeCurrency(Objects.isNull(orderItemDO.getClearanceFreightCurrency()) ? null : Integer.valueOf(String.valueOf(orderItemDO.getClearanceFreightCurrency())));
param.setClearanceFeeVolume(orderItemDO.getClearanceFreightVolume()); param.setClearanceFeeVolume(orderItemDO.getClearanceFreightVolume());
if (type == 50) { if (type == 51) {
param.setCalculationType(7);
if (StringUtils.isNotBlank(orderItemDO.getCouponInfo())) {
List<CouponInfoVO> couponInfoVOList = JSONObject.parseArray(orderItemDO.getCouponInfo(), CouponInfoVO.class);
if (CollectionUtil.isNotEmpty(couponInfoVOList)) {
param.setCouponInfoVOList(JSONObject.parseArray(orderItemDO.getCouponInfo(), CouponInfoVO.class));
}
}
} else if (type == 50) {
param.setCalculationType(6); param.setCalculationType(6);
} else if (type == 14) { } else if (type == 14) {
// 批量加价 // 批量加价
...@@ -3749,23 +3759,30 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order ...@@ -3749,23 +3759,30 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
!Objects.equals(orderDO.getStatus(), OrderStatusEnum.DRAFT.getValue())) { !Objects.equals(orderDO.getStatus(), OrderStatusEnum.DRAFT.getValue())) {
isWarehouseIn = true; isWarehouseIn = true;
} }
List<ProdConditionParam> prodConditionParams = null;
// 定单价费用 // 定单价费用
List<ProdConditionParam> prodConditionParams = if (type != 51) {
prodCostCalculation.obtainProdLineOnePrice( prodConditionParams =
prodConditionParamList, prodCostCalculation.obtainProdLineOnePrice(
orderDO.getOrderNo(), prodConditionParamList,
orderDO.getCustomsType(), orderDO.getOrderNo(),
orderDO.getCustomerId(), orderDO.getCustomsType(),
orderDO.getTransportId(), orderDO.getCustomerId(),
orderDO.getLineId(), orderDO.getTransportId(),
orderDO.getChannelId(), isWarehouseIn); orderDO.getLineId(),
// 对订单品名的收费数据进行误差补全,单价最低的品名加上误差值 orderDO.getChannelId(), isWarehouseIn);
if (type != 1 && type != 2 && !Objects.equals(orderDO.getStatus(),
OrderStatusEnum.ORDER_PLACED.getValue()) && !Objects.equals(orderDO.getStatus(), OrderStatusEnum.DRAFT.getValue())) { // 对订单品名的收费数据进行误差补全,单价最低的品名加上误差值
// 只要不是草稿和待入仓订单,都会对此进行计算, 对误差值进行调整 if (type != 1 && type != 2 && !Objects.equals(orderDO.getStatus(),
errorValueAdjustment(orderItemDOList, OrderStatusEnum.ORDER_PLACED.getValue()) && !Objects.equals(orderDO.getStatus(), OrderStatusEnum.DRAFT.getValue())) {
orderDO, // 只要不是草稿和待入仓订单,都会对此进行计算, 对误差值进行调整
prodConditionParams); errorValueAdjustment(orderItemDOList,
orderDO,
prodConditionParams);
}
} else {
prodConditionParams = new ArrayList<>();
prodConditionParams.addAll(prodConditionParamList);
} }
// 计算小计费用 // 计算小计费用
CalculationCostResultDto resultDto = CalculationCostResultDto resultDto =
......
...@@ -1072,8 +1072,10 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -1072,8 +1072,10 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
order.getOrderId())).findFirst().orElse(null); order.getOrderId())).findFirst().orElse(null);
CustomerDO customerDO = customerService.getById(order.getCustomerId()); CustomerDO customerDO = customerService.getById(order.getCustomerId());
order.setIsInOpenSea(customerDO.getIsInOpenSea()); if(Objects.nonNull(customerDO)) {
order.setYejiType(customerDO.getIsNew() ? 1 : 0); order.setIsInOpenSea(customerDO.getIsInOpenSea());
order.setYejiType(customerDO.getIsNew() ? 1 : 0);
}
Long oldCustomerService = null; Long oldCustomerService = null;
// 老客户经理默认为null // 老客户经理默认为null
if (Objects.nonNull(customerDO) && if (Objects.nonNull(customerDO) &&
...@@ -2667,6 +2669,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -2667,6 +2669,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
infoVO.setOrgValue(vo.getIsCargoControl() ? "是/yes" : "否/no"); infoVO.setOrgValue(vo.getIsCargoControl() ? "是/yes" : "否/no");
infoVO.setNewValue(updateReqVO.getIsCargoControl() ? "是/yes" : "否/no"); infoVO.setNewValue(updateReqVO.getIsCargoControl() ? "是/yes" : "否/no");
vo.setIsCargoControl(updateReqVO.getIsCargoControl()); vo.setIsCargoControl(updateReqVO.getIsCargoControl());
vo.setIsCheckCoupon(Boolean.TRUE);
applyInfoList.add(infoVO); applyInfoList.add(infoVO);
} }
Map<Integer, CurrencyRespDTO> currencyMap = currencyApi.getAllCurrency(); Map<Integer, CurrencyRespDTO> currencyMap = currencyApi.getAllCurrency();
...@@ -2713,6 +2716,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -2713,6 +2716,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
infoVO.setOrgValue(vo.getCustomsType() == 1 ? "我司全代/Our full representative" : (vo.getCustomsType() == 2 ? "自单代报/Self reporting" : "混合报关/Mixed customs declaration")); infoVO.setOrgValue(vo.getCustomsType() == 1 ? "我司全代/Our full representative" : (vo.getCustomsType() == 2 ? "自单代报/Self reporting" : "混合报关/Mixed customs declaration"));
infoVO.setNewValue(updateReqVO.getCustomsType() == 1 ? "我司全代/Our full representative" : (updateReqVO.getCustomsType() == 2 ? "自单代报/Self reporting" : "混合报关/Mixed customs declaration")); infoVO.setNewValue(updateReqVO.getCustomsType() == 1 ? "我司全代/Our full representative" : (updateReqVO.getCustomsType() == 2 ? "自单代报/Self reporting" : "混合报关/Mixed customs declaration"));
vo.setCustomsType(updateReqVO.getCustomsType()); vo.setCustomsType(updateReqVO.getCustomsType());
vo.setIsCheckCoupon(Boolean.TRUE);
applyInfoList.add(infoVO); applyInfoList.add(infoVO);
} }
// 出单方式 // 出单方式
...@@ -5554,38 +5558,6 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -5554,38 +5558,6 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
descZh, descEn); descZh, descEn);
orderExceptionService.createOrderException(orderExceptionCreateReqVO); orderExceptionService.createOrderException(orderExceptionCreateReqVO);
} }
// TODO 业绩变动逻辑判断已经放入申请时进行判断,此处业务后面删除
// Date expireTime = DateUtil.offsetDay(warehouseInDO.getInTime(), 3);
// if (expireTime.compareTo(new Date()) >= 0) {
// int customerType = 1; // 发货人 1 收货人 2
// if (Objects.nonNull(orderDO.getType()) && orderDO.getType().contains("2")) {
// // 海外仓归属发货人
// orderDO.setCustomerId(consignorDO.getCustomerId());
// } else {
// // 控货订单归属发货人 / 非控货订单归属收货人
// if (orderDO.getIsCargoControl()) {
// orderDO.setCustomerId(consignorDO.getCustomerId());
// } else {
// customerType = 2;
// orderDO.setCustomerId(consigneeDO.getCustomerId());
// }
// }
// // 拆单子订单不执行客户经理分配规则,以原单为主
// if (Objects.isNull(orderDO.getParentOrderId()) || orderDO.getParentOrderId() == 0) {
// // 更新所属客户经理(业务员)
//// if (Objects.nonNull(orderDO.getCustomerId()) && orderDO.getCustomerId() > 0) {
// addOrderCustomerService(orderDO, customerType);
//// }
// }
// }
// 判断是否需要生成单证异常
// if (!Objects.equals(oldOrder.getCustomsType(), orderDO.getCustomsType())) {
// if ((orderDO.getCustomsType().equals(2) || orderDO.getCustomsType().equals(3)) && StringUtils.isEmpty(orderDO.getDocumentsFile())) {
// OrderExceptionCreateReqVO orderExceptionCreateReqVO = this.genOrderException(orderDO.getOrderId(), orderDO, null, null, OrderExceptionEnum.ORDER_DOC_EXCEPTION,
// OrderExceptionEnum.ORDER_DOC_EXCEPTION.getZhValueDesc(), OrderExceptionEnum.ORDER_DOC_EXCEPTION.getEnValueDesc());
// orderExceptionService.createOrderException(orderExceptionCreateReqVO);
// }
// }
// 这里可能因为修改内容不触发计价业务,而提交审批内容的同时,提交了不用审批的修改货值,导致费用清单变更,所以这里需要同步当前数据库的费用清单 // 这里可能因为修改内容不触发计价业务,而提交审批内容的同时,提交了不用审批的修改货值,导致费用清单变更,所以这里需要同步当前数据库的费用清单
orderDO.setCost(oldOrder.getCost()); orderDO.setCost(oldOrder.getCost());
// 在这中间可能有订单的入仓子状态变更,例如调仓等操作,需要同步当前数据库订单状态,因为订单审批同时只能有一个,所以审批状态肯定是实时的,只需要同步其他状态 // 在这中间可能有订单的入仓子状态变更,例如调仓等操作,需要同步当前数据库订单状态,因为订单审批同时只能有一个,所以审批状态肯定是实时的,只需要同步其他状态
...@@ -5622,6 +5594,12 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -5622,6 +5594,12 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
// 强制重新定价, 则需要将特价属性都重置 // 强制重新定价, 则需要将特价属性都重置
orderBusinessService.costCalculation(String.valueOf(userId), orderDO, consignorDO.getCustomerId(), Objects.isNull(consigneeDO) ? 0L : consigneeDO.getCustomerId(), orderBusinessService.costCalculation(String.valueOf(userId), orderDO, consignorDO.getCustomerId(), Objects.isNull(consigneeDO) ? 0L : consigneeDO.getCustomerId(),
consignorDO.getCustomerContactsId(), Objects.isNull(consigneeDO) ? 0L : consigneeDO.getCustomerContactsId(), orderItemDOList, 10); consignorDO.getCustomerContactsId(), Objects.isNull(consigneeDO) ? 0L : consigneeDO.getCustomerContactsId(), orderItemDOList, 10);
}else if (orderBackVO.getIsCheckCoupon()){
// 如果没有重新计价,这里就需要对订单优惠活动进行检查,是否需要重新匹配新的优惠
List<OrderItemDO> orderItemDOList = orderItemMapper.selectList(new LambdaQueryWrapper<OrderItemDO>().eq(OrderItemDO::getOrderId, orderDO.getOrderId()));
// 是否需要检查优惠卷(如果满足当前优惠卷,则继续使用(即使过期也可以),如果不满足则匹配最新的优惠(排除过期))
orderBusinessService.costCalculation(String.valueOf(userId), orderDO, consignorDO.getCustomerId(), Objects.isNull(consigneeDO) ? 0L : consigneeDO.getCustomerId(),
consignorDO.getCustomerContactsId(), Objects.isNull(consigneeDO) ? 0L : consigneeDO.getCustomerContactsId(), orderItemDOList, 51);
} }
orderBusinessService.addOrderTimeLog(orderDO.getStatus(), orderDO, 7, now, now); orderBusinessService.addOrderTimeLog(orderDO.getStatus(), orderDO, 7, now, now);
// 空运相关订单处理业务 // 空运相关订单处理业务
...@@ -6218,6 +6196,8 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -6218,6 +6196,8 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (Objects.nonNull(memberUserDO)){ if (Objects.nonNull(memberUserDO)){
// 会员端下单,需要保存会员id信息 // 会员端下单,需要保存会员id信息
newOrder.setUserId(memberUserDO.getId()); newOrder.setUserId(memberUserDO.getId());
}else {
newOrder.setUserId(0L);
} }
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
String creator = String.valueOf(loginUser != null ? loginUser.getId() : null); String creator = String.valueOf(loginUser != null ? loginUser.getId() : null);
...@@ -6382,6 +6362,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -6382,6 +6362,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderItemDO.setWeight(io.getWeight()); orderItemDO.setWeight(io.getWeight());
orderItemDO.setQuantity(io.getQuantity()); orderItemDO.setQuantity(io.getQuantity());
orderItemDO.setNum(io.getQuantity()); orderItemDO.setNum(io.getQuantity());
orderItemDO.setWorth(io.getWorth());
orderItemDO.setBoxGauge(io.getBoxGauge()); orderItemDO.setBoxGauge(io.getBoxGauge());
orderItemDO.setBrand(io.getBrand()); orderItemDO.setBrand(io.getBrand());
orderItemDO.setBrandType(io.getBrandType()); orderItemDO.setBrandType(io.getBrandType());
...@@ -6397,7 +6378,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl ...@@ -6397,7 +6378,7 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
*/ */
private static void initializeOrderInfo(OrderDO newOrder) { private static void initializeOrderInfo(OrderDO newOrder) {
newOrder.setOrderId(null); newOrder.setOrderId(null);
newOrder.setUserId(null); newOrder.setUserId(0L);
newOrder.setSumNum(null); newOrder.setSumNum(null);
newOrder.setSumQuantity(null); newOrder.setSumQuantity(null);
newOrder.setSumVolume(null); newOrder.setSumVolume(null);
......
...@@ -29,6 +29,7 @@ import cn.iocoder.yudao.module.order.vo.orderPickup.*; ...@@ -29,6 +29,7 @@ import cn.iocoder.yudao.module.order.vo.orderPickup.*;
import cn.iocoder.yudao.module.order.vo.orderTime.OrderTimeQueryVO; import cn.iocoder.yudao.module.order.vo.orderTime.OrderTimeQueryVO;
import cn.iocoder.yudao.module.system.service.user.AdminUserService; import cn.iocoder.yudao.module.system.service.user.AdminUserService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -38,6 +39,7 @@ import org.springframework.validation.annotation.Validated; ...@@ -38,6 +39,7 @@ import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -122,7 +124,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O ...@@ -122,7 +124,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
orderPickup.setOrderStatus(orderDO.getStatus()); orderPickup.setOrderStatus(orderDO.getStatus());
} }
orderPickupMapper.insert(orderPickup); orderPickupMapper.insert(orderPickup);
orderService.updateStatus(null, createReqVO.getOrderId(), OrderStatusEnum.PICKED_UP.getValue(), null, null, null, null, null, createReqVO.getPickTime(), false); // orderService.updateStatus(null, createReqVO.getOrderId(), OrderStatusEnum.PICKED_UP.getValue(), null, null, null, null, null, createReqVO.getPickTime(), false);
//升级客户vip等级 //升级客户vip等级
updateCustomerLevelUp(orderDO); updateCustomerLevelUp(orderDO);
...@@ -188,6 +190,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O ...@@ -188,6 +190,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
} }
} }
} }
dealDeliveryRate(createReqVO.getOrderId(),orderDO.getSumNum(),PickStateEnum.picked.getPickState());
// 返回 // 返回
return orderPickup.getId(); return orderPickup.getId();
} }
...@@ -204,6 +207,19 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O ...@@ -204,6 +207,19 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
return orderDO.getSumNum() - allPickNum; return orderDO.getSumNum() - allPickNum;
} }
private void dealDeliveryRate(String orderNo,Integer sumNum,Integer pickState) {
List<OrderPickupDO> orderPickupDOS = orderPickupMapper.selectList(OrderPickupDO::getOrderId, orderNo);
int pickedSum = orderPickupDOS.stream().mapToInt(OrderPickupDO::getPickNum).sum();
BigDecimal pickRatio = new BigDecimal((double) pickedSum / sumNum * 100 );
pickRatio.setScale(2, RoundingMode.HALF_UP);
orderService.update(new LambdaUpdateWrapper<OrderDO>()
.set(OrderDO::getPickNum, pickedSum)
.set(OrderDO::getPickRatio, pickRatio)
.set(OrderDO::getPickState,pickState)
.eq(OrderDO::getOrderNo,orderNo)
);
}
private void deleteCustomLevelAndCreditLevelLog(OrderPickupDO orderPickupDO) { private void deleteCustomLevelAndCreditLevelLog(OrderPickupDO orderPickupDO) {
OrderBackInfoDto info = orderQueryService.info(orderService.selectOne(OrderDO::getOrderNo, orderPickupDO.getOrderId()).getOrderId()); OrderBackInfoDto info = orderQueryService.info(orderService.selectOne(OrderDO::getOrderNo, orderPickupDO.getOrderId()).getOrderId());
if (info.getSumNum() != 0) { if (info.getSumNum() != 0) {
...@@ -317,12 +333,14 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O ...@@ -317,12 +333,14 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
// 获取未撤销的提货记录 // 获取未撤销的提货记录
List<OrderPickupDO> pickupDOList = orderPickupMapper.selectList(new LambdaQueryWrapper<OrderPickupDO>().eq(OrderPickupDO::getOrderId, orderPickupDO.getOrderId()).orderByDesc(OrderPickupDO::getPickTime)); List<OrderPickupDO> pickupDOList = orderPickupMapper.selectList(new LambdaQueryWrapper<OrderPickupDO>().eq(OrderPickupDO::getOrderId, orderPickupDO.getOrderId()).orderByDesc(OrderPickupDO::getPickTime));
if (CollectionUtil.isNotEmpty(pickupDOList) && pickupDOList.size() > 0) { if (CollectionUtil.isNotEmpty(pickupDOList) && pickupDOList.size() > 0) {
orderService.updateStatus(one.getOrderId(), null, OrderStatusEnum.PART_PICKED_UP.getValue(), null, null, null, null, null); // orderService.updateStatus(one.getOrderId(), null, OrderStatusEnum.PART_PICKED_UP.getValue(), null, null, null, null, null);
dealDeliveryRate(one.getOrderNo(),one.getSumNum(),PickStateEnum.partPick.getPickState());
} else { } else {
// 找到已删除 订单状态大于0的数据来恢复订单状态 // 找到已删除 订单状态大于0的数据来恢复订单状态
OrderPickupDO delOrderPickupDO = orderPickupMapper.selectDeletedPickup(orderPickupDO.getOrderId()); OrderPickupDO delOrderPickupDO = orderPickupMapper.selectDeletedPickup(orderPickupDO.getOrderId());
// 这里需要考虑到老数据的空指针异常 // 这里需要考虑到老数据的空指针异常
orderService.updateStatus(one.getOrderId(), null, Objects.nonNull(delOrderPickupDO) ? delOrderPickupDO.getOrderStatus() : 16, null, null, null, null, null); // orderService.updateStatus(one.getOrderId(), null, Objects.nonNull(delOrderPickupDO) ? delOrderPickupDO.getOrderStatus() : 16, null, null, null, null, null);
dealDeliveryRate(one.getOrderNo(),one.getSumNum(),PickStateEnum.picked.getPickState());
} }
if (Objects.equals(one.getTransportId(), TransportTypeShortEnum.AIR_FREIGHT_LINE.getValue())) { if (Objects.equals(one.getTransportId(), TransportTypeShortEnum.AIR_FREIGHT_LINE.getValue())) {
...@@ -473,7 +491,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O ...@@ -473,7 +491,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
orderPickup.setOrderStatus(orderDO.getStatus()); orderPickup.setOrderStatus(orderDO.getStatus());
} }
orderPickupMapper.insert(orderPickup); orderPickupMapper.insert(orderPickup);
orderService.updateStatus(null, orderDO.getOrderNo(), OrderStatusEnum.PICKED_UP.getValue(), null, null, null, null, null, createReqVO.getPickTime(), false); // orderService.updateStatus(null, orderDO.getOrderNo(), OrderStatusEnum.PICKED_UP.getValue(), null, null, null, null, null, createReqVO.getPickTime(), false);
//升级客户vip等级 //升级客户vip等级
updateCustomerLevelUp(orderDO); updateCustomerLevelUp(orderDO);
...@@ -516,6 +534,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O ...@@ -516,6 +534,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
} }
} }
} }
dealDeliveryRate(createReqVO.getOrderId(),orderDO.getSumNum(),PickStateEnum.picked.getPickState());
} }
} }
} }
...@@ -630,7 +649,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O ...@@ -630,7 +649,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
orderPickup.setOrderStatus(orderDO.getStatus()); orderPickup.setOrderStatus(orderDO.getStatus());
} }
orderPickupMapper.insert(orderPickup); orderPickupMapper.insert(orderPickup);
orderService.updateStatus(null, createReqVO.getOrderId(), OrderStatusEnum.PART_PICKED_UP.getValue(), null, null, null, null, null, createReqVO.getPickTime(), false); // orderService.updateStatus(null, createReqVO.getOrderId(), OrderStatusEnum.PART_PICKED_UP.getValue(), null, null, null, null, null, createReqVO.getPickTime(), false);
//发送站内信 //发送站内信
sendMsg(orderDO.getOrderNo(), orderDO.getMarks(), String.valueOf(orderPickup.getPickNum()), DateUtils.formatDate(orderPickup.getPickTime()), Long.valueOf(orderPickup.getCreator())); sendMsg(orderDO.getOrderNo(), orderDO.getMarks(), String.valueOf(orderPickup.getPickNum()), DateUtils.formatDate(orderPickup.getPickTime()), Long.valueOf(orderPickup.getCreator()));
...@@ -638,6 +657,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O ...@@ -638,6 +657,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
OrderDO orderDO1 = new OrderDO(); OrderDO orderDO1 = new OrderDO();
BeanUtils.copyProperties(orderDO, orderDO1); BeanUtils.copyProperties(orderDO, orderDO1);
insertCustomLevelAndCreditLevelLog(orderPickup, orderDO1, false); insertCustomLevelAndCreditLevelLog(orderPickup, orderDO1, false);
dealDeliveryRate(createReqVO.getOrderId(),orderDO.getSumNum(),PickStateEnum.partPick.getPickState());
} else if (num < 0) { } else if (num < 0) {
//如果分批提的数量加上已分批提的数量超过了总量 则重新计算成剩余的量 //如果分批提的数量加上已分批提的数量超过了总量 则重新计算成剩余的量
throw exception(PICK_UP_TOO_MORE); throw exception(PICK_UP_TOO_MORE);
...@@ -652,7 +672,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O ...@@ -652,7 +672,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
orderPickup.setOrderStatus(orderDO.getStatus()); orderPickup.setOrderStatus(orderDO.getStatus());
} }
orderPickupMapper.insert(orderPickup); orderPickupMapper.insert(orderPickup);
orderService.updateStatus(null, createReqVO.getOrderId(), OrderStatusEnum.PICKED_UP.getValue(), null, null, null, null, null, createReqVO.getPickTime(), false); // orderService.updateStatus(null, createReqVO.getOrderId(), OrderStatusEnum.PICKED_UP.getValue(), null, null, null, null, null, createReqVO.getPickTime(), false);
//发送站内信 //发送站内信
sendMsg(orderDO.getOrderNo(), orderDO.getMarks(), String.valueOf(orderPickup.getPickNum()), DateUtils.formatDate(orderPickup.getPickTime()), Long.valueOf(orderPickup.getCreator())); sendMsg(orderDO.getOrderNo(), orderDO.getMarks(), String.valueOf(orderPickup.getPickNum()), DateUtils.formatDate(orderPickup.getPickTime()), Long.valueOf(orderPickup.getCreator()));
...@@ -662,6 +682,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O ...@@ -662,6 +682,7 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
BeanUtils.copyProperties(orderDO, orderDO1); BeanUtils.copyProperties(orderDO, orderDO1);
insertCustomLevelAndCreditLevelLog(orderPickup, orderDO1, true); insertCustomLevelAndCreditLevelLog(orderPickup, orderDO1, true);
updateCustomerLevelUp(orderDO1); updateCustomerLevelUp(orderDO1);
dealDeliveryRate(createReqVO.getOrderId(),orderDO.getSumNum(),PickStateEnum.picked.getPickState());
} }
orderBusinessService.addOrderOperateLog(orderDO.getOrderId(), "", "分批提货", ""); orderBusinessService.addOrderOperateLog(orderDO.getOrderId(), "", "分批提货", "");
if (Objects.equals(orderDO.getTransportId(), TransportTypeShortEnum.AIR_FREIGHT_LINE.getValue())) { if (Objects.equals(orderDO.getTransportId(), TransportTypeShortEnum.AIR_FREIGHT_LINE.getValue())) {
......
...@@ -375,7 +375,7 @@ public class OrderBackPageVO { ...@@ -375,7 +375,7 @@ public class OrderBackPageVO {
private Integer pickState; private Integer pickState;
@ApiModelProperty(value = "'提货率'") @ApiModelProperty(value = "'提货率'")
private Integer pickRatio; private BigDecimal pickRatio;
@ApiModelProperty(value = "'提货箱数'") @ApiModelProperty(value = "'提货箱数'")
private Integer pickNum; private Integer pickNum;
...@@ -440,10 +440,16 @@ public class OrderBackPageVO { ...@@ -440,10 +440,16 @@ public class OrderBackPageVO {
@ApiModelProperty(value = "报价单状态") @ApiModelProperty(value = "报价单状态")
private Integer offerStatus; private Integer offerStatus;
/** /**
* 状态说明 * 状态说明
*/ */
@ApiModelProperty(value = "状态说明") @ApiModelProperty(value = "状态说明")
private String statusText;
/**
* 动态
*/
@ApiModelProperty(value = "动态")
private String statusMsg; private String statusMsg;
...@@ -549,6 +555,8 @@ public class OrderBackPageVO { ...@@ -549,6 +555,8 @@ public class OrderBackPageVO {
public void setStatus(Integer status) { public void setStatus(Integer status) {
this.status = status; this.status = status;
Integer lang = Objects.nonNull(this.lang) ? this.lang : I18nMessage.getLang();
this.statusText = lang == 0 ? OrderStatusEnum.valueOf(status).getNameZh() : OrderStatusEnum.valueOf(status).getNameEn();
this.getOrderDesc(); this.getOrderDesc();
} }
......
...@@ -544,6 +544,9 @@ public class OrderBackVO { ...@@ -544,6 +544,9 @@ public class OrderBackVO {
@ApiModelProperty(value = "是否需要重新计价") @ApiModelProperty(value = "是否需要重新计价")
private Boolean isResetPrice = Boolean.FALSE; private Boolean isResetPrice = Boolean.FALSE;
@ApiModelProperty(value = "是否需要检查优惠卷(如果满足当前优惠卷,则继续使用(即使过期也可以),如果不满足则匹配最新的优惠(排除过期))")
private Boolean isCheckCoupon = Boolean.FALSE;
// 物流信息 // 物流信息
@ApiModelProperty(value = "物流信息相关") @ApiModelProperty(value = "物流信息相关")
...@@ -631,7 +634,7 @@ public class OrderBackVO { ...@@ -631,7 +634,7 @@ public class OrderBackVO {
private Integer pickState; private Integer pickState;
@ApiModelProperty(value = "'提货率'") @ApiModelProperty(value = "'提货率'")
private Integer pickRatio; private BigDecimal pickRatio;
@ApiModelProperty(value = "'提货箱数'") @ApiModelProperty(value = "'提货箱数'")
private Integer pickNum; private Integer pickNum;
......
...@@ -359,7 +359,7 @@ public class OrderBaseVO { ...@@ -359,7 +359,7 @@ public class OrderBaseVO {
private Integer pickState; private Integer pickState;
@ApiModelProperty(value = "'提货率'") @ApiModelProperty(value = "'提货率'")
private Integer pickRatio; private BigDecimal pickRatio;
@ApiModelProperty(value = "'提货箱数'") @ApiModelProperty(value = "'提货箱数'")
private Integer pickNum; private Integer pickNum;
......
...@@ -542,16 +542,16 @@ public class OrderQueryVO { ...@@ -542,16 +542,16 @@ public class OrderQueryVO {
private Integer pickState; private Integer pickState;
@ApiModelProperty(value = "'提货率'") @ApiModelProperty(value = "'提货率'")
private Integer pickRatio; private BigDecimal pickRatio;
@ApiModelProperty(value = "小于等于提货率") @ApiModelProperty(value = "小于等于提货率")
private String lePickRatio; private BigDecimal lePickRatio;
@ApiModelProperty(value = "等于提货率") @ApiModelProperty(value = "等于提货率")
private String eqPickRatio; private BigDecimal eqPickRatio;
@ApiModelProperty(value = "大于等于提货率") @ApiModelProperty(value = "大于等于提货率")
private String gePickRatio; private BigDecimal gePickRatio;
@ApiModelProperty(value = "'提货箱数'") @ApiModelProperty(value = "'提货箱数'")
private Integer pickNum; private Integer pickNum;
...@@ -571,6 +571,9 @@ public class OrderQueryVO { ...@@ -571,6 +571,9 @@ public class OrderQueryVO {
@ApiModelProperty(value = "目的国ids") @ApiModelProperty(value = "目的国ids")
private List<Long> destCountryIds ; private List<Long> destCountryIds ;
@ApiModelProperty(value = "订单类型筛选条件:0 普通订单 1 集运服务 2 海外仓")
private List<String> types;
@ApiModelProperty(value = "入仓类型") @ApiModelProperty(value = "入仓类型")
private List<Integer> warehouseTypes; private List<Integer> warehouseTypes;
...@@ -625,6 +628,7 @@ public class OrderQueryVO { ...@@ -625,6 +628,7 @@ public class OrderQueryVO {
@ApiModelProperty(value = "是否有收货人") @ApiModelProperty(value = "是否有收货人")
private Boolean hasConsignee; private Boolean hasConsignee;
public void setHasConsignee(Boolean hasConsignee) { public void setHasConsignee(Boolean hasConsignee) {
if (Objects.nonNull(hasConsignee)) { if (Objects.nonNull(hasConsignee)) {
// 这里数据的条件正好相反,数据库是同步的客户信息设置,是否允许无收货人,true为允许无收货人 // 这里数据的条件正好相反,数据库是同步的客户信息设置,是否允许无收货人,true为允许无收货人
......
package cn.iocoder.yudao.module.product.dal.dataobject.coupon; //package cn.iocoder.yudao.module.product.dal.dataobject.coupon;
//
import com.baomidou.mybatisplus.annotation.TableName; //import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; //import lombok.Data;
//
import java.util.Date; //import java.util.Date;
//
@TableName("z_test") //@TableName("z_test")
@Data //@Data
public class zTest3 { //public class zTest3 {
//
private Long id; // private Long id;
private String testname; // private String testname;
private Date createdate; // private Date createdate;
} //}
package cn.iocoder.yudao.module.product.dal.mysql.coupon; //package cn.iocoder.yudao.module.product.dal.mysql.coupon;
//
import cn.iocoder.yudao.framework.mybatis.core.mapper.AbstractMapper; //import cn.iocoder.yudao.framework.mybatis.core.mapper.AbstractMapper;
import cn.iocoder.yudao.module.product.dal.dataobject.coupon.zTest3; ////import cn.iocoder.yudao.module.product.dal.dataobject.coupon.zTest3;
import org.apache.ibatis.annotations.Mapper; //import org.apache.ibatis.annotations.Mapper;
//
@Mapper //@Mapper
public interface ZTestMapper3 extends AbstractMapper<zTest3> { //public interface ZTestMapper3 extends AbstractMapper<zTest3> {
} //}
//
...@@ -300,6 +300,7 @@ public interface ProductMapper extends BaseMapperX<ProductDO> { ...@@ -300,6 +300,7 @@ public interface ProductMapper extends BaseMapperX<ProductDO> {
.likeIfPresent(ProductDO::getProductCode, reqVO.getProductCode()) .likeIfPresent(ProductDO::getProductCode, reqVO.getProductCode())
.likeIfPresent(ProductDO::getCustomsCode, reqVO.getCustomsCode()) .likeIfPresent(ProductDO::getCustomsCode, reqVO.getCustomsCode())
.eqIfPresent(ProductDO::getTypeId, reqVO.getTypeId()) .eqIfPresent(ProductDO::getTypeId, reqVO.getTypeId())
.inIfPresent(ProductDO::getTypeId, reqVO.getTypeIds())
.eqIfPresent(ProductDO::getAuditStatus, reqVO.getAuditStatus()) .eqIfPresent(ProductDO::getAuditStatus, reqVO.getAuditStatus())
.eqIfPresent(ProductDO::getStatus, reqVO.getStatus()) .eqIfPresent(ProductDO::getStatus, reqVO.getStatus())
.inIfPresent(ProductDO::getId, idList) .inIfPresent(ProductDO::getId, idList)
......
...@@ -322,7 +322,7 @@ public class ProdConditionParam { ...@@ -322,7 +322,7 @@ public class ProdConditionParam {
@ApiModelProperty(value = "货值货币id") @ApiModelProperty(value = "货值货币id")
private Integer worthCurrency; private Integer worthCurrency;
@ApiModelProperty(value = "类型:1 正常计算 2 特价申请已传入的商品单价计算 3 指定重泡货标准计算 4 佣金设置 5 批量加价 6 订单优惠更新") @ApiModelProperty(value = "类型:1 正常计算 2 特价申请已传入的商品单价计算 3 指定重泡货标准计算 4 佣金设置 5 批量加价 6 订单优惠更新 7 检查优惠(如果满足当前优惠卷,则继续使用(即使过期也可以),如果不满足则匹配最新的优惠(排除过期))")
private Integer calculationType = 1; private Integer calculationType = 1;
@ApiModelProperty(value = "上次计价使用的优惠信息") @ApiModelProperty(value = "上次计价使用的优惠信息")
......
...@@ -24,10 +24,10 @@ import cn.iocoder.yudao.module.ecw.api.currency.dto.ExchangeRateRespDTO; ...@@ -24,10 +24,10 @@ import cn.iocoder.yudao.module.ecw.api.currency.dto.ExchangeRateRespDTO;
import cn.iocoder.yudao.module.ecw.api.internalMessage.InternalMessageApi; import cn.iocoder.yudao.module.ecw.api.internalMessage.InternalMessageApi;
import cn.iocoder.yudao.module.ecw.api.internalMessage.dto.InternalMessageCreateDto; import cn.iocoder.yudao.module.ecw.api.internalMessage.dto.InternalMessageCreateDto;
import cn.iocoder.yudao.module.product.convert.product.ProductPriceConvert; import cn.iocoder.yudao.module.product.convert.product.ProductPriceConvert;
import cn.iocoder.yudao.module.product.dal.dataobject.coupon.zTest3; //import cn.iocoder.yudao.module.product.dal.dataobject.coupon.zTest3;
import cn.iocoder.yudao.module.product.dal.dataobject.product.*; import cn.iocoder.yudao.module.product.dal.dataobject.product.*;
import cn.iocoder.yudao.module.product.dal.dataobject.productPriceSnapshot.ProductPriceSnapshotDO; import cn.iocoder.yudao.module.product.dal.dataobject.productPriceSnapshot.ProductPriceSnapshotDO;
import cn.iocoder.yudao.module.product.dal.mysql.coupon.ZTestMapper3; //import cn.iocoder.yudao.module.product.dal.mysql.coupon.ZTestMapper3;
import cn.iocoder.yudao.module.product.dal.mysql.product.*; import cn.iocoder.yudao.module.product.dal.mysql.product.*;
import cn.iocoder.yudao.module.product.dal.mysql.productPriceSnapshot.ProductPriceSnapshotMapper; import cn.iocoder.yudao.module.product.dal.mysql.productPriceSnapshot.ProductPriceSnapshotMapper;
import cn.iocoder.yudao.module.product.dto.AirClearancePriceResultDto; import cn.iocoder.yudao.module.product.dto.AirClearancePriceResultDto;
...@@ -129,8 +129,8 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper, ...@@ -129,8 +129,8 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
@Resource @Resource
private ProductPriceStepClearanceService productPriceStepClearanceService; private ProductPriceStepClearanceService productPriceStepClearanceService;
@Resource // @Resource
private ZTestMapper3 zTestMapper; // private ZTestMapper3 zTestMapper;
private static final String PREFIX = "price_batch_update_"; private static final String PREFIX = "price_batch_update_";
...@@ -1259,10 +1259,10 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper, ...@@ -1259,10 +1259,10 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
//没有价格信息不继续后面的处理 //没有价格信息不继续后面的处理
if (!hasPrice) { if (!hasPrice) {
zTest3 m = new zTest3(); // zTest3 m = new zTest3();
m.setTestname("没有价格信息,不后续处理"); // m.setTestname("没有价格信息,不后续处理");
m.setCreatedate(new Date()); // m.setCreatedate(new Date());
zTestMapper.insert(m); // zTestMapper.insert(m);
continue; continue;
} }
...@@ -1298,10 +1298,10 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper, ...@@ -1298,10 +1298,10 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
handleData.setNeedHandleList(needHandleList); handleData.setNeedHandleList(needHandleList);
applicationContext.publishEvent(handleData); applicationContext.publishEvent(handleData);
} else { } else {
zTest3 m = new zTest3(); // zTest3 m = new zTest3();
m.setTestname("needHandleList 为空"); // m.setTestname("needHandleList 为空");
m.setCreatedate(new Date()); // m.setCreatedate(new Date());
zTestMapper.insert(m); // zTestMapper.insert(m);
} }
} }
......
...@@ -16,6 +16,9 @@ public class ProductExportReqVO { ...@@ -16,6 +16,9 @@ public class ProductExportReqVO {
@ApiModelProperty(value = "商品类型id") @ApiModelProperty(value = "商品类型id")
private Long typeId; private Long typeId;
@ApiModelProperty(value = "商品类型ids")
private List<Long> typeIds;
@ApiModelProperty(value = "商品属性id") @ApiModelProperty(value = "商品属性id")
private String attrId; private String attrId;
......
...@@ -92,27 +92,63 @@ public interface OfferMapper extends BaseMapperX<OfferDO> { ...@@ -92,27 +92,63 @@ public interface OfferMapper extends BaseMapperX<OfferDO> {
@ResultType(OfferRespVO.class) @ResultType(OfferRespVO.class)
@Select({ @Select({
"<script>", "<script>",
"select o.offer_id, ", "select o.*, ",
"o.number, ", // "o.number, ",
"o.order_no, ", // "o.order_no, ",
"o.order_id, ", // "o.order_id, ",
"if(#{lang} = 0, o.departure ->> '$.titleZh', o.departure ->> '$.titleEn') as departure_name, ", "if(#{lang} = 0, o.departure ->> '$.titleZh', o.departure ->> '$.titleEn') as departure_name, ",
"if(#{lang} = 0, o.objective ->> '$.titleZh', o.objective ->> '$.titleEn') as objective_name, ", "if(#{lang} = 0, o.objective ->> '$.titleZh', o.objective ->> '$.titleEn') as objective_name, ",
"o.start_time, ", // "o.start_time, ",
"o.end_time, ", // "o.end_time, ",
"o.stop_time, ", // "o.stop_time, ",
"o.status, ", // "o.status, ",
"o.transport_id, ", // "o.transport_id, ",
"o.est_cost, ", // "o.est_cost, ",
"o.create_time, ", // "o.create_time, ",
"o.update_time, ", // "o.update_time, ",
"(select count(1) from ecw_customer_follow l where l.biz_id = o.offer_id and l.follow_type = 4) as log_count, ", "(select count(1) from ecw_customer_followup l where l.offer_id = o.offer_id) as log_count, ",
"u.nickname as creator_name, ", "u.nickname as creator_name, ",
"(SELECT cc.`name` FROM ecw_customer_contacts cc WHERE ( o.relation = 1 AND cc.id = o.consignor_id ) OR ( o.relation = 2 AND cc.id = o.consignee_id)) AS relation_name ", "u.nickname as business_manager_name, ",
// "(SELECT cc.`name` FROM ecw_customer_contacts cc WHERE ( o.relation = 1 AND cc.id = o.consignor_id ) OR ( o.relation = 2 AND cc.id = o.consignee_id)) AS relation_name ",
"cc.name as relation_name, ",
"cc.area_code as relation_area_code, ",
"cc.phone_new as relation_phone, ",
"line.start_warehouse_id, ",
"line.dest_warehouse_id, ",
"line.transport_type ",
"from ecw_offer o ", "from ecw_offer o ",
// "left join ecw_customer_contacts cc on (o.relation = 1 and cc.id = o.consignor_id) or (o.relation = 2 and cc.id = o.consignee_id) ", "left join ecw_customer_contacts cc on (o.relation = 1 and cc.id = o.consignor_id) or (o.relation = 2 and cc.id = o.consignee_id) ",
"left join system_user u on u.id = o.follow_up_salesman_id ", "left join system_user u on u.id = o.follow_up_salesman_id ",
"left join ecw_region s on o.objective_id = s.id ",
"left join ecw_warehouse_line line on o.line_id = line.id ",
"left join ecw_warehouse dst on line.dest_warehouse_id = dst.id ",
"where o.deleted = 0", "where o.deleted = 0",
//destCountryIds
"<when test = 'pageVO.destCountryIds != null and pageVO.destCountryIds.size() > 0'>",
"AND dst.guojia IN",
"<foreach item='destCountryId' collection='pageVO.destCountryIds' open='(' close=')' separator=','> #{destCountryId} </foreach>",
"</when>",
//objectiveIds
"<when test = 'pageVO.objectiveIds != null and pageVO.objectiveIds.size() > 0'>",
"AND dst.objective_id IN",
"<foreach item='objectiveId' collection='pageVO.objectiveIds' open='(' close=')' separator=','> #{objectiveId} </foreach>",
"</when>",
//destWarehouseIds
"<when test = 'pageVO.destWarehouseIds != null and pageVO.destWarehouseIds.size() > 0'>",
"AND dst.id IN",
"<foreach item='destWarehouseId' collection='pageVO.destWarehouseIds' open='(' close=')' separator=','> #{destWarehouseId} </foreach>",
"</when>",
//customerId
"<when test = 'pageVO.customerId != null'>",
"AND o.relation_id = #{pageVO.customerId} ",
"</when>",
"<when test = 'pageVO.deptId != null'>", "<when test = 'pageVO.deptId != null'>",
"AND o.dept_id = #{pageVO.deptId} ", "AND o.dept_id = #{pageVO.deptId} ",
"</when>", "</when>",
...@@ -192,7 +228,32 @@ public interface OfferMapper extends BaseMapperX<OfferDO> { ...@@ -192,7 +228,32 @@ public interface OfferMapper extends BaseMapperX<OfferDO> {
"select count(1)", "select count(1)",
"from ecw_offer o ", "from ecw_offer o ",
"left join ecw_customer c on c.id = o.relation_id ", "left join ecw_customer c on c.id = o.relation_id ",
"left join ecw_region s on o.objective_id = s.id ",
"left join ecw_warehouse_line line on o.line_id = line.id ",
"left join ecw_warehouse dst on line.dest_warehouse_id = dst.id ",
"where o.deleted = 0", "where o.deleted = 0",
//destCountryIds
"<when test = 'pageVO.destCountryIds != null and pageVO.destCountryIds.size() > 0'>",
"AND dst.guojia IN",
"<foreach item='destCountryId' collection='pageVO.destCountryIds' open='(' close=')' separator=','> #{destCountryId} </foreach>",
"</when>",
//objectiveIds
"<when test = 'pageVO.objectiveIds != null and pageVO.objectiveIds.size() > 0'>",
"AND dst.objective_id IN",
"<foreach item='objectiveId' collection='pageVO.objectiveIds' open='(' close=')' separator=','> #{objectiveId} </foreach>",
"</when>",
//destWarehouseIds
"<when test = 'pageVO.destWarehouseIds != null and pageVO.destWarehouseIds.size() > 0'>",
"AND dst.id IN",
"<foreach item='destWarehouseId' collection='pageVO.destWarehouseIds' open='(' close=')' separator=','> #{destWarehouseId} </foreach>",
"</when>",
//customerId
"<when test = 'pageVO.customerId != null'>",
"AND o.relation_id = #{pageVO.customerId} ",
"</when>",
"<when test = 'pageVO.deptId != null'>", "<when test = 'pageVO.deptId != null'>",
"AND o.dept_id = #{pageVO.deptId} ", "AND o.dept_id = #{pageVO.deptId} ",
"</when>", "</when>",
......
...@@ -161,4 +161,18 @@ public class OfferPageReqVO extends PageParam { ...@@ -161,4 +161,18 @@ public class OfferPageReqVO extends PageParam {
@ApiModelProperty(value = "创建者或业务员") @ApiModelProperty(value = "创建者或业务员")
private String creator; private String creator;
@ApiModelProperty(value = "客户id")
private Long customerId;
@ApiModelProperty(value = "目的国id集合")
private List<Long> destCountryIds;
@ApiModelProperty(value = "目的地id集合")
private List<Long> objectiveIds;
@ApiModelProperty(value = "目的仓ID集合")
private List<Long> destWarehouseIds;
} }
...@@ -40,13 +40,35 @@ public class OfferRespVO extends OfferBaseVO { ...@@ -40,13 +40,35 @@ public class OfferRespVO extends OfferBaseVO {
@ApiModelProperty(value = "目的地名称") @ApiModelProperty(value = "目的地名称")
private String objectiveName; private String objectiveName;
@ApiModelProperty(value = "关联客户名称")
private String relationName;
@ApiModelProperty(value = "业务员名称") @ApiModelProperty(value = "业务员名称")
private String creatorName; private String creatorName;
@ApiModelProperty(value = "跟进业务员") @ApiModelProperty(value = "跟进业务员")
private String followUpSalesmanId; private String followUpSalesmanId;
@ApiModelProperty(value = "关联客户名称")
private String relationName;
@ApiModelProperty(value = "联系人区号")
private String relationAreaCode;
@ApiModelProperty(value = "联系人手机号")
private String relationPhone;
// 线路相关
@ExcelProperty("始发仓库id")
private Long startWarehouseId;
@ExcelProperty("目的仓库id")
private Long destWarehouseId;
@ExcelProperty("运输方式")
private String transportType;
@ApiModelProperty(value = "业务员名称-客户经理")
private String businessManagerName;
} }
...@@ -10,4 +10,10 @@ Content-Type: application/json ...@@ -10,4 +10,10 @@ Content-Type: application/json
"result": 1, "result": 1,
"reason": "no reason", "reason": "no reason",
"warehousingType": 1 "warehousingType": 1
} }
\ No newline at end of file
### page
GET {{baseUrl}}/ecw/offer/page?pageNo=1&pageSize=10&transportId=1&customerId=51966&destCountryIds%5B0%5D=4174
Authorization: Bearer {{token}}
tenant-id: {{adminTenentId}}
\ No newline at end of file
### list
GET {{baseUrl}}/system/dept/list-my-and-under-simple
Authorization: Bearer {{token}}
tenant-id: {{adminTenentId}}
...@@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.system.controller.admin.dept; ...@@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.system.controller.admin.dept;
import cn.iocoder.yudao.framework.common.util.spring.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.util.spring.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.*; import cn.iocoder.yudao.module.system.controller.admin.dept.vo.dept.*;
import cn.iocoder.yudao.module.system.convert.dept.DeptConvert; import cn.iocoder.yudao.module.system.convert.dept.DeptConvert;
...@@ -88,6 +89,23 @@ public class DeptController { ...@@ -88,6 +89,23 @@ public class DeptController {
return success(DeptConvert.INSTANCE.convertList02(list)); return success(DeptConvert.INSTANCE.convertList02(list));
} }
@GetMapping("/list-my-and-under-simple")
@ApiOperation(value = "获取自己和下属部门精简信息列表", notes = "只包含被开启的部门,主要用于前端的下拉选项")
public CommonResult<List<DeptSimpleRespVO>> getMyAndUnderSimpleDepts() {
// 获得部门列表,只要开启状态的
DeptListReqVO reqVO = new DeptListReqVO();
reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus());
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
Long deptId = loginUser.getDeptId();
List<DeptDO> list = deptService.getDeptsByParentIdFromCache(deptId, true);
DeptDO dept = deptService.getDept(deptId);
list.add(dept);
// 排序后,返回给前端
list.sort(Comparator.comparing(DeptDO::getSort));
return success(DeptConvert.INSTANCE.convertList02(list));
}
@GetMapping("/get") @GetMapping("/get")
@ApiOperation("获得部门信息") @ApiOperation("获得部门信息")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
......
...@@ -274,3 +274,8 @@ order.cargo.control.limit.update.consignee.error= ...@@ -274,3 +274,8 @@ order.cargo.control.limit.update.consignee.error=
order.cargo.control.limit.update.consignee.info= order.cargo.control.limit.update.consignee.info=
order.cargo.control.consignee.limit.update.applying= order.cargo.control.consignee.limit.update.applying=
order.cargo.control.overseas.warehouse.update.applying= order.cargo.control.overseas.warehouse.update.applying=
customer.saved.not.exists=
customer.deleted.not.exists=
customer.saved.customer.service.is.null=
customer.deleted.customer.service.is.null=
customer.merge.customer.service.not.same=
...@@ -1081,3 +1081,8 @@ overseas.warehouse.update.processing=Overseas warehouse modification application ...@@ -1081,3 +1081,8 @@ overseas.warehouse.update.processing=Overseas warehouse modification application
overseas.warehouse.update.pass=Overseas warehouse modification approval passed overseas.warehouse.update.pass=Overseas warehouse modification approval passed
overseas.warehouse.update.reject=Overseas warehouse modification approval rejected overseas.warehouse.update.reject=Overseas warehouse modification approval rejected
overseas.warehouse.update.cancel=Overseas warehouse modification approval cancelled overseas.warehouse.update.cancel=Overseas warehouse modification approval cancelled
customer.saved.not.exists=customer saved not exists
customer.deleted.not.exists=customer deleted not exists
customer.saved.customer.service.is.null=customer saved customer service is null
customer.deleted.customer.service.is.null=customer merged customer service is null
customer.merge.customer.service.not.same=tow customer's customer serivce not same
...@@ -1031,10 +1031,10 @@ reward.redeem.allow.count.error = \u5DF2\u8D85\u51FA\u4E2A\u4EBA\u5141\u8BB8\u51 ...@@ -1031,10 +1031,10 @@ reward.redeem.allow.count.error = \u5DF2\u8D85\u51FA\u4E2A\u4EBA\u5141\u8BB8\u51
reward.node.and.points.list.error = \u521B\u5EFA\u793C\u54C1\u7F51\u70B9\u6216\u6240\u9700\u79EF\u5206\u9519\u8BEF reward.node.and.points.list.error = \u521B\u5EFA\u793C\u54C1\u7F51\u70B9\u6216\u6240\u9700\u79EF\u5206\u9519\u8BEF
reward.redeem.recipient.error = \u793C\u54C1\u6536\u8D27\u4EBA\u4FE1\u606F\u4E0D\u5168 reward.redeem.recipient.error = \u793C\u54C1\u6536\u8D27\u4EBA\u4FE1\u606F\u4E0D\u5168
redeem.import.no.record = \u8868\u683C\u4E2D\u65E0\u8BB0\u5F55 redeem.import.no.record = \u8868\u683C\u4E2D\u65E0\u8BB0\u5F55
order.cargo.control.limit.update.consignee.error=\u5f53\u524d\u63a7\u8d27\u8ba2\u5355\u9650\u5236\u4fee\u6539\u6536\u8d27\u4eba\uff0c\u672a\u67e5\u8be2\u5230\u9650\u5236\u65f6\u95f4 order.cargo.control.limit.update.consignee.error=\u5F53\u524D\u63A7\u8D27\u8BA2\u5355\u9650\u5236\u4FEE\u6539\u6536\u8D27\u4EBA\uFF0C\u672A\u67E5\u8BE2\u5230\u9650\u5236\u65F6\u95F4
order.cargo.control.limit.update.consignee.info=\u63a7\u8d27\u8ba2\u5355\u6536\u8d27\u4eba\u9650\u5236\u4fee\u6539\u65f6\u95f4\u672a\u5230\u671f\uff0c\u4e0d\u80fd\u4fee\u6539\u8ba2\u5355\u6536\u8d27\u4eba\u4fe1\u606f order.cargo.control.limit.update.consignee.info=\u63A7\u8D27\u8BA2\u5355\u6536\u8D27\u4EBA\u9650\u5236\u4FEE\u6539\u65F6\u95F4\u672A\u5230\u671F\uFF0C\u4E0D\u80FD\u4FEE\u6539\u8BA2\u5355\u6536\u8D27\u4EBA\u4FE1\u606F
order.cargo.control.consignee.limit.update.applying=\u6536\u8d27\u4eba\u9650\u5236\u4fee\u6539\u7533\u8bf7\u4e2d\uff0c\u4e0d\u80fd\u8fdb\u884c\u653e\u8d27\uff01 order.cargo.control.consignee.limit.update.applying=\u6536\u8D27\u4EBA\u9650\u5236\u4FEE\u6539\u7533\u8BF7\u4E2D\uFF0C\u4E0D\u80FD\u8FDB\u884C\u653E\u8D27\uFF01
order.cargo.control.overseas.warehouse.update.applying=\u6d77\u5916\u4ed3\u4fee\u6539\u7533\u8bf7\u4e2d\uff0c\u4e0d\u80fd\u8fdb\u884c\u653e\u8d27\uff01 order.cargo.control.overseas.warehouse.update.applying=\u6D77\u5916\u4ED3\u4FEE\u6539\u7533\u8BF7\u4E2D\uFF0C\u4E0D\u80FD\u8FDB\u884C\u653E\u8D27\uFF01
get.lock.failed = \u670D\u52A1\u7E41\u5FD9\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5 get.lock.failed = \u670D\u52A1\u7E41\u5FD9\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5
reward.redeem.not.exist = \u793C\u54C1\u5151\u6362\u8BB0\u5F55\u4E0D\u5B58\u5728 reward.redeem.not.exist = \u793C\u54C1\u5151\u6362\u8BB0\u5F55\u4E0D\u5B58\u5728
...@@ -1072,12 +1072,17 @@ score.rule.first.order.error = \u662F\u5426\u9996\u5355\u5FC5\u987B\u4E3A\u662F\ ...@@ -1072,12 +1072,17 @@ score.rule.first.order.error = \u662F\u5426\u9996\u5355\u5FC5\u987B\u4E3A\u662F\
user.address.not.exists = \u7528\u6237\u5730\u5740\u4E0D\u5B58\u5728 user.address.not.exists = \u7528\u6237\u5730\u5740\u4E0D\u5B58\u5728
user.address.field.error = \u7528\u6237\u5730\u5740\u5B57\u6BB5\u9519\u8BEF\uFF1A{} user.address.field.error = \u7528\u6237\u5730\u5740\u5B57\u6BB5\u9519\u8BEF\uFF1A{}
consignee.limit.update.processing=\u6536\u8d27\u4eba\u9650\u5236\u4fee\u6539\u7533\u8bf7\u4e2d consignee.limit.update.processing=\u6536\u8D27\u4EBA\u9650\u5236\u4FEE\u6539\u7533\u8BF7\u4E2D
consignee.limit.update.pass=\u6536\u8d27\u4eba\u9650\u5236\u4fee\u6539\u5ba1\u6279\u901a\u8fc7 consignee.limit.update.pass=\u6536\u8D27\u4EBA\u9650\u5236\u4FEE\u6539\u5BA1\u6279\u901A\u8FC7
consignee.limit.update.reject=\u6536\u8d27\u4eba\u9650\u5236\u4fee\u6539\u5ba1\u6279\u62d2\u7edd consignee.limit.update.reject=\u6536\u8D27\u4EBA\u9650\u5236\u4FEE\u6539\u5BA1\u6279\u62D2\u7EDD
consignee.limit.update.cancel=\u6536\u8d27\u4eba\u9650\u5236\u4fee\u6539\u5ba1\u6279\u53d6\u6d88 consignee.limit.update.cancel=\u6536\u8D27\u4EBA\u9650\u5236\u4FEE\u6539\u5BA1\u6279\u53D6\u6D88
overseas.warehouse.update.processing=\u6d77\u5916\u4ed3\u4fee\u6539\u7533\u8bf7\u4e2d overseas.warehouse.update.processing=\u6D77\u5916\u4ED3\u4FEE\u6539\u7533\u8BF7\u4E2D
overseas.warehouse.update.pass=\u6d77\u5916\u4ed3\u4fee\u6539\u5ba1\u6279\u901a\u8fc7 overseas.warehouse.update.pass=\u6D77\u5916\u4ED3\u4FEE\u6539\u5BA1\u6279\u901A\u8FC7
overseas.warehouse.update.reject=\u6d77\u5916\u4ed3\u4fee\u6539\u5ba1\u6279\u62d2\u7edd overseas.warehouse.update.reject=\u6D77\u5916\u4ED3\u4FEE\u6539\u5BA1\u6279\u62D2\u7EDD
overseas.warehouse.update.cancel=\u6d77\u5916\u4ed3\u4fee\u6539\u5ba1\u6279\u53d6\u6d88 overseas.warehouse.update.cancel=\u6D77\u5916\u4ED3\u4FEE\u6539\u5BA1\u6279\u53D6\u6D88
\ No newline at end of file customer.saved.not.exists=\u4FDD\u7559\u5BA2\u6237\u4E0D\u5B58\u5728
customer.deleted.not.exists=\u88AB\u5408\u5E76\u5BA2\u6237\u4E0D\u5B58\u5728
customer.saved.customer.service.is.null=\u88AB\u4FDD\u7559\u5BA2\u6237\u7684\u5BA2\u6237\u7ECF\u7406\u4E3A\u7A7A
customer.deleted.customer.service.is.null=\u88AB\u5408\u5E76\u7684\u5BA2\u6237\u7684\u5BA2\u6237\u7ECF\u7406\u4E3A\u7A7A
customer.merge.customer.service.not.same=\u4E24\u5BA2\u6237\u7684\u5BA2\u6237\u7ECF\u7406\u4E0D\u4E00\u81F4
\ No newline at end of file
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