Commit e2b9427d authored by 332784038@qq.com's avatar 332784038@qq.com

Merge branch 'release-fix' into dev

# Conflicts:
#	yudao-module-depository/yudao-module-depository-core/src/main/java/cn/iocoder/yudao/module/depository/service/warehouse/WarehouseService.java
#	yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/orderException/OrderExceptionServiceImpl.java
#	yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/vo/orderException/OrderExceptionQueryVO.java
#	yudao-module-order/yudao-module-order-core/src/main/resources/mapper/orderException/OrderExceptionMapper.xml
parents e4fe87bc b6037034
-- 增加区号
alter table ecw_region add COLUMN area_code varchar(32) DEFAULT NULL comment '区号';
......@@ -92,12 +92,14 @@ 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_id` bigint NULL DEFAULT NULL COMMENT '上一级跟进单ID',
`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_id` bigint NULL DEFAULT NULL COMMENT '联系人id',
`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',
......
......@@ -12,3 +12,22 @@ INSERT INTO `system_dict_data` (`sort`, `value`, `label`, `label_en`, `dict_type
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');
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 (28, '28', '设置是否显示提单价格', 'Set Customer Is Show Tidan Price', '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 (29, '29', '设置到仓确认', 'Set Customer Arrival Confirm', '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 (30, '30', '设置重货标准', 'Set Customer Wight Unit', '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 (31, '31', '设置泡货标准', 'Set Customer Light Unit', '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 (32, '32', '设置客户设置', 'Set Customer Setup', '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 (34, '34', '客户跟进导出', 'Customer Followup Export', 'download_type', 0, 'default', '', NULL, '1', now(), '115', now(), b'0');
......@@ -17,6 +17,6 @@ alter table `ecw_order`
add column `pick_num` int DEFAULT 0 COMMENT '提货箱数';
-- 批量刷新订单提货数量、提货率、提货状态
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 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 2 else 1 end);
-- 已提货和部分提货的订单批量刷新订单主状态
update ecw_order t set t.`status`=16 where t.`status` in (20,21);
\ No newline at end of file
-- 当订单无收货人时,收货方式无法保存的bug修复
alter table `ecw_order`
add column `harvest_method` tinyint DEFAULT '1' COMMENT '收货方式:1 自提 2 送货上门';
alter table `ecw_order`
add column `city` bigint DEFAULT NULL COMMENT '收货地址市';
alter table `ecw_order`
add column `province` bigint DEFAULT NULL COMMENT '收货地址省';
alter table `ecw_order`
add column `country` bigint DEFAULT NULL COMMENT '收货地址国家';
alter table `ecw_order`
add column `consignee_address` varchar(255) DEFAULT '' COMMENT '收货地址';
-- 放货箱数与放货率
alter table `ecw_order`
add column `release_ratio` decimal(5,2) DEFAULT '0.00' COMMENT '放货率';
alter table `ecw_order`
add column `release_num` int DEFAULT 0 COMMENT '放货箱数';
-- 批量刷新订单放货数量、放货率
update ecw_order t LEFT JOIN (select ccp.order_id , ifnull(sum(ccp.pick_num),0) as releaseNum from ecw_order_cargo_control_pick ccp where
ccp.status in(1,2,3,4,5,6) group by ccp.order_id) t1 on t.order_id=t1.order_id set t.release_num=t1.releaseNum, t.release_ratio=ROUND(t1.releaseNum/t.sum_num,2)*100;
\ No newline at end of file
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 (33, '33', '客户合并', 'Customer Merge', 'customer_operate_type', 0, 'default', '', NULL, '1', now(), '115', now(), b'0');
package cn.iocoder.yudao.framework.common.pojo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
/**
* @author Administrator
*/
@ApiModel("时间段")
@Data
public class TimeSlot {
@ApiModelProperty(value = "开始时间", required = false)
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String after;
@ApiModelProperty(value = "结束时间", required = false)
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String before;
}
......@@ -23,6 +23,9 @@ public class OrderAssociationOfferInfoEvent {
@ApiModelProperty(value = "主键ID", required = true)
private Long offerId;
@ApiModelProperty(value = "报价单号", required = true)
private String offerNo;
}
......@@ -43,6 +43,7 @@ public interface CustomerFollowupConvert {
* @return
*/
List<CustomerFollowupBackVO> convertList(List<CustomerFollowupDO> list);
List<CustomerFollowupExcelVO> convertList2(List<CustomerFollowupDO> list);
/***
* 实体分页转返回分页
......
package cn.iocoder.yudao.module.customer.dal.dataobject.customerFollowup;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import java.util.*;
import com.baomidou.mybatisplus.annotation.*;
......@@ -28,6 +30,10 @@ public class CustomerFollowupDO extends BaseDO {
* 编号
*/
private String number;
/**
* 上一级跟进id
*/
private Long parentId;
/**
* 上一级跟进单号
*/
......@@ -52,6 +58,11 @@ public class CustomerFollowupDO extends BaseDO {
* 跟进时间
*/
private Date followTime;
/**
* 联系人id
*/
private Long contactId;
/**
* 联系人
*/
......@@ -102,4 +113,13 @@ public class CustomerFollowupDO extends BaseDO {
@TableField(exist = false)
private String updaterName;
@TableField(exist = false)
private String followUserName;
@ApiModelProperty(value = "联系人电话")
@TableField(exist = false)
private String contactPhone;
}
......@@ -68,4 +68,17 @@ public interface CustomerApprovalMapper extends AbstractMapper<CustomerApprovalD
"ORDER BY approval_id DESC limit 1"
})
CustomerApprovalDO getCustomerHandoverApprovalByCustomerId(@Param("customerId") Long customerId);
@Select({
"SELECT * FROM ecw_customer_approval WHERE deleted=0 ",
"AND status = 1 ",
"AND ( ",
"(type = 2 AND details is not null AND details ->> '$.customerHandoverDetailDtoList' is not null and JSON_EXTRACT(details, '$.customerHandoverDetailDtoList') like concat('%\"customerId\": ', concat(#{customerId},',%')))",
" or (customer_id = #{customerId}) ",
") ",
"ORDER BY approval_id DESC"
})
List<CustomerApprovalDO> selectInApprovalByCustomerId(@Param("customerId") Long customerId);
}
......@@ -421,6 +421,13 @@ public interface CustomerService extends IService<CustomerDO> {
void changeCustomerDefaultPay(CustomerChangeDefaultPayReqVO customerChangeDefaultPayReqVO);
void changeCustomerDefaultBilling(CustomerChangeDefaultBillingReqVO customerChangeDefaultBillingReqVO);
void changeCustomerIsShowTidanPrice(CustomerChangeIsShowTidanPriceReqVO customerChangeIsShowTidanPriceReqVO);
void changeCustomerArrivalConfirm(CustomerChangeArrivalConfirmReqVO customerChangeArrivalConfirmReqVO);
void changeCustomerWeightUnit(CustomerChangeWeightUnitReqVO customerChangeWeightUnitReqVO);
void changeCustomerLightUnit(CustomerChangeLightUnitReqVO customerChangeLightUnitReqVO);
void updateCustomerSetup(CustomerSetupUpdateReqVO customerSetupUpdateReqVO);
/**
* @param areaCode 区号 eg: 86
* @param phone 电话 eg: 13233334444
......@@ -460,4 +467,7 @@ public interface CustomerService extends IService<CustomerDO> {
* @param isNew 新客户=true,老客户=false
*/
void updateCustomerNewOrOld(Long customerId, Boolean isNew);
void validateCustomerApproval(CustomerDO customerDO);
}
......@@ -7,6 +7,7 @@ import cn.iocoder.yudao.framework.mybatis.core.service.IService;
import cn.iocoder.yudao.module.customer.vo.customerApproval.*;
import cn.iocoder.yudao.module.customer.dal.dataobject.customerApproval.CustomerApprovalDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import org.apache.ibatis.annotations.Param;
/**
* 客户相关审核详情 Service 接口
......@@ -70,4 +71,12 @@ public interface CustomerApprovalService extends IService<CustomerApprovalDO> {
* @return
*/
CustomerApprovalDO getCustomerHandoverApprovalByCustomerId(Long customerId);
/**
* 通过客户id查询所有类型的审批中的审批记录
*
* @param customerId
* @return
*/
List<CustomerApprovalDO> selectInApprovalByCustomerId(Long customerId);
}
......@@ -71,4 +71,9 @@ public class CustomerApprovalServiceImpl extends AbstractService<CustomerApprova
public CustomerApprovalDO getCustomerHandoverApprovalByCustomerId(Long customerId) {
return customerApprovalMapper.getCustomerHandoverApprovalByCustomerId(customerId);
}
@Override
public List<CustomerApprovalDO> selectInApprovalByCustomerId(Long customerId) {
return customerApprovalMapper.selectInApprovalByCustomerId(customerId);
}
}
......@@ -12,7 +12,9 @@ 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.customerContacts.CustomerContactsDO;
import cn.iocoder.yudao.module.customer.dal.mysql.customer.CustomerMapper;
import cn.iocoder.yudao.module.customer.dal.mysql.customerContacts.CustomerContactsMapper;
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;
......@@ -49,6 +51,9 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu
@Resource
private CustomerMapper customerMapper;
@Resource
private CustomerContactsMapper customerContactsMapper;
/**
* 跟进单编号生成方式:GJ+年份+六位数字,按年份累计
* @return
......@@ -78,12 +83,16 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu
// 插入
CustomerFollowupDO followup = CustomerFollowupConvert.INSTANCE.convert(createReqVO);
// 设置联系人名称
setContactName(followup);
followupMapper.insert(followup);
Long customerId = createReqVO.getCustomerId();
if (customerId != null) {
CustomerDO customer = customerMapper.selectById(customerId);
if (customer == null) {
if (customer != null) {
// 插入日志
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
......@@ -108,6 +117,17 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu
return followup.getId();
}
private void setContactName(CustomerFollowupDO followup) {
// 设置联系人名称
Long contactId = followup.getContactId();
if (contactId != null) {
CustomerContactsDO customerContactsDO = customerContactsMapper.selectById(contactId);
if (customerContactsDO != null) {
followup.setContactName(I18nMessage.getLang() == 0 ? customerContactsDO.getName() : customerContactsDO.getNameEn());
}
}
}
@Override
public void updateFollowup(CustomerFollowupUpdateReqVO updateReqVO) {
// 校验存在
......@@ -121,12 +141,16 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu
}
// 更新
CustomerFollowupDO updateObj = CustomerFollowupConvert.INSTANCE.convert(updateReqVO);
// 设置联系人名称
setContactName(updateObj);
followupMapper.updateById(updateObj);
Long customerId = updateReqVO.getCustomerId();
if (customerId != null) {
CustomerDO customer = customerMapper.selectById(customerId);
if (customer == null) {
if (customer != null) {
// 插入日志
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
......@@ -169,7 +193,7 @@ public class CustomerFollowupServiceImpl extends AbstractService<CustomerFollowu
Long customerId = customerFollowupDO.getCustomerId();
if (customerId != null) {
CustomerDO customer = customerMapper.selectById(customerId);
if (customer == null) {
if (customer != null) {
// 插入日志
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
......
......@@ -9,7 +9,7 @@ import io.swagger.annotations.*;
@ToString(callSuper = true)
public class CustomerLineUpdateReqVO extends CustomerLineBaseVO {
@ApiModelProperty(value = "自增ID")
@ApiModelProperty(value = "自增ID 有id时需要填,没有时设空")
private Long id;
}
package cn.iocoder.yudao.module.customer.vo.customer.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import javax.validation.constraints.NotEmpty;
import java.util.List;
@ApiModel("管理后台 - 到仓确认切换 Request VO")
@Data
@EqualsAndHashCode
@ToString
public class CustomerChangeArrivalConfirmReqVO {
@ApiModelProperty(value = "客户ID列表", required = true)
@NotEmpty(message = "客户ID列表不能为空")
private List<Long> customerIdList;
/**
* 到仓确认
*/
@ApiModelProperty(value = "到仓确认", required = true)
private Integer arrivalConfirm;
}
package cn.iocoder.yudao.module.customer.vo.customer.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;
@ApiModel("管理后台 - 是否显示提单价格切换 Request VO")
@Data
@EqualsAndHashCode
@ToString
public class CustomerChangeIsShowTidanPriceReqVO {
@ApiModelProperty(value = "客户ID列表", required = true)
@NotEmpty(message = "客户ID列表不能为空")
private List<Long> customerIdList;
/**
* 是否显示提单价格
*/
@ApiModelProperty(value = "是否显示提单价格", required = true)
private Boolean isShowTidanPrice;
}
package cn.iocoder.yudao.module.customer.vo.customer.vo;
import cn.iocoder.yudao.module.customer.vo.customer.line.CustomerLineUpdateReqVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import java.math.BigDecimal;
import java.util.List;
@ApiModel("管理后台 - 泡货标准切换 Request VO")
@Data
@EqualsAndHashCode
@ToString
public class CustomerChangeLightUnitReqVO {
@ApiModelProperty(value = "客户ID列表", required = true)
@NotEmpty(message = "客户ID列表不能为空")
private List<Long> customerIdList;
/**
* 泡货标准(kg)
*/
@ApiModelProperty(value = "泡货标准(kg) 可以为空。当为空时线路会被删除", required = true)
private BigDecimal lightUnit;
/**
* 客户线路集合
*/
@ApiModelProperty(value = "客户线路集合", notes = "参见CustomerLineUpdateReqVO")
@Valid
private List<CustomerLineUpdateReqVO> customerLines;
}
package cn.iocoder.yudao.module.customer.vo.customer.vo;
import cn.iocoder.yudao.module.customer.vo.customer.line.CustomerLineUpdateReqVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import java.math.BigDecimal;
import java.util.List;
@ApiModel("管理后台 - 重货标准切换 Request VO")
@Data
@EqualsAndHashCode
@ToString
public class CustomerChangeWeightUnitReqVO {
@ApiModelProperty(value = "客户ID列表", required = true)
@NotEmpty(message = "客户ID列表不能为空")
private List<Long> customerIdList;
/**
* 重货标准(CBM)
*/
@ApiModelProperty(value = "重货标准 可以为空。 当为空时线路会被删除", required = true)
private BigDecimal weightUnit;
/**
* 客户线路集合
*/
@ApiModelProperty(value = "客户线路集合", notes = "参见CustomerLineUpdateReqVO")
@Valid
private List<CustomerLineUpdateReqVO> customerLines;
}
......@@ -14,9 +14,9 @@ public class CustomerMerge {
@ApiModelProperty(value = "被保留的客户id")
@NotNull(message = "被保留的客户id不能为空")
private Long id1;
private Long customerIdSaved;
@ApiModelProperty(value = "被删除的客户id")
@NotNull(message = "被删除的客户id不能为空")
private Long id2;
private Long customerIdDeleted;
}
package cn.iocoder.yudao.module.customer.vo.customer.vo;
import cn.iocoder.yudao.module.customer.vo.customer.customerContacts.CustomerContactsUpdateReqVO;
import cn.iocoder.yudao.module.customer.vo.customer.line.CustomerLineUpdateReqVO;
import cn.iocoder.yudao.module.customer.vo.customerBank.CustomerBankUpdateReqVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.hibernate.validator.constraints.Length;
import javax.validation.Valid;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@ApiModel("管理后台 - 客户设置更新 Request VO")
@Data
@ToString(callSuper = true)
public class CustomerSetupUpdateReqVO {
@ApiModelProperty(value = "客户ID 主键", required = true)
@NotNull(message = "客户ID不能为空")
private Long id;
/**
* 是否显示提单价格
*/
@ApiModelProperty(value = "是否显示提单价格")
private Boolean isShowTidanPrice;
/**
* 到仓确认
*/
@ApiModelProperty(value = "到仓确认")
private Integer arrivalConfirm;
/**
* 默认开票,1-是,0-否
*/
@ApiModelProperty(value = "默认开票,1-是,0-否")
private Boolean defaultBilling;
@ApiModelProperty(value = "是否默认付款")
private Boolean defaultPay;
@ApiModelProperty(value = "是否控货无收货人")
private Boolean noConsignee;
/**
* 重货标准(CBM)
*/
@ApiModelProperty(value = "重货标准")
private BigDecimal weightUnit;
/**
* 泡货标准(kg)
*/
@ApiModelProperty(value = "泡货标准(kg)")
private BigDecimal lightUnit;
/**
* 客户线路集合
*/
@ApiModelProperty(value = "客户线路集合", notes = "参见CustomerLineUpdateReqVO")
@Valid
private List<CustomerLineUpdateReqVO> customerLines;
}
......@@ -46,12 +46,14 @@ public class CustomerFollowupBackVO {
@ApiModelProperty(value = "客户编号")
private String customerNumber;
// 联系人id
@ApiModelProperty(value = "联系人id")
private Long contactId;
@ExcelProperty("联系人")
@ApiModelProperty(value = "联系人")
private String contactName;
//TODO 联系方式
@ApiModelProperty(value = "客户经理/跟进业务员id")
private Long followUserId;
@ExcelProperty("客户经理")
......@@ -95,6 +97,10 @@ public class CustomerFollowupBackVO {
private String parentNumber;
@ApiModelProperty(value = "上一级跟进单ID")
private String parentId;
@ExcelProperty(value = "提交状态", converter = DictConvert.class)
@DictFormat("customer_followup_status")
@ApiModelProperty(value = "状态 字典customer_followup_status")
......@@ -129,4 +135,10 @@ public class CustomerFollowupBackVO {
private String attatchment;
@ExcelProperty("联系人电话")
@ApiModelProperty(value = "联系人电话")
private String contactPhone;
}
......@@ -37,6 +37,10 @@ public class CustomerFollowupBaseVO {
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date followTime;
//联系人id
@ApiModelProperty(value = "联系人id")
private Long contactId;
@ApiModelProperty(value = "联系人")
private String contactName;
......
package cn.iocoder.yudao.module.customer.vo.customerFollowup;
import cn.iocoder.yudao.framework.excel.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.convert.DictConvert;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
......@@ -15,100 +17,114 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
* @author yanghao
*/
@Data
@ApiModel("管理后台 - 客户跟进 Response VO")
@ApiModel("管理后台 - 客户跟进Excel Response VO")
public class CustomerFollowupExcelVO {
@ExcelProperty("主键")
@ApiModelProperty(value = "主键", required = true)
private Long id;
@ExcelProperty("编号")
@ApiModelProperty(value = "编号")
private String number;
@ExcelProperty("上一级跟进单号")
@ApiModelProperty(value = "上一级跟进单号")
private String parentNumber;
@ExcelProperty(value = "跟进类型", converter = DictConvert.class)
@DictFormat("customer_followup_type")
@ApiModelProperty(value = "跟进类型 字典customer_followup_type")
private Integer followType;
@ExcelProperty("状态 字典customer_followup_status")
@ApiModelProperty(value = "状态 字典customer_followup_status")
private Integer status;
@ExcelProperty("客户编号")
@ApiModelProperty(value = "客户编号")
private Long customerId;
@ExcelProperty("报价单")
@ApiModelProperty(value = "报价单")
private Long offerId;
@ExcelProperty("跟进类型 字典customer_followup_type")
@ApiModelProperty(value = "跟进类型 字典customer_followup_type")
private Integer followType;
@ExcelProperty("报价单号")
@ApiModelProperty(value = "报价单编号")
private String offerNumber;
@ExcelProperty("跟进时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "跟进时间")
private Date followTime;
@ExcelProperty("客户编号")
@ApiModelProperty(value = "客户编号")
private String customerNumber;
@ExcelProperty("联系人")
@ApiModelProperty(value = "联系人")
private String contactName;
@ExcelProperty("跟进方式 字典customer_followup_method")
@ExcelProperty("联系人电话")
@ApiModelProperty(value = "联系人电话")
private String contactPhone;
@ExcelProperty("客户经理")
private String followUserName;
@ExcelProperty(value = "跟进方式", converter = DictConvert.class)
@DictFormat("customer_followup_method")
@ApiModelProperty(value = "跟进方式 字典customer_followup_method")
private Integer followMethod;
@ExcelProperty("客户经理/跟进业务员id")
@ApiModelProperty(value = "客户经理/跟进业务员id")
private Long followUserId;
@ExcelProperty("目的")
@ApiModelProperty(value = "目的")
private String purpose;
@ExcelProperty("跟进结果 字典customer_followup_result_type")
@ExcelProperty("跟进情况")
@ApiModelProperty(value = "客户反馈")
private String feedback;
@ExcelProperty(value = "跟进结果", converter = DictConvert.class)
@DictFormat("customer_followup_result_type")
@ApiModelProperty(value = "跟进结果 字典customer_followup_result_type")
private Integer resultType;
@ExcelProperty("客户反馈")
@ApiModelProperty(value = "客户反馈")
private String feedback;
@ExcelProperty("附件 多个以逗号分隔")
@ApiModelProperty(value = "附件 多个以逗号分隔")
private String attatchment;
@ExcelProperty("下次跟进时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "下次跟进时间")
private Date nextTime;
@ExcelProperty("关联跟进纪录")
@ApiModelProperty(value = "上一级跟进单号")
private String parentNumber;
@ExcelProperty("下次跟进计划")
@ApiModelProperty(value = "下次跟进计划")
private String nextPlan;
@ExcelProperty(value = "提交状态", converter = DictConvert.class)
@DictFormat("customer_followup_status")
@ApiModelProperty(value = "状态 字典customer_followup_status")
private Integer status;
//creator_name
@ExcelProperty("创建人")
@ApiModelProperty(value = "创建人名称")
private String creatorName;
@ExcelProperty("创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "创建时间", required = true)
private Date createTime;
@ExcelProperty("更新时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "更新时间")
private Date updateTime;
@ApiModelProperty(value = "客户编号")
private String customerNumber;
@ApiModelProperty(value = "报价单编号")
private String offerNumber;
//creator_name
@ApiModelProperty(value = "创建人名称")
private String creatorName;
// updater_name
@ExcelProperty("最后更新人")
@ApiModelProperty(value = "更新人名称")
private String updaterName;
@ExcelProperty("最后更新时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "更新时间")
private Date updateTime;
}
......@@ -41,6 +41,10 @@ public class CustomerFollowupQueryVO extends PageParam {
@ApiModelProperty(value = "结束跟进时间")
private Date endFollowTime;
//联系人id
@ApiModelProperty(value = "联系人id")
private Long contactId;
@ApiModelProperty(value = "联系人")
private String contactName;
......
......@@ -27,6 +27,10 @@
<if test="query.followType != null">
AND a.follow_type = #{query.followType}
</if>
<if test="query.followMethod != null">
AND a.follow_method = #{query.followMethod}
</if>
<if test="query.followUserId != null">
AND a.follow_user_id = #{query.followUserId}
</if>
......@@ -40,13 +44,15 @@
select a.*, b.number as customer_number, c.number as offer_number,
d.nickname as creator_name, e.nickname as updater_name,
f.nickname as follow_user_name
f.nickname as follow_user_name,
concat('+', g.area_code, g.phone_new) as contact_phone
from ecw_customer_followup a
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 system_user d on a.creator = d.id
left join system_user e on a.updater = e.id
left join system_user f on a.follow_user_id = f.id
left join ecw_customer_contacts g on a.contact_id = g.id
WHERE 1=1 AND a.deleted = 0
......
......@@ -645,6 +645,14 @@
</foreach>
</if>
<!--常用提货点-->
<if test="query.pickupPoints != null and query.pickupPoints.size()>0">
AND
<foreach item='item' index="index" collection='query.pickupPoints' open='(' separator='or' close=')'>
FIND_IN_SET(#{item}, contact.pickup_points)
</foreach>
</if>
<!--创建人-->
<if test="query.founder != null">
AND contact.founder = #{query.founder}
......@@ -683,7 +691,7 @@
AND contact.num_yearly <![CDATA[ <= ]]> #{query.leNumYearly}
</if>
<if test="query.eqNumYearly != null">
AND contact.num_yearly = #{query.leNumYearly}
AND contact.num_yearly = #{query.eqNumYearly}
</if>
......
......@@ -14,6 +14,13 @@ Content-Type: application/json
### 合并客户
GET {{baseUrl}}/ecw/customer/mergeCus?customerIdSaved=52009&customerIdDeleted=51966
Authorization: Bearer {{token}}
tenant-id: {{adminTenentId}}
Content-Type: application/json
### create
POST {{baseUrl}}/ecw/customer/handover/approval
Authorization: Bearer {{token}}
......@@ -40,6 +47,31 @@ Content-Type: application/json
{"inquiry":null,"id":"38155","number":"SGP00004","name":"yh2345","nameEn":null,"level":1,"country":194,"type":"0,1","transportType":"1","agentId":null,"company":"","companyEn":null,"payerName":null,"address":null,"productType":null,"productId":null,"pickupPoint":null,"memberId":null,"birthday":null,"balance":null,"source":5,"picture":null,"customerService":null,"customerContacts":[{"customerId":38155,"department":"","position":"","name":"yh12345","nameEn":"","social":null,"socialNumber":"","email":"","isDefault":1,"userid":null,"username":null,"areaCode":"65","phoneNew":"66666666","createTime":1692929203000,"id":69056,"customerContactsId":69056,"customerName":null,"company":""}],"customerLines":[],"lightUnit":null,"promoter":null,"status":1,"founder":118,"department":null,"invoiceTitle":null,"licenseNumber":null,"bank":null,"bankNumber":null,"project":null,"billingAddress":null,"billingTell":null,"taxRate":0,"remarks":null,"arrivalConfirm":0,"weightUnit":null,"createTime":1692924735000,"isShowTidanPrice":true,"carName":null,"carNo":null,"customerBanks":[],"creditLevel":3,"vipLevelScore":1,"vipLevelNameZh":"普通","vipLevelNameEn":"common","creditLevelScore":400,"creditLevelNameZh":"信用良好","creditLevelNameEn":"good credit","customerServiceName":null,"consigneeFirstCustomerService":null,"isNew":true,"resourceType":1,"isInOpenSea":false,"enterOpenSeaTime":null,"estimateEnterOpenSeaTime":null,"catchTime":null,"promoterName":null,"enquiryInfo":null,"isCustomerServiceConfirmed":false,"isWebOrderConsigneeSync":false,"isPotential":false,"founderName":"yanghao","customerBankBackVOList":[],"countryNameZh":"新加坡","countryNameEn":"Singapore","productTypeNameZh":null,"productTypeNameEn":null,"productNameZh":null,"productNameEn":null,"pickupPointNameZh":null,"pickupPointNameEn":null}
### update
PUT {{baseUrl}}/ecw/customer/update-customer-setup
Authorization: Bearer {{token}}
tenant-id: {{adminTenentId}}
Content-Type: application/json
{
"customerIdList": [51966],
"arrivalConfirm": 1,
"customerLines": [
{
"objectiveIds": "2,4",
"departureId": 1,
"zhongPaoType": 1
}
],
"defaultBilling": true,
"defaultPay": true,
"isShowTidanPrice": true,
"lightUnit": "13"
}
### page
GET {{baseUrl}}/ecw/customer/page?pageNo=1&pageSize=10&customerService[0]=1144&customerService[1]=2659&beginEnterOpenSeaTime=2024-10-02%2000%3A00%3A00&endEnterOpenSeaTime=2024-10-05%2000%3A00%3A00
Authorization: Bearer {{token}}
......
### 客户跟进
GET {{baseUrl}}/customer/followup/page?pageNo=1&pageSize=10&total=0&customerId=51966
Authorization: Bearer {{token}}
tenant-id: {{adminTenentId}}
Content-Type: application/json
\ No newline at end of file
......@@ -86,6 +86,8 @@ public interface WarehouseLineMapper extends BaseMapperX<WarehouseLineDO> {
"ew_dest.qianzhui as dest_qianzhui,",
"ew_dest_country.title_zh as dest_country_title_zh,",
"ew_dest_country.title_en as dest_country_title_en,",
"ew_dest_city.title_zh as dest_city_title_zh,",
"ew_dest_city.title_en as dest_city_title_en,",
"ew_dest.volume as dest_volume,",
"ew_dest.rent_free_days as dest_rent_free_days,",
"ew_dest.lock_recipient_days as dest_lock_recipient_days,",
......@@ -103,6 +105,8 @@ public interface WarehouseLineMapper extends BaseMapperX<WarehouseLineDO> {
"ON ewl.dest_warehouse_id = ew_dest.id",
"JOIN ecw_region ew_dest_country",
"ON ew_dest_country.id = ew_dest.guojia",
"JOIN ecw_region ew_dest_city",
"ON ew_dest_city.id = ew_dest.shi",
"WHERE ",
" ewl.id = #{lineId}"
})
......
......@@ -154,9 +154,9 @@ public interface WarehouseMapper extends BaseMapperX<WarehouseDO> {
"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>",
"<if test= 'tradeType != null'>",
"AND w.`trade_type` =#{tradeType}",
"</if>",
"</script>"
})
List<WarehouseTreeVO> getWarehouseTreeList(@Param("tradeType") Integer tradeType);
......@@ -172,7 +172,7 @@ public interface WarehouseMapper extends BaseMapperX<WarehouseDO> {
"ON w.guojia = r1.id ",
"LEFT JOIN ecw_region r2 ",
"ON w.shi = r2.id ",
"WHERE w.deleted = 0 AND w.`status` =0 AND trade_type =1 ",
"WHERE w.deleted = 0 AND w.`status` =0 AND w.`trade_type` =1 ",
"<when test = 'type == 1'>",
"GROUP BY r1.title_zh",
"</when>",
......
......@@ -32,6 +32,12 @@ public class LogisticsInfoDto {
@ApiModelProperty(value = "始发地国家英文名称")
private String startCountryTitleEn;
// @ApiModelProperty(value = "始发地城市中文名称")
// private String startCityTitleZh;
//
// @ApiModelProperty(value = "始发地城市英文名称")
// private String startCityTitleEn;
@ApiModelProperty(value = "始发地仓库容量")
private String startVolume;
......@@ -76,6 +82,12 @@ public class LogisticsInfoDto {
@ApiModelProperty(value = "目的地国家英文名称")
private String destCountryTitleEn;
@ApiModelProperty(value = "目的地城市中文名称")
private String destCityTitleZh;
@ApiModelProperty(value = "目的地城市英文名称")
private String destCityTitleEn;
@ApiModelProperty(value = "目的地仓库容量")
private String destVolume;
......
......@@ -178,4 +178,5 @@ public interface WarehouseService {
List<WarehouseDO> getWarehouseListSimple(String title);
WarehouseListVO getGuojiaAndShiAndWarehouseList(Integer tradeType);
}
......@@ -29,6 +29,7 @@ import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.cache.annotation.Caching;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
......@@ -62,7 +63,10 @@ public class WarehouseServiceImpl implements WarehouseService {
private DictDataApi dictDataApi;
@Override
@CacheEvict(cacheNames = "jd:warehouse:tree", key = "'all'")
@Caching(evict = {
@CacheEvict(cacheNames = "jd:warehouse:tree", key = "#createReqVO.tradeType"),
@CacheEvict(cacheNames = "jd:warehouse:list", key = "#createReqVO.tradeType")
})
public Long createWarehouse(WarehouseCreateReqVO createReqVO) {
// 插入
WarehouseDO warehouse = WarehouseConvert.INSTANCE.convert(createReqVO);
......@@ -73,7 +77,11 @@ public class WarehouseServiceImpl implements WarehouseService {
@Override
@Transactional(rollbackFor = Exception.class)
@CacheEvict(cacheNames = "jd:warehouse:tree", key = "'all'")
@Caching(evict = {
@CacheEvict(cacheNames = "jd:warehouse:tree", key = "#updateReqVO.tradeType"),
@CacheEvict(cacheNames = "jd:warehouse:list", key = "#updateReqVO.tradeType")
})
public void updateWarehouse(WarehouseUpdateReqVO updateReqVO) {
Long id = updateReqVO.getId();
// 校验存在
......@@ -512,7 +520,7 @@ public class WarehouseServiceImpl implements WarehouseService {
}
@Override
@Cacheable(cacheNames = "jd:warehouse:tree", key = "'all'")
@Cacheable(cacheNames = "jd:warehouse:tree", key = "#tradeType")
public List<WarehouseTreeVO> getWarehouseTreeList(Integer tradeType) {
List<WarehouseTreeVO> list = warehouseMapper.getWarehouseTreeList(tradeType);
Map<Long, List<WarehouseTreeVO>> shiMap = list.stream()
......@@ -547,6 +555,44 @@ public class WarehouseServiceImpl implements WarehouseService {
return guojiaList;
}
@Override
@Cacheable(cacheNames = "jd:warehouse:list", key = "#tradeType")
public WarehouseListVO getGuojiaAndShiAndWarehouseList(Integer tradeType) {
WarehouseListVO vo = new WarehouseListVO();
List<WarehouseTreeVO> list = warehouseMapper.getWarehouseTreeList(tradeType);
vo.setWarehouseList(list);
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();
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);
}
vo.setShiList(shiVOList);
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();
WarehouseTreeVO warehouseTreeVO = shiWarehouseList.get(0);
v.setGuojiaNameEn(warehouseTreeVO.getGuojiaNameEn());
v.setGuojiaName(warehouseTreeVO.getGuojiaName());
guojiaList.add(v);
}
vo.setGuojiaList(guojiaList);
return vo;
}
@Override
public List<WarehouseTreeRegionVO> getWarehouseTreeRegionList(Integer tradeType) {
List<WarehouseTreeRegionVO> list = warehouseMapper.getWarehouseTreeRegionList(tradeType);
......
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 WarehouseListVO {
@ApiModelProperty("国家区域列表")
private List<WarehouseTreeVO> guojiaList;
@ApiModelProperty("城市区域列表")
private List<WarehouseTreeVO> shiList;
@ApiModelProperty("仓库列表")
private List<WarehouseTreeVO> warehouseList;
}
......@@ -107,6 +107,14 @@ public class WarehouseController {
return success(list);
}
@GetMapping("/getGuojiaAndShiAndWarehouseList")
@ApiOperation("获取仓库区域并行国家、城市、仓库列表")
@ApiImplicitParam(name = "tradeType", value = "进出口类型,1-进口,2-出口", required = false, example = "1", dataTypeClass = Integer.class)
public CommonResult<WarehouseListVO> getGuojiaAndShiAndWarehouseList(Integer tradeType){
WarehouseListVO warehouseListVO = warehouseService.getGuojiaAndShiAndWarehouseList(tradeType);
return success(warehouseListVO);
}
@GetMapping("/getRegionList")
public CommonResult<List<WarehouseTreeRegionVO>> getRegionList(
......
......@@ -184,6 +184,13 @@ public class AppWarehouseController {
return success(list);
}
@GetMapping("/getGuojiaAndShiAndWarehouseList")
@ApiOperation("获取仓库区域并行国家、城市、仓库列表")
@ApiImplicitParam(name = "tradeType", value = "进出口类型,1-进口,2-出口", required = false, example = "1", dataTypeClass = Integer.class)
public CommonResult<WarehouseListVO> getGuojiaAndShiAndWarehouseList(Integer tradeType){
WarehouseListVO warehouseListVO = warehouseService.getGuojiaAndShiAndWarehouseList(tradeType);
return success(warehouseListVO);
}
@GetMapping("/getRegionList")
......
......@@ -58,6 +58,20 @@ public enum CustomerOperateTypeEnum {
FOLLOWUP_UPDATE(26, "编辑跟进纪录"),
FOLLOWUP_COMMIT(27, "提交跟进纪录"),
CHANGE_IS_SHOW_TIDAN_PRICE(28, "设置是否显示提单价格"),
CHANGE_ARRIVAL_CONFIRM(29, "设置到仓确认"),
CHANGE_WEIGHT_UNIT(30, "设置重货标准"),
CHANGE_LIGHT_UNIT(31, "设置泡货标准"),
CUSTOMER_UPDATE_SETUP(32, "设置客户设置"),
CUSTOMER_MERGE(33, "客户合并"),
DELETE(100, "删除"),
......
......@@ -187,6 +187,8 @@ public interface ErrorCodeConstants {
ErrorCode CUSTOMER_MERGE_CUSTOMER_SERVICE_NOT_SAME = new ErrorCode(1004006042, "customer.merge.customer.service.not.same");
ErrorCode CUSTOMER_APPROVAL_IN_PROCESSING = new ErrorCode(1004006043, "customer.approval.in.processing");
}
......@@ -59,4 +59,6 @@ public class RegionBaseVO {
private String importCurrency4;
@ApiModelProperty(value = "应收额币种", required = false)
private String importCurrency5;
@ApiModelProperty(value = "区号", required = false)
private String areaCode;
}
package cn.iocoder.yudao.module.ecw.dal.dataobject.region;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
......@@ -93,4 +92,8 @@ public class RegionDO extends BaseDO {
* 进口国应收额币种
*/
private String importCurrency5;
/**
* 区号
*/
private String areaCode;
}
......@@ -21,4 +21,13 @@ public interface OrderApi {
* 根据订单id获取所有订单项
*/
List<OrderItemRespDTO> getOrderItemsByOrderId(Long orderId);
/**
* 合并订单
* @param customerIdSaved 保留客户id
* @param customerIdDeleted 删除客户id
* @return 是否合并成功
*/
boolean mergeOrder(Long customerIdSaved, Long customerIdDeleted);
}
......@@ -3,33 +3,41 @@ package cn.iocoder.yudao.module.order.api;
import cn.hutool.core.collection.CollectionUtil;
import cn.iocoder.boot.module.order.api.OrderApi;
import cn.iocoder.boot.module.order.api.dto.*;
import cn.iocoder.yudao.module.order.convert.orderConsignor.OrderConsignorConvert;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.customer.dal.dataobject.customer.CustomerDO;
import cn.iocoder.yudao.module.customer.service.customer.CustomerService;
import cn.iocoder.yudao.module.order.dal.dataobject.order.OrderDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderConsignee.OrderConsigneeDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderConsignor.OrderConsignorDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderItem.OrderItemDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderObjective.OrderObjectiveDO;
import cn.iocoder.yudao.module.order.service.order.OrderConsigneeService;
import cn.iocoder.yudao.module.order.service.order.OrderConsignorService;
import cn.iocoder.yudao.module.order.service.order.OrderObjectiveService;
import cn.iocoder.yudao.module.order.service.order.OrderService;
import cn.iocoder.yudao.module.order.service.order.*;
import cn.iocoder.yudao.module.order.service.order.impl.OrderItemServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.google.common.base.Joiner;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.module.order.enums.ErrorCodeConstants.ORDER_IS_APPROVAL_IN_PROCESS_WITH_ORDERNOS;
@Service
@Validated
public class OrderApiImpl implements OrderApi {
@Resource
private OrderService orderService;
@Resource
private OrderBusinessService orderBusinessService;
@Resource
private CustomerService customerService;
@Resource
private OrderObjectiveService objectiveService;
@Resource
private OrderConsigneeService orderConsigneeService;
......@@ -92,4 +100,65 @@ public class OrderApiImpl implements OrderApi {
}
return null;
}
@Override
public boolean mergeOrder(Long customerIdSaved, Long customerIdDeleted) {
CustomerDO customerDeleted = customerService.getById(customerIdDeleted);
CustomerDO customerSaved = customerService.getById(customerIdSaved);
// 将customerId=customerIdDeleted的订单的customerId更新为customerIdSaved
List<OrderDO> list = orderService.selectList(new LambdaQueryWrapperX<OrderDO>().eq(OrderDO::getCustomerId, customerIdDeleted));
if (CollectionUtil.isNotEmpty(list)) {
// 订单有审核中,则不允许合并
List<String> auditingOrderNoList = list.stream().filter(t -> t.getAuditType() != 0).map(OrderDO::getOrderNo).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(auditingOrderNoList)) {
throw exception(ORDER_IS_APPROVAL_IN_PROCESS_WITH_ORDERNOS, Joiner.on(",").join(auditingOrderNoList));
}
for (OrderDO order : list) {
order.setCustomerId(customerIdSaved);
order.setUpdateTime(new Date());
orderService.updateById(order);
// 保存操作日志
orderBusinessService.addOrderOperateLog(order.getOrderId(), "合并客户-归属人",
String.format("将此订单的客户由【%d-%s-%s】合并为【%d-%s-%s】", customerDeleted.getId(), customerDeleted.getNumber(), customerDeleted.getName(),
customerSaved.getId(), customerSaved.getNumber(), customerSaved.getName()));
}
}
// 修改收货人
List<OrderConsigneeDO> orderConsigneeDOList = orderConsigneeService.selectList(new LambdaQueryWrapperX<OrderConsigneeDO>().eq(OrderConsigneeDO::getCustomerId, customerIdDeleted));
if (CollectionUtil.isNotEmpty(orderConsigneeDOList)) {
for (OrderConsigneeDO orderConsigneeDO : orderConsigneeDOList) {
orderConsigneeDO.setCustomerId(customerIdSaved);
orderConsigneeDO.setCustomerNumber(customerSaved.getNumber());
orderConsigneeService.updateById(orderConsigneeDO);
// 保存操作日志
orderBusinessService.addOrderOperateLog(orderConsigneeDO.getOrderId(), "合并客户-收货人",
String.format("将此订单的收货人客户由【%d-%s-%s】合并为【%d-%s-%s】", customerDeleted.getId(), customerDeleted.getNumber(), customerDeleted.getName(),
customerSaved.getId(), customerSaved.getNumber(), customerSaved.getName()));
}
}
// 修改发货人
List<OrderConsignorDO> orderConsignorDOList = orderConsignorService.selectList(new LambdaQueryWrapperX<OrderConsignorDO>().eq(OrderConsignorDO::getCustomerId, customerIdDeleted));
if (CollectionUtil.isNotEmpty(orderConsignorDOList)) {
for (OrderConsignorDO orderConsignorDO : orderConsignorDOList) {
orderConsignorDO.setCustomerId(customerIdSaved);
orderConsignorDO.setCustomerNumber(customerSaved.getNumber());
orderConsignorService.updateById(orderConsignorDO);
// 保存操作日志
orderBusinessService.addOrderOperateLog(orderConsignorDO.getOrderId(), "合并客户-发货人",
String.format("将此订单的发货人客户由【%d-%s-%s】合并为【%d-%s-%s】", customerDeleted.getId(), customerDeleted.getNumber(), customerDeleted.getName(),
customerSaved.getId(), customerSaved.getNumber(), customerSaved.getName()));
}
}
return false;
}
}
......@@ -406,6 +406,20 @@ public class OrderDO extends BaseDO {
@ApiModelProperty(value = "送货时间")
private Date deliveryDate;
@ApiModelProperty(value = "收货方式:1 自提 2 送货上门 ")
private Integer harvestMethod;
@ApiModelProperty(value = "收货地址的国家")
private Long country;
@ApiModelProperty(value = "收货地址的省")
private Long province;
@ApiModelProperty(value = "收货地址的市")
private Long city;
@ApiModelProperty(value = "收货地址")
private String consigneeAddress;
/**
* 入仓时间
*/
......@@ -537,12 +551,18 @@ public class OrderDO extends BaseDO {
@ApiModelProperty(value = "提货状态:0 未提货 1 部分提货 2 已提货")
private Integer pickState;
@ApiModelProperty(value = "'提货率'")
@ApiModelProperty(value = "提货率")
private BigDecimal pickRatio;
@ApiModelProperty(value = "'提货箱数'")
@ApiModelProperty(value = "提货箱数")
private Integer pickNum;
@ApiModelProperty(value = "放货率")
private BigDecimal releaseRatio;
@ApiModelProperty(value = "放货箱数")
private Integer releaseNum;
@TableField(exist = false)
@ApiModelProperty(value = "订单商品项列表")
@NotNull(message = "订单商品项列表不能为空")
......
......@@ -84,6 +84,7 @@ public interface OrderCargoControlMapper extends AbstractMapper<OrderCargoContro
"o.parent_number, ",
"o.container_number, ",
"o.marks, ",
"o.type, ",
"o.`status`, ",
"o.abnormal_state, ",
"o.in_warehouse_state, ",
......
......@@ -5,8 +5,6 @@ import cn.iocoder.yudao.framework.mybatis.core.mapper.AbstractMapper;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQuery;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderException.OrderExceptionDO;
import cn.iocoder.yudao.module.order.vo.order.OrderBackPageVO;
import cn.iocoder.yudao.module.order.vo.order.OrderQueryVO;
import cn.iocoder.yudao.module.order.vo.order.StatisticsOrderVO;
import cn.iocoder.yudao.module.order.vo.orderException.OrderBackVO;
import cn.iocoder.yudao.module.order.vo.orderException.OrderExceptionBackVO;
......@@ -17,7 +15,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;
import java.util.List;
......@@ -40,7 +37,7 @@ public interface OrderExceptionMapper extends AbstractMapper<OrderExceptionDO> {
//.eqIfPresent(OrderExceptionDO::getOrderExceptionRemark, vo.getOrderExceptionRemark())
//.eqIfPresent(OrderExceptionDO::getOrderExceptionAmount, vo.getOrderExceptionAmount())
//.eqIfPresent(OrderExceptionDO::getOrderExceptionAttr, vo.getOrderExceptionAttr())
.eqIfPresent(OrderExceptionDO::getOrderExceptionStatus, vo.getOrderExceptionStatus())
.eqIfPresent(OrderExceptionDO::getOrderExceptionStatus, vo.getOrderExceptionStatusList())
.betweenIfPresent(OrderExceptionDO::getCreateTime, vo.getBeginCreateTime(), vo.getEndCreateTime())
.orderByDesc(OrderExceptionDO::getId));
}
......@@ -56,7 +53,7 @@ public interface OrderExceptionMapper extends AbstractMapper<OrderExceptionDO> {
.eqIfPresent(OrderExceptionDO::getOrderId, vo.getOrderId())
//.eqIfPresent(OrderExceptionDO::getOrderNumber, vo.getOrderNumber())
.eqIfPresent(OrderExceptionDO::getOrderExceptionType, vo.getOrderExceptionType())
.eqIfPresent(OrderExceptionDO::getOrderExceptionStatus, vo.getOrderExceptionStatus())
.eqIfPresent(OrderExceptionDO::getOrderExceptionStatus, vo.getOrderExceptionStatusList())
.betweenIfPresent(OrderExceptionDO::getCreateTime, vo.getBeginCreateTime(), vo.getEndCreateTime())
.orderByDesc(OrderExceptionDO::getId));
}
......
......@@ -417,6 +417,8 @@ public class OrderBackInfoDto {
* 入仓时间
*/
@ApiModelProperty(value = "入仓时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private Date rucangTime;
@DateTimeFormat(pattern = "yyyy-MM-dd")
......@@ -424,9 +426,12 @@ public class OrderBackInfoDto {
@ApiModelProperty(value = "送货时间")
private Date deliveryDate;
@ApiModelProperty(value = "收方式:1 自提 2 送货上门 ")
@ApiModelProperty(value = "收方式:1 自提 2 送货上门 ")
private Integer harvestMethod;
@ApiModelProperty(value = "收货地址")
private String consigneeAddress;
@ApiModelProperty(value = "收货地址的国家")
private Long country;
......@@ -436,10 +441,8 @@ public class OrderBackInfoDto {
@ApiModelProperty(value = "收货地址的市")
private Long city;
@ApiModelProperty(value = "收货地址")
private String consigneeAddress;
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
@ApiModelProperty(value = "创建时间")
private Date createTime;
......@@ -539,6 +542,13 @@ public class OrderBackInfoDto {
@ApiModelProperty(value = "'提货箱数'")
private Integer pickNum;
@ApiModelProperty(value = "放货率")
private BigDecimal releaseRatio;
@ApiModelProperty(value = "放货箱数")
private Integer releaseNum;
public void setExceptionReason(String exceptionReason) {
this.exceptionReason = exceptionReason;
if (StringUtils.isNotBlank(exceptionReason) && Objects.nonNull(this.lang)) {
......
......@@ -33,6 +33,10 @@ public class OrderCargoControlReleaseInfoDto {
@ApiModelProperty(value = "唛头")
private String marks;
@ApiModelProperty(value = "增值服务(多个使用','连接):1 集运服务 2 海外仓")
private String type;
@ApiModelProperty(value = "货柜自编号")
private String containerNumber;
......
......@@ -152,7 +152,6 @@ public interface ErrorCodeConstants {
ErrorCode YOUR_CUSTOMER_INFO_IS_INCOMPLETE = new ErrorCode(1004020105, "your.customer.information.is.incomplete");
ErrorCode ORDER_IS_APPROVAL_IN_PROCESS = new ErrorCode(1004020106, "order.is.approval.in.process");
ErrorCode MODIFY_APPROVAL_NOT_UPDATE_OR_DELETE_WAREHOUSE_IN = new ErrorCode(1004020107, "modify.approval.not.update.warehouse.in");
ErrorCode WAREHOUSE_IN_ITEM_EXPRESS_NO_LIMIT = new ErrorCode(1004020108, "warehouse.in.item.expressno.limit");
......@@ -404,4 +403,26 @@ public interface ErrorCodeConstants {
ErrorCode ORDER_CARGO_CONTROL_LIMIT_UPDATE_CONSIGNEE_INFO = new ErrorCode(1004001156, "order.cargo.control.limit.update.consignee.info");
ErrorCode ORDER_CARGO_CONTROL_CONSIGNEE_LIMIT_UPDATE_APPLYING = new ErrorCode(1004001157, "order.cargo.control.consignee.limit.update.applying");
ErrorCode ORDER_CARGO_CONTROL_OVERSEAS_WAREHOUSE_UPDATE_APPLYING = new ErrorCode(1004001158, "order.cargo.control.overseas.warehouse.update.applying");
ErrorCode ORDER_EXISTS_PICKUP_NOT_CARGO_CONTROL = new ErrorCode(1004001159, "order.exists.pickup.not.cargo.control");
ErrorCode ORDER_EXISTS_PICK_NOT_CANCEL_CARGO_CONTROL = new ErrorCode(1004001160, "order.exists.pick.not.cancel.cargo.control");
ErrorCode ORDER_OVERSEAS_WAREHOUSE_UPDATE_NEED_APPLY = new ErrorCode(1004001161, "order.overseas.warehouse.update.need.applying");
ErrorCode NOT_UPDATE_DEST_COUNTRY = new ErrorCode(1004001162, "order.not.update.dest.country");
ErrorCode NOT_UPDATE_DEPARTURE = new ErrorCode(1004001163, "order.not.update.departure");
ErrorCode NOT_UPDATE_TRANSPORT = new ErrorCode(1004001164, "order.not.update.transport");
ErrorCode ORDER_PRE_INSTALLATION_UNPACKAGED_CONTAINER_NOT_UPDATE = new ErrorCode(1004001165, "order.pre.installation.unpackaged.container.not.update");
// /空运订单分拣未出货, 锁定订单信息无法修改
ErrorCode ORDER_SORTING_NOT_SHIPMENT_NOT_UPDATE = new ErrorCode(1004001166, "order.sorting.not.shipment.not.update");
ErrorCode ORDER_IS_APPROVAL_IN_PROCESS_WITH_ORDERNOS = new ErrorCode(1004001167, "order.is.approval.in.process.with.ordernos");
// 请选择订单海外仓修改是或否
ErrorCode ORDER_OVERSEAS_WAREHOUSE_UPDATE_IS_OR_NO = new ErrorCode(1004001168, "order.overseas.warehouse.update.is.or.no");
// 该订单已经是海外仓订单
ErrorCode ORDER_IS_OVERSEAS_WAREHOUSE_ORDER = new ErrorCode(1004001169, "order.is.overseas.warehouse.order");
// 该订单已经是非海外仓订单
ErrorCode ORDER_NOT_IS_OVERSEAS_WAREHOUSE_ORDER = new ErrorCode(1004001170, "order.not.is.overseas.warehouse.order");
}
......@@ -9,11 +9,9 @@ public enum PickStateEnum {
unpick(0,"待提货"),
picking(1,"提货中"),
partPick(1,"部分提货"),
partPick(2,"部分提货"),
picked(3,"已提货");
picked(2,"已提货");
private Integer pickState;
......
......@@ -41,19 +41,27 @@ public interface OrderService extends IService<OrderDO> {
OrderDO createOrder(OrderCreateReqVO createReqVO, MemberUserDO memberUserDO);
/**
* 更新订单
* 更新编辑下单或草稿订单
*
* @param updateReqVO 更新信息
*/
void updateOrder(@Valid OrderUpdateReqVO updateReqVO, MemberUserDO memberUserDO);
/**
* 更新订单
* 更新入仓订单
*
* @param updateReqVO 更新信息
* @param memberUserDO 会员信息
*/
void updateOrderApply(@Valid OrderUpdateReqVO updateReqVO, MemberUserDO memberUserDO);
/**
* 更新出货订单
*
* @param updateReqVO 更新信息
*/
void shipmentOrderApplyUpdate(@Valid OrderUpdateReqVO updateReqVO, MemberUserDO memberUserDO);
/**
* 订单入仓
......
......@@ -1891,6 +1891,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
private void updateConsignorAndConsignee(OrderConsignorDO orderConsignorDO, OrderConsigneeDO
orderConsigneeDO, OrderDO orderDO, List<String> bugList) {
orderDO.setHasConsignee(Objects.nonNull(orderConsigneeDO));
boolean flag = false;
CustomerDO consignorDO = null;
CustomerDO consigneeDO = null;
......@@ -2056,7 +2057,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
}
}
OrderAssociationOfferInfoEvent event = new OrderAssociationOfferInfoEvent(orderDO.getOrderId(), null);
OrderAssociationOfferInfoEvent event = new OrderAssociationOfferInfoEvent(orderDO.getOrderId(), null, null);
applicationContext.publishEvent(event);
checkOrderSalesman(orderDO, event.getOfferId(), consignorDO, consigneeDO, orderConsignorDO, orderConsigneeDO);
......@@ -2112,7 +2113,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
// 海外仓归属发货人
order.setCustomerId(orderConsignorDO.getCustomerId());
} else {
if (consignorDO != null && !consignorDO.getNoConsignee() && !order.getHasConsignee()) {//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
if (consignorDO != null && consignorDO.getNoConsignee() && !order.getHasConsignee()) {//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
order.setCustomerId(orderConsignorDO.getCustomerId());
} else {
if (order.getDrawee() == 1) {//发货人付款
......
......@@ -518,8 +518,16 @@ public class OrderCargoControlServiceImpl extends AbstractService<OrderCargoCont
} else if (orderApprovalDO.getType() == 62) {
msg = result == 4 ? "海外仓修改申请取消" : "海外仓修改申请拒绝";
ApplyInfoVO applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName("订单修改为海外仓模式");
applyInfoVO.setName("订单修改海外仓模式");
applyInfoVO.setOrgValue(applyVO.getOrgIsOverseasWarehouse() ? "订单修改为海外仓" : "订单修改为非海外仓");
applyInfoVO.setNewValue(applyVO.getNewIsOverseasWarehouse() ? "订单修改为海外仓" : "订单修改为非海外仓");
list.add(applyInfoVO);
if (StringUtils.isNotBlank(applyVO.getReasonZh())) {
applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName("订单修改海外仓模式理由");
applyInfoVO.setNewValue(applyVO.getReasonZh());
list.add(applyInfoVO);
}
}
}
if (result == 2) {
......@@ -553,10 +561,26 @@ public class OrderCargoControlServiceImpl extends AbstractService<OrderCargoCont
}
} else if (orderApprovalDO.getType() == 62) {
// TODO 海外仓修改申请
String type = orderDO.getType();
if (StringUtils.isNotBlank(type)) {
type = applyVO.getNewIsOverseasWarehouse() ? type.concat(",2") : Arrays.stream(type.split(",")).filter(s -> !StringUtils.equals("2", s)).collect(Collectors.joining(","));
} else {
type = "2";
}
// TODO 修改订单海外仓模式, 不确定对订单其他方面是否有影响,订单编号生成规则与海外仓无关联
orderService.update(new LambdaUpdateWrapper<OrderDO>().set(OrderDO::getType, type).eq(OrderDO::getOrderId, orderApprovalDO.getOrderId()));
msg = "海外仓修改申请审批通过";
ApplyInfoVO applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName("订单修改为海外仓模式");
applyInfoVO.setName("订单修改海外仓模式");
applyInfoVO.setOrgValue(applyVO.getOrgIsOverseasWarehouse() ? "订单修改为海外仓" : "订单修改为非海外仓");
applyInfoVO.setNewValue(applyVO.getNewIsOverseasWarehouse() ? "订单修改为海外仓" : "订单修改为非海外仓");
list.add(applyInfoVO);
if (StringUtils.isNotBlank(applyVO.getReasonZh())) {
applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName("订单修改海外仓模式理由");
applyInfoVO.setNewValue(applyVO.getReasonZh());
list.add(applyInfoVO);
}
}
}
orderApprovalMapper.updateById(orderApprovalDO);
......@@ -589,6 +613,8 @@ public class OrderCargoControlServiceImpl extends AbstractService<OrderCargoCont
OrderCargoControlApplyVO orderCargoControlApplyVO = new OrderCargoControlApplyVO();
BeanUtils.copyProperties(releaseInfoDto, orderCargoControlApplyVO);
orderCargoControlApplyVO.setApplyStatus(0);
orderCargoControlApplyVO.setOrderType(releaseInfoDto.getType());
orderCargoControlApplyVO.setOrgIsOverseasWarehouse(StringUtils.isNotBlank(releaseInfoDto.getType()) && releaseInfoDto.getType().contains("2"));
return orderCargoControlApplyVO;
} else {
OrderCargoControlApplyVO applyVO = JSONObject.parseObject(orderApprovalDO.getDetails(), OrderCargoControlApplyVO.class);
......@@ -612,7 +638,7 @@ public class OrderCargoControlServiceImpl extends AbstractService<OrderCargoCont
OrderDO orderDO = orderService.getById(orderCargoControlApplyVO.getOrderId());
// TODO 待确认具体拦截哪些审批任务
int count = orderApprovalMapper.processingItemApproval(null, orderCargoControlApplyVO.getOrderId(), Arrays.asList(orderCargoControlApplyVO.getApplyType(), 14));
if (count > 0){
if (count > 0) {
throw exception(ORDER_IS_APPROVAL_IN_PROCESS);
}
OrderCargoControlReleaseInfoDto releaseInfoDto = this.getOrderCargoControlReleaseInfo(orderCargoControlApplyVO.getOrderId());
......@@ -672,6 +698,15 @@ public class OrderCargoControlServiceImpl extends AbstractService<OrderCargoCont
list.add(applyInfoVO);
}
} else if (orderCargoControlApplyVO.getApplyType() == 62) {
if (Objects.isNull(orderCargoControlApplyVO.getNewIsOverseasWarehouse())) {
throw exception(ORDER_OVERSEAS_WAREHOUSE_UPDATE_IS_OR_NO);
}
if (StringUtils.isNotBlank(orderDO.getType()) && orderDO.getType().contains("2") && orderCargoControlApplyVO.getNewIsOverseasWarehouse()) {
throw exception(ORDER_IS_OVERSEAS_WAREHOUSE_ORDER);
}
if ((StringUtils.isBlank(orderDO.getType()) || !orderDO.getType().contains("2")) && !orderCargoControlApplyVO.getNewIsOverseasWarehouse()) {
throw exception(ORDER_NOT_IS_OVERSEAS_WAREHOUSE_ORDER);
}
orderApprovalDO.setOrderId(orderCargoControlApplyVO.getOrderId());
orderApprovalDO.setType(62);
orderApprovalDO.setDetails(JSONObject.toJSONString(orderCargoControlApplyVO));
......@@ -681,8 +716,16 @@ public class OrderCargoControlServiceImpl extends AbstractService<OrderCargoCont
orderApprovalDO.setFormId(formId);
msg = "海外仓修改申请";
ApplyInfoVO applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName("订单修改为海外仓模式");
applyInfoVO.setName("订单修改海外仓模式");
applyInfoVO.setOrgValue(orderCargoControlApplyVO.getOrgIsOverseasWarehouse() ? "订单修改为海外仓" : "订单修改为非海外仓");
applyInfoVO.setNewValue(orderCargoControlApplyVO.getNewIsOverseasWarehouse() ? "订单修改为海外仓" : "订单修改为非海外仓");
list.add(applyInfoVO);
if (StringUtils.isNotBlank(orderCargoControlApplyVO.getReasonZh())) {
applyInfoVO = new ApplyInfoVO();
applyInfoVO.setName("订单修改海外仓模式理由");
applyInfoVO.setNewValue(orderCargoControlApplyVO.getReasonZh());
list.add(applyInfoVO);
}
}
orderApprovalMapper.updateById(orderApprovalDO);
orderService.updateStatus(orderApprovalDO.getOrderId(), "", null, null, null, null, orderApprovalDO.getType(), OrderApprovalTypeResultEnum.typeAndResultOf(orderApprovalDO.getType(), 1).getDesc(), false);
......
......@@ -433,13 +433,11 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
queryWrapper.inIfPresent("e.order_exception_type", reqVo.getOrderExceptionType());
}
queryWrapper.eqIfPresent("tot.order_exception_status", reqVo.getOrderExceptionStatus());
queryWrapper.inIfPresent("tot.order_exception_status", reqVo.getOrderExceptionStatusList());
if (StringUtils.isNotBlank(reqVo.getConsignor())) {
queryWrapper.eq("r.customer_id", reqVo.getConsignor());
}
if (StringUtils.isNotBlank(reqVo.getProductRecord())) {
queryWrapper.eqIfPresent("o.product_record", reqVo.getProductRecord());
}
queryWrapper.eq(StrUtil.isNotBlank(reqVo.getSalesmanId()), "o.salesman_id", reqVo.getSalesmanId());
if (null != reqVo.getCustomerIds() && reqVo.getCustomerIds().size() > 0) {
......@@ -489,6 +487,14 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
//跟进客服
queryWrapper.in(null != reqVo.getSalesmanIds(), "su.customer_service_id", reqVo.getSalesmanIds());
//增值服务
queryWrapper.in(null != reqVo.getTypes(), "a.type", reqVo.getTypes());
//商品类型
queryWrapper.in(null != reqVo.getGoodsTypes(), "m.prod_type", reqVo.getGoodsTypes());
//备案
queryWrapper.in(null != reqVo.getProductRecord(), "o.product_record", reqVo.getProductRecord());
queryWrapper.orderByDesc("e.id");
return orderExceptionMapper.getOrderExceptionExcelList(queryWrapper, reqVo.getOrderExceptionType(), startTime, endTime);
......@@ -2528,13 +2534,10 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
queryWrapper.inIfPresent("eo.objective_country_id", reqVo.getDestCountryIds());
}
queryWrapper.eqIfPresent("s.order_exception_status", reqVo.getOrderExceptionStatus());
queryWrapper.inIfPresent("s.order_exception_status", reqVo.getOrderExceptionStatusList());
if (StringUtils.isNotBlank(reqVo.getConsignor())) {
queryWrapper.eq("oc.customer_id", reqVo.getConsignor());
}
if (StringUtils.isNotBlank(reqVo.getProductRecord())) {
queryWrapper.eqIfPresent("a.product_record", reqVo.getProductRecord());
}
//queryWrapper.eq(StrUtil.isNotBlank(reqVo.getSalesmanId()), "a.salesman_id", reqVo.getSalesmanId());
if (null != reqVo.getCustomerIds() && reqVo.getCustomerIds().size() > 0) {
......@@ -2593,6 +2596,12 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
//跟进客服
queryWrapper.in(null != reqVo.getSalesmanIds(), "su.customer_service_id", reqVo.getSalesmanIds());
//增值服务
queryWrapper.in(null != reqVo.getTypes(), "a.type", reqVo.getTypes());
//商品类型
queryWrapper.in(null != reqVo.getGoodsTypes(), "m.prod_type", reqVo.getGoodsTypes());
//备案
queryWrapper.in(null != reqVo.getProductRecord(), "a.product_record", reqVo.getProductRecord());
queryWrapper.orderByDesc("b.id");
......@@ -2655,13 +2664,10 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
queryWrapper.inIfPresent("eo.objective_country_id", reqVo.getDestCountryIds());
}
queryWrapper.eqIfPresent("s.order_exception_status", reqVo.getOrderExceptionStatus());
queryWrapper.inIfPresent("s.order_exception_status", reqVo.getOrderExceptionStatusList());
if (StringUtils.isNotBlank(reqVo.getConsignor())) {
queryWrapper.eq("oc.customer_id", reqVo.getConsignor());
}
if (StringUtils.isNotBlank(reqVo.getProductRecord())) {
queryWrapper.eqIfPresent("a.product_record", reqVo.getProductRecord());
}
//queryWrapper.eq(StrUtil.isNotBlank(reqVo.getSalesmanId()), "a.salesman_id", reqVo.getSalesmanId());
if (null != reqVo.getCustomerIds() && reqVo.getCustomerIds().size() > 0) {
......@@ -2712,6 +2718,14 @@ public class OrderExceptionServiceImpl extends AbstractService<OrderExceptionMap
//跟进客服
queryWrapper.in(null != reqVo.getSalesmanIds(), "su.customer_service_id", reqVo.getSalesmanIds());
//增值服务
queryWrapper.in(null != reqVo.getTypes(), "a.type", reqVo.getTypes());
//商品类型
queryWrapper.in(null != reqVo.getGoodsTypes(), "m.prod_type", reqVo.getGoodsTypes());
//备案
queryWrapper.in(null != reqVo.getProductRecord(), "a.product_record", reqVo.getProductRecord());
StatisticsOrderVO vo = orderExceptionMapper.statisticsExceptionOrder(queryWrapper, reqVo.getOrderExceptionType(), startTime, endTime);
if (Objects.nonNull(vo)) {
vo.setTotalVolume(new BigDecimal(vo.getTotalVolume()).setScale(2, RoundingMode.HALF_UP).toString());
......
......@@ -25,6 +25,7 @@ import cn.iocoder.yudao.module.order.dto.OrderBackInfoDto;
import cn.iocoder.yudao.module.order.enums.*;
import cn.iocoder.yudao.module.order.service.order.*;
import cn.iocoder.yudao.module.order.service.orderCargoControlPick.OrderCargoControlPickService;
import cn.iocoder.yudao.module.order.vo.orderConsignee.OrderConsigneeBackVO;
import cn.iocoder.yudao.module.order.vo.orderPickup.*;
import cn.iocoder.yudao.module.order.vo.orderTime.OrderTimeQueryVO;
import cn.iocoder.yudao.module.system.service.user.AdminUserService;
......@@ -622,8 +623,9 @@ public class OrderPickupServiceImpl extends AbstractService<OrderPickupMapper, O
Long aLong = orderPickupMapper.selectCount(OrderPickupDO::getOrderId, createReqVO.getOrderId());
OrderDO order = orderService.selectOne(OrderDO::getOrderNo, createReqVO.getOrderId());
OrderBackInfoDto orderDO = orderQueryService.info(order.getOrderId());
if (orderDO.getConsigneeVO().getHarvestMethod() == 2) {
OrderConsigneeBackVO consigneeVO = orderDO.getConsigneeVO();
Integer harvestMethod = consigneeVO == null ? orderDO.getHarvestMethod() : consigneeVO.getHarvestMethod();
if (Objects.isNull(harvestMethod) || harvestMethod == 2) {
if (StringUtils.isNotBlank(orderDO.getTidanNo())) {
errorOrderNo.add(orderDO.getOrderNo() + "(" + orderDO.getTidanNo() + ")");
} else {
......
......@@ -380,6 +380,13 @@ public class OrderBackPageVO {
@ApiModelProperty(value = "'提货箱数'")
private Integer pickNum;
@ApiModelProperty(value = "放货率")
private BigDecimal releaseRatio;
@ApiModelProperty(value = "放货箱数")
private Integer releaseNum;
/**
* 渠道名称
*/
......@@ -399,9 +406,6 @@ public class OrderBackPageVO {
@ApiModelProperty(value = "当前控货箱数")
private BigDecimal controlWeight;
@ApiModelProperty(value = "已放货箱数")
private Integer releaseNum;
@ApiModelProperty(value = "放货数量")
private Integer releaseQuantity;
......@@ -434,6 +438,10 @@ public class OrderBackPageVO {
*/
@ApiModelProperty(value = "报价单ID")
private Long offerId;
@ApiModelProperty(value = "报价单号")
private String offerNo;
/**
* 报价单状态
*/
......
......@@ -413,6 +413,9 @@ public class OrderBackVO {
@ApiModelProperty(value = "发货人信息")
private OrderConsignorBackVO consignorVO;
@ApiModelProperty(value = "收货方式:1 自提 2 送货上门 ")
private Integer harvestMethod;
@ApiModelProperty(value = "收货地址的国家")
private Long country;
......@@ -425,6 +428,7 @@ public class OrderBackVO {
@ApiModelProperty(value = "收货地址")
private String consigneeAddress;
@ApiModelProperty(value = "收货客户id", required = true)
@NotNull(message = "收货客户id不能为空")
private Long consigneeId;
......@@ -436,9 +440,6 @@ public class OrderBackVO {
@ApiModelProperty(value = "收货人信息")
private OrderConsigneeBackVO consigneeVO;
@ApiModelProperty(value = "收获方式:1 自提 2 送货上门 ")
private Integer harvestMethod;
@ApiModelProperty(value = "始发地id")
private Long departureId;
......@@ -640,6 +641,13 @@ public class OrderBackVO {
private Integer pickNum;
@ApiModelProperty(value = "放货率")
private BigDecimal releaseRatio;
@ApiModelProperty(value = "放货箱数")
private Integer releaseNum;
public void setExternalWarehouseJson(String externalWarehouseJson) {
this.externalWarehouseJson = externalWarehouseJson;
if (StringUtils.isNotBlank(externalWarehouseJson)) {
......
......@@ -282,6 +282,21 @@ public class OrderBaseVO {
// @NotNull(message = "送货时间不能为空")
private Date deliveryDate;
@ApiModelProperty(value = "收货方式:1 自提 2 送货上门 ")
private Integer harvestMethod;
@ApiModelProperty(value = "收货地址的国家")
private Long country;
@ApiModelProperty(value = "收货地址的省")
private Long province;
@ApiModelProperty(value = "收货地址的市")
private Long city;
@ApiModelProperty(value = "收货地址")
private String consigneeAddress;
@ApiModelProperty(value = "特需类型ids")
private String packageType;
......@@ -364,6 +379,13 @@ public class OrderBaseVO {
@ApiModelProperty(value = "'提货箱数'")
private Integer pickNum;
@ApiModelProperty(value = "放货率")
private BigDecimal releaseRatio;
@ApiModelProperty(value = "放货箱数")
private Integer releaseNum;
public void setExceptionReason(String exceptionReason) {
this.exceptionReason = StringUtils.isNotBlank(exceptionReason) ? I18nMessage.getMessage(exceptionReason) : exceptionReason;
}
......
......@@ -71,23 +71,8 @@ public class OrderCreateReqVO extends OrderBaseVO {
@ApiModelProperty(value = "收货客户联系人id")
private Long consigneeContactsId;
@ApiModelProperty(value = "国家")
private Long country;
@ApiModelProperty(value = "省")
private Long province;
@ApiModelProperty(value = "市")
private Long city;
@ApiModelProperty(value = "收货地址")
private String consigneeAddress;
@ApiModelProperty(value = "自定义付款人清单(name 详见字典 自定义付款人(custom_drawee), value 1 发货人 2 收货人)")
private List<CustomDraweeVO> customDraweeVOList;
@ApiModelProperty(value = "收获方式:1 自提 2 送货上门 ")
private Integer harvestMethod;
@ApiModelProperty(value = "优惠使用人")
private Long couponCustomerId;
......
......@@ -91,8 +91,6 @@ public class OrderUpdateReqVO extends OrderBaseVO {
@ApiModelProperty(value = "自定义付款人清单(name 详见字典 自定义付款人(custom_drawee), value 1 发货人 2 收货人)")
private List<CustomDraweeVO> customDraweeVOList;
@ApiModelProperty(value = "收获方式:1 自提 2 送货上门 ")
private Integer harvestMethod;
//
// @ApiModelProperty(value = "地址", required = true)
// private String address;
......@@ -109,19 +107,6 @@ public class OrderUpdateReqVO extends OrderBaseVO {
@ApiModelProperty(value = "收货人电话国家区号")
private String countryCode;
@ApiModelProperty(value = "国家")
private Long country;
@ApiModelProperty(value = "省")
private Long province;
@ApiModelProperty(value = "市")
private Long city;
@ApiModelProperty(value = "收货地址", required = true)
private String consigneeAddress;
@ApiModelProperty(value = "抄送人(id逗号拼接)")
private String ccIds;
......
......@@ -30,6 +30,9 @@ public class OrderCargoControlApplyVO {
@ApiModelProperty(value = "订单编号")
private String orderNo;
@ApiModelProperty(value = "增值服务(多个使用','连接):1 集运服务 2 海外仓")
private String orderType;
@ApiModelProperty(value = "提单号")
private String tidanNo;
......@@ -87,6 +90,13 @@ public class OrderCargoControlApplyVO {
private Integer newLockConsigneeDay;
@ApiModelProperty(value = "原值是否海外仓")
private Boolean orgIsOverseasWarehouse;
@ApiModelProperty(value = "新值是否海外仓")
private Boolean newIsOverseasWarehouse;
@ApiModelProperty(value = "附件")
private String annex;
......
......@@ -48,13 +48,13 @@ public class OrderExceptionQueryVO {
private List<String> orderExceptionType;
@ApiModelProperty(value = "异常状态")
private Integer orderExceptionStatus;
private List<Integer> orderExceptionStatusList;
@ApiModelProperty(value = "发货人")
private String consignor;
@ApiModelProperty(value = "备案")
private String productRecord;
/* @ApiModelProperty(value = "备案")
private String productRecord;*/
@ApiModelProperty(value = "1:入仓时间2:处理时间")
private String dateType;
......@@ -112,4 +112,13 @@ public class OrderExceptionQueryVO {
@ApiModelProperty(value = "目的城市")
private List<Long> objectiveIds;
@ApiModelProperty(value = "增值服务")
private List<Long> types;
@ApiModelProperty(value = "商品类型")
private List<Long> goodsTypes;
@ApiModelProperty(value = "备案")
private List<Integer> productRecord;
}
......@@ -210,6 +210,7 @@
LEFT JOIN ecw_warehouse_line wl on a.line_id = wl.id
LEFT JOIN ecw_warehouse dest_warehouse on wl.dest_warehouse_id = dest_warehouse.id
left join ecw_order_objective eo on a.order_id = eo.order_id
LEFT JOIN system_user su on a.salesman_id = su.id
left join (select it.order_id AS order_id,
SUM(
IFNULL(
......
......@@ -74,7 +74,7 @@ tenant-id: {{adminTenentId}}
### 查询前20条
GET {{baseUrl}}/ecw/order/customer-order-page?customerDetailId=41694&rows=10&page=1&pageNo=1&destCountryId%5B0%5D=4174&destCountryId%5B1%5D=4175&objectiveId%5B0%5D=4181&objectiveId%5B1%5D=4184&destWarehouseId%5B0%5D=2&destWarehouseId%5B1%5D=4&destWarehouseId%5B2%5D=6
GET {{baseUrl}}/ecw/order/customer-order-page?customerDetailId=5008
Authorization: Bearer {{token}}
tenant-id: {{adminTenentId}}
......
......@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.io.file.FileNameUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.apollo.core.event.OrderAssociationOfferInfoEvent;
import cn.iocoder.yudao.framework.common.util.spring.enums.UserTypeEnum;
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
......@@ -80,6 +81,7 @@ import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import java.util.stream.Collectors;
import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeConstants.UNAUTHORIZED;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.error;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
......@@ -104,7 +106,6 @@ public class OrderController {
private RoleApi roleApi;
@Autowired
private OrderItemService orderItemService;
@Autowired
private ProductService productService;
@Autowired
......@@ -267,7 +268,7 @@ public class OrderController {
@ApiOperation("(新修改订单)订单修改审批申请")
// @PreAuthorize("@ss.hasPermission('ecw:order:update')")
@Idempotent(timeout = 5)
public CommonResult<Boolean> specialApplyOrder(@Valid @RequestBody OrderUpdateReqVO updateReqVO) {
public CommonResult<Boolean> orderUpdateApply(@Valid @RequestBody OrderUpdateReqVO updateReqVO) {
if (Objects.equals(TransportTypeShortEnum.AIR_FREIGHT_LINE.getValue(), updateReqVO.getTransportId())
|| Objects.equals(TransportTypeShortEnum.AIR_SEA_COMBINED_TRANSPORT.getValue(), updateReqVO.getTransportId())) {
if (Objects.isNull(updateReqVO.getChannelId()) || 0 == updateReqVO.getChannelId()) {
......@@ -285,6 +286,27 @@ public class OrderController {
return success(true);
}
@PutMapping("/shipment/update/apply")
@ApiOperation("(新修改订单)订单修改审批申请")
@Idempotent(timeout = 5)
public CommonResult<Boolean> shipmentOrderApplyUpdate(@Valid @RequestBody OrderUpdateReqVO updateReqVO) {
if (Objects.equals(TransportTypeShortEnum.AIR_FREIGHT_LINE.getValue(), updateReqVO.getTransportId())
|| Objects.equals(TransportTypeShortEnum.AIR_SEA_COMBINED_TRANSPORT.getValue(), updateReqVO.getTransportId())) {
if (Objects.isNull(updateReqVO.getChannelId()) || 0 == updateReqVO.getChannelId()) {
throw exception(ORDER_LINE_CHANNEL_NOT_NULL);
}
}
String redisKey = MessageFormat.format(ORDER_UPDATE_KEY, updateReqVO.getOrderId().toString());
Long count = redisHelper.incrBy(redisKey, 1);
if (count > 1) {
return error(ORDER_UPDATE_REPEAT_COMMIT);
}
redisHelper.expire(redisKey, 1, TimeUnit.MINUTES);
orderService.shipmentOrderApplyUpdate(updateReqVO, null);
redisHelper.delete(redisKey);
return success(true);
}
@GetMapping("update/info")
@ApiOperation("获得订单修改申请详情")
@ApiImplicitParam(name = "approveId", value = "审核ID", required = true, example = "1024", dataType = "Long")
......@@ -330,7 +352,7 @@ public class OrderController {
// @PreAuthorize("@ss.hasPermission('ecw:order:query')")
public CommonResult<PageResult<OrderBackPageVO>> getOrderPage(OrderQueryVO query, PageVO page) {
query.setUserType(UserTypeEnum.ADMIN.getValue());
PageResult<OrderBackPageVO> pageResult = orderQueryService.myOrderPage(query, page);
PageResult<OrderBackPageVO> pageResult = orderQueryService.orderPage(query, page);
return success(pageResult);
}
......@@ -341,6 +363,18 @@ public class OrderController {
public CommonResult<PageResult<OrderBackPageVO>> getCustomerOrderPage(OrderQueryVO query, PageVO page) {
query.setUserType(UserTypeEnum.ADMIN.getValue());
PageResult<OrderBackPageVO> pageResult = orderQueryService.myOrderPage(query, page);
//填充报价单号
List<OrderBackPageVO> list = pageResult.getList();
if (CollectionUtil.isNotEmpty(list)) {
for (OrderBackPageVO vo : list) {
OrderAssociationOfferInfoEvent event = new OrderAssociationOfferInfoEvent(vo.getOrderId(), null, null);
applicationContext.publishEvent(event);
vo.setOfferId(event.getOfferId());
vo.setOfferNo(event.getOfferNo());
}
}
return success(pageResult);
}
......
......@@ -160,6 +160,14 @@ public class OrderCargoControlController {
return success(applyVO);
}
@GetMapping("overseas-warehouse-update/info/{orderId}")
@ApiOperation("根据订单ID查询订单海外仓修改审核详情")
@ApiImplicitParam(name = "orderId", value = "订单ID", required = true, example = "1024", dataType = "Long")
public CommonResult<OrderCargoControlApplyVO> approvalOrderCargoControlOverseasWarehouseUpdateByOrderId(@PathVariable(value = "orderId") Long orderId) {
OrderCargoControlApplyVO applyVO = orderCargoControlService.approvalOrderCargoControlOverseasWarehouseUpdateByOrderId(orderId);
return success(applyVO);
}
@GetMapping("cancel/approval/{orderApprovalId}")
@ApiOperation("根据审批id取消审批")
@ApiImplicitParams({
......
......@@ -55,7 +55,11 @@ public class ProdLinePriceController {
it.setIsPriced(false);
WarehouseInInfoParam warehouseInInfoVO = it.getWarehouseInInfoVO();
if (Objects.nonNull(warehouseInInfoVO)){
it.setPackages(Arrays.asList(warehouseInInfoVO.getUnits().split(StrUtil.COMMA)));
if (StrUtil.isNotBlank(warehouseInInfoVO.getUnits())) {
it.setPackages(Arrays.asList(warehouseInInfoVO.getUnits().split(StrUtil.COMMA)));
}else {
it.setPackages(Arrays.asList(it.getUnit().split(StrUtil.COMMA)));
}
it.setVolume(warehouseInInfoVO.getVolume());
it.setWeight(warehouseInInfoVO.getWeight());
it.setQuantity(warehouseInInfoVO.getQuantityAll());
......
......@@ -106,6 +106,7 @@ public interface OfferMapper extends BaseMapperX<OfferDO> {
// "o.est_cost, ",
// "o.create_time, ",
// "o.update_time, ",
"user.number as customer_number, ",
"(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 business_manager_name, ",
......@@ -113,16 +114,21 @@ public interface OfferMapper extends BaseMapperX<OfferDO> {
"cc.name as relation_name, ",
"cc.area_code as relation_area_code, ",
"cc.phone_new as relation_phone, ",
"if(#{lang} = 0, l.name_zh , l.name_en ) as channel_name, ",
"line.start_warehouse_id, ",
"line.dest_warehouse_id, ",
"line.transport_type ",
"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) ",
"<when test = 'pageVO.sourceIds != null and pageVO.sourceIds.size() > 0'>",
"left join ecw_customer user on user.id = o.relation_id ",
"</when>",
"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 ",
"left join ecw_channel l on o.channel_id = l.channel_id ",
"where o.deleted = 0",
//destCountryIds
......@@ -195,6 +201,29 @@ public interface OfferMapper extends BaseMapperX<OfferDO> {
"<when test = 'pageVO.beginEndTime != null and pageVO.endEndTime != null '>",
"AND o.`end_time` between #{pageVO.beginEndTime} and #{pageVO.endEndTime}",
"</when>",
"<when test = 'pageVO.expired != null and pageVO.expired.after != null and pageVO.expired.before != null'>",
"AND o.`end_time` between #{pageVO.expired.after} and #{pageVO.expired.before}",
"</when>",
"<when test = 'pageVO.importances != null and pageVO.importances.size() > 0'>",
"AND o.`importance` IN ",
"<foreach item='importance' collection='pageVO.importances' open='(' close=')' separator=','> #{importance} </foreach>)",
"</when>",
"<when test = 'pageVO.salesmanIds != null and pageVO.salesmanIds.size() > 0'>",
"AND o.`follow_up_salesman_id` IN ",
"<foreach item='id' collection='pageVO.salesmanIds' open='(' close=')' separator=','> #{id} </foreach>)",
"</when>",
"<when test = 'pageVO.statusList != null and pageVO.statusList.size() > 0'>",
"AND o.`status` IN ",
"<foreach item='it' collection='pageVO.statusList' open='(' close=')' separator=','> #{it} </foreach>)",
"</when>",
"<when test = 'pageVO.channelIds != null and pageVO.channelIds.size() > 0'>",
"AND o.`channel_id` IN ",
"<foreach item='it' collection='pageVO.channelIds' open='(' close=')' separator=','> #{it} </foreach>)",
"</when>",
"<when test = 'pageVO.sourceIds != null and pageVO.sourceIds.size() > 0'>",
"AND user.`source` IN ",
"<foreach item='it' collection='pageVO.sourceIds' open='(' close=')' separator=','> #{it} </foreach>)",
"</when>",
"<when test = 'pageVO.beginStopTime != null and pageVO.endStopTime != null '>",
"AND o.`stop_time` between #{pageVO.beginStopTime} and #{pageVO.endStopTime}",
"</when>",
......@@ -303,6 +332,29 @@ public interface OfferMapper extends BaseMapperX<OfferDO> {
"<when test = 'pageVO.beginStopTime != null and pageVO.endStopTime != null '>",
"AND o.`stop_time` between #{pageVO.beginStopTime} and #{pageVO.endStopTime}",
"</when>",
"<when test = 'pageVO.expired != null and pageVO.expired.after != null and pageVO.expired.before != null'>",
"AND o.`end_time` between #{pageVO.expired.after} and #{pageVO.expired.before}",
"</when>",
"<when test = 'pageVO.importances != null and pageVO.importances.size() > 0'>",
"AND o.`importance` IN ",
"<foreach item='importance' collection='pageVO.importances' open='(' close=')' separator=','> #{importance} </foreach>)",
"</when>",
"<when test = 'pageVO.salesmanIds != null and pageVO.salesmanIds.size() > 0'>",
"AND o.`follow_up_salesman_id` IN ",
"<foreach item='id' collection='pageVO.salesmanIds' open='(' close=')' separator=','> #{id} </foreach>)",
"</when>",
"<when test = 'pageVO.statusList != null and pageVO.statusList.size() > 0'>",
"AND o.`status` IN ",
"<foreach item='it' collection='pageVO.statusList' open='(' close=')' separator=','> #{it} </foreach>)",
"</when>",
"<when test = 'pageVO.channelIds != null and pageVO.channelIds.size() > 0'>",
"AND o.`channel_id` IN ",
"<foreach item='it' collection='pageVO.channelIds' open='(' close=')' separator=','> #{it} </foreach>)",
"</when>",
"<when test = 'pageVO.sourceIds != null and pageVO.sourceIds.size() > 0'>",
"AND c.`source` IN ",
"<foreach item='it' collection='pageVO.sourceIds' open='(' close=')' separator=','> #{it} </foreach>)",
"</when>",
"<when test = 'pageVO.relationId != null'>",
"AND o.`relation_id` = #{pageVO.relationId}",
"</when>",
......
......@@ -9,6 +9,7 @@ import cn.iocoder.yudao.module.customer.convert.customerFollowup.CustomerFollowu
import cn.iocoder.yudao.module.customer.dal.dataobject.customerFollowup.CustomerFollowupDO;
import cn.iocoder.yudao.module.customer.service.customerFollowup.CustomerFollowupService;
import cn.iocoder.yudao.module.customer.vo.customerFollowup.CustomerFollowupBackVO;
import cn.iocoder.yudao.module.customer.vo.customerFollowup.CustomerFollowupExcelVO;
import cn.iocoder.yudao.module.customer.vo.customerFollowup.CustomerFollowupQueryVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileDO;
import cn.iocoder.yudao.module.infra.service.file.FileService;
......@@ -75,9 +76,9 @@ public class CustomerFollowupExcelExportListener {
// 导出 Excel
List<CustomerFollowupBackVO> datas = CustomerFollowupConvert.INSTANCE.convertList(customerFollowupDOList);
List<CustomerFollowupExcelVO> datas = CustomerFollowupConvert.INSTANCE.convertList2(customerFollowupDOList);
String path = ExcelUtils.write(dir, fileName, "数据", CustomerFollowupBackVO.class, datas);
String path = ExcelUtils.write(dir, fileName, "数据", CustomerFollowupExcelVO.class, datas);
// 获取到临时文件
File file = new File(path);
......
......@@ -67,6 +67,7 @@ public class OrderAssociationOfferListener {
OfferRespVO offerRespVO = offerService.getOfferByOrderId(event.getOrderId());
if (Objects.nonNull(offerRespVO)) {
event.setOfferId(offerRespVO.getOfferId());
event.setOfferNo(offerRespVO.getNumber());
}
}
}
package cn.iocoder.yudao.module.sale.vo.offer;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.*;
import java.util.*;
import io.swagger.annotations.*;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.TimeSlot;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import java.util.List;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
......@@ -175,4 +177,22 @@ public class OfferPageReqVO extends PageParam {
@ApiModelProperty(value = "目的仓ID集合")
private List<Long> destWarehouseIds;
@ApiModelProperty(value = "有效期")
private TimeSlot expired;
@ApiModelProperty(value = "重要程度")
private List<Integer> importances;
@ApiModelProperty(value = "客户经理列表")
private List<Long> salesmanIds;
@ApiModelProperty(value = "阶段列表")
private List<Integer> statusList;
@ApiModelProperty(value = "出货渠道列表")
private List<Long> channelIds;
@ApiModelProperty(value = "客户来源列表")
private List<Long> sourceIds;
}
......@@ -67,6 +67,11 @@ public class OfferRespVO extends OfferBaseVO {
private String transportType;
@ApiModelProperty(value = "渠道名称")
private String channelName;
@ApiModelProperty(value = "客户编号")
private String customerNumber;
@ApiModelProperty(value = "业务员名称-客户经理")
private String businessManagerName;
......
......@@ -121,5 +121,6 @@ public interface ErrorCodeConstants {
ErrorCode CASE_NUM_IN_MERGE_PKG = new ErrorCode(1109010058,"case.num.in.merge.pkg");
ErrorCode ORDER_IN_MERGE_PKG = new ErrorCode(1109010059,"order.already.in.merge.pkg");
ErrorCode BOX_UPDATE_REPEAT_COMMIT = new ErrorCode(1109010060, "box.update.repeat.commit");
}
\ No newline at end of file
......@@ -1575,6 +1575,12 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements
warehouseIdList = warehouseList.stream().map(WarehouseDO::getId).collect(Collectors.toList());
query.setWarehouseIdList(warehouseIdList);
}
if (CollectionUtil.isNotEmpty(query.getCountryIdList())) {
List<WarehouseDO> warehouseList =
warehouseService.findByCountryIdList(query.getCountryIdList());
warehouseIdList = warehouseList.stream().map(WarehouseDO::getId).collect(Collectors.toList());
query.setWarehouseIdList(warehouseIdList);
}
//上面都是处理查询条件相关逻辑
return boxInfoQuery1(boxMapper.selectPage2(page, query), false);
}
......
......@@ -131,4 +131,168 @@ public class BoxQueryVO {
@ApiModelProperty(value = "发货方式:1、多票,2、单票")
private Integer deliveryType;
@ApiModelProperty(value = "始发仓多选")
private List<Long> startWarehouseIdList;
@ApiModelProperty(value = "目的国多选")
private List<Long> countryIdList;
@ApiModelProperty(value = "目的城市多选")
private List<Long> destCityIdList;
@ApiModelProperty(value = "目的仓多选")
private List<Long> destWarehouseIdList;
@ApiModelProperty(value = "状态多选")
private List<Integer> boxStatusList;
@ApiModelProperty(value = "起运港多选")
private List<Long> bigPortIdList;
@ApiModelProperty(value = "目的港多选")
private List<Long> destPortIdList;
@ApiModelProperty(value = "订舱公司多选")
private List<Long> spaceCompanyIdList;
@ApiModelProperty(value = "驳船港多选")
private List<Long> bargePortIdList;
/**
* 预计驳船时间
*/
@ApiModelProperty(value = "预计驳船开始时间")
// @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String bargeBeginTime;
@ApiModelProperty(value = "预计驳船结束时间")
// //@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String bargeEndTime;
/**
* 预计开船时间
*/
@ApiModelProperty(value = "预计开船开始时间")
//@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String sailBeginTime;
@ApiModelProperty(value = "预计开船结束时间")
//@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String sailEndTime;
/**
* 截补料时间
*/
@ApiModelProperty(value = "截补料开始时间")
//@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String ladingBillBeginTime;
@ApiModelProperty(value = "截补料结束时间")
//@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String ladingBillEndTime;
/**
* VGM提交时间
*/
@ApiModelProperty(value = "VGM提交开始时间")
//@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String customsBeginTime;
@ApiModelProperty(value = "VGM提交结束时间")
//@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String customsEndTime;
/**
* 截关时间
*/
@ApiModelProperty(value = "截关开始时间")
//@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String cutOffBeginTime;
@ApiModelProperty(value = "截关结束时间")
//@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String cutOffEndTime;
@ApiModelProperty(value = "报关方式多选-海运空运共用")
private List<Integer> dcCustomsTypeList;
@ApiModelProperty(value = "报关公司多选-海运空运共用")
private List<Integer> dcCompanyIdList;
@ApiModelProperty(value = "放行开始时间-海运空运共用")
//@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String dcPassBeginTime;
@ApiModelProperty(value = "放行结束时间-海运空运共用")
//@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String dcPassEndTime;
/**
* 实际开船时间
*/
@ApiModelProperty(value = "实际开船开始时间")
//@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String dtRealShipBeginTime;
@ApiModelProperty(value = "实际开船结束时间")
//@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String dtRealShipEndTime;
/**
* 预计到港时间
*/
@ApiModelProperty(value = "预计到港开始时间")
//@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String dtEstArrivalBeginTime;
@ApiModelProperty(value = "预计到港结束时间")
//@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String dtEstArrivalEndTime;
@ApiModelProperty(value = "出单方式多选")
private List<Integer> cdOutBillTypeList;
@ApiModelProperty(value = "Agent list状态")
private Integer cdAgentlistType;
@ApiModelProperty(value = "Soncap状态")
private Integer cdSoncapType;
/**
* 预计清关时间
*/
@ApiModelProperty(value = "预计清关开始时间")
//@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String clEstBeginTime;
/**
* 预计清关时间
*/
@ApiModelProperty(value = "预计清关结束时间")
//@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String clEstEndTime;
//---------------------------空运--------------------------
@ApiModelProperty(value = "目的港清关多选")
private List<Integer> destinationClearanceList;
@ApiModelProperty(value = "发货方式多选")
private List<Integer> deliveryTypeList;
@ApiModelProperty(value = "出货渠道多选")
private List<Long> shippingChannelIdList;
@ApiModelProperty(value = "空运起运港多选")
private List<Long> departurePortIdList;
@ApiModelProperty(value = "空运目的港多选")
private List<Long> airDestPortIdList;
@ApiModelProperty(value = "航程")
private Integer voyage;
@ApiModelProperty(value = "订舱代理多选")
private List<Long> shipperIdList;
@ApiModelProperty(value = "航空公司多选")
private List<Long> airlineCompanyIdList;
@ApiModelProperty(value = "预计起飞开始时间")
//@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String flyBeginTime;
@ApiModelProperty(value = "预计起飞结束时间")
//@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private String flyEndTime;
@ApiModelProperty(value = "代理公司Agent多选")
private List<Long> agentIdList;
}
......@@ -9,6 +9,7 @@ import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import cn.iocoder.yudao.framework.redis.helper.RedisHelper;
import cn.iocoder.yudao.module.order.dal.dataobject.approval.OrderApprovalDO;
import cn.iocoder.yudao.module.order.enums.ApprovalResultStatusEnum;
import cn.iocoder.yudao.module.order.enums.OrderApprovalTypeEnum;
......@@ -32,11 +33,16 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.text.MessageFormat;
import java.util.Collection;
import java.util.List;
import java.util.concurrent.TimeUnit;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.error;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
import static cn.iocoder.yudao.module.shipment.controller.admin.constant.Constant.BOX_UPDATE_KEY;
import static cn.iocoder.yudao.module.shipment.enums.ErrorCodeConstants.BOX_UPDATE_REPEAT_COMMIT;
@Validated
@RestController
......@@ -53,6 +59,8 @@ public class BoxApprovalController {
@Resource
private OrderApprovalService orderApprovalService;
@Resource
private RedisHelper redisHelper;
/*
创建出货审批流程
*/
......@@ -62,7 +70,20 @@ public class BoxApprovalController {
//@PreAuthorize("@ss.hasPermission('ecw:box-approval:create')")
public CommonResult<Long> createBoxApproval(
@Valid @RequestBody BoxApprovalCreateReqVO createReqVO) {
return success(boxApprovalService.createBoxApproval(createReqVO));
String redisKey = MessageFormat.format(BOX_UPDATE_KEY, createReqVO.getShipmentId().toString());
Long count = redisHelper.incrBy(redisKey, 1);
if (count > 1) {
return error(BOX_UPDATE_REPEAT_COMMIT);
}
redisHelper.expire(redisKey, 1, TimeUnit.MINUTES);
try {
Long id = boxApprovalService.createBoxApproval(createReqVO);
return success(id);
}catch (Exception e){
throw e;
} finally {
redisHelper.delete(redisKey);
}
}
@PostMapping("/approvalDetail")
......
package cn.iocoder.yudao.module.shipment.controller.admin;
import cn.hutool.core.collection.CollectionUtil;
import cn.iocoder.yudao.framework.i18n.core.I18nMessage;
import cn.iocoder.yudao.framework.idempotent.core.annotation.Idempotent;
import cn.iocoder.yudao.framework.limiter.dynamic.DynamicRateLimiter;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.module.ecw.dal.dataobject.region.RegionDO;
import cn.iocoder.yudao.module.order.dto.ContainerNumberSummaryDto;
import cn.iocoder.yudao.module.order.dto.OrderCostSummaryDto;
import cn.iocoder.yudao.framework.redis.helper.RedisHelper;
import cn.iocoder.yudao.module.order.vo.order.OrderBackPageVO;
import cn.iocoder.yudao.module.order.vo.order.OrderBackVO;
import cn.iocoder.yudao.module.order.vo.orderSplit.OrderSplitBackVO;
import cn.iocoder.yudao.module.shipment.convert.BoxConvert;
import cn.iocoder.yudao.module.shipment.dal.dataobject.BoxDO;
import cn.iocoder.yudao.module.shipment.enums.SlStatueEnum;
import cn.iocoder.yudao.module.shipment.vo.boxTally.BoxOrderLocationUpdateReq;
import cn.iocoder.yudao.module.shipment.vo.boxTally.BoxTallyBackVO;
import cn.iocoder.yudao.module.system.api.file.FileMakeApi;
import cn.iocoder.yudao.module.system.api.file.dto.FileMakeReqDTO;
import cn.iocoder.yudao.module.system.enums.download.DownloadTypeEnum;
import cn.iocoder.yudao.module.system.enums.sms.SmsSceneEnum;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.fill.FillConfig;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.*;
......@@ -35,18 +28,22 @@ import io.swagger.annotations.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.io.*;
import java.math.BigDecimal;
import java.text.MessageFormat;
import java.util.*;
import java.util.concurrent.TimeUnit;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.error;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.excel.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
import static cn.iocoder.yudao.module.shipment.enums.ErrorCodeConstants.BOX_REPORT_NOT_EXIST;
import static cn.iocoder.yudao.module.shipment.controller.admin.constant.Constant.BOX_UPDATE_KEY;
import static cn.iocoder.yudao.module.shipment.enums.ErrorCodeConstants.BOX_UPDATE_REPEAT_COMMIT;
import cn.iocoder.yudao.module.shipment.vo.box.*;
import cn.iocoder.yudao.module.shipment.service.box.BoxService;
......@@ -62,6 +59,9 @@ public class BoxController {
@Resource
private BoxService boxService;
@Resource
private RedisHelper redisHelper;
@Resource
private FileMakeApi fileMakeApi;
......@@ -105,7 +105,19 @@ public class BoxController {
@DynamicRateLimiter(base = "#Headers['Authorization']", permits = 1)
@Idempotent(timeout = 5)
public CommonResult<Boolean> updateBox(@Valid @RequestBody BoxUpdateReqVO updateReqVO) {
boxService.updateBox(updateReqVO);
String redisKey = MessageFormat.format(BOX_UPDATE_KEY, updateReqVO.getId().toString());
Long count = redisHelper.incrBy(redisKey, 1);
if (count > 1) {
return error(BOX_UPDATE_REPEAT_COMMIT);
}
redisHelper.expire(redisKey, 1, TimeUnit.MINUTES);
try {
boxService.updateBox(updateReqVO);
} catch (Exception e) {
throw e;
} finally {
redisHelper.delete(redisKey);
}
return success(true);
}
......@@ -129,7 +141,7 @@ public class BoxController {
})
@PreAuthorize("@ss.hasPermission('shipment:box:update')")
public CommonResult<Boolean> shipConfigure(@RequestParam("shipmentId") Long shipmentId, @RequestParam("saExmtStatus") Integer saExmtStatus,
@RequestParam("operateType") Integer operateType, @RequestParam(name = "configTime", required = false) String configTime) {
@RequestParam("operateType") Integer operateType, @RequestParam(name = "configTime", required = false) String configTime) {
boxService.shipConfigure(shipmentId, saExmtStatus, operateType, configTime);
return success(true);
}
......@@ -268,7 +280,7 @@ public class BoxController {
@PreAuthorize("@ss.hasPermission('shipment:box:export')")
@OperateLog(type = EXPORT)
public void exportBoxExcel(@Valid BoxQueryVO query,
HttpServletResponse response) throws IOException {
HttpServletResponse response) throws IOException {
List<BoxExportVO> list = boxService.getExportBoxList(query);
// 导出 Excel
ExcelUtils.write(response, "海运导出出货.xls", "shipment", BoxExportVO.class, list);
......@@ -279,7 +291,7 @@ public class BoxController {
@PreAuthorize("@ss.hasPermission('shipment:box:export:seaAir')")
@OperateLog(type = EXPORT)
public void exportBoxExcelSeaAir(@Valid BoxQueryVO query,
HttpServletResponse response) throws IOException {
HttpServletResponse response) throws IOException {
List<BoxExportVO> list = boxService.getExportBoxList(query);
// 导出 Excel
ExcelUtils.write(response, "海空导出出货.xls", "shipment", BoxExportVO.class, list);
......@@ -290,7 +302,7 @@ public class BoxController {
@PreAuthorize("@ss.hasPermission('shipment:box:export:air')")
@OperateLog(type = EXPORT)
public void exportBoxExcelAir(@Valid BoxQueryVO query,
HttpServletResponse response) throws IOException {
HttpServletResponse response) throws IOException {
List<BoxExportVO> list = boxService.getExportBoxList(query);
// 导出 Excel
ExcelUtils.write(response, "空运导出出货.xls", "shipment", BoxExportVO.class, list);
......@@ -330,7 +342,7 @@ public class BoxController {
public CommonResult exportOrderSummary(BoxSettlementQueryVO query, HttpServletResponse response) throws Exception {
FileMakeReqDTO reqDTO = new FileMakeReqDTO();
JSONObject jsonObject = new JSONObject();
jsonObject.put("query",JSONObject.toJSONString(query));
jsonObject.put("query", JSONObject.toJSONString(query));
reqDTO.setType(DownloadTypeEnum.SHIPMENT_SUMMERY_EXCEL_EXPORT.getType());
reqDTO.setName("出货应收报表");
reqDTO.setFileSuffix("xlsx");
......
package cn.iocoder.yudao.module.shipment.controller.admin;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.framework.redis.helper.RedisHelper;
import cn.iocoder.yudao.module.shipment.convert.BoxCustomsConvert;
import cn.iocoder.yudao.module.shipment.dal.dataobject.BoxCustomsDO;
import cn.iocoder.yudao.module.shipment.service.boxCustoms.BoxCustomsService;
......@@ -15,14 +16,21 @@ import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.annotations.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.text.MessageFormat;
import java.util.*;
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.error;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.excel.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
import static cn.iocoder.yudao.module.shipment.controller.admin.constant.Constant.BOX_UPDATE_KEY;
import static cn.iocoder.yudao.module.shipment.enums.ErrorCodeConstants.BOX_UPDATE_REPEAT_COMMIT;
@Validated
@RestController
......@@ -33,6 +41,9 @@ public class BoxCustomsController {
@Resource
private BoxCustomsService boxCustomsService;
@Resource
private RedisHelper redisHelper;
@PostMapping("/create")
@ApiOperation("创建报关,use this")
// @PreAuthorize("@ss.hasPermission('ecw:box-customs:create')")
......@@ -44,7 +55,19 @@ public class BoxCustomsController {
@ApiOperation("更新报关, use this")
// @PreAuthorize("@ss.hasPermission('ecw:box-customs:update')")
public CommonResult<Boolean> updateBoxCustoms(@Valid @RequestBody BoxCustomsUpdateReqVO updateReqVO) {
boxCustomsService.updateBoxCustoms(updateReqVO);
String redisKey = MessageFormat.format(BOX_UPDATE_KEY, updateReqVO.getShipmentId().toString());
Long count = redisHelper.incrBy(redisKey, 1);
if (count > 1) {
return error(BOX_UPDATE_REPEAT_COMMIT);
}
redisHelper.expire(redisKey, 1, TimeUnit.MINUTES);
try {
boxCustomsService.updateBoxCustoms(updateReqVO);
}catch (Exception e){
throw e;
} finally {
redisHelper.delete(redisKey);
}
return success(true);
}
......
......@@ -32,6 +32,7 @@ import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
......@@ -44,6 +45,7 @@ import java.text.MessageFormat;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.error;
......@@ -135,6 +137,18 @@ public class MakeBillOfLadingController {
return success(true);
}
@PostMapping("/check/billOfLading/{orderId}")
@ApiOperation("检查提单状态是否已制作提单")
@ApiImplicitParam(name = "orderId", value = "该值为orderId", required = true, example = "1024", dataType = "Long")
public CommonResult<Boolean> checkBillOfLadingStatus(@PathVariable Long orderId) {
MakeBillOfLadingDO billOfLadingDO = makeBillOfLadingService.getOne(new LambdaQueryWrapperX<MakeBillOfLadingDO>()
.eq(MakeBillOfLadingDO::getOrderId, orderId)
.orderByDesc(MakeBillOfLadingDO::getId)
.last("limit 1"));
return success(Objects.nonNull(billOfLadingDO) && StringUtils.isNotBlank(billOfLadingDO.getImgUrl()));
}
@GetMapping("/get")
@ApiOperation("获得制作提货单")
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
......
package cn.iocoder.yudao.module.shipment.controller.admin.constant;
public interface Constant {
String BOX_UPDATE_KEY = "jiedao:box:update:{0}";
}
......@@ -279,3 +279,25 @@ customer.deleted.not.exists=
customer.saved.customer.service.is.null=
customer.deleted.customer.service.is.null=
customer.merge.customer.service.not.same=
order.exists.pickup.not.cargo.control=
order.exists.pick.not.cancel.cargo.control=
order.overseas.warehouse.update.need.applying=
order.not.update.dest.country=
order.not.update.departure=
order.not.update.transport=
order.pre.installation.unpackaged.container.not.update=
order.sorting.not.shipment.not.update=
box.update.repeat.commit=
order.is.approval.in.process.with.ordernos=
customer.approval.in.processing=
order.overseas.warehouse.update.is.or.no=
order.is.overseas.warehouse.order=
order.not.is.overseas.warehouse.order=
\ No newline at end of file
......@@ -1085,4 +1085,26 @@ 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
customer.merge.customer.service.not.same=Retained clients and non-primary clients cannot be under two different account managers
order.exists.pickup.not.cargo.control=The order has a delivery record and cannot be controlled
order.exists.pick.not.cancel.cargo.control=There is a release record for the order, and the control cannot be cancelled
order.overseas.warehouse.update.need.applying=Order overseas warehouse modification requires separate application
order.not.update.dest.country=Not allowed to modify the destination country
order.not.update.departure=Not allowed to modify the origin location
order.not.update.transport=No modification of transportation method allowed
order.pre.installation.unpackaged.container.not.update=Order pre installed without container, order information cannot be modified
order.sorting.not.shipment.not.update=Order sorting not shipped, order information cannot be modified
box.update.repeat.commit=Duplicate submission of self assigned number status modification
order.is.approval.in.process.with.ordernos=Orders placed by non-main customers are being approved and cannot be merged: [{}]
customer.approval.in.processing=Non-main customer approval is in progress and cannot be operated
order.overseas.warehouse.update.is.or.no=Please select order overseas warehouse modification Yes or No
order.is.overseas.warehouse.order=This order is already an overseas warehouse order
order.not.is.overseas.warehouse.order=This order is already a non overseas warehouse order
\ No newline at end of file
......@@ -1085,4 +1085,26 @@ 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
customer.merge.customer.service.not.same=\u4FDD\u7559\u5BA2\u6237\u548C\u975E\u4E3B\u5BA2\u6237\uFF0C\u4E0D\u80FD\u5728\u4E24\u4E2A\u4E0D\u540C\u7684\u5BA2\u6237\u7ECF\u7406\u540D\u4E0B
order.exists.pickup.not.cargo.control=\u8BA2\u5355\u5B58\u5728\u63D0\u8D27\u8BB0\u5F55\uFF0C\u4E0D\u80FD\u8FDB\u884C\u63A7\u8D27
order.exists.pick.not.cancel.cargo.control=\u8BA2\u5355\u5B58\u5728\u653E\u8D27\u8BB0\u5F55\uFF0C\u4E0D\u80FD\u53D6\u6D88\u63A7\u8D27
order.overseas.warehouse.update.need.applying=\u8BA2\u5355\u6D77\u5916\u4ED3\u4FEE\u6539\u9700\u8981\u5355\u72EC\u7533\u8BF7
order.not.update.dest.country=\u4E0D\u5141\u8BB8\u4FEE\u6539\u76EE\u7684\u56FD
order.not.update.departure=\u4E0D\u5141\u8BB8\u4FEE\u6539\u59CB\u53D1\u5730
order.not.update.transport=\u4E0D\u5141\u8BB8\u4FEE\u6539\u8FD0\u8F93\u65B9\u5F0F
order.pre.installation.unpackaged.container.not.update=\u8BA2\u5355\u9884\u88C5\u672A\u88C5\u67DC, \u8BA2\u5355\u4FE1\u606F\u65E0\u6CD5\u4FEE\u6539
order.sorting.not.shipment.not.update=\u8BA2\u5355\u5206\u62E3\u672A\u51FA\u8D27, \u8BA2\u5355\u4FE1\u606F\u65E0\u6CD5\u4FEE\u6539
box.update.repeat.commit=\u81EA\u7F16\u53F7\u72B6\u6001\u4FEE\u6539\u91CD\u590D\u63D0\u4EA4
order.is.approval.in.process.with.ordernos=\u975E\u4E3B\u5BA2\u6237\u4E0B\u6709\u8BA2\u5355\u6B63\u5728\u5BA1\u6279\u4E2D\uFF0C\u4E0D\u5141\u8BB8\u5408\u5E76\uFF1A[{}]
customer.approval.in.processing=\u975E\u4E3B\u5BA2\u6237\u5BA1\u6279\u6B63\u5728\u8FDB\u884C\u4E2D\uFF0C\u4E0D\u5141\u8BB8\u5408\u5E76
order.overseas.warehouse.update.is.or.no=\u8bf7\u9009\u62e9\u8ba2\u5355\u6d77\u5916\u4ed3\u4fee\u6539\u662f\u6216\u5426
order.is.overseas.warehouse.order=\u8be5\u8ba2\u5355\u5df2\u7ecf\u662f\u6d77\u5916\u4ed3\u8ba2\u5355
order.not.is.overseas.warehouse.order=\u8be5\u8ba2\u5355\u5df2\u7ecf\u662f\u975e\u6d77\u5916\u4ed3\u8ba2\u5355
\ 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