Commit 5677129a by lzxry

点击数万单位处理

parent d68ef5d3
......@@ -232,9 +232,9 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
BigDecimal clickTenThousand = new BigDecimal(0);
if(clickFlow!=0){
clickTenThousand = new BigDecimal(clickFlow / 10000 * 100);
clickTenThousand = new BigDecimal(clickFlow / 10000.0 * 100);
//区间点击数
contract.setClickFlow(new BigDecimal(clickFlow / 10000).setScale(4,BigDecimal.ROUND_HALF_UP).doubleValue());
contract.setClickFlow(new BigDecimal(clickFlow / 10000.0).setScale(4,BigDecimal.ROUND_HALF_UP).doubleValue());
}
//区间分摊收入
contract.setIntervaIncomeShare(unitPriceAccurate.multiply(clickTenThousand).setScale(0, BigDecimal.ROUND_HALF_UP).longValue());
......@@ -251,7 +251,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
//累计总收入
clickNum = accountFlowRestrictService.getTotalNum(contractPart[0].toString("yyyy-MM-dd"), grossDate.toString("yyyy-MM-dd"), appkeyStr, "account_track_flow_restrict", "click_sum");
clickFlow = clickNum==null?0:clickNum.intValue();
contract.setIncomeGross(unitPriceAccurate.multiply(new BigDecimal(clickFlow / 10000 * 100)).setScale(0, BigDecimal.ROUND_HALF_UP).longValue());
contract.setIncomeGross(unitPriceAccurate.multiply(new BigDecimal(clickFlow / 10000.0 * 100)).setScale(0, BigDecimal.ROUND_HALF_UP).longValue());
isLater = false;
} else if (selected[1].isBefore(creatPoints[1])) {
......@@ -273,9 +273,10 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
BigDecimal clickTenThousand = new BigDecimal(0);
if(clickFlow!=0){
clickTenThousand = new BigDecimal(clickFlow / 10000 * 100);
clickTenThousand = new BigDecimal(clickFlow / 10000.0 * 100);
//区间点击数
contract.setClickFlow(new BigDecimal(clickFlow / 10000).setScale(4,BigDecimal.ROUND_HALF_UP).doubleValue());
System.out.println(new BigDecimal(clickFlow / 10000.0));
contract.setClickFlow(new BigDecimal(clickFlow / 10000.0).setScale(4,BigDecimal.ROUND_HALF_UP).doubleValue());
}
//区间分摊收入
contract.setIntervaIncomeShare(unitPriceAccurate.multiply(clickTenThousand).setScale(0, BigDecimal.ROUND_HALF_UP).longValue());
......@@ -289,7 +290,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
clickFlow = clickNum==null?0:clickNum.intValue();
clickTenThousand = new BigDecimal(0);
if(clickFlow!=0){
clickTenThousand = new BigDecimal(clickFlow / 10000 * 100);
clickTenThousand = new BigDecimal(clickFlow / 10000.0 * 100);
//区间点击数
}
contract.setAdjustmentFund(unitPriceAccurate.multiply(clickTenThousand).setScale(0, BigDecimal.ROUND_HALF_UP).longValue());
......@@ -306,7 +307,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
//累计总收入
clickNum = accountFlowRestrictService.getTotalNum(contractPart[0].toString("yyyy-MM-dd"), grossDate.toString("yyyy-MM-dd"), appkeyStr, "account_track_flow_restrict", "click_sum");
clickFlow = clickNum==null?0:clickNum.intValue();
contract.setIncomeGross(unitPriceAccurate.multiply(new BigDecimal(clickFlow / 10000 * 100)).setScale(0, BigDecimal.ROUND_HALF_UP).longValue());
contract.setIncomeGross(unitPriceAccurate.multiply(new BigDecimal(clickFlow / 10000.0 * 100)).setScale(0, BigDecimal.ROUND_HALF_UP).longValue());
}
if (checkTwoTime(contractPart[1], selected[1])) {
......@@ -323,7 +324,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
int clickFlow = clickNum==null?0:clickNum.intValue();
BigDecimal clickTenThousand = new BigDecimal(0);
if(clickFlow!=0){
clickTenThousand = new BigDecimal(clickFlow / 10000 * 100);
clickTenThousand = new BigDecimal(clickFlow / 10000.0 * 100);
}
long beforeTheMoney = unitPriceAccurate.multiply(clickTenThousand).setScale(0, BigDecimal.ROUND_HALF_UP).longValue();
......@@ -331,7 +332,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
clickNum = accountFlowRestrictService.getTotalNum(contractPart[1].toString("yyyy-MM-dd"), contractPart[1].toString("yyyy-MM-dd"), appkeyStr, "account_track_flow_restrict", "click_sum");
clickFlow = clickNum==null?0:clickNum.intValue();
clickTenThousand = new BigDecimal(0);
if(clickFlow!=0)clickTenThousand = new BigDecimal(clickFlow / 10000 * 100);
if(clickFlow!=0)clickTenThousand = new BigDecimal(clickFlow / 10000.0 * 100);
long lastDayTheMoney = unitPriceAccurate.multiply(clickTenThousand).setScale(0, BigDecimal.ROUND_HALF_UP).longValue();
//合同的税后总金额减去最后合同一日之前的钱和调整金
lastDay = contract.getIncomeExcludingTax() - contract.getAdjustmentFund() - beforeTheMoney;
......@@ -374,7 +375,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
BigDecimal clickTenThousand = new BigDecimal(0);
if(clickFlow!=0){
clickTenThousand = new BigDecimal(clickFlow / 10000 * 100);
clickTenThousand = new BigDecimal(clickFlow / 10000.0 * 100);
}
adjustmentFund = unitPriceAccurate.multiply(clickTenThousand.multiply(new BigDecimal(-1))).setScale(0, BigDecimal.ROUND_HALF_UP).longValue();
}
......@@ -386,9 +387,9 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
int clickFlow = clickNum==null?0:clickNum.intValue();
BigDecimal clickTenThousand = new BigDecimal(0);
if(clickFlow!=0){
clickTenThousand = new BigDecimal(clickFlow / 10000 * 100);
clickTenThousand = new BigDecimal(clickFlow / 10000.0 * 100);
//区间点击数
contract.setClickFlow(new BigDecimal(clickFlow / 10000).setScale(4,BigDecimal.ROUND_HALF_UP).doubleValue());
contract.setClickFlow(new BigDecimal(clickFlow / 10000.0).setScale(4,BigDecimal.ROUND_HALF_UP).doubleValue());
}
//区间分摊收入,乘以100,前端除以100
long share = unitPriceAccurate.multiply(clickTenThousand).setScale(0, BigDecimal.ROUND_HALF_UP).longValue();
......@@ -404,7 +405,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
//累计总收入
clickNum = accountFlowRestrictService.getTotalNum(contractPart[0].toString("yyyy-MM-dd"), grossDate.toString("yyyy-MM-dd"), appkeys, "account_track_flow_restrict", "click_sum");
clickFlow = clickNum==null?0:clickNum.intValue();
contract.setIncomeGross(unitPriceAccurate.multiply(new BigDecimal(clickFlow / 10000 * 100)).setScale(0, BigDecimal.ROUND_HALF_UP).longValue());
contract.setIncomeGross(unitPriceAccurate.multiply(new BigDecimal(clickFlow / 10000.0 * 100)).setScale(0, BigDecimal.ROUND_HALF_UP).longValue());
return contract;
}
......@@ -430,9 +431,9 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
contract.setClickFlow(0.0);
BigDecimal clickTenThousand = new BigDecimal(0);
if(clickFlow!=0){
clickTenThousand = new BigDecimal(clickFlow / 10000 * 100);
clickTenThousand = new BigDecimal(clickFlow / 10000.0 * 100);
//区间点击数
contract.setClickFlow(new BigDecimal(clickFlow / 10000).setScale(4,BigDecimal.ROUND_HALF_UP).doubleValue());
contract.setClickFlow(new BigDecimal(clickFlow / 10000.0).setScale(4,BigDecimal.ROUND_HALF_UP).doubleValue());
}
//区间分摊收入,乘以100,前端除以100
long share = unitPriceAccurate.multiply(clickTenThousand).setScale(0, BigDecimal.ROUND_HALF_UP).longValue();
......@@ -742,9 +743,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
}
public static void main(String[] args) {
DateTime dateTime = new DateTime("2020-09-25");
DateTime creatTime = new DateTime("2020-10-11");
System.out.println(dateTime.isBefore(creatTime));
System.out.println(new BigDecimal(34009003 / 10000.0));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment