Commit cb8ddf1e authored by liuzeheng's avatar liuzeheng

我的客户列表导出优化

parent 0e76f384
...@@ -98,6 +98,7 @@ import java.util.concurrent.TimeUnit; ...@@ -98,6 +98,7 @@ import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
import static cn.iocoder.yudao.module.bpm.enums.WorkFlowEmus.QUOTATION_CUSTOMER_DELAY_PUBLIC; import static cn.iocoder.yudao.module.bpm.enums.WorkFlowEmus.QUOTATION_CUSTOMER_DELAY_PUBLIC;
import static cn.iocoder.yudao.module.bpm.enums.WorkFlowEmus.QUOTATION_CUSTOMER_HANDOVER; import static cn.iocoder.yudao.module.bpm.enums.WorkFlowEmus.QUOTATION_CUSTOMER_HANDOVER;
import static cn.iocoder.yudao.module.ecw.enums.ErrorCodeConstants.*; import static cn.iocoder.yudao.module.ecw.enums.ErrorCodeConstants.*;
...@@ -1483,9 +1484,12 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, Custome ...@@ -1483,9 +1484,12 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, Custome
public List<CustomerDO> getWaitToConfirmCustomerExcelVoListReq(CustomerExportReqDTO reqVO){ public List<CustomerDO> getWaitToConfirmCustomerExcelVoListReq(CustomerExportReqDTO reqVO){
reqVO.setIsCustomerServiceConfirmed(false) ; reqVO.setIsCustomerServiceConfirmed(false) ;
reqVO.setIsInOpenSea(false) ; reqVO.setIsInOpenSea(false) ;
List<Long> setCustomerService = new ArrayList<>(); List<Long> setCustomerService = new ArrayList<Long>();
setCustomerService.add(WebFrameworkUtils.getLoginUserId()) ; if(getLoginUserId()!=null){
reqVO.setCustomerService(setCustomerService) ; setCustomerService.add(getLoginUserId()) ;
reqVO.setCustomerService(setCustomerService) ;
}
return customerMapper.getWaitToConfirmCustomerExcelVoListReq(reqVO) ; return customerMapper.getWaitToConfirmCustomerExcelVoListReq(reqVO) ;
} }
@Override @Override
...@@ -1858,7 +1862,7 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, Custome ...@@ -1858,7 +1862,7 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, Custome
if (Objects.isNull(delayApprovalInfoDto.getEstimateEnterOpenSeaTime())) { if (Objects.isNull(delayApprovalInfoDto.getEstimateEnterOpenSeaTime())) {
throw exception(ESTIMATE_ENTER_OPEN_SEA_TIME_NOT_NULL); throw exception(ESTIMATE_ENTER_OPEN_SEA_TIME_NOT_NULL);
} }
String creator = String.valueOf(SecurityFrameworkUtils.getLoginUserId()); String creator = String.valueOf(getLoginUserId());
CustomerDO customerDO = customerMapper.selectById(delayApprovalInfoDto.getCustomerId()); CustomerDO customerDO = customerMapper.selectById(delayApprovalInfoDto.getCustomerId());
if (Objects.isNull(customerDO)) { if (Objects.isNull(customerDO)) {
throw exception(CUSTOMER_NOT_EXISTS); throw exception(CUSTOMER_NOT_EXISTS);
...@@ -1933,7 +1937,7 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, Custome ...@@ -1933,7 +1937,7 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, Custome
@Override @Override
public void cancelDelayApproval(Long approveId, String reason) { public void cancelDelayApproval(Long approveId, String reason) {
Long userId = SecurityFrameworkUtils.getLoginUserId(); Long userId = getLoginUserId();
CustomerApprovalDO approvalDO = customerApprovalService.getById(approveId); CustomerApprovalDO approvalDO = customerApprovalService.getById(approveId);
if (approvalDO.getDeleted() || (approvalDO.getType() != 1 && approvalDO.getStatus() != 1)) { if (approvalDO.getDeleted() || (approvalDO.getType() != 1 && approvalDO.getStatus() != 1)) {
throw exception(CUSTOMER_APPROVAL_STATUS_NOT_CORRECT); throw exception(CUSTOMER_APPROVAL_STATUS_NOT_CORRECT);
...@@ -2273,7 +2277,7 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, Custome ...@@ -2273,7 +2277,7 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, Custome
customerApprovalDO.setCreateTime(new Date()); customerApprovalDO.setCreateTime(new Date());
customerApprovalService.save(customerApprovalDO); customerApprovalService.save(customerApprovalDO);
String creator = String.valueOf(SecurityFrameworkUtils.getLoginUserId()); String creator = String.valueOf(getLoginUserId());
String formId = bpmCreateServiceFactory.createBmpDesignated(Long.valueOf(creator), customerApprovalDO.getApprovalId(), QUOTATION_CUSTOMER_HANDOVER.getKey(), String formId = bpmCreateServiceFactory.createBmpDesignated(Long.valueOf(creator), customerApprovalDO.getApprovalId(), QUOTATION_CUSTOMER_HANDOVER.getKey(),
null, null, String.valueOf(customerServiceOld)); null, null, String.valueOf(customerServiceOld));
...@@ -2349,7 +2353,7 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, Custome ...@@ -2349,7 +2353,7 @@ public class CustomerServiceImpl extends AbstractService<CustomerMapper, Custome
@Override @Override
public void cancelHandoverApproval(Long approveId, String reason) { public void cancelHandoverApproval(Long approveId, String reason) {
Long userId = SecurityFrameworkUtils.getLoginUserId(); Long userId = getLoginUserId();
CustomerApprovalDO approvalDO = customerApprovalService.getById(approveId); CustomerApprovalDO approvalDO = customerApprovalService.getById(approveId);
if (approvalDO.getDeleted() || (approvalDO.getType() != 2 && approvalDO.getStatus() != 1)) { if (approvalDO.getDeleted() || (approvalDO.getType() != 2 && approvalDO.getStatus() != 1)) {
throw exception(CUSTOMER_APPROVAL_STATUS_NOT_CORRECT); throw exception(CUSTOMER_APPROVAL_STATUS_NOT_CORRECT);
......
...@@ -32,6 +32,7 @@ import java.util.ArrayList; ...@@ -32,6 +32,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import static cn.iocoder.yudao.framework.excel.constant.ExportConstant.DATA_FORMAT; import static cn.iocoder.yudao.framework.excel.constant.ExportConstant.DATA_FORMAT;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
/** /**
...@@ -73,8 +74,12 @@ public class CustomerExcelExportListener { ...@@ -73,8 +74,12 @@ public class CustomerExcelExportListener {
public void customerMineExcelExportPushEvent(CustomerMineExcelExportPushEvent event) { public void customerMineExcelExportPushEvent(CustomerMineExcelExportPushEvent event) {
CustomerExportReqDTO exportReqVO = JSONObject.parseObject(event.getRequestParams(), CustomerExportReqDTO.class); CustomerExportReqDTO exportReqVO = JSONObject.parseObject(event.getRequestParams(), CustomerExportReqDTO.class);
List<Long> setCustomerService = new ArrayList<>(); List<Long> setCustomerService = new ArrayList<>();
setCustomerService.add(WebFrameworkUtils.getLoginUserId()) ; if(getLoginUserId()!=null){
exportReqVO.setCustomerService(setCustomerService) ; setCustomerService.add(getLoginUserId()) ;
exportReqVO.setCustomerService(setCustomerService) ;
}
//未被接收 //未被接收
exportReqVO.setIsCustomerServiceConfirmed(true); exportReqVO.setIsCustomerServiceConfirmed(true);
......
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