Commit 3e71c660 authored by liuzeheng's avatar liuzeheng

二期申请延期掉入公海

parent aa361efc
......@@ -363,6 +363,9 @@ public class CustomerDO extends BaseDO {
*/
private Boolean noConsignee ;
@ApiModelProperty("延期申请次数")
private int delayApprovalNum ;
/**
* vip等级-中文
*/
......
......@@ -2,8 +2,10 @@ package cn.iocoder.yudao.module.customer.dal.mysql.customer;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.customer.dal.dataobject.customer.CustomerDO;
import cn.iocoder.yudao.module.customer.dto.CustomerOrderQueryDTO;
import cn.iocoder.yudao.module.customer.vo.customer.vo.CustomerDetailRespVO;
import cn.iocoder.yudao.module.customer.vo.customer.vo.CustomerSelectReqVO;
import cn.iocoder.yudao.module.customer.vo.customerDetail.CustomerOrderBackPageVO;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
......@@ -175,4 +177,9 @@ public interface CustomerMapper extends BaseMapperX<CustomerDO> {
@Update("update ecw_customer set is_new = #{isNew} where deleted = 0 and is_new != #{isNew} and id = #{customerId}")
void updateCustomerNewOrOld(@Param("customerId") Long customerId, @Param("isNew") Boolean isNew);
@Update("update ecw_customer set delay_approval_num = #{delayApprovalNum} where deleted = 0 and id = #{customerId}")
void updateCustomerDelayApprovalNum(@Param("customerId") Long customerId,@Param("delayApprovalNum") int delayApprovalNum);
List<CustomerOrderBackPageVO> orderList(@Param("start") int start, @Param("size") int size, @Param("query") CustomerOrderQueryDTO query);
}
......@@ -47,6 +47,7 @@ import cn.iocoder.yudao.module.customer.dal.mysql.customerPublicCatchLog.Custome
import cn.iocoder.yudao.module.customer.dto.CustomerDelayApprovalInfoDto;
import cn.iocoder.yudao.module.customer.dto.CustomerHandoverApprovalInfoDto;
import cn.iocoder.yudao.module.customer.dto.CustomerHandoverDetailDto;
import cn.iocoder.yudao.module.customer.dto.CustomerOrderQueryDTO;
import cn.iocoder.yudao.module.customer.service.customerApproval.CustomerApprovalService;
import cn.iocoder.yudao.module.customer.service.customerContacts.CustomerContactsService;
import cn.iocoder.yudao.module.customer.service.customerOperateLog.CustomerOperateLogService;
......@@ -58,6 +59,7 @@ import cn.iocoder.yudao.module.customer.vo.customer.line.CustomerLineUpdateReqVO
import cn.iocoder.yudao.module.customer.vo.customer.vo.*;
import cn.iocoder.yudao.module.customer.vo.customerBank.CustomerBankCreateReqVO;
import cn.iocoder.yudao.module.customer.vo.customerBank.CustomerBankUpdateReqVO;
import cn.iocoder.yudao.module.customer.vo.customerDetail.CustomerOrderBackPageVO;
import cn.iocoder.yudao.module.customer.vo.customerOperateLog.CustomerOperateLogCreateReqVO;
import cn.iocoder.yudao.module.ecw.dal.dataobject.country.CountryDO;
import cn.iocoder.yudao.module.ecw.enums.CustomerOperateTypeEnum;
......@@ -303,6 +305,8 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, Custome
customer.setIsCustomerServiceConfirmed(false);
customer.setIsInOpenSea(false);
}
Date estimateEnterOpenSeaTime = DateUtil.offsetMonth(new Date(), 3).toJdkDate(); //改为3个月
customer.setEstimateEnterOpenSeaTime(estimateEnterOpenSeaTime);
}
......@@ -1781,6 +1785,9 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, Custome
if (Objects.isNull(customerDO)) {
throw exception(CUSTOMER_NOT_EXISTS);
}
if(customerDO.getDelayApprovalNum() >=1){
throw exception(CUSTOMER_DELAY_APPROVAL_MORE_THEN_ONE);
}
if (customerDO.getIsInOpenSea()) {
throw exception(CUSTOMER_HAS_IN_OPEN_SEA);
}
......@@ -1825,6 +1832,9 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, Custome
customerApprovalDO.setFormId(formId);
customerApprovalService.updateById(customerApprovalDO);
//记录延期申请审核次数
customerMapper.updateCustomerDelayApprovalNum(customerDO.getId(),customerDO.getDelayApprovalNum()+1) ;
//纪录日志
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
CustomerOperateLogCreateReqVO customerOperateLogCreateReqVO = new CustomerOperateLogCreateReqVO()
......@@ -2488,12 +2498,20 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, Custome
boolean isFcl = isFcl(customer);
//捞取后设置预计进入公海池时间
Date estimateEnterOpenSeaTime = isFcl ? null : DateUtil.offsetMonth(now, 1).toJdkDate();
if(!loginUserId.equals(customer.getCustomerService())){//如果捞取新旧客户经理不是同一个,
//Date estimateEnterOpenSeaTime = isFcl ? null : DateUtil.offsetMonth(now, 1).toJdkDate();
Date estimateEnterOpenSeaTime = isFcl ? null : DateUtil.offsetMonth(now, 3).toJdkDate();
if (!loginUserId.equals(customer.getCustomerService())) {//如果捞取新旧客户经理不是同一个,
estimateEnterOpenSeaTime = isFcl ? null : DateUtil.offsetMonth(now, 3).toJdkDate();//改为3个月
}
if(loginUserId.equals(customer.getCustomerService())){//如果捞取新旧客户经理是同一个,且客户的最后一次成交订单归属当前客户经理,延期6个月
if (loginUserId.equals(customer.getCustomerService())) {//如果捞取新旧客户经理是同一个,且客户的最后一次成交订单归属当前客户经理,延期6个月
List<CustomerOrderBackPageVO> orderList = customerMapper.orderList(0, 10, new CustomerOrderQueryDTO().setCustomerId(customerId));
if (CollectionUtil.isNotEmpty(orderList) && orderList.size() > 0) {//客户成交的订单不为空
CustomerOrderBackPageVO orderBackPageVO = orderList.get(0);
if (loginUserId.equals(customer.getCustomerService()) && orderBackPageVO != null && orderBackPageVO.getSalesmanId().equals(loginUserId)) {//订单的客户经理和当前是同一个
estimateEnterOpenSeaTime = isFcl ? null : DateUtil.offsetMonth(now, 6).toJdkDate();//改为6个月
}
}
}
......
......@@ -85,6 +85,8 @@ public interface ErrorCodeConstants {
ErrorCode CUSTOMER_CONTACTS_USERID_ALREADY_BIND = new ErrorCode(1004002016, "customer.contact.already.binding.others");
ErrorCode MESSAGE_LEAVE_NOT_EXISTS = new ErrorCode(1004002020, "message.leave.not.exists");
ErrorCode COUNTRY_NOT_EXISTS = new ErrorCode(1004002025, "country.not.exists");
......@@ -173,6 +175,7 @@ public interface ErrorCodeConstants {
ErrorCode CUSTOMER_IS_NEW_OR_OLD_NO_CHANGE = new ErrorCode(1004006036, "customer.is.new.or.old.no.change");
ErrorCode CUSTOMER_DELAY_APPROVAL_MORE_THEN_ONE = new ErrorCode (1004006037,"customer.delay.approval.times.more.then.one") ;
}
......@@ -1913,7 +1913,9 @@
<if test="query.userType == 2 ">
AND ((o.user_id is not null AND o.user_id > 0 AND o.`status` != 0) or o.user_id is null or o.user_id = 0)
</if>
</sql><sql id="issuedOrderQuery">
</sql>
<sql id="issuedOrderQuery">
<if test="query.type != null and query.type != '' and query.type == 0 ">
AND (o.type is null or o.type = '' or o.type = '0')
</if>
......
......@@ -62,6 +62,7 @@ customer.contacts.already.bind=
customer.contacts.multi.default=
customer.contacts.no.default=
customer.not.exists=
customer.delay.approval.times.more.then.one=
zhong.pao.line.config.exists=
zhong.pao.not.exists=
currency.not.exists=
......
......@@ -997,4 +997,5 @@ case.num.in.merge.pkg=This box has been packed, please scan the packing box numb
order.already.in.merge.pkg=The order has been placed under the packaging box
customer.is.new.or.old.no.change=customer current business type is {}, it's no change
order.is.pre.installed=Order pre installed
customer.delay.approval.times.more.then.one=delay approval times more then one
......@@ -565,6 +565,7 @@ customer.contacts.already.bind=\u5BA2\u6237\u8054\u7CFB\u4EBA\u624B\u673A\u53F7{
customer.contacts.multi.default=\u5BA2\u6237\u8054\u7CFB\u4EBA\u53EA\u80FD\u8BBE\u7F6E\u4E00\u4E2A\u9ED8\u8BA4\u8054\u7CFB\u4EBA
customer.contacts.no.default=\u5BA2\u6237\u8054\u7CFB\u4EBA\u672A\u8BBE\u7F6E\u9ED8\u8BA4\u8054\u7CFB\u4EBA
customer.not.exists=\u5BA2\u6237\u4E0D\u5B58\u5728
customer.delay.approval.times.more.then.one=\u5DF2\u7ECF\u7533\u8BF7\u8FC71\u6B21\u5EF6\u671F\u4E0D\u80FD\u518D\u7533\u8BF7\u4E86
zhong.pao.line.config.exists=\u6B64\u7EBF\u8DEF\u7684\u91CD\u6CE1\u8D27\u914D\u7F6E\u5DF2\u5B58\u5728
zhong.pao.not.exists=\u91CD\u6CE1\u8D27\u914D\u7F6E\u4E0D\u5B58\u5728
currency.not.exists=\u8D27\u5E01\u5355\u4F4D\u4E0D\u5B58\u5728
......
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