|
|
@@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import io.seata.spring.annotation.GlobalTransactional;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springblade.core.secure.utils.AuthUtil;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
@@ -46,6 +47,7 @@ import org.springblade.los.finance.fee.service.IFinAccBillsService;
|
|
|
import org.springblade.system.entity.Dept;
|
|
|
import org.springblade.system.feign.ISysClient;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
@@ -87,6 +89,8 @@ public class AmendsServiceImpl extends ServiceImpl<AmendsMapper, Amends> impleme
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ @GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
|
|
|
public R submit(Amends amends) {
|
|
|
String deptId = "";
|
|
|
String deptName = "";
|
|
|
@@ -139,7 +143,7 @@ public class AmendsServiceImpl extends ServiceImpl<AmendsMapper, Amends> impleme
|
|
|
}
|
|
|
this.saveOrUpdate(amends);
|
|
|
if (ObjectUtils.isNotNull(amends.getFeeCenterList())) {
|
|
|
- for (FeeCenter item:amends.getFeeCenterList()) {
|
|
|
+ for (FeeCenter item : amends.getFeeCenterList()) {
|
|
|
item.setPid(amends.getId());
|
|
|
}
|
|
|
feeCenterService.submitList(amends.getFeeCenterList());
|
|
|
@@ -174,6 +178,8 @@ public class AmendsServiceImpl extends ServiceImpl<AmendsMapper, Amends> impleme
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ @GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
|
|
|
public Amends checkAmends(Amends amends) {
|
|
|
Amends declare = baseMapper.selectById(amends.getId());
|
|
|
Integer actId = null;
|
|
|
@@ -256,6 +262,9 @@ public class AmendsServiceImpl extends ServiceImpl<AmendsMapper, Amends> impleme
|
|
|
.eq(FeeCenter::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(FeeCenter::getPid, declare.getId())
|
|
|
);
|
|
|
+ if (feeCenterList.size() == 0) {
|
|
|
+ throw new RuntimeException("费用明细不能为空");
|
|
|
+ }
|
|
|
BigDecimal amountC = feeCenterList.stream().filter(e -> "C".equals(e.getDc())).map(FeeCenter::getAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
BigDecimal amountD = feeCenterList.stream().filter(e -> "D".equals(e.getDc())).map(FeeCenter::getAmount).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
auditProecessDTO.setPayAmount(amountC);
|
|
|
@@ -273,6 +282,8 @@ public class AmendsServiceImpl extends ServiceImpl<AmendsMapper, Amends> impleme
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ @GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
|
|
|
public Amends revokeCheckAmends(Amends amends) {
|
|
|
Amends declare = baseMapper.selectById(amends.getId());
|
|
|
if (3 == declare.getStatus()) {
|
|
|
@@ -288,6 +299,8 @@ public class AmendsServiceImpl extends ServiceImpl<AmendsMapper, Amends> impleme
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ @GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
|
|
|
public R passCheck(Long id) {
|
|
|
Amends bills = baseMapper.selectById(id);
|
|
|
if (bills == null) {
|