|
|
@@ -20,6 +20,8 @@ import com.goafanti.core.mybatis.JDBCIdGenerator;
|
|
|
import com.goafanti.core.mybatis.page.Pagination;
|
|
|
import com.goafanti.core.shiro.token.TokenManager;
|
|
|
import com.goafanti.expenseAccount.Enums.EAProcessStatus;
|
|
|
+import com.goafanti.expenseAccount.Enums.EATypes;
|
|
|
+import com.goafanti.expenseAccount.Enums.EAsecondaryTypes;
|
|
|
import com.goafanti.expenseAccount.bo.*;
|
|
|
import com.goafanti.expenseAccount.service.ExpenseAccountService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -30,7 +32,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
-import java.util.concurrent.atomic.AtomicReference;
|
|
|
|
|
|
@Service
|
|
|
public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapper> implements ExpenseAccountService {
|
|
|
@@ -708,13 +709,29 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
|
|
|
in.setPayDep(admin.getDepartmentId());
|
|
|
Integer eaaid = expenseAccountPrivateMapper.selectByaidDefault(TokenManager.getAdminId());
|
|
|
in.setEaaid(eaaid);
|
|
|
- AtomicReference<BigDecimal> count = new AtomicReference<>(new BigDecimal(0));
|
|
|
- list.stream().forEach(e -> {
|
|
|
- count.set(count.get().add(e.getTotalAmount()));
|
|
|
- });
|
|
|
- in.setTotalAmount(count.get());
|
|
|
- in.setRealAmount(count.get());
|
|
|
+ BigDecimal count = new BigDecimal(0);
|
|
|
+ List<String> typeList = new ArrayList<String>();
|
|
|
+ for (ExpenseAccount e : list) {
|
|
|
+ count.add(e.getTotalAmount());
|
|
|
+ StringBuffer types=new StringBuffer();
|
|
|
+ if (e.getType()!=0){
|
|
|
+ types=types.append(EATypes.getDescByCode(e.getType()));
|
|
|
+ }else {
|
|
|
+ types=types.append(e.getTypeOther());
|
|
|
+ }
|
|
|
+ if (e.getSecondaryType()!=0){
|
|
|
+ if (e.getSecondaryType()==13){
|
|
|
+ types=types.append(e.getSecondaryTypeOther());
|
|
|
+ }else{
|
|
|
+ types=types.append(EAsecondaryTypes.getDescByCode(e.getSecondaryType()));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (typeList.contains(types.toString()))typeList.add(types.toString());
|
|
|
+ }
|
|
|
+ in.setTotalAmount(count);
|
|
|
+ in.setRealAmount(count);
|
|
|
in.setExpenseMain(1);
|
|
|
+ in.setTypeOther(String.join(",",typeList));
|
|
|
expenseAccountMapper.insertSelective(in);
|
|
|
list.stream().forEach(e -> {
|
|
|
ExpenseRelationship er=new ExpenseRelationship();
|