|
|
@ -37,6 +37,7 @@ import com.qs.serve.modules.bir.service.BirActivityCenterGoodsService; |
|
|
|
import com.qs.serve.modules.bir.mapper.BirActivityCenterGoodsMapper; |
|
|
|
|
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.math.RoundingMode; |
|
|
|
import java.time.LocalDate; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.util.ArrayList; |
|
|
@ -76,8 +77,8 @@ public class BirActivityCenterGoodsServiceImpl extends ServiceImpl<BirActivityCe |
|
|
|
int lastDayNum2 = startDate.lengthOfMonth(); |
|
|
|
LocalDate endDate = LocalDate.of(year,month,lastDayNum2); |
|
|
|
//加载所有异动的数据
|
|
|
|
List<TbsActivityCenterGoods> activityCenterGoodsAllList = this.baseMapper.selectChangeCenterGoods(startDate,endDate,null); |
|
|
|
// List<TbsActivityCenterGoods> activityCenterGoodsAllList = this.baseMapper.selectChangeCenterGoods(null,null,20637L);
|
|
|
|
// List<TbsActivityCenterGoods> activityCenterGoodsAllList = this.baseMapper.selectChangeCenterGoods(startDate,endDate,null);
|
|
|
|
List<TbsActivityCenterGoods> activityCenterGoodsAllList = this.baseMapper.selectChangeCenterGoods(null,null,15840L); |
|
|
|
if(activityCenterGoodsAllList.size()<1){ |
|
|
|
return; |
|
|
|
} |
|
|
@ -103,8 +104,8 @@ public class BirActivityCenterGoodsServiceImpl extends ServiceImpl<BirActivityCe |
|
|
|
|
|
|
|
this.remove(birBaseActivityLqw); |
|
|
|
|
|
|
|
activityCenterGoodsAllList = this.baseMapper.selectChangeCenterGoods(startDate,endDate,null); |
|
|
|
// activityCenterGoodsAllList = this.baseMapper.selectChangeCenterGoods(null,null,20637L);
|
|
|
|
// activityCenterGoodsAllList = this.baseMapper.selectChangeCenterGoods(startDate,endDate,null);
|
|
|
|
activityCenterGoodsAllList = this.baseMapper.selectChangeCenterGoods(null,null,15840L); |
|
|
|
if(activityCenterGoodsAllList.size()<1){ |
|
|
|
return; |
|
|
|
} |
|
|
@ -377,14 +378,14 @@ public class BirActivityCenterGoodsServiceImpl extends ServiceImpl<BirActivityCe |
|
|
|
if (splitDTO.getYearMonth().equals(currDateSplit.getYearMonth())) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
splitCenterGoodsAmount = splitCenterGoodsAmount.subtract(currentCenterGoodsAmount.multiply(dayRate)); |
|
|
|
splitCheckAmount = splitCheckAmount.subtract(currentCheckAmount.multiply(dayRate)); |
|
|
|
splitCenterGoodsAmount = splitCenterGoodsAmount.subtract(currentCenterGoodsAmount.multiply(dayRate).setScale(2, RoundingMode.HALF_UP)); |
|
|
|
splitCheckAmount = splitCheckAmount.subtract(currentCheckAmount.multiply(dayRate).setScale(2, RoundingMode.HALF_UP)); |
|
|
|
} |
|
|
|
} else { |
|
|
|
BigDecimal dayRate = new BigDecimal(currDateSplit.getDays() + "") |
|
|
|
.divide(new BigDecimal(currentActDays + ""), 4, BigDecimal.ROUND_HALF_DOWN); |
|
|
|
splitCenterGoodsAmount = currentCenterGoodsAmount.multiply(dayRate); |
|
|
|
splitCheckAmount = currentCheckAmount.multiply(dayRate); |
|
|
|
splitCenterGoodsAmount = currentCenterGoodsAmount.multiply(dayRate).setScale(2, RoundingMode.HALF_UP); |
|
|
|
splitCheckAmount = currentCheckAmount.multiply(dayRate).setScale(2, RoundingMode.HALF_UP); |
|
|
|
} |
|
|
|
BirCenterGoodSplitDTO goodSplitDTO = new BirCenterGoodSplitDTO(); |
|
|
|
goodSplitDTO.setCurrentSplitAmount(splitCenterGoodsAmount); |
|
|
|