|
@@ -17,9 +17,11 @@ import com.fs.qw.service.ICustomerTransferApprovalService;
|
|
|
import com.fs.qw.vo.TransferCustomDTO;
|
|
|
import com.fs.store.domain.FsUser;
|
|
|
import com.fs.store.dto.FsUserTransferParamDTO;
|
|
|
+import com.fs.store.mapper.FsUserCompanyUserMapper;
|
|
|
import com.fs.store.service.IFsUserService;
|
|
|
import com.fs.store.service.cache.IFsUserCacheService;
|
|
|
import com.hc.openapi.tool.util.StringUtils;
|
|
|
+import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.apache.http.util.Asserts;
|
|
|
import org.springframework.aop.framework.AopContext;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -53,6 +55,8 @@ public class CustomerTransferApprovalServiceImpl implements ICustomerTransferApp
|
|
|
@Autowired
|
|
|
private IFsUserService fsUserService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private FsUserCompanyUserMapper fsUserCompanyUserMapper;
|
|
|
/**
|
|
|
* 查询客户转移审批
|
|
|
*
|
|
@@ -239,9 +243,6 @@ public class CustomerTransferApprovalServiceImpl implements ICustomerTransferApp
|
|
|
item.setProcessedAt(new Date());
|
|
|
// 审批状态: 0=待审批, 1=审批通过, 2=审批驳回, 3=已撤销
|
|
|
// 如果审批通过 进行转移
|
|
|
- List<Long> customerIds1 = JSON.parseArray(item.getCustomerIds(), Long.class);
|
|
|
- List<TransferCustomDTO> customerList = getCustomerList(customerIds1, item);
|
|
|
- item.setTransferBefore(JSON.toJSONString(customerList));
|
|
|
|
|
|
if(ObjectUtil.equal(1,item.getApprovalStatus())){
|
|
|
FsUserTransferParamDTO transferParam = new FsUserTransferParamDTO();
|
|
@@ -253,9 +254,19 @@ public class CustomerTransferApprovalServiceImpl implements ICustomerTransferApp
|
|
|
transferParam.setUserIds(customerIds);
|
|
|
transferParam.setSourceCompanyUserId(item.getOriginalUserId());
|
|
|
|
|
|
- fsUserService.transfer(transferParam);
|
|
|
+ if(CollectionUtils.isNotEmpty(transferParam.getUserIds())) {
|
|
|
+ fsUserService.transfer(transferParam);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(CollectionUtils.isNotEmpty(transferParam.getUserIds())) {
|
|
|
+ fsUserCompanyUserMapper.transfer(transferParam);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+ List<Long> customerIds = JSON.parseArray(item.getCustomerIds(), Long.class);
|
|
|
+ List<TransferCustomDTO> customerList = getCustomerList(customerIds, item);
|
|
|
+ item.setTransferBefore(JSON.toJSONString(customerList));
|
|
|
+
|
|
|
return customerTransferApprovalMapper.updateCustomerTransferApproval(item);
|
|
|
}
|
|
|
|