Commit a1559e22 by lzxry

最后一天金额bugfix

parent a96649e9
...@@ -308,7 +308,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService { ...@@ -308,7 +308,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
lastDate = new DateTime[]{contractPart[0],contractPart[1].plusDays(-1)}; lastDate = new DateTime[]{contractPart[0],contractPart[1].plusDays(-1)};
} }
//合同除去最后一天的流量 //合同除去最后一天的流量
BigDecimal clickNum = tkioFlowRepository.sumFlowByContractCodeAndDs(contract.getContractCode(),lastDate[0].toString("yyyy-MM-dd"),lastDate[1].plusDays(-1).toString("yyyy-MM-dd")); BigDecimal clickNum = tkioFlowRepository.sumFlowByContractCodeAndDs(contract.getContractCode(),lastDate[0].toString("yyyy-MM-dd"),lastDate[1].toString("yyyy-MM-dd"));
int clickFlow = clickNum==null?0:clickNum.intValue(); int clickFlow = clickNum==null?0:clickNum.intValue();
BigDecimal clickTenThousand = new BigDecimal(0); BigDecimal clickTenThousand = new BigDecimal(0);
if(clickFlow!=0){ if(clickFlow!=0){
...@@ -317,7 +317,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService { ...@@ -317,7 +317,7 @@ public class ShareIncomeServiceImpl implements ShareIncomeService {
long beforeTheMoney = unitPriceAccurate.multiply(clickTenThousand).setScale(0, BigDecimal.ROUND_HALF_UP).longValue(); long beforeTheMoney = unitPriceAccurate.multiply(clickTenThousand).setScale(0, BigDecimal.ROUND_HALF_UP).longValue();
//最后一天的流量 //最后一天的流量
clickNum = tkioFlowRepository.sumFlowByContractCodeAndDs(contract.getContractCode(),contractPart[1].toString("yyyy-MM-dd"),contractPart[1].plusDays(-1).toString("yyyy-MM-dd")); clickNum = tkioFlowRepository.sumFlowByContractCodeAndDs(contract.getContractCode(),contractPart[1].toString("yyyy-MM-dd"),contractPart[1].toString("yyyy-MM-dd"));
clickFlow = clickNum==null?0:clickNum.intValue(); clickFlow = clickNum==null?0:clickNum.intValue();
clickTenThousand = new BigDecimal(0); clickTenThousand = new BigDecimal(0);
if(clickFlow!=0)clickTenThousand = new BigDecimal(clickFlow / 10000.0 * 100); if(clickFlow!=0)clickTenThousand = new BigDecimal(clickFlow / 10000.0 * 100);
......
...@@ -196,7 +196,8 @@ public class TrackingFlowTask { ...@@ -196,7 +196,8 @@ public class TrackingFlowTask {
List<String> emails = contractRepository.findDistinctEmailByPlatform("tkio"); List<String> emails = contractRepository.findDistinctEmailByPlatform("tkio");
List<TkioFlow> tkioFlowList = new ArrayList<>(); List<TkioFlow> tkioFlowList = new ArrayList<>();
String yesterday = DateUtil.getBeforeDays(1);//昨日
logger.info("昨日流量同步:"+yesterday);
for (String email : emails) { for (String email : emails) {
//查询用户下所有appkey //查询用户下所有appkey
...@@ -211,7 +212,6 @@ public class TrackingFlowTask { ...@@ -211,7 +212,6 @@ public class TrackingFlowTask {
appkeyStr= "'"+appkeyStr+"'"; appkeyStr= "'"+appkeyStr+"'";
String yesterday = DateUtil.getBeforeDays(1);//昨日
BigInteger clickNum = accountFlowRestrictService.getTotalNum(yesterday, yesterday, appkeyStr, "account_track_flow_restrict", "click_sum"); BigInteger clickNum = accountFlowRestrictService.getTotalNum(yesterday, yesterday, appkeyStr, "account_track_flow_restrict", "click_sum");
if(clickNum!=null&&clickNum.longValue()>0){ if(clickNum!=null&&clickNum.longValue()>0){
List<Contract> contracts = contractRepository.findByPlatformAndEmail("tkio", email); List<Contract> contracts = contractRepository.findByPlatformAndEmail("tkio", email);
......
...@@ -18,7 +18,9 @@ ...@@ -18,7 +18,9 @@
<logger name="org.springframework"> <logger name="org.springframework">
<level value="warn" /> <level value="warn" />
</logger> </logger>
<logger name=" org.apache.commons.httpclient">
<level value="error" />
</logger>
<logger name="org.hibernate"> <logger name="org.hibernate">
<level value="warn" /> <level value="warn" />
</logger> </logger>
......
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