Commit 6abfb71e authored by liuzeheng's avatar liuzeheng

二期需求

parent 007da332
......@@ -353,6 +353,15 @@ public class CustomerDO extends BaseDO {
*/
private Boolean isPotential;
/**
* 默认付款,1-是,0-否
*/
private Boolean defaultPay ;
/**
* 控货无收货人,1-是,0-否
*/
private Boolean noConsignee ;
/**
* vip等级-中文
......
......@@ -286,7 +286,8 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, Custome
customer.setEstimateEnterOpenSeaTime(null);
} else {
// 接收后一个月,无任何报价、下单则掉入公海
Date estimateEnterOpenSeaTime = DateUtil.offsetMonth(new Date(), 1).toJdkDate();
//Date estimateEnterOpenSeaTime = DateUtil.offsetMonth(new Date(), 1).toJdkDate();
Date estimateEnterOpenSeaTime = DateUtil.offsetMonth(new Date(), 3).toJdkDate(); //改为3个月
if (customer.getEstimateEnterOpenSeaTime() == null || customer.getEstimateEnterOpenSeaTime().compareTo(estimateEnterOpenSeaTime) == -1) {
customer.setEstimateEnterOpenSeaTime(estimateEnterOpenSeaTime);
}
......@@ -1792,7 +1793,8 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, Custome
throw exception(CUSTOMER_CANNOT_DELAY_APPROVAL_WITH_NO_ENTER_OPEN_SEA_TIME);
}
// TODO 待加入配置 最大延期时间
long maxTime = 31 * 24 * 60 * 60 * 1000L;
//long maxTime = 31 * 24 * 60 * 60 * 1000L;//原逻辑按一个月31天计算 ,现改为最多6个月
long maxTime = 6*31 * 24 * 60 * 60 * 1000L;//原逻辑按一个月31天计算 ,现改为最多6个月
// long minTime = 24 * 60 * 60 * 1000L;
long time = DateUtils.getTimeInMillis(delayApprovalInfoDto.getEstimateEnterOpenSeaTime()) - DateUtils.getTimeInMillis(customerDO.getEstimateEnterOpenSeaTime());
if (time <= 0 || time > maxTime) {
......@@ -2355,7 +2357,8 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, Custome
customer.setStatusUpdateTime(now);
//设置预计进行公海池时间
Date estimateEnterOpenSeaTime = DateUtil.offsetMonth(now, 1).toJdkDate();
//Date estimateEnterOpenSeaTime = DateUtil.offsetMonth(now, 1).toJdkDate();
Date estimateEnterOpenSeaTime = DateUtil.offsetMonth(now, 3).toJdkDate(); //改为延期3个月
if (customer.getEstimateEnterOpenSeaTime() == null || customer.getEstimateEnterOpenSeaTime().compareTo(estimateEnterOpenSeaTime) == -1) {
customer.setEstimateEnterOpenSeaTime(estimateEnterOpenSeaTime);
log.info("确认接收客户[{}],设置预计掉入公海时间为[{}]", customer.getId(), estimateEnterOpenSeaTime);
......@@ -2810,7 +2813,8 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, Custome
log.info("完成入仓客户[{}]包含海运整柜,设置不掉入公海", customer.getId());
} else {
// 下单完成入仓,根据订单入仓的时间往后延期六个月
Date date = DateUtil.offsetMonth(rucangTime, 6).toJdkDate();
//Date date = DateUtil.offsetMonth(rucangTime, 6).toJdkDate();
Date date = DateUtil.offsetMonth(rucangTime, 12).toJdkDate();
if (customer.getEstimateEnterOpenSeaTime() == null || customer.getEstimateEnterOpenSeaTime().compareTo(date) == -1) {
customer.setEstimateEnterOpenSeaTime(date);
}
......
......@@ -514,6 +514,9 @@ public class OrderDO extends BaseDO {
@ApiModelProperty(value = "是否显示提单金额")
private Boolean displayBillLadingPrice = true;
@ApiModelProperty(value = "是否有收货人,1-是,0-否")
private Boolean hasConsignee = true;
//
// @ApiModelProperty(value = "拆单子订单是否变更运输方式")
// private Boolean splitChangeTransport = false;
......
......@@ -590,6 +590,57 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
order.setCustomerId(orderConsigneeDO.getCustomerId());
}
}
// 补充业绩规则判断
if(!consignorCustomerDO.getNoConsignee() && !order.getHasConsignee()){//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
order.setCustomerId(orderConsignorDO.getCustomerId()) ;
}
if(createReqVO.getOfferId()!=null && order.getDrawee()==1){//订单关联报价单 && 发货人付款
order.setCustomerId(orderConsignorDO.getCustomerId()) ;
}
if(createReqVO.getOfferId()!=null && order.getDrawee()==3 ){//订单关联报价单 && 自定义付款
List<CustomDraweeVO> list = JSONObject.parseArray(order.getCustomDrawee(), CustomDraweeVO.class);
List<CustomDraweeVO> freightList = list.stream().filter(s-> s.getName().equals("freight") ).collect(Collectors.toList());
List<CustomDraweeVO> clearanceFeeList = list.stream().filter(s-> s.getName().equals("clearanceFee") ).collect(Collectors.toList());
int freight = freightList.get(0).getValue() ;
int clearanceFee = clearanceFeeList.get(0).getValue();
if(createReqVO.getOfferId()!=null && ( order.getDrawee()==3 && freight==1 )){//订单关联报价单 && 自定义付款 且发货人付运费
order.setCustomerId(orderConsignorDO.getCustomerId()) ;
}
if(createReqVO.getOfferId()!=null && ( order.getDrawee()==3 && clearanceFee==1 )){//订单关联报价单 && 自定义付款 且发货人付清关费
order.setCustomerId(orderConsignorDO.getCustomerId()) ;
}
}
if(consignorCustomerDO.getDefaultPay() ){//发货人档案设置默认付运费 --层级4
List<CustomDraweeVO> list = JSONObject.parseArray(order.getCustomDrawee(), CustomDraweeVO.class);
List<CustomDraweeVO> freightList = list.stream().filter(s-> s.getName().equals("freight") ).collect(Collectors.toList());
List<CustomDraweeVO> clearanceFeeList = list.stream().filter(s-> s.getName().equals("clearanceFee") ).collect(Collectors.toList());
int freight = freightList.get(0).getValue() ;
int clearanceFee = clearanceFeeList.get(0).getValue();
if(order.getDrawee()==1 || ( order.getDrawee()==3 && freight==1 ) || ( order.getDrawee()==3 && clearanceFee==1 )){//如果是发货人付款 或自定义付款且发货人付运费 或自定义付款且发货人付清关费,业绩归属发货人
order.setCustomerId(orderConsignorDO.getCustomerId()) ;
}
}
if(order.getDrawee()==2 || order.getDrawee()==3){//如果是收货人付款或是自定义付款 --层级5
if(order.getDrawee()==2){//订单收货人付款,业绩归属收货人
order.setCustomerId(orderConsigneeDO.getCustomerId());
}else if(order.getDrawee()==3){
List<CustomDraweeVO> list = JSONObject.parseArray(order.getCustomDrawee(), CustomDraweeVO.class);
List<CustomDraweeVO> freightList = list.stream().filter(s-> s.getName().equals("freight") ).collect(Collectors.toList());
List<CustomDraweeVO> clearanceFeeList = list.stream().filter(s-> s.getName().equals("clearanceFee") ).collect(Collectors.toList());
int freight = freightList.get(0).getValue() ;
int clearanceFee = clearanceFeeList.get(0).getValue();
if((order.getDrawee()==3 && freight==2 ) || (order.getDrawee()==3 && clearanceFee==2)){//自定义付款且收款人付运费 或自定义付款且收款人付清关费 ,业绩归属收货人
order.setCustomerId(orderConsigneeDO.getCustomerId());
}
}
}
}
// 更新所属客户经理(业务员)
if (!OrderStatusEnum.DRAFT.getValue().equals(order.getStatus()) && Objects.nonNull(order.getCustomerId()) && order.getCustomerId() > 0) {
......@@ -814,6 +865,57 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
order.setCustomerId(orderConsigneeDO.getCustomerId());
}
}
// 补充业绩规则判断
if(!consignorDO.getNoConsignee() && !order.getHasConsignee()){//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
order.setCustomerId(orderConsignorDO.getCustomerId()) ;
}
if(createReqVO.getOfferId()!=null && order.getDrawee()==1){//订单关联报价单 && 发货人付款
order.setCustomerId(orderConsignorDO.getCustomerId()) ;
}
if(createReqVO.getOfferId()!=null && order.getDrawee()==3 ){//订单关联报价单 && 自定义付款
List<CustomDraweeVO> list = JSONObject.parseArray(order.getCustomDrawee(), CustomDraweeVO.class);
List<CustomDraweeVO> freightList = list.stream().filter(s-> s.getName().equals("freight") ).collect(Collectors.toList());
List<CustomDraweeVO> clearanceFeeList = list.stream().filter(s-> s.getName().equals("clearanceFee") ).collect(Collectors.toList());
int freight = freightList.get(0).getValue() ;
int clearanceFee = clearanceFeeList.get(0).getValue();
if(createReqVO.getOfferId()!=null && ( order.getDrawee()==3 && freight==1 )){//订单关联报价单 && 自定义付款 且发货人付运费
order.setCustomerId(orderConsignorDO.getCustomerId()) ;
}
if(createReqVO.getOfferId()!=null && ( order.getDrawee()==3 && clearanceFee==1 )){//订单关联报价单 && 自定义付款 且发货人付清关费
order.setCustomerId(orderConsignorDO.getCustomerId()) ;
}
}
if(consignorDO.getDefaultPay() ){//发货人档案设置默认付运费 --层级4
List<CustomDraweeVO> list = JSONObject.parseArray(order.getCustomDrawee(), CustomDraweeVO.class);
List<CustomDraweeVO> freightList = list.stream().filter(s-> s.getName().equals("freight") ).collect(Collectors.toList());
List<CustomDraweeVO> clearanceFeeList = list.stream().filter(s-> s.getName().equals("clearanceFee") ).collect(Collectors.toList());
int freight = freightList.get(0).getValue() ;
int clearanceFee = clearanceFeeList.get(0).getValue();
if(order.getDrawee()==1 || ( order.getDrawee()==3 && freight==1 ) || ( order.getDrawee()==3 && clearanceFee==1 )){//如果是发货人付款 或自定义付款且发货人付运费 或自定义付款且发货人付清关费,业绩归属发货人
order.setCustomerId(orderConsignorDO.getCustomerId()) ;
}
}
if(order.getDrawee()==2 || order.getDrawee()==3){//如果是收货人付款或是自定义付款 --层级5
if(order.getDrawee()==2){//订单收货人付款,业绩归属收货人
order.setCustomerId(orderConsigneeDO.getCustomerId());
}else if(order.getDrawee()==3){
List<CustomDraweeVO> list = JSONObject.parseArray(order.getCustomDrawee(), CustomDraweeVO.class);
List<CustomDraweeVO> freightList = list.stream().filter(s-> s.getName().equals("freight") ).collect(Collectors.toList());
List<CustomDraweeVO> clearanceFeeList = list.stream().filter(s-> s.getName().equals("clearanceFee") ).collect(Collectors.toList());
int freight = freightList.get(0).getValue() ;
int clearanceFee = clearanceFeeList.get(0).getValue();
if((order.getDrawee()==3 && freight==2 ) || (order.getDrawee()==3 && clearanceFee==2)){//自定义付款且收款人付运费 或自定义付款且收款人付清关费 ,业绩归属收货人
order.setCustomerId(orderConsigneeDO.getCustomerId());
}
}
}
}
// 更新所属客户经理(业务员)
if (Objects.nonNull(order.getCustomerId()) && order.getCustomerId() > 0) {
......@@ -2737,6 +2839,58 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
updateObj.setCustomerId(orderConsigneeDO.getCustomerId());
}
}
// 补充业绩规则判断
if(!consignorCustomerDO.getNoConsignee() && !updateObj.getHasConsignee()){//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
updateObj.setCustomerId(orderConsignorDO.getCustomerId()) ;
}
if(updateReqVO.getOfferId()!=null && updateObj.getDrawee()==1){//订单关联报价单 && 发货人付款
updateObj.setCustomerId(orderConsignorDO.getCustomerId()) ;
}
if(updateReqVO.getOfferId()!=null && updateObj.getDrawee()==3 ){//订单关联报价单 && 自定义付款
List<CustomDraweeVO> list = JSONObject.parseArray(updateObj.getCustomDrawee(), CustomDraweeVO.class);
List<CustomDraweeVO> freightList = list.stream().filter(s-> s.getName().equals("freight") ).collect(Collectors.toList());
List<CustomDraweeVO> clearanceFeeList = list.stream().filter(s-> s.getName().equals("clearanceFee") ).collect(Collectors.toList());
int freight = freightList.get(0).getValue() ;
int clearanceFee = clearanceFeeList.get(0).getValue();
if(updateReqVO.getOfferId()!=null && ( updateObj.getDrawee()==3 && freight==1 )){//订单关联报价单 && 自定义付款 且发货人付运费
updateObj.setCustomerId(orderConsignorDO.getCustomerId()) ;
}
if(updateReqVO.getOfferId()!=null && ( updateObj.getDrawee()==3 && clearanceFee==1 )){//订单关联报价单 && 自定义付款 且发货人付清关费
updateObj.setCustomerId(orderConsignorDO.getCustomerId()) ;
}
}
if(consignorCustomerDO.getDefaultPay() ){//发货人档案设置默认付运费 --层级4
List<CustomDraweeVO> list = JSONObject.parseArray(updateObj.getCustomDrawee(), CustomDraweeVO.class);
List<CustomDraweeVO> freightList = list.stream().filter(s-> s.getName().equals("freight") ).collect(Collectors.toList());
List<CustomDraweeVO> clearanceFeeList = list.stream().filter(s-> s.getName().equals("clearanceFee") ).collect(Collectors.toList());
int freight = freightList.get(0).getValue() ;
int clearanceFee = clearanceFeeList.get(0).getValue();
if(updateObj.getDrawee()==1 || ( updateObj.getDrawee()==3 && freight==1 ) || ( updateObj.getDrawee()==3 && clearanceFee==1 )){//如果是发货人付款 或自定义付款且发货人付运费 或自定义付款且发货人付清关费,业绩归属发货人
updateObj.setCustomerId(orderConsignorDO.getCustomerId()) ;
}
}
if(updateObj.getDrawee()==2 || updateObj.getDrawee()==3){//如果是收货人付款或是自定义付款 --层级5
if(updateObj.getDrawee()==2){//订单收货人付款,业绩归属收货人
updateObj.setCustomerId(orderConsigneeDO.getCustomerId());
}else if(updateObj.getDrawee()==3){
List<CustomDraweeVO> list = JSONObject.parseArray(updateObj.getCustomDrawee(), CustomDraweeVO.class);
List<CustomDraweeVO> freightList = list.stream().filter(s-> s.getName().equals("freight") ).collect(Collectors.toList());
List<CustomDraweeVO> clearanceFeeList = list.stream().filter(s-> s.getName().equals("clearanceFee") ).collect(Collectors.toList());
int freight = freightList.get(0).getValue() ;
int clearanceFee = clearanceFeeList.get(0).getValue();
if((updateObj.getDrawee()==3 && freight==2 ) || (updateObj.getDrawee()==3 && clearanceFee==2)){//自定义付款且收款人付运费 或自定义付款且收款人付清关费 ,业绩归属收货人
updateObj.setCustomerId(orderConsigneeDO.getCustomerId());
}
}
}
}
// 更新所属客户经理(业务员)
if (!OrderStatusEnum.DRAFT.getValue().equals(updateObj.getStatus()) && Objects.nonNull(updateObj.getCustomerId()) && updateObj.getCustomerId() > 0) {
......@@ -2979,7 +3133,58 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
}
}
}
// 更新所属客户经理(业务员)
// 补充业绩规则判断
if(!consignorDO.getNoConsignee() && !updateObj.getHasConsignee()){//发货人档案设置控货无收货人且订单无收获人,归属发货人业绩 -- 层级2
updateObj.setCustomerId(orderConsignorDO.getCustomerId()) ;
}
if(updateReqVO.getOfferId()!=null && updateObj.getDrawee()==1){//订单关联报价单 && 发货人付款
updateObj.setCustomerId(orderConsignorDO.getCustomerId()) ;
}
if(updateReqVO.getOfferId()!=null && updateObj.getDrawee()==3 ){//订单关联报价单 && 自定义付款
List<CustomDraweeVO> list = JSONObject.parseArray(updateObj.getCustomDrawee(), CustomDraweeVO.class);
List<CustomDraweeVO> freightList = list.stream().filter(s-> s.getName().equals("freight") ).collect(Collectors.toList());
List<CustomDraweeVO> clearanceFeeList = list.stream().filter(s-> s.getName().equals("clearanceFee") ).collect(Collectors.toList());
int freight = freightList.get(0).getValue() ;
int clearanceFee = clearanceFeeList.get(0).getValue();
if(updateReqVO.getOfferId()!=null && ( updateObj.getDrawee()==3 && freight==1 )){//订单关联报价单 && 自定义付款 且发货人付运费
updateObj.setCustomerId(orderConsignorDO.getCustomerId()) ;
}
if(updateReqVO.getOfferId()!=null && ( updateObj.getDrawee()==3 && clearanceFee==1 )){//订单关联报价单 && 自定义付款 且发货人付清关费
updateObj.setCustomerId(orderConsignorDO.getCustomerId()) ;
}
}
if(consignorDO.getDefaultPay() ){//发货人档案设置默认付运费 --层级4
List<CustomDraweeVO> list = JSONObject.parseArray(updateObj.getCustomDrawee(), CustomDraweeVO.class);
List<CustomDraweeVO> freightList = list.stream().filter(s-> s.getName().equals("freight") ).collect(Collectors.toList());
List<CustomDraweeVO> clearanceFeeList = list.stream().filter(s-> s.getName().equals("clearanceFee") ).collect(Collectors.toList());
int freight = freightList.get(0).getValue() ;
int clearanceFee = clearanceFeeList.get(0).getValue();
if(updateObj.getDrawee()==1 || ( updateObj.getDrawee()==3 && freight==1 ) || ( updateObj.getDrawee()==3 && clearanceFee==1 )){//如果是发货人付款 或自定义付款且发货人付运费 或自定义付款且发货人付清关费,业绩归属发货人
updateObj.setCustomerId(orderConsignorDO.getCustomerId()) ;
}
}
if(updateObj.getDrawee()==2 || updateObj.getDrawee()==3){//如果是收货人付款或是自定义付款 --层级5
if(updateObj.getDrawee()==2){//订单收货人付款,业绩归属收货人
updateObj.setCustomerId(orderConsigneeDO.getCustomerId());
}else if(updateObj.getDrawee()==3){
List<CustomDraweeVO> list = JSONObject.parseArray(updateObj.getCustomDrawee(), CustomDraweeVO.class);
List<CustomDraweeVO> freightList = list.stream().filter(s-> s.getName().equals("freight") ).collect(Collectors.toList());
List<CustomDraweeVO> clearanceFeeList = list.stream().filter(s-> s.getName().equals("clearanceFee") ).collect(Collectors.toList());
int freight = freightList.get(0).getValue() ;
int clearanceFee = clearanceFeeList.get(0).getValue();
if((updateObj.getDrawee()==3 && freight==2 ) || (updateObj.getDrawee()==3 && clearanceFee==2)){//自定义付款且收款人付运费 或自定义付款且收款人付清关费 ,业绩归属收货人
updateObj.setCustomerId(orderConsigneeDO.getCustomerId());
}
}
}
// 更新所属客户经理(业务员)
if (!OrderStatusEnum.DRAFT.getValue().equals(updateObj.getStatus()) && Objects.nonNull(updateObj.getCustomerId()) && updateObj.getCustomerId() > 0) {
addOrderCustomerService(updateObj, customerType);
}
......
......@@ -596,7 +596,7 @@ region.label.code.not.null=The country locale import city code cannot be empty
region.label.code.country.and.city=The format of import city code is -> Country (code)- City (code).
region.label.code.country.and.city.and.air.country=The format of the import city code for country and region settings is ->Country (code) ->City (code) ->Country (air freight code)
estimate.enter.open.sea.time.not.null=Estimated time of entry to the open seas cannot be null
estimate.enter.open.sea.time.delay.transfinite=The extension is expected to last up to 31 days
estimate.enter.open.sea.time.delay.transfinite=The extension is expected to last up to 180 days
customer.approval.status.not.correct=The customer approval status is incorrect
customer.approval.form.id.not.exists=The customer approval process instance ID does not exist
customer.approval.info.not.find=Customer approval details not found
......
......@@ -601,7 +601,7 @@ region.label.code.not.null=\u56FD\u5BB6\u533A\u57DF\u8BBE\u7F6E\u8FDB\u53E3\u57C
region.label.code.country.and.city=\u56FD\u5BB6\u533A\u57DF\u8BBE\u7F6E\u8FDB\u53E3\u57CE\u5E02\u4EE3\u7801\u683C\u5F0F\u4E3A-> \u56FD\u5BB6(\u4EE3\u7801)-\u57CE\u5E02(\u4EE3\u7801)
region.label.code.country.and.city.and.air.country=\u56FD\u5BB6\u533A\u57DF\u8BBE\u7F6E\u8FDB\u53E3\u57CE\u5E02\u4EE3\u7801\u683C\u5F0F\u4E3A-> \u56FD\u5BB6%28\u4EE3\u7801%29-\u57CE\u5E02%28\u4EE3\u7801%29-\u56FD\u5BB6%28\u7A7A\u8FD0\u4EE3\u7801%29
estimate.enter.open.sea.time.not.null=\u9884\u8BA1\u8FDB\u5165\u516C\u6D77\u65F6\u95F4\u4E0D\u80FD\u4E3A\u7A7A
estimate.enter.open.sea.time.delay.transfinite=\u9884\u8BA1\u8FDB\u5165\u516C\u6D77\u5EF6\u671F\u65F6\u95F4\u6700\u592731\u5929
estimate.enter.open.sea.time.delay.transfinite=\u9884\u8BA1\u8FDB\u5165\u516C\u6D77\u5EF6\u671F\u65F6\u95F4\u6700\u5927180\u5929
customer.approval.status.not.correct=\u5BA2\u6237\u5BA1\u6279\u72B6\u6001\u9519\u8BEF
customer.approval.form.id.not.exists=\u5BA2\u6237\u5BA1\u6279\u6D41\u7A0B\u5B9E\u4F8BID\u4E0D\u5B58\u5728
customer.approval.info.not.find=\u5BA2\u6237\u5BA1\u6279\u8BE6\u60C5\u672A\u627E\u5230
......
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