Commit 2ec88a7c authored by 332784038@qq.com's avatar 332784038@qq.com

Merge branch 'test' into dev

parents 575f8b1f b8c4ba8e
-- 这里是补充脚本,生产环境已存在
-- 添加新字段
alter table `ecw_customer` add column `no_consignee` bit(1) NOT NULL DEFAULT b'0' COMMENT '控货无收货人';
alter table `ecw_customer` add column `default_pay` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否默认付款';
-- 添加新字段
alter table `ecw_warehouse` add column `rent_free_days` int DEFAULT NULL COMMENT '仓库免租期';
alter table `ecw_warehouse` add column `lock_recipient_days` int DEFAULT NULL COMMENT '锁定收货人天数';
......@@ -55,7 +55,7 @@ public interface AbstractMapper<T> extends BaseMapper<T> {
IPage<T> mpPage = MyBatisUtils.buildPage(pageParam);
selectPage(mpPage, queryWrapper);
// 转换返回
return new PageResult<>(mpPage.getRecords(), mpPage.getTotal());
return new PageResult<>(mpPage.getRecords(), mpPage.getTotal(), mpPage.getSize(), mpPage.getCurrent(), mpPage.getPages());
}
/***
......
......@@ -85,4 +85,15 @@ public class CustomerFollowupQueryVO extends PageParam {
@ApiModelProperty(value = "结束创建时间")
private Date endCreateTime;
@ApiModelProperty(value = "跟进类型,下拉多选")
private List<Integer> followTypes;
@ApiModelProperty(value = "跟进方式,下拉多选")
private List<Integer> followMethods;
@ApiModelProperty(value = "跟进结果,下拉多选")
private List<Integer> resultTypes;
//跟进状态,多选,逗号分隔
@ApiModelProperty(value = "跟进状态,下拉多选")
private List<Integer> statuses;
}
......@@ -38,6 +38,35 @@
AND a.result_type = #{query.resultType}
</if>
<if test="query.followTypes != null and query.followTypes.size()>0">
AND
<foreach item='item' index="index" collection='query.followTypes' open='(' separator='or' close=')'>
FIND_IN_SET(#{item}, a.follow_type)
</foreach>
</if>
<if test="query.followMethods != null and query.followMethods.size()>0">
AND
<foreach item='item' index="index" collection='query.followMethods' open='(' separator='or' close=')'>
FIND_IN_SET(#{item}, a.follow_method)
</foreach>
</if>
<if test="query.resultTypes != null and query.resultTypes.size()>0">
AND
<foreach item='item' index="index" collection='query.resultTypes' open='(' separator='or' close=')'>
FIND_IN_SET(#{item}, a.result_type)
</foreach>
</if>
<if test="query.statuses != null and query.statuses.size()>0">
AND
<foreach item='item' index="index" collection='query.statuses' open='(' separator='or' close=')'>
FIND_IN_SET(#{item}, a.status)
</foreach>
</if>
</sql>
<select id="selectPage1" resultType="cn.iocoder.yudao.module.customer.dal.dataobject.customerFollowup.CustomerFollowupDO">
......
......@@ -9,15 +9,13 @@ import cn.iocoder.yudao.module.customer.dal.dataobject.customer.CustomerDO;
import cn.iocoder.yudao.module.customer.dal.dataobject.customer.complaint.CustomerComplaintDO;
import cn.iocoder.yudao.module.customer.dal.dataobject.customer.follow.CustomerFollowDO;
import cn.iocoder.yudao.module.customer.dal.dataobject.customerContacts.CustomerContactsDO;
import cn.iocoder.yudao.module.customer.dal.dataobject.customerFollowup.CustomerFollowupDO;
import cn.iocoder.yudao.module.customer.service.customer.CustomerService;
import cn.iocoder.yudao.module.customer.service.customer.commission.CustomerCommissionService;
import cn.iocoder.yudao.module.customer.service.customer.complaint.CustomerComplaintService;
import cn.iocoder.yudao.module.customer.service.customer.complaint.follow.CustomerFollowService;
import cn.iocoder.yudao.module.customer.service.customerContacts.CustomerContactsService;
import cn.iocoder.yudao.module.customer.service.customerCredit.CustomerCreditService;
import cn.iocoder.yudao.module.customer.service.customerLevel.CustomerLevelService;
import cn.iocoder.yudao.module.customer.service.customerFollowup.CustomerFollowupService;
import cn.iocoder.yudao.module.customer.service.customerLevelLog.CustomerLevelLogService;
import cn.iocoder.yudao.module.customer.service.customerLevelLog.CustomerLevelLogServiceImpl;
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.CustomerOperateTypeEnum;
......@@ -60,7 +58,7 @@ public class CustomerMergeServiceImpl implements CustomerMergeService {
//客户跟进
@Resource
CustomerFollowService customerFollowService;
CustomerFollowupService customerFollowupService;
@Resource
private CustomerComplaintService customerComplaintService;
......@@ -134,7 +132,7 @@ public class CustomerMergeServiceImpl implements CustomerMergeService {
//合并报价单 2
doMogeOffer(customerDOSaved, customerDODeleted, loginUserId);
//合并跟进记录 3
doMergeCustomerFollow(customerDOSaved, customerDODeleted, loginUserId);
doMergeCustomerFollowup(customerDOSaved, customerDODeleted, loginUserId);
//合并客户投诉 4
doMergeCustomerComplaint(customerDOSaved, customerDODeleted, loginUserId);
//合并产品品牌授权 6
......@@ -293,19 +291,19 @@ public class CustomerMergeServiceImpl implements CustomerMergeService {
//合并客户跟进
private void doMergeCustomerFollow(CustomerDO customerDOSaved,
CustomerDO customerDODeleted,
long loginUserId) {
private void doMergeCustomerFollowup(CustomerDO customerDOSaved,
CustomerDO customerDODeleted,
long loginUserId) {
LambdaQueryWrapperX q2 =
new LambdaQueryWrapperX<CustomerFollowDO>().
eq(CustomerFollowDO::getCustomerId, customerDODeleted.getId());
List<CustomerFollowDO> list = customerFollowService.selectList(q2);
new LambdaQueryWrapperX<CustomerFollowupDO>().
eq(CustomerFollowupDO::getCustomerId, customerDODeleted.getId());
List<CustomerFollowupDO> list = customerFollowupService.selectList(q2);
if (CollectionUtil.isEmpty(list)) return;
for (CustomerFollowDO d : list
for (CustomerFollowupDO d : list
) {
d.setCustomerId(customerDOSaved.getId());
customerFollowService.updateById(d);
customerFollowupService.updateById(d);
}
}
......
......@@ -33,6 +33,7 @@ import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
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;
......@@ -109,7 +110,7 @@ public class WarehouseController {
@GetMapping("/getGuojiaAndShiAndWarehouseList")
@ApiOperation("获取仓库区域并行国家、城市、仓库列表")
@ApiImplicitParam(name = "tradeType", value = "进出口类型,1-进口,2-出口", required = false, example = "1", dataTypeClass = Integer.class)
@ApiImplicitParam(name = "tradeType", value = "进出口类型,1-进口,2-出口", required = true, example = "1", dataTypeClass = Integer.class)
public CommonResult<WarehouseListVO> getGuojiaAndShiAndWarehouseList(Integer tradeType){
WarehouseListVO warehouseListVO = warehouseService.getGuojiaAndShiAndWarehouseList(tradeType);
return success(warehouseListVO);
......@@ -216,6 +217,9 @@ public class WarehouseController {
channelInfoEvent.setChannelId(requestVO.getChannelId());
applicationContext.publishEvent(channelInfoEvent);
if (Objects.nonNull(channelInfoEvent.getCountryId()) && channelInfoEvent.getCountryId() > 0L){
if (Objects.nonNull(requestVO.getDestCountryId()) && requestVO.getDestCountryId() > 0L && !Objects.equals(requestVO.getDestCountryId(),channelInfoEvent.getCountryId())) {
return error(400,"目的国与渠道不匹配");
}
requestVO.setDestCountryId(channelInfoEvent.getCountryId());
}
}
......
......@@ -29,6 +29,7 @@ import javax.validation.Valid;
import java.util.*;
import java.util.stream.Collectors;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.error;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Api(tags = "app-web - 仓库")
......@@ -137,6 +138,9 @@ public class AppWarehouseController {
channelInfoEvent.setChannelId(requestVO.getChannelId());
applicationContext.publishEvent(channelInfoEvent);
if (Objects.nonNull(channelInfoEvent.getCountryId()) && channelInfoEvent.getCountryId() > 0L){
if (Objects.nonNull(requestVO.getDestCountryId()) && requestVO.getDestCountryId() > 0L && !Objects.equals(requestVO.getDestCountryId(),channelInfoEvent.getCountryId())) {
return error(400,"目的国与渠道不匹配");
}
requestVO.setDestCountryId(channelInfoEvent.getCountryId());
}
}
......@@ -186,7 +190,7 @@ public class AppWarehouseController {
@GetMapping("/getGuojiaAndShiAndWarehouseList")
@ApiOperation("获取仓库区域并行国家、城市、仓库列表")
@ApiImplicitParam(name = "tradeType", value = "进出口类型,1-进口,2-出口", required = false, example = "1", dataTypeClass = Integer.class)
@ApiImplicitParam(name = "tradeType", value = "进出口类型,1-进口,2-出口", required = true, example = "1", dataTypeClass = Integer.class)
public CommonResult<WarehouseListVO> getGuojiaAndShiAndWarehouseList(Integer tradeType){
WarehouseListVO warehouseListVO = warehouseService.getGuojiaAndShiAndWarehouseList(tradeType);
return success(warehouseListVO);
......
......@@ -111,6 +111,10 @@ public interface OrderCargoControlPickMapper extends AbstractMapper<OrderCargoCo
"o.sum_volume, ",
"o.sum_weight, ",
"o.create_time, ",
"o.`unload_time`, ",
"o.`is_limit_update_consignee`, ",
"o.`lock_consignee_time`, ",
"o.`lock_consignee_day`, ",
"nee.name as consignee_name, ",
"nee.name_en as consignee_name_en, ",
"nee.phone as consignee_phone, ",
......
......@@ -2322,6 +2322,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
//15 是费用计算
//10 入仓更新
//30 空运定时刷新价格
@Override
public void costCalculation(String userId,
OrderDO orderDO,
Long consignorCustomerId,
......@@ -2728,7 +2729,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
// 拆单后的子订单直接去生成应收
isPayAdvanceException = this.addOrderReceivable(orderDO, 1);
} else {
if (type == 6 && Objects.equals(orderDO.getInWarehouseState(), OrderWarehouseInStatusEnum.warehouse_finished.getValue())) {
if ((type == 6 || type == 12) && Objects.equals(orderDO.getInWarehouseState(), OrderWarehouseInStatusEnum.warehouse_finished.getValue())) {
// 处理未报价时,如果是已入仓产品去生成应收
isPayAdvanceException = this.addOrderReceivable(orderDO,
1);
......
......@@ -312,7 +312,17 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
String creator = String.valueOf(loginUser != null ? loginUser.getId() : null);
Date now = new Date();
if (Objects.nonNull(createReqVO.getHarvestMethod()) && createReqVO.getHarvestMethod() == 2) {
order.setCountry(createReqVO.getCountry());
order.setProvince(createReqVO.getProvince());
order.setCity(createReqVO.getCity());
order.setConsigneeAddress(createReqVO.getConsigneeAddress());
} else {
order.setCountry(0L);
order.setProvince(0L);
order.setCity(0L);
order.setConsigneeAddress("");
}
order.setCreator(creator);
order.setUpdater(creator);
order.setCreateTime(now);
......@@ -619,8 +629,12 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderConsigneeDO.setCompanyEn(createReqVO.getConsigneeCompanyEn());
orderConsigneeDO.setHarvestMethod(createReqVO.getHarvestMethod()); // 收货方式
if (StringUtils.isNotBlank(createReqVO.getConsigneeAddress())) {
orderConsigneeDO.setAddress(createReqVO.getConsigneeAddress());
if (Objects.nonNull(createReqVO.getHarvestMethod()) && createReqVO.getHarvestMethod() == 2) {
if (StringUtils.isNotBlank(createReqVO.getConsigneeAddress())) {
orderConsigneeDO.setAddress(createReqVO.getConsigneeAddress());
}
} else {
orderConsigneeDO.setAddress("");
}
orderConsigneeDO.setCountry(createReqVO.getCountry());
orderConsigneeDO.setProvince(createReqVO.getProvince());
......@@ -684,7 +698,11 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderConsigneeService.save(orderConsigneeDO);
} else {
// 控货订单没有收货人则不限制修改收货人
order.setIsLimitUpdateConsignee(Boolean.FALSE);
if (order.getIsCargoControl() && !hasConsignee) {
order.setIsLimitUpdateConsignee(Boolean.TRUE);
} else {
order.setIsLimitUpdateConsignee(Boolean.FALSE);
}
}
if (!Objects.equals(createReqVO.getStatus(), DRAFT.getValue())) {
//customerType 发货人-1 收货人 2
......@@ -879,9 +897,12 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderConsigneeDO.setHarvestMethod(createReqVO.getHarvestMethod());
//收货方式
if (StringUtils.isNotBlank(createReqVO.getConsigneeAddress())) {
orderConsigneeDO.setAddress(createReqVO.getConsigneeAddress());
if (Objects.nonNull(createReqVO.getHarvestMethod()) && createReqVO.getHarvestMethod() == 2) {
if (StringUtils.isNotBlank(createReqVO.getConsigneeAddress())) {
orderConsigneeDO.setAddress(createReqVO.getConsigneeAddress());
}
} else {
orderConsigneeDO.setAddress("");
}
orderConsigneeDO.setCountry(createReqVO.getCountry());
orderConsigneeDO.setProvince(createReqVO.getProvince());
......@@ -931,7 +952,11 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
}
} else {
// 控货订单没有收货人则不限制修改收货人
order.setIsLimitUpdateConsignee(Boolean.FALSE);
if (order.getIsCargoControl() && !hasConsignee) {
order.setIsLimitUpdateConsignee(Boolean.TRUE);
} else {
order.setIsLimitUpdateConsignee(Boolean.FALSE);
}
}
if (!Objects.equals(createReqVO.getStatus(),
DRAFT.getValue())) {
......@@ -1627,7 +1652,17 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
Date now = new Date();
updateObj.setUpdater(updater);
updateObj.setUpdateTime(now);
if (Objects.nonNull(updateReqVO.getHarvestMethod()) && updateReqVO.getHarvestMethod() == 2) {
updateObj.setCountry(updateReqVO.getCountry());
updateObj.setProvince(updateReqVO.getProvince());
updateObj.setCity(updateReqVO.getCity());
updateObj.setConsigneeAddress(updateReqVO.getConsigneeAddress());
} else {
updateObj.setCountry(0L);
updateObj.setProvince(0L);
updateObj.setCity(0L);
updateObj.setConsigneeAddress("");
}
departureDO.setUpdater(updater);
departureDO.setUpdateTime(now);
departureDO.setDepartureCountryId(logisticsInfoDto.getStartCountryId());
......@@ -2947,6 +2982,15 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderConsigneeBackVO.setAddress(updateReqVO.getConsigneeAddress());
orderConsigneeBackVO.setHarvestMethod(updateReqVO.getHarvestMethod());
vo.setConsigneeVO(orderConsigneeBackVO);
vo.setCountry(updateReqVO.getCountry());
vo.setProvince(updateReqVO.getProvince());
vo.setCity(updateReqVO.getCity());
vo.setConsigneeAddress(updateReqVO.getConsigneeAddress());
} else {
vo.setCountry(0L);
vo.setProvince(0L);
vo.setCity(0L);
vo.setConsigneeAddress("");
}
applyInfoList.add(infoVO);
}
......@@ -3214,8 +3258,12 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderConsigneeDO.setCompanyEn(updateReqVO.getConsigneeCompanyEn());
orderConsigneeDO.setHarvestMethod(updateReqVO.getHarvestMethod()); // 收货方式
if (StringUtils.isNotBlank(updateReqVO.getConsigneeAddress())) {
orderConsigneeDO.setAddress(updateReqVO.getConsigneeAddress());
if (Objects.nonNull(updateReqVO.getHarvestMethod()) && updateReqVO.getHarvestMethod() == 2) {
if (StringUtils.isNotBlank(updateReqVO.getConsigneeAddress())) {
orderConsigneeDO.setAddress(updateReqVO.getConsigneeAddress());
}
} else {
orderConsigneeDO.setAddress("");
}
orderConsigneeDO.setCountry(updateReqVO.getCountry());
orderConsigneeDO.setProvince(updateReqVO.getProvince());
......@@ -3267,12 +3315,16 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderConsigneeService.saveOrUpdate(orderConsigneeDO);
} else {
// 如果控货订单发货人设置了控货无收货人,则需要删除订单已有收货人
if (Objects.nonNull(orderConsigneeDO)) {
if (Objects.nonNull(orderConsigneeDO) && !hasConsignee) {
orderConsigneeService.removeById(orderConsigneeDO.getId());
orderConsigneeDO = null;
}
// 控货订单没有收货人则不限制修改收货人
updateObj.setIsLimitUpdateConsignee(Boolean.FALSE);
if (updateObj.getIsCargoControl() && !hasConsignee) {
updateObj.setIsLimitUpdateConsignee(Boolean.TRUE);
} else {
updateObj.setIsLimitUpdateConsignee(Boolean.FALSE);
}
}
if (!Objects.equals(updateReqVO.getStatus(),
DRAFT.getValue())) {
......@@ -3481,8 +3533,12 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
throw exception(CONSIGNEE_PHONE_IS_EXTERNAL);
}
orderConsigneeDO.setHarvestMethod(updateReqVO.getHarvestMethod()); // 收货方式
if (StringUtils.isNotBlank(updateReqVO.getConsigneeAddress())) {
orderConsigneeDO.setAddress(updateReqVO.getConsigneeAddress());
if (Objects.nonNull(updateReqVO.getHarvestMethod()) && updateReqVO.getHarvestMethod() == 2) {
if (StringUtils.isNotBlank(updateReqVO.getConsigneeAddress())) {
orderConsigneeDO.setAddress(updateReqVO.getConsigneeAddress());
}
} else {
orderConsigneeDO.setAddress("");
}
orderConsigneeDO.setOrderId(updateObj.getOrderId());
orderConsigneeDO.setUpdater(updater);
......@@ -3526,13 +3582,17 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
}
} else {
// 如果控货订单发货人设置了控货无收货人,则需要删除订单已有收货人
if (Objects.nonNull(orderConsigneeDO)) {
if (Objects.nonNull(orderConsigneeDO) && !hasConsignee) {
orderConsigneeService.removeById(orderConsigneeDO.getId());
orderConsigneeDO = null;
}
consigneeDO = null;
// 控货订单没有收货人则不限制修改收货人
updateObj.setIsLimitUpdateConsignee(Boolean.FALSE);
if (updateObj.getIsCargoControl() && !hasConsignee) {
updateObj.setIsLimitUpdateConsignee(Boolean.TRUE);
} else {
updateObj.setIsLimitUpdateConsignee(Boolean.FALSE);
}
}
if (!Objects.equals(updateReqVO.getStatus(),
DRAFT.getValue())) {
......
......@@ -6563,8 +6563,6 @@
from (
select
o.*,
o.release_num,
o.release_ratio,
occ.`name` as cargo_control_name,
occ.dial_code as cargo_control_country_code,
occ.phone as cargo_control_phone,
......
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