|
@@ -21,6 +21,7 @@ import com.ydtech.modules.esm.dao.EsmUserReferrerMapper;
|
|
|
import com.ydtech.modules.esm.model.EsmUserReferrer;
|
|
import com.ydtech.modules.esm.model.EsmUserReferrer;
|
|
|
import com.ydtech.modules.order.service.InsOrdersService;
|
|
import com.ydtech.modules.order.service.InsOrdersService;
|
|
|
import com.ydtech.modules.protocols.service.InsFeeOrderNewService;
|
|
import com.ydtech.modules.protocols.service.InsFeeOrderNewService;
|
|
|
|
|
+import com.ydtech.utils.BigDecimalUtils;
|
|
|
import com.ydtech.utils.StringUtils;
|
|
import com.ydtech.utils.StringUtils;
|
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
import org.apache.commons.lang3.ObjectUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -105,10 +106,11 @@ public class DeptBalanceServiceImpl implements DeptBalanceService {
|
|
|
itemLeader.setBeginDate(deptBalanceVo.getBeginDate());
|
|
itemLeader.setBeginDate(deptBalanceVo.getBeginDate());
|
|
|
itemLeader.setEndDate(deptBalanceVo.getEndDate());
|
|
itemLeader.setEndDate(deptBalanceVo.getEndDate());
|
|
|
|
|
|
|
|
- SysPartnerAccount sysPartnerAccount =sysPartnerAccountMapper.getByDeptBalanceDto(itemLeader);
|
|
|
|
|
- if (sysPartnerAccount != null) {
|
|
|
|
|
- BigDecimal sumPremium = sysPartnerAccount.getSumPremium();
|
|
|
|
|
- BigDecimal extractFee = sysPartnerAccount.getExtractFee();
|
|
|
|
|
|
|
+ HashMap<String,BigDecimal>totalAmountMap =sysPremiumDetailsMapper.getTotalAmount(itemLeader);
|
|
|
|
|
+// SysPartnerAccount sysPartnerAccount =sysPartnerAccountMapper.getByDeptBalanceDto(itemLeader);
|
|
|
|
|
+ if (totalAmountMap != null) {
|
|
|
|
|
+ BigDecimal sumPremium = totalAmountMap.get("totalAmount");
|
|
|
|
|
+ BigDecimal extractFee = totalAmountMap.get("extractFeeAmount");
|
|
|
itemLeader.setTotalIncome(sumPremium);
|
|
itemLeader.setTotalIncome(sumPremium);
|
|
|
itemLeader.setDeptManagementFee(extractFee);
|
|
itemLeader.setDeptManagementFee(extractFee);
|
|
|
|
|
|
|
@@ -164,6 +166,8 @@ public class DeptBalanceServiceImpl implements DeptBalanceService {
|
|
|
String userId = item.getUserId();
|
|
String userId = item.getUserId();
|
|
|
item.setLoginUserId(userId);
|
|
item.setLoginUserId(userId);
|
|
|
SysPartnerAccount sysPartnerAccount = sysPartnerAccountMapper.selectOne(new LambdaQueryWrapper<SysPartnerAccount>()
|
|
SysPartnerAccount sysPartnerAccount = sysPartnerAccountMapper.selectOne(new LambdaQueryWrapper<SysPartnerAccount>()
|
|
|
|
|
+ .between(StringUtils.isNotEmpty(deptBalanceVo.getBeginDate()) && StringUtils.isNotEmpty(deptBalanceVo.getEndDate()),
|
|
|
|
|
+ SysPartnerAccount::getCreateTime, deptBalanceVo.getBeginDate(), deptBalanceVo.getEndDate())
|
|
|
.eq(SysPartnerAccount::getUserId, item.getUserId()));
|
|
.eq(SysPartnerAccount::getUserId, item.getUserId()));
|
|
|
if(ObjectUtils.isNotEmpty(sysPartnerAccount)){
|
|
if(ObjectUtils.isNotEmpty(sysPartnerAccount)){
|
|
|
if(sysPartnerAccount.getSumPremium() !=null ){
|
|
if(sysPartnerAccount.getSumPremium() !=null ){
|
|
@@ -394,9 +398,22 @@ public class DeptBalanceServiceImpl implements DeptBalanceService {
|
|
|
ssKTAmount = sysUserAccountEntity.getSumAmount()==null?BigDecimal.ZERO: sysUserAccountEntity.getSumAmount();
|
|
ssKTAmount = sysUserAccountEntity.getSumAmount()==null?BigDecimal.ZERO: sysUserAccountEntity.getSumAmount();
|
|
|
}
|
|
}
|
|
|
BigDecimal sumAmount=ysTXAmount.add(ssKTAmount).add(txzTXAmount);
|
|
BigDecimal sumAmount=ysTXAmount.add(ssKTAmount).add(txzTXAmount);
|
|
|
|
|
+
|
|
|
|
|
+ //2025-1-8 需求 总收入 = 当天审核订单收入 收支明细
|
|
|
|
|
+ deptBalanceVo.setUserId(record.getUserId());
|
|
|
|
|
+ HashMap<String, BigDecimal> incomeIndication = deptBalanceMapper.getIncomeIndication(deptBalanceVo);
|
|
|
record.setWithdrawn(ysTXAmount);
|
|
record.setWithdrawn(ysTXAmount);
|
|
|
record.setNotWithdrawn(ssKTAmount);
|
|
record.setNotWithdrawn(ssKTAmount);
|
|
|
- record.setTotalIncome(sumAmount);
|
|
|
|
|
|
|
+ if(incomeIndication!=null){
|
|
|
|
|
+ if(deptBalanceVo.getManagementSource().equals("2")){
|
|
|
|
|
+ record.setTotalIncome(incomeIndication.get("totalAmount"));
|
|
|
|
|
+ }else {
|
|
|
|
|
+ record.setTotalIncome(BigDecimalUtils.nullToZero(incomeIndication.get("totalAmount")).divide(new BigDecimal(10)));
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ }else {
|
|
|
|
|
+ record.setTotalIncome(BigDecimal.ZERO);
|
|
|
|
|
+ }
|
|
|
record.setWithdrawingAmount(txzTXAmount);
|
|
record.setWithdrawingAmount(txzTXAmount);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|