diff --git a/src/main/java/com/zhgd/xmgl/modules/weight/controller/WeighInfoController.java b/src/main/java/com/zhgd/xmgl/modules/weight/controller/WeighInfoController.java index 39993f30c..04bb61540 100644 --- a/src/main/java/com/zhgd/xmgl/modules/weight/controller/WeighInfoController.java +++ b/src/main/java/com/zhgd/xmgl/modules/weight/controller/WeighInfoController.java @@ -233,5 +233,13 @@ public class WeighInfoController { return Result.success(weighInfoService.countWeighInfoGoodsName(paramMap)); } - + @ApiOperation(value = "过磅统计趋势", notes = "过磅统计趋势", httpMethod = "POST") + @ApiImplicitParams({ + @ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"), + @ApiImplicitParam(name = "type", value = "1今日2、7日3、30日", paramType = "body", required = true, dataType = "Integer"), + }) + @PostMapping(value = "/countWeighInfoTrend") + public Result> countWeighInfoTrend(@ApiIgnore @RequestBody HashMap paramMap) { + return Result.success(weighInfoService.countWeighInfoTrend(paramMap)); + } } diff --git a/src/main/java/com/zhgd/xmgl/modules/weight/entity/vo/CountWeighInfoVO.java b/src/main/java/com/zhgd/xmgl/modules/weight/entity/vo/CountWeighInfoVO.java index d001e103a..cc6b19060 100644 --- a/src/main/java/com/zhgd/xmgl/modules/weight/entity/vo/CountWeighInfoVO.java +++ b/src/main/java/com/zhgd/xmgl/modules/weight/entity/vo/CountWeighInfoVO.java @@ -8,11 +8,11 @@ public class CountWeighInfoVO { @ApiModelProperty("今日过磅") private Double weighingToday; @ApiModelProperty("今日预约") - private Double makeAnAppointmentToday; + private Integer makeAnAppointmentToday; @ApiModelProperty("累计过磅") private Double accumulatedWeighing; @ApiModelProperty("累计预约") - private Double cumulativeReservations; + private Integer cumulativeReservations; @ApiModelProperty("本次过磅数") private Double numberOfWeighThisTime; @ApiModelProperty("车牌号") diff --git a/src/main/java/com/zhgd/xmgl/modules/weight/mapper/WeighInfoMapper.java b/src/main/java/com/zhgd/xmgl/modules/weight/mapper/WeighInfoMapper.java index 4c66ca122..f33cf5459 100644 --- a/src/main/java/com/zhgd/xmgl/modules/weight/mapper/WeighInfoMapper.java +++ b/src/main/java/com/zhgd/xmgl/modules/weight/mapper/WeighInfoMapper.java @@ -1,6 +1,7 @@ package com.zhgd.xmgl.modules.weight.mapper; import com.zhgd.xmgl.base.entity.vo.SectorOneVo; +import com.zhgd.xmgl.base.entity.vo.TrendVo; import com.zhgd.xmgl.modules.weight.entity.vo.CountWeighInfoVO; import com.zhgd.xmgl.modules.weight.entity.vo.WeighInfoForwardingUnitRankVo; import com.zhgd.xmgl.modules.weight.entity.vo.WeighInfoGoodsNameStatisticVo; @@ -34,4 +35,6 @@ public interface WeighInfoMapper extends BaseMapper { CountWeighInfoVO countWeighInfo(HashMap paramMap); List countWeighInfoGoodsName(HashMap paramMap); + + List countWeighInfoTrend(HashMap paramMap); } diff --git a/src/main/java/com/zhgd/xmgl/modules/weight/mapper/xml/WeighBookVehicleInfoMapper.xml b/src/main/java/com/zhgd/xmgl/modules/weight/mapper/xml/WeighBookVehicleInfoMapper.xml index ec1623831..7f4edd7c9 100644 --- a/src/main/java/com/zhgd/xmgl/modules/weight/mapper/xml/WeighBookVehicleInfoMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/weight/mapper/xml/WeighBookVehicleInfoMapper.xml @@ -28,7 +28,7 @@ + + diff --git a/src/main/java/com/zhgd/xmgl/modules/weight/service/IWeighInfoService.java b/src/main/java/com/zhgd/xmgl/modules/weight/service/IWeighInfoService.java index a50a1a17c..67ba8ab13 100644 --- a/src/main/java/com/zhgd/xmgl/modules/weight/service/IWeighInfoService.java +++ b/src/main/java/com/zhgd/xmgl/modules/weight/service/IWeighInfoService.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.zhgd.jeecg.common.api.vo.Result; import com.zhgd.xmgl.base.entity.vo.SectorOneVo; import com.zhgd.xmgl.base.entity.vo.SectorVo; +import com.zhgd.xmgl.base.entity.vo.TrendVo; import com.zhgd.xmgl.modules.weight.entity.WeighInfo; import com.baomidou.mybatisplus.extension.service.IService; import com.zhgd.xmgl.modules.weight.entity.vo.CountWeighInfoVO; @@ -38,4 +39,6 @@ public interface IWeighInfoService extends IService { CountWeighInfoVO countWeighInfo(HashMap paramMap); SectorVo countWeighInfoGoodsName(HashMap paramMap); + + List countWeighInfoTrend(HashMap paramMap); } diff --git a/src/main/java/com/zhgd/xmgl/modules/weight/service/impl/WeighBookVehicleInfoServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/weight/service/impl/WeighBookVehicleInfoServiceImpl.java index 9470876ec..3b26b2c2c 100644 --- a/src/main/java/com/zhgd/xmgl/modules/weight/service/impl/WeighBookVehicleInfoServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/weight/service/impl/WeighBookVehicleInfoServiceImpl.java @@ -122,7 +122,6 @@ public class WeighBookVehicleInfoServiceImpl extends ServiceImpl countWeighBookVehicleInfoTrend(HashMap paramMap) { - List list = baseMapper.countWeighBookVehicleInfoTrend(paramMap); Integer type = MapUtils.getInteger(paramMap, "type"); String format = null; List dateTimeStrList = null; @@ -138,6 +137,7 @@ public class WeighBookVehicleInfoServiceImpl extends ServiceImpl list = baseMapper.countWeighBookVehicleInfoTrend(paramMap); return TrendVo.fillTrendVos(list, dateTimeStrList, format); } diff --git a/src/main/java/com/zhgd/xmgl/modules/weight/service/impl/WeighInfoServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/weight/service/impl/WeighInfoServiceImpl.java index 2fe841204..0eb180aab 100644 --- a/src/main/java/com/zhgd/xmgl/modules/weight/service/impl/WeighInfoServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/weight/service/impl/WeighInfoServiceImpl.java @@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.zhgd.jeecg.common.api.vo.Result; import com.zhgd.xmgl.base.entity.vo.SectorOneVo; import com.zhgd.xmgl.base.entity.vo.SectorVo; +import com.zhgd.xmgl.base.entity.vo.TrendVo; import com.zhgd.xmgl.modules.weight.entity.WeighInfo; import com.zhgd.xmgl.modules.weight.entity.WeighPic; import com.zhgd.xmgl.modules.weight.entity.vo.CountWeighInfoVO; @@ -19,6 +20,7 @@ import com.zhgd.xmgl.modules.weight.mapper.WeighBookVehicleInfoMapper; import com.zhgd.xmgl.modules.weight.mapper.WeighInfoMapper; import com.zhgd.xmgl.modules.weight.mapper.WeighPicMapper; import com.zhgd.xmgl.modules.weight.service.IWeighInfoService; +import com.zhgd.xmgl.util.DateUtils; import org.apache.commons.collections.MapUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -109,7 +111,7 @@ public class WeighInfoServiceImpl extends ServiceImpl countWeighInfoTrend(HashMap paramMap) { + Integer type = MapUtils.getInteger(paramMap, "type"); + String format = null; + List dateTimeStrList = null; + if (Objects.equals(type, 1)) { + format = "HH:00"; + dateTimeStrList = DateUtils.getDateTimeStrList(100, "yyyy-MM-dd HH:00"); + } else if (Objects.equals(type, 2)) { + format = "yyyy-MM-dd"; + dateTimeStrList = DateUtils.getDateTimeStrList(60, "yyyy-MM-dd"); + } else if (Objects.equals(type, 3)) { + format = "yyyy-MM-dd"; + dateTimeStrList = DateUtils.getDateTimeStrList(80, "yyyy-MM-dd"); + } else { + return null; + } + List list = baseMapper.countWeighInfoTrend(paramMap); + return TrendVo.fillTrendVos(list, dateTimeStrList, format); + } + }