|
|
@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.ydtech.core.page.HttpResult;
|
|
|
+import com.ydtech.modules.admin.constants.MoneyAttrConstants;
|
|
|
+import com.ydtech.modules.admin.constants.WithdrawTypeConstants;
|
|
|
import com.ydtech.modules.admin.dao.SysUserAccountMapper;
|
|
|
import com.ydtech.modules.admin.model.po.SysAmountAuditingEntity;
|
|
|
import com.ydtech.modules.admin.model.po.SysUserAccount;
|
|
|
@@ -65,7 +67,6 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
|
|
|
SysUserAccount newAccount = new SysUserAccount();
|
|
|
|
|
|
if (ObjectUtils.isNotEmpty(sysUserAccountEntity)) {
|
|
|
-
|
|
|
sysUserAccountEntity.setHandlingFee(sysUserAccount.getHandlingFee().add(sysUserAccountEntity.getHandlingFee()));
|
|
|
sysUserAccountEntity.setDocumentary(sysUserAccount.getDocumentary().add(sysUserAccountEntity.getDocumentary()));
|
|
|
sysUserAccountEntity.setPromotion(sysUserAccount.getPromotion().add(sysUserAccountEntity.getPromotion()));
|
|
|
@@ -74,14 +75,15 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
|
|
|
}
|
|
|
baseMapper.updateById(sysUserAccountEntity);
|
|
|
} else {
|
|
|
- newAccount.setUserId(userId);
|
|
|
- newAccount.setDocumentary(sysUserAccount.getDocumentary());
|
|
|
- newAccount.setPromotion(sysUserAccount.getPromotion());
|
|
|
- newAccount.setHandlingFee(sysUserAccount.getHandlingFee());
|
|
|
+ sysUserAccountEntity = new SysUserAccount();
|
|
|
+ sysUserAccountEntity.setUserId(userId);
|
|
|
+ sysUserAccountEntity.setDocumentary(sysUserAccount.getDocumentary());
|
|
|
+ sysUserAccountEntity.setPromotion(sysUserAccount.getPromotion());
|
|
|
+ sysUserAccountEntity.setHandlingFee(sysUserAccount.getHandlingFee());
|
|
|
if (StringUtils.isNotEmpty(sysUserAccount.getDocumentaryStatus())) {
|
|
|
- newAccount.setDocumentaryStatus(sysUserAccount.getDocumentaryStatus());
|
|
|
+ sysUserAccountEntity.setDocumentaryStatus(sysUserAccount.getDocumentaryStatus());
|
|
|
}
|
|
|
- baseMapper.insert(newAccount);
|
|
|
+ baseMapper.insert(sysUserAccountEntity);
|
|
|
}
|
|
|
|
|
|
if (StringUtils.isNotEmpty(sysUserAccount.getDocumentaryStatus())) {
|
|
|
@@ -90,36 +92,39 @@ public class SysUserAccountServiceImpl extends ServiceImpl<SysUserAccountMapper,
|
|
|
sysUserAccountHistory.setUserId(sysUserAccount.getUserId());
|
|
|
sysUserAccountHistory.setDocumentary(Integer.valueOf(sysUserAccount.getDocumentaryStatus()));
|
|
|
sysUserAccountHistory.setSuborder(sysUserAccount.getSuborderId());
|
|
|
+ //跟单费
|
|
|
if(sysUserAccount.getDocumentary()!=null && sysUserAccount.getDocumentary().compareTo(BigDecimal.ZERO)!=0){
|
|
|
sysUserAccountHistory.setAmount(sysUserAccount.getDocumentary());
|
|
|
- sysUserAccountHistory.setProperty(2);
|
|
|
- if("2".equals(sysUserAccount.getDocumentaryStatus())){ // 收入 相加
|
|
|
- sysUserAccountHistory.setSurplusAmount(sysUserAccount.getDocumentary().add(newAccount.getDocumentary()));
|
|
|
+ sysUserAccountHistory.setProperty(MoneyAttrConstants.M_2.getCode());
|
|
|
+ if(WithdrawTypeConstants.WT_2.getCode().equals(sysUserAccount.getDocumentaryStatus())){ // 收入 相加
|
|
|
+ sysUserAccountHistory.setSurplusAmount(sysUserAccountEntity.getDocumentary());
|
|
|
}else {
|
|
|
BigDecimal subtract = newSysAccount.getDocumentary().subtract(sysUserAccount.getDocumentary());
|
|
|
sysUserAccountHistory.setSurplusAmount(subtract);
|
|
|
}
|
|
|
sysUserAccountHistoryService.updayteByUserAccount(sysUserAccountHistory);
|
|
|
}
|
|
|
+ //手续费
|
|
|
if(sysUserAccount.getHandlingFee()!=null && sysUserAccount.getHandlingFee().compareTo(BigDecimal.ZERO) !=0){
|
|
|
sysUserAccountHistory.setId(null);
|
|
|
sysUserAccountHistory.setAmount(sysUserAccount.getHandlingFee());
|
|
|
- sysUserAccountHistory.setProperty(1);
|
|
|
- if("2".equals(sysUserAccount.getDocumentaryStatus())){ // 收入 相加
|
|
|
- sysUserAccountHistory.setSurplusAmount(sysUserAccount.getHandlingFee().add(newAccount.getHandlingFee()));
|
|
|
+ sysUserAccountHistory.setProperty(MoneyAttrConstants.M_1.getCode());
|
|
|
+ if(WithdrawTypeConstants.WT_2.getCode().equals(sysUserAccount.getDocumentaryStatus())){ // 收入 相加
|
|
|
+ sysUserAccountHistory.setSurplusAmount(sysUserAccountEntity.getHandlingFee());
|
|
|
}else {
|
|
|
BigDecimal subtract = newSysAccount.getHandlingFee().subtract(sysUserAccount.getHandlingFee());
|
|
|
sysUserAccountHistory.setSurplusAmount(subtract);
|
|
|
}
|
|
|
sysUserAccountHistoryService.updayteByUserAccount(sysUserAccountHistory);
|
|
|
}
|
|
|
+ //推广费
|
|
|
if(sysUserAccount.getPromotion() !=null && sysUserAccount.getPromotion().compareTo(BigDecimal.ZERO) !=0){
|
|
|
sysUserAccountHistory.setId(null);
|
|
|
|
|
|
sysUserAccountHistory.setAmount(sysUserAccount.getPromotion());
|
|
|
- sysUserAccountHistory.setProperty(3);
|
|
|
- if("2".equals(sysUserAccount.getDocumentaryStatus())){ // 收入 相加
|
|
|
- sysUserAccountHistory.setSurplusAmount(sysUserAccount.getPromotion().add(newAccount.getPromotion()));
|
|
|
+ sysUserAccountHistory.setProperty(MoneyAttrConstants.M_3.getCode());
|
|
|
+ if(WithdrawTypeConstants.WT_2.getCode().equals(sysUserAccount.getDocumentaryStatus())){ // 收入 相加
|
|
|
+ sysUserAccountHistory.setSurplusAmount(sysUserAccountEntity.getPromotion());
|
|
|
}else {
|
|
|
BigDecimal subtract = newSysAccount.getPromotion().subtract(sysUserAccount.getPromotion());
|
|
|
sysUserAccountHistory.setSurplusAmount(subtract);
|