|
@@ -24,11 +24,13 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
+import io.seata.spring.annotation.GlobalTransactional;
|
|
|
import lombok.AllArgsConstructor;
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.secure.utils.SecureUtil;
|
|
import org.springblade.core.secure.utils.SecureUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.utils.ObjectUtil;
|
|
import org.springblade.core.tool.utils.ObjectUtil;
|
|
|
|
|
+import org.springblade.purchase.sales.entity.Biding;
|
|
|
import org.springblade.salesPart.corps.mapper.CorpsDescMapper;
|
|
import org.springblade.salesPart.corps.mapper.CorpsDescMapper;
|
|
|
import org.springblade.salesPart.corps.mapper.CorpsTypeDescMapper;
|
|
import org.springblade.salesPart.corps.mapper.CorpsTypeDescMapper;
|
|
|
import org.springblade.salesPart.corps.mapper.CorpsTypeMapper;
|
|
import org.springblade.salesPart.corps.mapper.CorpsTypeMapper;
|
|
@@ -72,7 +74,7 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
|
|
|
|
|
|
|
|
private final CorpsTypeMapper corpsTypeMapper;
|
|
private final CorpsTypeMapper corpsTypeMapper;
|
|
|
private final IUserClient userClient;
|
|
private final IUserClient userClient;
|
|
|
- private final ISysClient iSysClient;
|
|
|
|
|
|
|
+ private final ISysClient sysClient;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 获取客户详情
|
|
* 获取客户详情
|
|
@@ -140,6 +142,12 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
|
|
|
}
|
|
}
|
|
|
corpsDesc.setTenantId(AuthUtil.getTenantId());
|
|
corpsDesc.setTenantId(AuthUtil.getTenantId());
|
|
|
corpsDesc.setIsDeleted(0);
|
|
corpsDesc.setIsDeleted(0);
|
|
|
|
|
+ corpsDesc.setStrTenantId(Arrays.asList(AuthUtil.getDeptId().split(",")));
|
|
|
|
|
+
|
|
|
|
|
+ /*String role = AuthUtil.getUserRole();
|
|
|
|
|
+ if (!role.contains("管理员")){
|
|
|
|
|
+
|
|
|
|
|
+ }*/
|
|
|
|
|
|
|
|
IPage<CorpsDescVO> page1 = page.setRecords(baseMapper.selectCorpsDescPage(page, corpsDesc));
|
|
IPage<CorpsDescVO> page1 = page.setRecords(baseMapper.selectCorpsDescPage(page, corpsDesc));
|
|
|
return page1;
|
|
return page1;
|
|
@@ -150,7 +158,8 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
|
|
|
* 新增或修改
|
|
* 新增或修改
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- @Transactional
|
|
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
|
+ @GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
|
|
|
public R submit(PjCorpsDesc corpsDesc) {
|
|
public R submit(PjCorpsDesc corpsDesc) {
|
|
|
Long userId = SecureUtil.getUserId();
|
|
Long userId = SecureUtil.getUserId();
|
|
|
Date date = new Date();
|
|
Date date = new Date();
|
|
@@ -161,17 +170,19 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
|
|
|
corpsDesc.setCreateDept(Long.valueOf(SecureUtil.getDeptId()));
|
|
corpsDesc.setCreateDept(Long.valueOf(SecureUtil.getDeptId()));
|
|
|
corpsDesc.setCreateTime(date);
|
|
corpsDesc.setCreateTime(date);
|
|
|
corpsDesc.setCreateUser(userId);
|
|
corpsDesc.setCreateUser(userId);
|
|
|
|
|
+ corpsDesc.setSalesCompanyId(Long.valueOf(AuthUtil.getDeptId()));
|
|
|
|
|
+ corpsDesc.setSalesCompanyName(sysClient.getDept(Long.valueOf(AuthUtil.getDeptId())).getData().getFullName());
|
|
|
baseMapper.insert(corpsDesc);
|
|
baseMapper.insert(corpsDesc);
|
|
|
} else {
|
|
} else {
|
|
|
corpsDesc.setTenantId(SecureUtil.getTenantId());
|
|
corpsDesc.setTenantId(SecureUtil.getTenantId());
|
|
|
corpsDesc.setUpdateTime(date);
|
|
corpsDesc.setUpdateTime(date);
|
|
|
corpsDesc.setCreateDept(Long.valueOf(SecureUtil.getDeptId()));
|
|
corpsDesc.setCreateDept(Long.valueOf(SecureUtil.getDeptId()));
|
|
|
- corpsDesc.setUpdateUser(userId);
|
|
|
|
|
|
|
+ corpsDesc.setUpdateUser(AuthUtil.getUserId());
|
|
|
baseMapper.updateById(corpsDesc);
|
|
baseMapper.updateById(corpsDesc);
|
|
|
}
|
|
}
|
|
|
Long pId = corpsDesc.getId();
|
|
Long pId = corpsDesc.getId();
|
|
|
String tenantId = corpsDesc.getTenantId();
|
|
String tenantId = corpsDesc.getTenantId();
|
|
|
- //保护客户联系人信息
|
|
|
|
|
|
|
+ //保存客户联系人信息
|
|
|
R saveOrUpdateAttn = this.saveOrUpdateAttn(corpsDesc, userId, pId, tenantId, date);
|
|
R saveOrUpdateAttn = this.saveOrUpdateAttn(corpsDesc, userId, pId, tenantId, date);
|
|
|
if (saveOrUpdateAttn.getCode() != 200) {
|
|
if (saveOrUpdateAttn.getCode() != 200) {
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
@@ -198,7 +209,8 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- @Transactional
|
|
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
|
+ @GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
|
|
|
public R importUser(List<CorpsDescImportExcel> data) {
|
|
public R importUser(List<CorpsDescImportExcel> data) {
|
|
|
try {
|
|
try {
|
|
|
if (CollectionUtils.isEmpty(data)) {
|
|
if (CollectionUtils.isEmpty(data)) {
|
|
@@ -294,7 +306,8 @@ public class CorpsDescServiceImpl extends ServiceImpl<CorpsDescMapper, PjCorpsDe
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- @Transactional
|
|
|
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
|
+ @GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
|
|
|
public R supplierImport(List<SupplierImportExcel> data) {
|
|
public R supplierImport(List<SupplierImportExcel> data) {
|
|
|
try {
|
|
try {
|
|
|
if (CollectionUtils.isEmpty(data)) {
|
|
if (CollectionUtils.isEmpty(data)) {
|