|
|
@@ -588,31 +588,47 @@ public class ExpenseAccountServiceImpl extends BaseMybatisDao<ExpenseAccountMapp
|
|
|
@Override
|
|
|
public Object statistics(String name,String depId,String startTime,String endTime) {
|
|
|
if (endTime!=null)endTime=endTime+" 23:59:59";
|
|
|
- List<OutExpenseAccountStatistics> list = expenseAccountMapper.selectStatistics(name, depId, startTime, endTime);
|
|
|
+ List<OutMyEAStatistics> list = expenseAccountMapper.selectStatistics(name, depId, startTime, endTime);
|
|
|
List<OutExpenseAccountStatistics> results=new ArrayList<>();
|
|
|
Map<String ,Object> map=new HashMap<>();
|
|
|
- for (OutExpenseAccountStatistics e : list) {
|
|
|
+ for (OutMyEAStatistics e : list) {
|
|
|
+ OutExpenseAccountStatistics out = new OutExpenseAccountStatistics(e.getAid());
|
|
|
+ out.setAname(e.getAname());
|
|
|
+ if (e.getStatus() == 2) {
|
|
|
+ if (e.getType() < 4) {
|
|
|
+ out.setBx(1);
|
|
|
+ out.setBxAmount(e.getTotalAmount());
|
|
|
+ if (!e.getDebitId().equals(0)) {
|
|
|
+ out.setDk(1);
|
|
|
+ out.setDkAmount(e.getBxdkAmount());
|
|
|
+ }
|
|
|
+ } else if (e.getType() == 4) {
|
|
|
+ out.setJz(1);
|
|
|
+ out.setJzAmount(e.getTotalAmount());
|
|
|
+ } else if (e.getType() == 5) {
|
|
|
+ out.setDk(1);
|
|
|
+ out.setDkAmount(e.getTotalAmount());
|
|
|
+ }
|
|
|
|
|
|
- //如果是报销有选择抵扣预借支则算入抵扣
|
|
|
- if (e.getBx()==1){
|
|
|
- if (e.getDebitId()!=null){
|
|
|
- e.setDk(1);
|
|
|
- e.setDkAmount(e.getBxdkAmount());
|
|
|
+ if (e.getTargetType() == 0) {
|
|
|
+ out.setGdfyAmount(e.getTotalAmount());
|
|
|
+ } else if (e.getTargetType() == 1) {
|
|
|
+ out.setBxddAmount(e.getTotalAmount());
|
|
|
}
|
|
|
- }
|
|
|
- if (e.getTargetType()==0){
|
|
|
- e.setGdfyAmount(e.getBxAmount().add(e.getJzAmount()));
|
|
|
- }else if (e.getTargetType()==1){
|
|
|
- e.setBxddAmount(e.getBxAmount().add(e.getJzAmount()));
|
|
|
+
|
|
|
+ } else if (e.getStatus() < 2) {
|
|
|
+ out.setWshs(1);
|
|
|
+ } else if (e.getStatus() == 3) {
|
|
|
+ out.setBhs(1);
|
|
|
}
|
|
|
//如果不存在就新增
|
|
|
- if (!map.keySet().contains(e.getAid())){
|
|
|
+ if (!map.keySet().contains(out.getAid())){
|
|
|
List<OutExpenseAccountStatistics> list2=new ArrayList<>();
|
|
|
- list2.add(e);
|
|
|
- map.put(e.getAid(),list2);
|
|
|
+ list2.add(out);
|
|
|
+ map.put(out.getAid(),list2);
|
|
|
}else {
|
|
|
List<OutExpenseAccountStatistics> list2 = (List<OutExpenseAccountStatistics>) map.get(e.getAid());
|
|
|
- list2.add(e);
|
|
|
+ list2.add(out);
|
|
|
}
|
|
|
}
|
|
|
for (String s : map.keySet()) {
|