|
|
@@ -446,16 +446,15 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
|
|
|
@Override
|
|
|
public Object logList(Integer eaid) {
|
|
|
List<OutExpenseAccountLog> list = expenseAccountLogMapper.selectByEaid(eaid);
|
|
|
- deduplication(list);
|
|
|
if (!list.isEmpty()) {
|
|
|
OutExpenseAccountLog lastout = list.get(list.size() - 1);
|
|
|
ExpenseAccount expenseAccount = expenseAccountMapper.selectByPrimaryKey(eaid);
|
|
|
Integer processStatus = lastout.getProcessStatus();
|
|
|
- if (processStatus <3){
|
|
|
- List<OutExpenseAccountLog> outExpenseAccountLogs = expenseAccountExamineMapper.selectNotExamineByEaidAndProcessStatus(eaid, processStatus);
|
|
|
- list.addAll(outExpenseAccountLogs);
|
|
|
- }
|
|
|
if (lastout.getStatus() != 3) {
|
|
|
+ if (processStatus <3){
|
|
|
+ List<OutExpenseAccountLog> outExpenseAccountLogs = expenseAccountExamineMapper.selectNotExamineByEaidAndProcessStatus(eaid, processStatus);
|
|
|
+ list.addAll(outExpenseAccountLogs);
|
|
|
+ }
|
|
|
List<ExpenseAccountExamine> expenseAccountExamines = expenseAccountExamineMapper.selectByEaidAndProcessStatus(eaid, processStatus);
|
|
|
for (ExpenseAccountExamine e : expenseAccountExamines) {
|
|
|
if (e.getStatus()==0){
|
|
|
@@ -472,24 +471,7 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
- private void deduplication(List<OutExpenseAccountLog> list) {
|
|
|
- List<OutExpenseAccountLog> newList=new ArrayList<>();
|
|
|
- if (!list.isEmpty()){
|
|
|
- for (OutExpenseAccountLog e : list) {
|
|
|
- int count=0;
|
|
|
- for (OutExpenseAccountLog e2 : list) {
|
|
|
- if (e.getAuditor().equals(e2.getAuditor())
|
|
|
- &&e.getStatus().equals(e2.getStatus())
|
|
|
- &&e.getCreateTime().getTime()==e2.getCreateTime().getTime()){
|
|
|
- count++;
|
|
|
- }
|
|
|
- }
|
|
|
- if (count==1)newList.add(e);
|
|
|
- }
|
|
|
- list.clear();
|
|
|
- list.addAll(newList);
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
private void addDetailsLog(List<OutExpenseAccountLog> list, ExpenseAccount expenseAccount,Integer useStatus) {
|
|
|
OrganizationListOut dep = departmentMapper.selectAllById(expenseAccount.getApplyDep());
|
|
|
@@ -1069,13 +1051,22 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
|
|
|
in.setExpenseMain(1);
|
|
|
in.setTypeOther(String.join(",",typeList));
|
|
|
expenseAccountMapper.insertSelective(in);
|
|
|
+ List<OutExpenseAccountLog> newLog=new ArrayList<>();
|
|
|
list.stream().forEach(e -> {
|
|
|
ExpenseRelationship er=new ExpenseRelationship();
|
|
|
er.setId(in.getId());
|
|
|
er.setEaId(e.getId());
|
|
|
expenseRelationshipMapper.insertSelective(er);
|
|
|
- expenseAccountLogMapper.updateUseLogByUseId(in.getId(),e.getId());
|
|
|
+ List<OutExpenseAccountLog> listLog = expenseAccountLogMapper.selectByEaid(e.getId());
|
|
|
+ for (OutExpenseAccountLog log : listLog) {
|
|
|
+ if (!newLog.contains(log)){
|
|
|
+ log.setEaid(in.getId());
|
|
|
+ newLog.add(log);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ expenseAccountLogMapper.deleteByeaid(e.getId());
|
|
|
});
|
|
|
+ if (!newLog.isEmpty())expenseAccountLogMapper.insertBatch(newLog);
|
|
|
expenseAccountMapper.updateByIds(list,1);
|
|
|
return in.getId();
|
|
|
}
|