Selaa lähdekoodia

1.控制台总收入数据不对,如:李馨

wuhp 1 vuosi sitten
vanhempi
commit
15e955eefd

+ 9 - 9
src/main/java/com/ydtech/modules/admin/service/impl/DeptBalanceServiceImpl.java

@@ -388,15 +388,6 @@ public class DeptBalanceServiceImpl implements DeptBalanceService {
                         mySumAmountQueryDto.setGroupFlag(true);
                     }
 
-                    deptBalanceVo.setUserId(record.getUserId());
-                    HashMap<String, BigDecimal> incomeIndication = deptBalanceMapper.getIncomeIndication(deptBalanceVo);
-
-                    if(incomeIndication!=null){
-                            record.setTotalIncome(incomeIndication.get("totalAmount"));
-                    }else {
-                        record.setTotalIncome(BigDecimal.ZERO);
-                    }
-
                     //如果是电销组长,将组员的数据算进来
                     mySumAmountQueryDto.setGroupFlag(true);
                     List<String> userList = sysUserService.getGroupByUserId(userId);
@@ -408,6 +399,15 @@ public class DeptBalanceServiceImpl implements DeptBalanceService {
                     sxAmount = insFeeOrderNewService.findMyAmountYTXmountByDates(record.getUserId(), "2",true,deptBalanceVo.getBeginDate(),deptBalanceVo.getEndDate());
                     // 可提现
                     wtxAmount= (sysUserAccountEntity==null || sysUserAccountEntity.getSumAmount()==null)?BigDecimal.ZERO:sysUserAccountEntity.getSumAmount();
+
+                    deptBalanceVo.setUserId(record.getUserId());
+                    HashMap<String, BigDecimal> incomeIndication = deptBalanceMapper.getIncomeIndication(deptBalanceVo);
+
+                    if(incomeIndication!=null){
+                        record.setTotalIncome(incomeIndication.get("totalAmount"));
+                    }else {
+                        record.setTotalIncome(BigDecimal.ZERO);
+                    }
                     //总的 =  已提现金额+  可提现金额 +  提现中
                     sumAmount = wtxAmount.add(sxAmount).add(ytxAmount);
                     record.setWithdrawn(ytxAmount);

+ 1 - 4
src/main/resources/mapper/modules/admin/DeptBalanceMapper.xml

@@ -227,10 +227,7 @@
             AND date(his.create_time) BETWEEN #{beginDate} AND #{endDate}
         </if>
         <if test="userId !=null and userId!=''">
-            AND his.user_id =#{userId}
-        </if>
-        <if test="name !=null and name !=''">
-            and su.name like concat('%',#{name},'%')
+            AND his.user_id  IN ( SELECT id FROM sys_user WHERE manager_id = #{userId} OR id= #{userId} )
         </if>
 
         <if test="phoneNumber !=null and phoneNumber !=''">