Browse Source

增加门架牌识流水数据接口

develop
Mr.Wang 6 months ago
parent
commit
63ebfa1f84
  1. 38
      zc-business/src/main/java/com/zc/business/controller/OdsTollViuDataController.java
  2. 5
      zc-business/src/main/java/com/zc/business/service/IOdsTollViuDataService.java
  3. 18
      zc-business/src/main/java/com/zc/business/service/impl/OdsTollViuDataServiceImpl.java

38
zc-business/src/main/java/com/zc/business/controller/OdsTollViuDataController.java

@ -0,0 +1,38 @@
package com.zc.business.controller;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.zc.business.service.IOdsTollViuDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* 门架牌识流水数据接口
*/
@Api(tags = {"门架牌识流水数据接口"})
@RestController
@RequestMapping("/business/odsTollViuData")
public class OdsTollViuDataController extends BaseController {
@Resource
private IOdsTollViuDataService iOdsTollViuDataService;
/**
* 当天门架牌识流水数据统计
*
* @return 查询结果
*/
@ApiOperation("门架牌识流水数据统计")
@GetMapping("/countNumber")
public AjaxResult odsTollViuDataCountNumber() {
return AjaxResult.success(iOdsTollViuDataService.odsTollViuDataCountNumber());
}
}

5
zc-business/src/main/java/com/zc/business/service/IOdsTollViuDataService.java

@ -8,4 +8,9 @@ import com.zc.business.domain.OdsTollViuData;
* @author xiepufeng * @author xiepufeng
*/ */
public interface IOdsTollViuDataService extends IService<OdsTollViuData> { public interface IOdsTollViuDataService extends IService<OdsTollViuData> {
/**
* 当天门架牌识流水数据统计
*/
int odsTollViuDataCountNumber();
} }

18
zc-business/src/main/java/com/zc/business/service/impl/OdsTollViuDataServiceImpl.java

@ -1,5 +1,6 @@
package com.zc.business.service.impl; package com.zc.business.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.annotation.DataSource; import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType; import com.ruoyi.common.enums.DataSourceType;
@ -8,6 +9,9 @@ import com.zc.business.mapper.OdsTollViuDataMapper;
import com.zc.business.service.IOdsTollViuDataService; import com.zc.business.service.IOdsTollViuDataService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.time.LocalDateTime;
/** /**
* 门架牌识流水数据 * 门架牌识流水数据
*/ */
@ -15,4 +19,18 @@ import org.springframework.stereotype.Service;
@DataSource(value = DataSourceType.SLAVE)//切换数据源 @DataSource(value = DataSourceType.SLAVE)//切换数据源
public class OdsTollViuDataServiceImpl extends ServiceImpl<OdsTollViuDataMapper, OdsTollViuData> public class OdsTollViuDataServiceImpl extends ServiceImpl<OdsTollViuDataMapper, OdsTollViuData>
implements IOdsTollViuDataService { implements IOdsTollViuDataService {
/**
* 当天门架牌识流水数据统计
* @return
*/
@Override
public int odsTollViuDataCountNumber() {
LambdaQueryWrapper<OdsTollViuData> queryWrapper = new LambdaQueryWrapper<>();
LocalDateTime startOfDay = LocalDate.now().atStartOfDay();
LocalDateTime endOfDay = LocalDate.now().atTime(23, 59, 59);
// 查询当天 门架牌识流水数据
queryWrapper.between(OdsTollViuData::getPictime, startOfDay, endOfDay);
return count(queryWrapper);
}
} }

Loading…
Cancel
Save