Commit 7be2b9ca by lzxry

tkio流量计算分摊报表

parent f106616f
......@@ -336,6 +336,7 @@ public class ContractController {
@ResponseBody
public ResultModel change(@CurrentAccount User loginAccount,
@RequestBody ContractChange contract, HttpServletRequest request, @PathVariable String platform) {
contract.setPlatform(platform);
Contract contract1 = service.change(loginAccount, contract, null);
NewUserLogThread userlog = new NewUserLogThread(loginAccount.getEmail(), loginAccount.getName(), OperateObjectTypeEnum.CUSTOMER.getKey(), contract1.getContractCode(), "修改套餐", "", contract1.toString(), request, platform);
userlog.start();
......
......@@ -6,6 +6,9 @@ import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.math.BigInteger;
public interface TkioFlowRepository extends JpaRepository<TkioFlow, Long> {
@Query(value = "select sum(flow) from tkio_flow where email = ?1 and contract_code = ?2", nativeQuery = true)
......@@ -15,4 +18,7 @@ public interface TkioFlowRepository extends JpaRepository<TkioFlow, Long> {
@Modifying
@Query(value = "delete from tkio_flow where email = ?1", nativeQuery = true)
void deleteByEmail(String email);
@Query(value = "select sum(flow) from tkio_flow where contract_code = ?1 and ds >= ?2 and ds <= ?3", nativeQuery = true)
BigDecimal sumFlowByContractCodeAndDs(String code, String startDate, String endDate);
}
......@@ -1742,7 +1742,7 @@ public class ContractServiceImpl implements ContractService {
calculationFlow.setEmail(resource.getEmail());
calculationFlow.setContractCode(resource.getContractCode());
calculationFlow.setStatus(0);
calculationFlow.setTriggerType("止");
calculationFlow.setTriggerType("止");
calculationFlow.setCreateTime(DateUtil.getCurrentDateStr());
calculationFlow.setIsAll(false);
if(contracts==null || contracts.size()>0){
......
......@@ -66,13 +66,13 @@
<bean id="syncTrackingFlowTask" class="track.task.TrackingFlowTask"></bean>
<task:scheduled-tasks>
<!--定时同步昨日流量(每天10点执行一次)-->
<task:scheduled ref="syncTrackingFlowTask" method="task" cron="* * 10 * * ?"/>
<task:scheduled ref="syncTrackingFlowTask" method="task" cron="0 0 10 * * ?"/>
</task:scheduled-tasks>
<bean id="syncCalculationFlowTask" class="track.task.TrackingFlowTask"></bean>
<task:scheduled-tasks>
<!--定时同步流量(每7分钟执行一次)-->
<task:scheduled ref="syncCalculationFlowTask" method="syncFlow" cron="* 0/7 * * * ? "/>
<task:scheduled ref="syncCalculationFlowTask" method="syncFlow" cron="0 0/7 * * * ? "/>
</task:scheduled-tasks>
</beans>
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