|
|
@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.PrivilegeQuery; |
|
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
|
|
import com.yxt.anrui.reportcenter.api.carsSoldProfit.*; |
|
|
|
import com.yxt.anrui.scm.api.scmvehrebate.ScmVehRebateCarsSoldProfitVo; |
|
|
|
import com.yxt.anrui.scm.api.scmvehrebate.ScmVehRebateFeign; |
|
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
|
import com.yxt.common.base.utils.PagerUtil; |
|
|
|
import com.yxt.common.base.utils.StringUtils; |
|
|
@ -16,6 +18,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Collections; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
@ -30,6 +33,8 @@ public class CarsSoldProfitService extends MybatisBaseService<CarsSoldProfitMapp |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private SysUserFeign sysUserFeign; |
|
|
|
@Autowired |
|
|
|
private ScmVehRebateFeign scmVehRebateFeign; |
|
|
|
|
|
|
|
public ResultBean saveProfit(List<CarsSoldProfitDto> dtoList) { |
|
|
|
ResultBean rb = ResultBean.fireFail(); |
|
|
@ -138,6 +143,35 @@ public class CarsSoldProfitService extends MybatisBaseService<CarsSoldProfitMapp |
|
|
|
} |
|
|
|
|
|
|
|
public ResultBean<CarsSoldProfitRebateAllVo> rebates(String sid) { |
|
|
|
return null; |
|
|
|
ResultBean<CarsSoldProfitRebateAllVo> rb = ResultBean.fireFail(); |
|
|
|
CarsSoldProfitRebateAllVo carsSoldProfitRebateAllVo = new CarsSoldProfitRebateAllVo(); |
|
|
|
List<CarsSoldProfitRebateDetailsVo> list = new ArrayList<>(); |
|
|
|
String vinSid = sid; |
|
|
|
BigDecimal expectedRebateTotalAll = BigDecimal.ZERO; |
|
|
|
BigDecimal adjustedRebateTotalAll = BigDecimal.ZERO; |
|
|
|
List<ScmVehRebateCarsSoldProfitVo> scmList = scmVehRebateFeign.getDetailByVinSid(vinSid).getData(); |
|
|
|
if (!scmList.isEmpty()) { |
|
|
|
for (int i = 0; i < scmList.size(); i++) { |
|
|
|
ScmVehRebateCarsSoldProfitVo scmVehRebateCarsSoldProfitVo = scmList.get(i); |
|
|
|
CarsSoldProfitRebateDetailsVo carsSoldProfitRebateDetailsVo = new CarsSoldProfitRebateDetailsVo(); |
|
|
|
carsSoldProfitRebateDetailsVo.setPolicy(scmVehRebateCarsSoldProfitVo.getPolicy()); |
|
|
|
carsSoldProfitRebateDetailsVo.setRebateType(scmVehRebateCarsSoldProfitVo.getRebateTypeValue()); |
|
|
|
carsSoldProfitRebateDetailsVo.setYearAndMonth(scmVehRebateCarsSoldProfitVo.getPalceGenDate()); |
|
|
|
carsSoldProfitRebateDetailsVo.setRebateName(scmVehRebateCarsSoldProfitVo.getRebateName()); |
|
|
|
carsSoldProfitRebateDetailsVo.setExpectedRebate(scmVehRebateCarsSoldProfitVo.getExpectedRebate()); |
|
|
|
carsSoldProfitRebateDetailsVo.setRebatesAdjust(scmVehRebateCarsSoldProfitVo.getAdjustmentMoney()); |
|
|
|
list.add(carsSoldProfitRebateDetailsVo); |
|
|
|
if (StringUtils.isNotBlank(carsSoldProfitRebateDetailsVo.getExpectedRebate())) { |
|
|
|
expectedRebateTotalAll.add(new BigDecimal(carsSoldProfitRebateDetailsVo.getExpectedRebate())); |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(carsSoldProfitRebateDetailsVo.getRebatesAdjust())) { |
|
|
|
adjustedRebateTotalAll.add(new BigDecimal(carsSoldProfitRebateDetailsVo.getRebatesAdjust())); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
carsSoldProfitRebateAllVo.setList(list); |
|
|
|
carsSoldProfitRebateAllVo.setAdjustedRebateTotal(adjustedRebateTotalAll.toString()); |
|
|
|
carsSoldProfitRebateAllVo.setExpectedRebateTotal(adjustedRebateTotalAll.toString()); |
|
|
|
return rb.success().setData(carsSoldProfitRebateAllVo); |
|
|
|
} |
|
|
|
} |
|
|
|