Commit ba20d12a authored by lanbaoming's avatar lanbaoming

2024-07-03-4提交

parent 1ca70cc0
......@@ -24,6 +24,15 @@ import java.util.List;
@Mapper
public interface CustomerMapper extends BaseMapperX<CustomerDO> {
//合并操作日志
void doMergeCustomerOperateLog(long customer_id1,long customer_id2);
//合并客户信用日志
void doMergeCustomerCreditLog(long customer_id1,long customer_id2);
//合并客户登记日志
void doMergeCustomerLevelLog(long customer_id1,long customer_id2);
IPage<CustomerDO> getPage(IPage<CustomerDO> page,
@Param(Constants.WRAPPER) Wrapper<CustomerDO> queryWrapper);
......
......@@ -26,6 +26,13 @@ import java.util.List;
*/
public interface CustomerService extends IService<CustomerDO> {
//合并操作日志
void doMergeCustomerOperateLog(long customer_id1,long customer_id2);
//合并客户信用日志
void doMergeCustomerCreditLog(long customer_id1,long customer_id2);
void doMergeCustomerLevelLog(long customer_id1,long customer_id2);
/**
* 新建订单,收货人同步到后台,如果手机号不存在新增一个客户档案,进入待分配客户
......
......@@ -174,6 +174,22 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper,
public static final String logFormat = "[%d]联系人:%s 区号:%s 电话:%s 默认:(%s)";
//合并操作日志
public void doMergeCustomerOperateLog(long customer_id1, long customer_id2) {
customerMapper.doMergeCustomerOperateLog(customer_id1, customer_id2);
}
//合并客户信用日志
public void doMergeCustomerCreditLog(long customer_id1, long customer_id2) {
customerMapper.doMergeCustomerCreditLog(customer_id1, customer_id2);
}
//合并客户登记日志
public void doMergeCustomerLevelLog(long customer_id1, long customer_id2) {
customerMapper.doMergeCustomerLevelLog(customer_id1, customer_id2);
}
/*
发货人带来的收货人,
......@@ -1148,8 +1164,8 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper,
log.warn(I18nMessage.getLang().toString());
int start = (page.getPage() - 1) * page.getRows();
int size = page.getRows();
List<CustomerDO> list = customerMapper.getMyPage(start,size,pageReqVO);
long total = customerMapper.getMyPageCount(pageReqVO) ;
List<CustomerDO> list = customerMapper.getMyPage(start, size, pageReqVO);
long total = customerMapper.getMyPageCount(pageReqVO);
return new PageResult<>(list, total,
mpPage.getSize(), page.getPage(),
(total + mpPage.getSize() - 1) / mpPage.getSize());
......@@ -1209,7 +1225,7 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper,
}
@Override
public PageResult<CustomerDO> getDeptCustomerPageReq(CustomerPageReqDTO pageReqVO,PageVO page){
public PageResult<CustomerDO> getDeptCustomerPageReq(CustomerPageReqDTO pageReqVO, PageVO page) {
IPage<CustomerDO> mpPage = MyBatisUtils.buildPage(page);
log.warn(I18nMessage.getLang().toString());
......@@ -1220,25 +1236,25 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper,
int start = (page.getPage() - 1) * page.getRows();
int size = page.getRows();
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
Long deptId =null;
Long deptId = null;
if (null != loginUser && null != loginUser.getDeptId()) {
deptId = loginUser.getDeptId() ;
deptId = loginUser.getDeptId();
}
List<CustomerDO> list =
customerMapper.getDeptCustomerPageReq(start,size,pageReqVO,deptId);
long total = customerMapper.getDeptCustomerPageReqCount(pageReqVO,deptId) ;
customerMapper.getDeptCustomerPageReq(start, size, pageReqVO, deptId);
long total = customerMapper.getDeptCustomerPageReqCount(pageReqVO, deptId);
return new PageResult<>(list, total, mpPage.getSize(), page.getPage(), (total + mpPage.getSize() - 1) / mpPage.getSize());
}
@Override
public List<CustomerDO> getDeptCustomerExcelVoListReq(CustomerExportReqDTO exportReqVO) {
LoginUser loginUser = SecurityFrameworkUtils.getLoginUser();
Long deptId =null;
if (null != loginUser && loginUser.getDeptId()>0) {
deptId = loginUser.getDeptId() ;
Long deptId = null;
if (null != loginUser && loginUser.getDeptId() > 0) {
deptId = loginUser.getDeptId();
}
return customerMapper.getDeptCustomerExcelVoListReq(exportReqVO,deptId) ;
return customerMapper.getDeptCustomerExcelVoListReq(exportReqVO, deptId);
}
@Override
......@@ -1348,15 +1364,16 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper,
/**
* 获得待分配客户列表 支持多个筛选
*
* @param pageReqVO
* @param page
* @return
*/
@Override
public PageResult<CustomerDO> getWaitToAssignedCustomerPageReq(CustomerPageReqDTO pageReqVO,PageVO page) {
pageReqVO.setIsInOpenSea(false) ;
pageReqVO.setIsCustomerServiceConfirmed(false) ;
pageReqVO.setCustomerService(null) ;
public PageResult<CustomerDO> getWaitToAssignedCustomerPageReq(CustomerPageReqDTO pageReqVO, PageVO page) {
pageReqVO.setIsInOpenSea(false);
pageReqVO.setIsCustomerServiceConfirmed(false);
pageReqVO.setCustomerService(null);
IPage<CustomerDO> mpPage = MyBatisUtils.buildPage(page);
log.warn(I18nMessage.getLang().toString());
......@@ -1366,8 +1383,8 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper,
int start = (page.getPage() - 1) * page.getRows();
int size = page.getRows();
List<CustomerDO> list =
customerMapper.getWaitToAssignedCustomerPageReq(start,size,pageReqVO);
long total = customerMapper.getWaitToAssignedCustomerPageReqCount(pageReqVO) ;
customerMapper.getWaitToAssignedCustomerPageReq(start, size, pageReqVO);
long total = customerMapper.getWaitToAssignedCustomerPageReqCount(pageReqVO);
return new PageResult<>(list, total, mpPage.getSize(), page.getPage(), (total + mpPage.getSize() - 1) / mpPage.getSize());
}
......@@ -1420,8 +1437,9 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper,
@Override
public List<CustomerDO> getWaitToAssignedCustomerExcelVoListReq(CustomerExportReqDTO exportReqVO) {
return customerMapper.getWaitToAssignedCustomerListReq(exportReqVO) ;
return customerMapper.getWaitToAssignedCustomerListReq(exportReqVO);
}
@Override
public PageResult<CustomerDO> getWaitToConfirmCustomerPage(CustomerPageReqVO pageReqVO) {
......@@ -1478,9 +1496,9 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper,
}
@Override
public PageResult<CustomerDO> getWaitToConfirmCustomerPageReq(CustomerPageReqDTO pageReqVO, PageVO page){
pageReqVO.setIsCustomerServiceConfirmed(false) ;
pageReqVO.setIsInOpenSea(false) ;
public PageResult<CustomerDO> getWaitToConfirmCustomerPageReq(CustomerPageReqDTO pageReqVO, PageVO page) {
pageReqVO.setIsCustomerServiceConfirmed(false);
pageReqVO.setIsInOpenSea(false);
IPage<CustomerDO> mpPage = MyBatisUtils.buildPage(page);
log.warn(I18nMessage.getLang().toString());
......@@ -1490,8 +1508,8 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper,
int start = (page.getPage() - 1) * page.getRows();
int size = page.getRows();
List<CustomerDO> list =
customerMapper.getWaitToConfirmCustomerPageReq(start,size,pageReqVO);
long total = customerMapper.getWaitToConfirmCustomerPageReqCount(pageReqVO) ;
customerMapper.getWaitToConfirmCustomerPageReq(start, size, pageReqVO);
long total = customerMapper.getWaitToConfirmCustomerPageReqCount(pageReqVO);
return new PageResult<>(list, total, mpPage.getSize(), page.getPage(), (total + mpPage.getSize() - 1) / mpPage.getSize());
}
......@@ -1544,23 +1562,26 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper,
return customerMapper.getCustomerExcelVoList(customerDOLambdaQueryWrapperX);
}
/**
* 我的待接收客户列表, 用于 Excel 导出 ,支持多选
*
* @param reqVO
* @return
*/
@Override
public List<CustomerDO> getWaitToConfirmCustomerExcelVoListReq(CustomerExportReqDTO reqVO){
reqVO.setIsCustomerServiceConfirmed(false) ;
reqVO.setIsInOpenSea(false) ;
public List<CustomerDO> getWaitToConfirmCustomerExcelVoListReq(CustomerExportReqDTO reqVO) {
reqVO.setIsCustomerServiceConfirmed(false);
reqVO.setIsInOpenSea(false);
List<Long> setCustomerService = new ArrayList<Long>();
if(getLoginUserId()!=null){
setCustomerService.add(getLoginUserId()) ;
reqVO.setCustomerService(setCustomerService) ;
if (getLoginUserId() != null) {
setCustomerService.add(getLoginUserId());
reqVO.setCustomerService(setCustomerService);
}
return customerMapper.getWaitToConfirmCustomerExcelVoListReq(reqVO) ;
return customerMapper.getWaitToConfirmCustomerExcelVoListReq(reqVO);
}
@Override
public PageResult<CustomerDO> getOpenSeaCustomerPage(CustomerPageReqVO reqVO) {
......@@ -1614,7 +1635,7 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper,
}
@Override
public PageResult<CustomerDO> getOpenSeaCustomerPageReq(CustomerPageReqDTO pageReqVO,PageVO page){
public PageResult<CustomerDO> getOpenSeaCustomerPageReq(CustomerPageReqDTO pageReqVO, PageVO page) {
pageReqVO.setIsInOpenSea(true);
IPage<CustomerDO> mpPage = MyBatisUtils.buildPage(page);
......@@ -1626,8 +1647,8 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper,
int start = (page.getPage() - 1) * page.getRows();
int size = page.getRows();
List<CustomerDO> list =
customerMapper.getOpenSeaCustomerPageReq(start,size,pageReqVO);
long total = customerMapper.getOpenSeaCustomerPageReqCount(pageReqVO) ;
customerMapper.getOpenSeaCustomerPageReq(start, size, pageReqVO);
long total = customerMapper.getOpenSeaCustomerPageReqCount(pageReqVO);
return new PageResult<>(list, total, mpPage.getSize(), page.getPage(), (total + mpPage.getSize() - 1) / mpPage.getSize());
}
......@@ -1679,9 +1700,9 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper,
}
@Override
public List<CustomerDO> getPublicCustomerExcelVoReqList(@Param("query") CustomerExportReqDTO reqVO){
reqVO.setIsInOpenSea(true) ;
return customerMapper.getPublicCustomerExcelVoReqList(reqVO) ;
public List<CustomerDO> getPublicCustomerExcelVoReqList(@Param("query") CustomerExportReqDTO reqVO) {
reqVO.setIsInOpenSea(true);
return customerMapper.getPublicCustomerExcelVoReqList(reqVO);
}
@Override
......
......@@ -60,7 +60,8 @@ public interface CustomerComplaintService extends IService<CustomerComplaintDO>
* @param pageReqVO 分页查询
* @return 客户投诉分页
*/
PageResult<CustomerComplaintRespVO> getCustomerComplaintPage(CustomerComplaintPageReqVO pageReqVO);
PageResult<CustomerComplaintRespVO> getCustomerComplaintPage(
CustomerComplaintPageReqVO pageReqVO);
/**
* 获得客户投诉列表, 用于 Excel 导出
......@@ -68,6 +69,7 @@ public interface CustomerComplaintService extends IService<CustomerComplaintDO>
* @param exportReqVO 查询条件
* @return 客户投诉列表
*/
List<CustomerComplaintExcelVO> getCustomerComplaintList(CustomerComplaintExportReqVO exportReqVO);
List<CustomerComplaintExcelVO> getCustomerComplaintList(
CustomerComplaintExportReqVO exportReqVO);
}
......@@ -81,7 +81,8 @@ public class CustomerOperateLogServiceImpl extends AbstractService<CustomerOpera
}
@Override
public PageResult<CustomerOperateLogDO> getOperateLogPage(CustomerOperateLogQueryVO query, PageVO page) {
public PageResult<CustomerOperateLogDO> getOperateLogPage(
CustomerOperateLogQueryVO query, PageVO page) {
return customerOperateLogMapper.selectPage(page, query);
}
......
......@@ -41,8 +41,6 @@
</select>
<select id="getList" resultType="cn.iocoder.yudao.module.customer.dal.dataobject.customer.CustomerDO">
select * from (
<include refid="queryTable"/>
......@@ -50,7 +48,6 @@
${ew.customSqlSegment}
</select>
<select id="getMyCustomerList"
resultType="cn.iocoder.yudao.module.customer.dal.dataobject.customer.CustomerDO">
<include refid="queryTable"/>
......@@ -1703,4 +1700,24 @@
</select>
<update id="doMergeCustomerLevelLog">
<!--合并客户登记日志-->
update ecw_customer_level_log set customer_id=#{customer_id1},update_time=now()
where customer_id=#{customer_id2}
</update>
<update id="doMergeCustomerCreditLog">
<!--合并信用日志-->
update ecw_customer_credit_log set customer_id=#{customer_id1},update_time=now()
where customer_id=#{customer_id2}
</update>
<update id="doMergeCustomerOperateLog">
<!--合并操作日志-->
update ecw_customer_operate_log set customer_id=#{customer_id1},update_time=now()
where customer_id=#{customer_id2}
</update>
</mapper>
......@@ -263,7 +263,8 @@ public class CustomerController {
for (CustomerContactsUpdateReqVO customerContact : customerContacts) {
Long userid = customerContact.getUserid();
if (userid != null && userid != 0) { //老数据导入过来后部分userid=0
count = customerContactsService.count(new LambdaQueryWrapperX<CustomerContactsDO>().eq(CustomerContactsDO::getUserid, userid)
count = customerContactsService.count(
new LambdaQueryWrapperX<CustomerContactsDO>().eq(CustomerContactsDO::getUserid, userid)
.ne(CustomerContactsDO::getCustomerId, updateReqVO.getId()).eq(BaseDO::getDeleted, 0));
if (count > 0) {
UserRespDTO user = memberUserApi.getUser(userid);
......@@ -363,6 +364,7 @@ public class CustomerController {
//3. 合并后,非主客户的联系人,跟进记录,报价单,订单,
// 客户投诉,品牌授权都迁移到保留客户中,其他信息不会迁移,
// 如需要维护非主客户的客户档案信息到保留客户中,请先维护好再操作
if (par.getId1() == null) {
return success(false);
}
......@@ -400,7 +402,9 @@ public class CustomerController {
}
private boolean doMergeCus(CustomerDO customerDO1,
CustomerDO customerDO2, long loginUserId) {
CustomerDO customerDO2,
long loginUserId) {
/*
提交验证:
当保留客户和非主客户的客户经理均不为空且不是同一个用户(允许客户在公海),
......@@ -422,22 +426,27 @@ public class CustomerController {
非主客户关联的订单/收款单/佣金情况单,佣金付款单有在途流程,
需要测试这种情况是否影响合并
*/
//把客户2的联系方式合并到客户1
//把客户2的联系方式合并到客户1 1
doMogeContact(customerDO1, customerDO2, loginUserId);
//合并报价单
//合并报价单 2
doMogeOffer(customerDO1, customerDO2, loginUserId);
//合并跟进记录
//合并跟进记录 3
doMergeCustomerFollow(customerDO1, customerDO2, loginUserId);
//合并客户投诉
//合并客户投诉 4
doMergeCustomerComplaint(customerDO1, customerDO2, loginUserId);
//合并收款单信息
//合并收款单信息 5
doMergeeReceipt(customerDO1, customerDO2, loginUserId);
//合并产品品牌授权
//合并产品品牌授权 6
doMergeProductBrandEmpower(customerDO1,customerDO2,loginUserId);
//合并客户信用日志
//合并客户登记日志 7
doMergeCustomerLevelLog(customerDO1,customerDO2,loginUserId);
//合并信用日志 8
customerService.doMergeCustomerCreditLog(customerDO1.getId(),
customerDO2.getId());
//合并操作日志 9
customerService.doMergeCustomerOperateLog(customerDO1.getId(),
customerDO2.getId());
return true;
}
......@@ -446,21 +455,8 @@ public class CustomerController {
CustomerDO customerDO2,
long loginUserId)
{
/*
LambdaQueryWrapperX q2 =
new LambdaQueryWrapperX<>().
eq(CustomerLevelLogDO::getCustomerId,
customerService.doMergeCustomerLevelLog(customerDO1.getId(),
customerDO2.getId());
List<CustomerLevelLogDO> list =
customerLevelLogService.selectList(q2);
if (CollectionUtil.isEmpty(list)) return;
for (CustomerLevelLogDO d : list
) {
d.setCustomerId(customerDO1.getId());
customerLevelLogService.updateById(d);
}*/
}
......@@ -469,7 +465,6 @@ public class CustomerController {
CustomerDO customerDO2,
long loginUserId)
{
LambdaQueryWrapperX q2 =
new LambdaQueryWrapperX<ProductBrandEmpowerDO>().
eq(ProductBrandEmpowerDO::getCustomerId,
......@@ -490,8 +485,11 @@ public class CustomerController {
long loginUserId) {
LambdaQueryWrapperX q2 =
new LambdaQueryWrapperX<CustomerComplaintDO>().
eq(CustomerComplaintDO::getCustomerId, customerDO2.getId());
List<CustomerComplaintDO> list = customerComplaintService.selectList(q2);
eq(CustomerComplaintDO::getCustomerId,
customerDO2.getId());
List<CustomerComplaintDO> list =
customerComplaintService.selectList(q2);
if (CollectionUtil.isEmpty(list)) return;
for (CustomerComplaintDO d : list
......
......@@ -126,7 +126,8 @@ public class CustomerDetailController {
@GetMapping("/creditLogPage")
@ApiOperation("获得客户信用日志分页")
public CommonResult<PageResult<CustomerCreditLogBackVO>> getCreditLogPage(@RequestParam("customerId") Long customerId, PageParam page) {
public CommonResult<PageResult<CustomerCreditLogBackVO>> getCreditLogPage(
@RequestParam("customerId") Long customerId, PageParam page) {
return success(customerCreditLogService.getCreditLogPage(customerId, page));
}
}
......@@ -77,7 +77,8 @@ public class CustomerOperateLogController {
@ApiOperation("获得客户操作日志分页")
@PreAuthorize("@ss.hasPermission('customer:operate-log:query')")
public CommonResult<PageResult<CustomerOperateLogBackVO>> getOperateLogPage(@Valid CustomerOperateLogQueryVO query, PageVO page) {
PageResult<CustomerOperateLogDO> pageResult = operateLogService.getOperateLogPage(query, page);
PageResult<CustomerOperateLogDO> pageResult =
operateLogService.getOperateLogPage(query, page);
return success(CustomerOperateLogConvert.INSTANCE.convertPage(pageResult));
}
......
......@@ -6016,6 +6016,10 @@ public interface OrderMapper extends AbstractMapper<OrderDO> {
@Param("calVvalue") BigDecimal calVvalue,
@Param("yejiCreateDate") Date yejiCreateDate);
@Update("update ecw_order set salesman_id=#{salesman_id} where order_id = #{orderId}")
void updateOrderSalesmanId(@Param("orderId") Long orderId,
@Param("salesman_id") Long salesman_id);
/**
* 报价结果赢单时,同步业绩归属
* @param customerId
......
......@@ -78,4 +78,14 @@ public interface TargetLogMapper extends AbstractMapper<TargetLogDO> {
})
List<TargetLogDO> selectList2(String sDate);
/*
@Select({
"<script>",
"select * from ecw_target_log where deleted=0 and (DATE_FORMAT(create_time,'%Y-%m')=#{sDate} OR DATE_FORMAT(achievement_time,'%Y-%m')=#{sDate})",
"</script>"
})
List<TargetLogDO> selectList2(String sDate);
*/
}
......@@ -29,6 +29,7 @@ import java.util.List;
*/
public interface OrderService extends IService<OrderDO> {
void updateOrderSalesmanId(Long orderId,Long salesman_id);
/**
* 创建订单
*
......
......@@ -162,16 +162,25 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
return;
}
// 判断该订单、该客户是否有未分配客户异常,如果有,则这个订单不计算业绩
List<OrderExceptionDO> orderExceptionDOList = orderExceptionService.getOrderExceptionByCustomerId(order.getCustomerId());
List<OrderExceptionDO> orderExceptionDOList =
orderExceptionService.getOrderExceptionByCustomerId(
order.getCustomerId());
// 获取当前订单的异常
OrderExceptionDO currentOrderException = orderExceptionDOList.stream()
.filter(orderExceptionDO -> Objects.equals(orderExceptionDO.getOrderId(), order.getOrderId())).findFirst().orElse(null);
CustomerDO customerDO = customerService.getById(order.getCustomerId());
Long oldCustomerService = null; // 老客户经理默认为null
if (Objects.nonNull(customerDO) && Objects.nonNull(customerDO.getCustomerService()) && customerDO.getCustomerService() != 0L && Objects.nonNull(customerDO.getCustomerServiceAssignedTime())
&& !customerDO.getIsCustomerServiceConfirmed() && !customerDO.getIsInOpenSea()) {
// 如果客户存在,客户经理已分配,有分配时间,但是待确认接收,也不是公海捞取,那么需要判断该客户之前是否有客户经理,没有则业绩属于公司客户,有则业绩归属于上个客户经理
CustomerOperateLogDO customerOperateLogDO = customerOperateLogService.getOne(new LambdaQueryWrapper<CustomerOperateLogDO>()
if (Objects.nonNull(customerDO) &&
Objects.nonNull(customerDO.getCustomerService())
&& customerDO.getCustomerService() != 0L
&& Objects.nonNull(customerDO.getCustomerServiceAssignedTime())
&& !customerDO.getIsCustomerServiceConfirmed()
&& !customerDO.getIsInOpenSea()) {
// 如果客户存在,客户经理已分配,有分配时间,但是待确认接收,
// 也不是公海捞取,那么需要判断该客户之前是否有客户经理,
// 没有则业绩属于公司客户,有则业绩归属于上个客户经理
CustomerOperateLogDO customerOperateLogDO =
customerOperateLogService.getOne(new LambdaQueryWrapper<CustomerOperateLogDO>()
.eq(CustomerOperateLogDO::getCustomerId, customerDO.getId())
.eq(CustomerOperateLogDO::getOperateType, 4) // TODO 暂定操作类型4为分配操作,有遗漏后面补充操作类型即可
.orderByDesc(CustomerOperateLogDO::getId).last("limit 1"));
......@@ -192,8 +201,12 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
if (Objects.nonNull(adminUserRespDTO)) {
order.setDeptId(adminUserRespDTO.getDeptId());
}
} else if (CollectionUtil.isEmpty(orderExceptionDOList) && Objects.nonNull(customerDO)
&& (Objects.isNull(customerDO.getCustomerService()) || (!customerDO.getIsCustomerServiceConfirmed() && Objects.isNull(oldCustomerService)))) {
} else if (CollectionUtil.isEmpty(orderExceptionDOList) &&
Objects.nonNull(customerDO)
&& (Objects.isNull(customerDO.getCustomerService()) ||
(!customerDO.getIsCustomerServiceConfirmed()
&& Objects.isNull(oldCustomerService)))) {
// 如果客户正在移交新客户经理,但是未接收,并且老客户经理不为null,则不创建客户经理未分配异常
//web下单,业绩为收货人,不产生未分配客户经理异常
if (order.getUserId() != null && order.getUserId() > 0 && customerType == 2) {
......@@ -219,7 +232,8 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
orderExceptionService.createOrderException(orderExceptionCreateReqVO);
}
} else {
// 该订单存在该客户未分配客户经理异常,或者该客户的客户经理待接收,则不再生成未分配客户经理异常,且该订单不产生业绩归属
// 该订单存在该客户未分配客户经理异常,
// 或者该客户的客户经理待接收,则不再生成未分配客户经理异常,且该订单不产生业绩归属
order.setSalesmanId(0L);
order.setDeptId(0L);
}
......
......@@ -1092,8 +1092,8 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
orderQueryService.isSplitOrderChildren(orderDO);
// 没有入仓数据则提示
Long inCount = orderWarehouseInMapper.selectCount(OrderWarehouseInDO::getOrderId,
orderId);
Long inCount = orderWarehouseInMapper.selectCount(
OrderWarehouseInDO::getOrderId, orderId);
if (inCount == 0) {
throw ServiceExceptionUtil.exception(
ErrorCodeConstants.ORDER_WAREHOUSE_IN_NOT_EXISTS);
......@@ -1135,8 +1135,12 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
orderWarehousePictureService.createWarehousePictureBatch(
finishReqVO.getExceptionUrls(), 4, orderId);
// 异常
String descZh = getOrderOtherExceptionDesc(manualExceptionType, 0, finishReqVO.getDescZh(), finishReqVO.getDescEn());
String descEn = getOrderOtherExceptionDesc(manualExceptionType, 1, finishReqVO.getDescZh(), finishReqVO.getDescEn());
String descZh = getOrderOtherExceptionDesc(manualExceptionType,
0, finishReqVO.getDescZh(),
finishReqVO.getDescEn());
String descEn = getOrderOtherExceptionDesc(manualExceptionType,
1, finishReqVO.getDescZh(),
finishReqVO.getDescEn());
OrderExceptionCreateReqVO orderExceptionCreateReqVO =
genOrderException(orderId,
......@@ -1182,9 +1186,7 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
// 更新
orderSpecialNeedService.updateBatchById(orderSpecialNeedList);
}
else
{
} else {
}
......@@ -1248,8 +1250,10 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
// orderWarehouseInDOList.stream().map(OrderWarehouseInDO::getWeight).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
// BigDecimal volumeSum = finishReqVO.getSumVolume() != null ? finishReqVO.getSumVolume() :
// orderWarehouseInDOList.stream().map(OrderWarehouseInDO::getVolume).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal weightSum = orderWarehouseInDOList.stream().map(OrderWarehouseInDO::getWeight).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal volumeSum = orderWarehouseInDOList.stream().map(OrderWarehouseInDO::getVolume).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal weightSum =
orderWarehouseInDOList.stream().map(OrderWarehouseInDO::getWeight).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
BigDecimal volumeSum =
orderWarehouseInDOList.stream().map(OrderWarehouseInDO::getVolume).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
orderDO.setSumQuantity(quantitySum);
orderDO.setSumWeight(weightSum);
orderDO.setSumVolume(volumeSum);
......@@ -1373,7 +1377,8 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
// 1、非拆单子订单 2、未发送短信 3、非退场入仓
if (!isSplitOrderChildren && finishReqVO.getSendMsg() && isNotRollbackIn) {
// 当没有异常时,才直接发送入仓短信。 有异常时需要在异常处理完后发送入仓短信。且入仓短信发送后不再次发送
OrderConsignorDO orderConsignorDO2 = orderConsignorService.getOne(new LambdaQueryWrapper<OrderConsignorDO>().eq(OrderConsignorDO::getOrderId, orderDO.getOrderId())
OrderConsignorDO orderConsignorDO2 =
orderConsignorService.getOne(new LambdaQueryWrapper<OrderConsignorDO>().eq(OrderConsignorDO::getOrderId, orderDO.getOrderId())
.orderByDesc(OrderConsignorDO::getId)
.last("limit 1"));
orderDO = orderService.getById(orderId);
......@@ -1381,7 +1386,8 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
if (exceptionNum == 0) {
Date appendInTime = new Date();
if (CollectionUtil.isNotEmpty(orderWarehouseInDOList)) {
OrderWarehouseInDO orderWarehouseInDO = orderWarehouseInDOList.stream().max(Comparator.comparing(OrderWarehouseInDO::getId)).get();
OrderWarehouseInDO orderWarehouseInDO =
orderWarehouseInDOList.stream().max(Comparator.comparing(OrderWarehouseInDO::getId)).get();
if (orderWarehouseInDO != null) {
appendInTime = orderWarehouseInDO.getInTime();
}
......@@ -1427,10 +1433,12 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
Objects.nonNull(consigneeCustomer.getCustomerService()) &&
(consignorCustomer.getCustomerService().equals(consigneeCustomer.getCustomerService()) || consignorCustomer.getCustomerService() == consigneeCustomer.getCustomerService())) {
if (orderConsignorDO2 != null && orderConsignorDO2.getCustomerId() != null) {
if (orderConsignorDO2 != null &&
orderConsignorDO2.getCustomerId() != null) {
idSet.add(orderConsignorDO2.getCustomerId());
}
if (orderConsigneeDO2 != null && orderConsigneeDO2.getCustomerId() != null) {
if (orderConsigneeDO2 != null &&
orderConsigneeDO2.getCustomerId() != null) {
idSet.add(orderConsigneeDO2.getCustomerId());
}
}
......@@ -3039,7 +3047,7 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
//删除储位
orderLocationService.deleteIfPresent(old.getOrderId(),
old.getOrderItemId(),old.getId());
old.getOrderItemId(), old.getId());
}
}
......@@ -3182,7 +3190,7 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
//删除储位
orderLocationService.deleteIfPresent(old.getOrderId(),
old.getOrderItemId(),old.getId());
old.getOrderItemId(), old.getId());
}
}
......@@ -3518,7 +3526,7 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
orderWarehouseInMapper.deleteBatchIds(deleteIds);
//根据订单ID删除储位
orderLocationService.deleteIfPresent(orderId,null,null);
orderLocationService.deleteIfPresent(orderId, null, null);
}
orderItemDO.setNum(updateReqVO.getNum());
......
......@@ -379,7 +379,9 @@ public class OrderController {
}
private static void addDataScopeQuery(OrderQueryVO query, LoginUser loginUser, List<RoleRespDTO> roleRespDTOS) {
private static void addDataScopeQuery(OrderQueryVO query,
LoginUser loginUser,
List<RoleRespDTO> roleRespDTOS) {
List<Long> deptIdList = new ArrayList<>();
boolean isAll = Boolean.FALSE;
for (RoleRespDTO roleRespDTO : roleRespDTOS) {
......
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