bug修改
This commit is contained in:
parent
e58cce6201
commit
bdc753a506
@ -11,6 +11,7 @@ import com.zhgd.xmgl.util.MessageUtil;
|
||||
import com.zhgd.xmgl.util.RefUtil;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.MapUtils;
|
||||
@ -59,6 +60,9 @@ public class DictionaryItemController {
|
||||
}
|
||||
|
||||
@ApiOperation(value = "列表查询基础字典信息(查启用的)", notes = "列表查询基础字典信息(查启用的)", httpMethod = "GET")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = false, dataType = "String"),
|
||||
})
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<DictionaryItem>> queryList(DictionaryItem dictionaryItem,
|
||||
HttpServletRequest req) {
|
||||
|
||||
@ -74,4 +74,6 @@ public class DictionaryItem implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "字典编码")
|
||||
private java.lang.String dictionaryEncoding;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String projectSn;
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ public interface IDictionaryItemService extends IService<DictionaryItem> {
|
||||
* @param dictionaryEncoding
|
||||
* @return
|
||||
*/
|
||||
List<DictionaryItem> getDictList(String dictionaryEncoding);
|
||||
List<DictionaryItem> getDictList(String dictionaryEncoding, String projectSn);
|
||||
|
||||
/**
|
||||
* 查询基础字典信息,根据数值
|
||||
|
||||
@ -13,6 +13,7 @@ import com.zhgd.xmgl.modules.basicdata.mapper.DictionaryItemMapper;
|
||||
import com.zhgd.xmgl.modules.basicdata.mapper.DictionaryMapper;
|
||||
import com.zhgd.xmgl.modules.basicdata.service.IDictionaryItemService;
|
||||
import com.zhgd.xmgl.util.RefUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
@ -35,7 +36,15 @@ public class DictionaryItemServiceImpl extends ServiceImpl<DictionaryItemMapper,
|
||||
* @param dictionaryEncoding
|
||||
* @return
|
||||
*/
|
||||
public List<DictionaryItem> getDictList(String dictionaryEncoding) {
|
||||
public List<DictionaryItem> getDictList(String dictionaryEncoding, String projectSn) {
|
||||
if (StringUtils.isNotBlank(projectSn)) {
|
||||
String newEncoding = dictionaryEncoding + "_" + projectSn;
|
||||
Integer count = dictionaryMapper.selectCount(new LambdaQueryWrapper<Dictionary>()
|
||||
.eq(Dictionary::getDictionaryEncoding, newEncoding));
|
||||
if (count > 0) {
|
||||
dictionaryEncoding = newEncoding;
|
||||
}
|
||||
}
|
||||
DictionaryItem di = new DictionaryItem();
|
||||
di.setDictionaryEncoding(dictionaryEncoding);
|
||||
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
||||
@ -73,6 +82,14 @@ public class DictionaryItemServiceImpl extends ServiceImpl<DictionaryItemMapper,
|
||||
|
||||
@Override
|
||||
public List<DictionaryItem> queryList(DictionaryItem dictionaryItem, HttpServletRequest req) {
|
||||
if (StringUtils.isNotBlank(dictionaryItem.getProjectSn())) {
|
||||
String newEncoding = dictionaryItem.getDictionaryEncoding() + "_" + dictionaryItem.getProjectSn();
|
||||
Integer count = dictionaryMapper.selectCount(new LambdaQueryWrapper<Dictionary>()
|
||||
.eq(Dictionary::getDictionaryEncoding, newEncoding));
|
||||
if (count > 0) {
|
||||
dictionaryItem.setDictionaryEncoding(newEncoding);
|
||||
}
|
||||
}
|
||||
QueryWrapper<DictionaryItem> queryWrapper = QueryGenerator.initQueryWrapper(dictionaryItem, req.getParameterMap(), null,
|
||||
RefUtil.fieldNames(DictionaryItem::getName))
|
||||
.orderByAsc(RefUtil.fieldNameUlc(DictionaryItem::getOrderNum));
|
||||
@ -80,4 +97,5 @@ public class DictionaryItemServiceImpl extends ServiceImpl<DictionaryItemMapper,
|
||||
List<DictionaryItem> pageList = list(queryWrapper);
|
||||
return pageList;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
@ -113,14 +114,21 @@ public class FrontierProtectionNoNetData implements Serializable {
|
||||
* 操作人id
|
||||
*/
|
||||
@Excel(name = "操作人id", width = 15)
|
||||
@ApiModelProperty(value = "操作人id")
|
||||
private java.lang.Integer operateId;
|
||||
/**
|
||||
* 操作时间
|
||||
*/
|
||||
@Excel(name = "操作时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "操作时间")
|
||||
private java.util.Date operateTime;
|
||||
@ApiModelProperty(value = "操作人id")
|
||||
private java.lang.Integer operateId;
|
||||
/**
|
||||
* 操作时间
|
||||
*/
|
||||
@Excel(name = "操作时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "操作时间")
|
||||
private java.util.Date operateTime;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "设备名称")
|
||||
private java.lang.String devName;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "设备位置")
|
||||
private java.lang.String location;
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
@ -50,23 +51,23 @@ public class FrontierProtectionNoNetDev implements Serializable {
|
||||
@ApiModelProperty(value = "设备位置")
|
||||
private java.lang.String location;
|
||||
/**
|
||||
* 项目sn
|
||||
*/
|
||||
@Excel(name = "项目sn", width = 15)
|
||||
@ApiModelProperty(value = "项目sn")
|
||||
private java.lang.String projectSn;
|
||||
/**
|
||||
* 责任班组id
|
||||
*/
|
||||
@Excel(name = "责任班组id", width = 15)
|
||||
@ApiModelProperty(value = "责任班组id")
|
||||
private java.lang.Integer dutyTeamInfoId;
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
@Excel(name = "图片", width = 15)
|
||||
@ApiModelProperty(value = "图片")
|
||||
private java.lang.Object image;
|
||||
* 项目sn
|
||||
*/
|
||||
@Excel(name = "项目sn", width = 15)
|
||||
@ApiModelProperty(value = "项目sn")
|
||||
private java.lang.String projectSn;
|
||||
/**
|
||||
* 责任班组id
|
||||
*/
|
||||
@Excel(name = "责任班组id", width = 15)
|
||||
@ApiModelProperty(value = "责任班组id")
|
||||
private java.lang.Long dutyTeamInfoId;
|
||||
/**
|
||||
* 图片
|
||||
*/
|
||||
@Excel(name = "图片", width = 15)
|
||||
@ApiModelProperty(value = "图片")
|
||||
private java.lang.Object image;
|
||||
/**
|
||||
* 创建时间 yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
@ -87,14 +88,18 @@ public class FrontierProtectionNoNetDev implements Serializable {
|
||||
* 备注
|
||||
*/
|
||||
@Excel(name = "备注", width = 15)
|
||||
@ApiModelProperty(value = "备注")
|
||||
private java.lang.String remark;
|
||||
/**
|
||||
* 上传时间
|
||||
*/
|
||||
@Excel(name = "上传时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "上传时间")
|
||||
private java.util.Date uploadDate;
|
||||
@ApiModelProperty(value = "备注")
|
||||
private java.lang.String remark;
|
||||
/**
|
||||
* 上传时间
|
||||
*/
|
||||
@Excel(name = "上传时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "上传时间")
|
||||
private java.util.Date uploadDate;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "责任班组名称")
|
||||
private java.lang.String dutyTeamInfoName;
|
||||
}
|
||||
|
||||
@ -1,8 +1,15 @@
|
||||
package com.zhgd.xmgl.modules.frontierprotectionnonet.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.xmgl.modules.frontierprotectionnonet.entity.FrontierProtectionNoNetData;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 临边防护(无网)-数据
|
||||
@ -13,4 +20,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
@Mapper
|
||||
public interface FrontierProtectionNoNetDataMapper extends BaseMapper<FrontierProtectionNoNetData> {
|
||||
|
||||
List<FrontierProtectionNoNetData> queryList(@Param(Constants.WRAPPER) QueryWrapper<FrontierProtectionNoNetData> queryWrapper);
|
||||
|
||||
IPage<FrontierProtectionNoNetData> queryList(Page<FrontierProtectionNoNetData> page, @Param(Constants.WRAPPER) QueryWrapper<FrontierProtectionNoNetData> queryWrapper);
|
||||
}
|
||||
|
||||
@ -1,8 +1,15 @@
|
||||
package com.zhgd.xmgl.modules.frontierprotectionnonet.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.zhgd.xmgl.modules.frontierprotectionnonet.entity.FrontierProtectionNoNetDev;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 临边防护(无网)-设备
|
||||
@ -13,4 +20,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
@Mapper
|
||||
public interface FrontierProtectionNoNetDevMapper extends BaseMapper<FrontierProtectionNoNetDev> {
|
||||
|
||||
List<FrontierProtectionNoNetDev> queryList(@Param(Constants.WRAPPER) QueryWrapper<FrontierProtectionNoNetDev> queryWrapper);
|
||||
|
||||
IPage<FrontierProtectionNoNetDev> queryList(Page<FrontierProtectionNoNetDev> page, @Param(Constants.WRAPPER) QueryWrapper<FrontierProtectionNoNetDev> queryWrapper);
|
||||
}
|
||||
|
||||
@ -1,4 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zhgd.xmgl.modules.frontierprotectionnonet.mapper.FrontierProtectionNoNetDataMapper">
|
||||
<select id="queryList"
|
||||
resultType="com.zhgd.xmgl.modules.frontierprotectionnonet.entity.FrontierProtectionNoNetData">
|
||||
select fpnnd.*,fpd.location,fpd.dev_name from frontier_protection_no_net_data fpnnd
|
||||
join frontier_protection_dev fpd on fpd.dev_sn=fpnnd.dev_sn
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -1,4 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zhgd.xmgl.modules.frontierprotectionnonet.mapper.FrontierProtectionNoNetDevMapper">
|
||||
<select id="queryList" resultType="com.zhgd.xmgl.modules.frontierprotectionnonet.entity.FrontierProtectionNoNetDev">
|
||||
select fpnnd.*,ti.team_name as dutyTeamInfoName from frontier_protection_no_net_dev fpnnd
|
||||
left join team_info ti on fpnnd.duty_team_info_id = ti.id
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -43,7 +43,7 @@ public class FrontierProtectionNoNetDataServiceImpl extends ServiceImpl<Frontier
|
||||
public IPage<FrontierProtectionNoNetData> queryPageList(HashMap<String, Object> paramMap) {
|
||||
QueryWrapper<FrontierProtectionNoNetData> queryWrapper = getQueryWrapper(paramMap);
|
||||
Page<FrontierProtectionNoNetData> page = PageUtil.getPage(paramMap);
|
||||
IPage<FrontierProtectionNoNetData> pageList = this.page(page, queryWrapper);
|
||||
IPage<FrontierProtectionNoNetData> pageList = baseMapper.queryList(page, queryWrapper);
|
||||
pageList.setRecords(dealList(pageList.getRecords()));
|
||||
return pageList;
|
||||
}
|
||||
@ -51,11 +51,11 @@ public class FrontierProtectionNoNetDataServiceImpl extends ServiceImpl<Frontier
|
||||
@Override
|
||||
public List<FrontierProtectionNoNetData> queryList(HashMap<String, Object> paramMap) {
|
||||
QueryWrapper<FrontierProtectionNoNetData> queryWrapper = getQueryWrapper(paramMap);
|
||||
return dealList(this.list(queryWrapper));
|
||||
return dealList(baseMapper.queryList(queryWrapper));
|
||||
}
|
||||
|
||||
private QueryWrapper<FrontierProtectionNoNetData> getQueryWrapper(HashMap<String, Object> paramMap) {
|
||||
String alias = "";
|
||||
String alias = "fpnnd.";
|
||||
QueryWrapper<FrontierProtectionNoNetData> queryWrapper = QueryGenerator.initPageQueryWrapper(FrontierProtectionNoNetData.class, paramMap, alias);
|
||||
queryWrapper.orderByDesc(alias + RefUtil.fieldNameUlc(FrontierProtectionNoNetData::getId));
|
||||
return queryWrapper;
|
||||
|
||||
@ -34,7 +34,7 @@ public class FrontierProtectionNoNetDevServiceImpl extends ServiceImpl<FrontierP
|
||||
public IPage<FrontierProtectionNoNetDev> queryPageList(HashMap<String, Object> paramMap) {
|
||||
QueryWrapper<FrontierProtectionNoNetDev> queryWrapper = getQueryWrapper(paramMap);
|
||||
Page<FrontierProtectionNoNetDev> page = PageUtil.getPage(paramMap);
|
||||
IPage<FrontierProtectionNoNetDev> pageList = this.page(page, queryWrapper);
|
||||
IPage<FrontierProtectionNoNetDev> pageList = baseMapper.queryList(page, queryWrapper);
|
||||
pageList.setRecords(dealList(pageList.getRecords()));
|
||||
return pageList;
|
||||
}
|
||||
@ -42,11 +42,11 @@ public class FrontierProtectionNoNetDevServiceImpl extends ServiceImpl<FrontierP
|
||||
@Override
|
||||
public List<FrontierProtectionNoNetDev> queryList(HashMap<String, Object> paramMap) {
|
||||
QueryWrapper<FrontierProtectionNoNetDev> queryWrapper = getQueryWrapper(paramMap);
|
||||
return dealList(this.list(queryWrapper));
|
||||
return dealList(baseMapper.queryList(queryWrapper));
|
||||
}
|
||||
|
||||
private QueryWrapper<FrontierProtectionNoNetDev> getQueryWrapper(HashMap<String, Object> paramMap) {
|
||||
String alias = "";
|
||||
String alias = "fpnnd.";
|
||||
QueryWrapper<FrontierProtectionNoNetDev> queryWrapper = QueryGenerator.initPageQueryWrapper(FrontierProtectionNoNetDev.class, paramMap, alias);
|
||||
queryWrapper.orderByDesc(alias + RefUtil.fieldNameUlc(FrontierProtectionNoNetDev::getId));
|
||||
return queryWrapper;
|
||||
|
||||
@ -187,9 +187,10 @@ public class AiAnalyseHardWareAlarmRecordServiceImpl extends ServiceImpl<AiAnaly
|
||||
@Override
|
||||
public List<AiAnalyseHardWareAlarmRecord> selectAiAnalyseHardWareAlarmList(Map<String, Object> map) {
|
||||
Integer sizeNum = MapUtils.getInteger(map, "sizeNum", 10);
|
||||
String projectSn = MapUtils.getString(map, "projectSn");
|
||||
map.put("sizeNum", sizeNum);
|
||||
List<AiAnalyseHardWareAlarmRecord> aiAnalyseHardWareAlarmRecords = aiAnalyseHardWareAlarmRecordMapper.selectAiAnalyseHardWareAlarmList(map);
|
||||
List<DictionaryItem> dictList = dictionaryItemService.getDictList(DictionaryConstant.AI_ANALYSE_HARD_WARE_ALARM_RECORD_TYPE);
|
||||
List<DictionaryItem> dictList = dictionaryItemService.getDictList(DictionaryConstant.AI_ANALYSE_HARD_WARE_ALARM_RECORD_TYPE, projectSn);
|
||||
try {
|
||||
Map<String, DictionaryItem> typeMap = dictList.stream().collect(Collectors.toMap(DictionaryItem::getData, Function.identity(), (dictionaryItem, dictionaryItem2) -> dictionaryItem));
|
||||
for (AiAnalyseHardWareAlarmRecord record : aiAnalyseHardWareAlarmRecords) {
|
||||
@ -206,8 +207,9 @@ public class AiAnalyseHardWareAlarmRecordServiceImpl extends ServiceImpl<AiAnaly
|
||||
|
||||
@Override
|
||||
public SectorVo getAiAnalyseHardWareAlarmTotal(Map<String, Object> map) {
|
||||
String projectSn = MapUtils.getString(map, "projectSn");
|
||||
List<SectorOneVo> list = aiAnalyseHardWareAlarmRecordMapper.getAiAnalyseHardWareAlarmTotal(map);
|
||||
return SectorVo.getSectorVoByDict(list, dictionaryItemService.getDictList(DictionaryConstant.AI_ANALYSE_HARD_WARE_ALARM_RECORD_TYPE), true);
|
||||
return SectorVo.getSectorVoByDict(list, dictionaryItemService.getDictList(DictionaryConstant.AI_ANALYSE_HARD_WARE_ALARM_RECORD_TYPE, projectSn), true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -4,8 +4,8 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.xmgl.base.entity.vo.TrendVo;
|
||||
import com.zhgd.xmgl.modules.weight.entity.WeighBookVehicleInfo;
|
||||
import com.zhgd.xmgl.modules.weight.entity.bo.WeighingTypeStatisticBo;
|
||||
import com.zhgd.xmgl.modules.weight.entity.vo.PullListVo;
|
||||
import com.zhgd.xmgl.modules.weight.entity.vo.WeighingTypeStatisticVo;
|
||||
import com.zhgd.xmgl.modules.weight.enums.WeighingTypeEnum;
|
||||
@ -194,4 +194,14 @@ public class WeighBookVehicleInfoController {
|
||||
public Result<PullListVo> pullList(@ApiIgnore @RequestParam HashMap<String, Object> paramMap) {
|
||||
return Result.success(weighBookVehicleInfoService.pullList(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 = "/countWeighBookVehicleInfoTrend")
|
||||
public Result<List<TrendVo>> countWeighBookVehicleInfoTrend(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
||||
return Result.success(weighBookVehicleInfoService.countWeighBookVehicleInfoTrend(paramMap));
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,7 +4,11 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
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.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;
|
||||
import com.zhgd.xmgl.modules.weight.entity.vo.WeighInfoTodayStatisticVo;
|
||||
@ -15,8 +19,10 @@ import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.formula.functions.Trend;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Arrays;
|
||||
@ -200,4 +206,32 @@ public class WeighInfoController {
|
||||
return Result.success(weighInfoService.getWeighInfoForwardingUnitRank(map));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "统计发货单位(供应商排行)", notes = "统计发货单位(供应商排行)", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/countForwardingUnit")
|
||||
public Result<List<SectorOneVo>> countForwardingUnit(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
||||
return Result.success(weighInfoService.countForwardingUnit(paramMap));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "统计称重记录(实时过磅)", notes = "统计称重记录(实时过磅)", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/countWeighInfo")
|
||||
public Result<CountWeighInfoVO> countWeighInfo(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
||||
return Result.success(weighInfoService.countWeighInfo(paramMap));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "统计货名(物料统计)", notes = "统计货名(物料统计)", httpMethod = "POST")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目sn", paramType = "body", required = true, dataType = "String"),
|
||||
})
|
||||
@PostMapping(value = "/countWeighInfoGoodsName")
|
||||
public Result<SectorVo> countWeighInfoGoodsName(@ApiIgnore @RequestBody HashMap<String, Object> paramMap) {
|
||||
return Result.success(weighInfoService.countWeighInfoGoodsName(paramMap));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,20 @@
|
||||
package com.zhgd.xmgl.modules.weight.entity.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CountWeighInfoVO {
|
||||
@ApiModelProperty("今日过磅")
|
||||
private Double weighingToday;
|
||||
@ApiModelProperty("今日预约")
|
||||
private Double makeAnAppointmentToday;
|
||||
@ApiModelProperty("累计过磅")
|
||||
private Double accumulatedWeighing;
|
||||
@ApiModelProperty("累计预约")
|
||||
private Double cumulativeReservations;
|
||||
@ApiModelProperty("本次过磅数")
|
||||
private Double numberOfWeighThisTime;
|
||||
@ApiModelProperty("车牌号")
|
||||
private String numberPlate;
|
||||
}
|
||||
@ -2,8 +2,10 @@ package com.zhgd.xmgl.modules.weight.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.zhgd.xmgl.base.entity.vo.TrendVo;
|
||||
import com.zhgd.xmgl.modules.weight.entity.WeighBookVehicleInfo;
|
||||
import com.zhgd.xmgl.modules.weight.entity.bo.WeighingTypeStatisticBo;
|
||||
import com.zhgd.xmgl.modules.weight.entity.vo.CountWeighInfoVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@ -27,4 +29,8 @@ public interface WeighBookVehicleInfoMapper extends BaseMapper<WeighBookVehicleI
|
||||
List<WeighingTypeStatisticBo> getWeighingTypeStatistic(HashMap<String, Object> map);
|
||||
|
||||
ArrayList<WeighBookVehicleInfo> pullList(HashMap<String, Object> paramMap);
|
||||
|
||||
CountWeighInfoVO countWeighInfo(HashMap<String, Object> paramMap);
|
||||
|
||||
List<TrendVo> countWeighBookVehicleInfoTrend(HashMap<String, Object> paramMap);
|
||||
}
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package com.zhgd.xmgl.modules.weight.mapper;
|
||||
|
||||
import com.zhgd.xmgl.base.entity.vo.SectorOneVo;
|
||||
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;
|
||||
import com.zhgd.xmgl.modules.weight.entity.vo.WeighInfoTodayStatisticVo;
|
||||
@ -26,4 +28,10 @@ public interface WeighInfoMapper extends BaseMapper<WeighInfo> {
|
||||
List<WeighInfoGoodsNameStatisticVo> getWeighInfoGoodsNameStatistic(HashMap<String, Object> map);
|
||||
|
||||
List<WeighInfoForwardingUnitRankVo> getWeighInfoForwardingUnitRank(HashMap<String, Object> map);
|
||||
|
||||
List<SectorOneVo> countForwardingUnit(HashMap<String, Object> paramMap);
|
||||
|
||||
CountWeighInfoVO countWeighInfo(HashMap<String, Object> paramMap);
|
||||
|
||||
List<SectorOneVo> countWeighInfoGoodsName(HashMap<String, Object> paramMap);
|
||||
}
|
||||
|
||||
@ -26,4 +26,36 @@
|
||||
and vi.update_time <![CDATA[>]]> #{beginTimestamp}
|
||||
limit 0,200
|
||||
</select>
|
||||
|
||||
<select id="countWeighInfo" resultType="com.zhgd.xmgl.modules.weight.entity.vo.CountWeighInfoVO">
|
||||
select ifnull(sum(if(create_time>current_date,1,0)),0) makeAnAppointmentToday,
|
||||
count(*) cumulativeReservations
|
||||
from weigh_book_vehicle_info
|
||||
where project_sn=#{projectSn}
|
||||
</select>
|
||||
|
||||
<select id="countWeighBookVehicleInfoTrend" resultType="com.zhgd.xmgl.base.entity.vo.TrendVo">
|
||||
select
|
||||
<if test="type == '1'.toString()">
|
||||
date_format(add_date_time,'%Y-%m-%d %H:00') x,
|
||||
</if>
|
||||
<if test="type == '2'.toString()">
|
||||
date_format(add_date_time,'%Y-%m-%d') x,
|
||||
</if>
|
||||
<if test="type == '3'.toString()">
|
||||
date_format(add_date_time,'%Y-%m-%d') x,
|
||||
</if>
|
||||
count(*) y from weigh_book_vehicle_info
|
||||
where project_sn=#{projectSn}
|
||||
<if test="type == '1'.toString()">
|
||||
and add_date_time > current_date
|
||||
</if>
|
||||
<if test="type == '2'.toString()">
|
||||
and add_date_time > date_sub(add_date_time,interval 6 day)
|
||||
</if>
|
||||
<if test="type == '3'.toString()">
|
||||
and add_date_time > date_sub(add_date_time,interval 29 day)
|
||||
</if>
|
||||
group by x
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -96,4 +96,26 @@
|
||||
wi.forwarding_unit
|
||||
ORDER BY net_weight desc
|
||||
</select>
|
||||
|
||||
<select id="countForwardingUnit" resultType="com.zhgd.xmgl.base.entity.vo.SectorOneVo">
|
||||
select forwarding_unit as name,count(*) count from weigh_info
|
||||
where project_sn=#{projectSn}
|
||||
group by forwarding_unit
|
||||
</select>
|
||||
|
||||
<select id="countWeighInfo" resultType="com.zhgd.xmgl.modules.weight.entity.vo.CountWeighInfoVO">
|
||||
select
|
||||
ifnull(sum(if(gross_time>current_date,net_weight,0)),0) weighingToday,
|
||||
ifnull(sum(net_weight),0) accumulatedWeighing
|
||||
from weigh_info wi
|
||||
where project_sn=#{projectSn}
|
||||
</select>
|
||||
|
||||
<select id="countWeighInfoGoodsName" resultType="com.zhgd.xmgl.base.entity.vo.SectorOneVo">
|
||||
select goods_name name,count(*) count
|
||||
from weigh_info
|
||||
where project_sn=#{projectSn}
|
||||
group by goods_name
|
||||
order by count
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -2,6 +2,7 @@ package com.zhgd.xmgl.modules.weight.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.xmgl.base.entity.vo.TrendVo;
|
||||
import com.zhgd.xmgl.modules.weight.entity.WeighBookVehicleInfo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.zhgd.xmgl.modules.weight.entity.bo.WeighingTypeStatisticBo;
|
||||
@ -25,4 +26,6 @@ public interface IWeighBookVehicleInfoService extends IService<WeighBookVehicleI
|
||||
WeighingTypeStatisticVo getWeighingTypeStatistic(HashMap<String, Object> map);
|
||||
|
||||
PullListVo pullList(HashMap<String, Object> paramMap);
|
||||
|
||||
List<TrendVo> countWeighBookVehicleInfoTrend(HashMap<String, Object> paramMap);
|
||||
}
|
||||
|
||||
@ -2,8 +2,11 @@ package com.zhgd.xmgl.modules.weight.service;
|
||||
|
||||
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.modules.weight.entity.WeighInfo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
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;
|
||||
import com.zhgd.xmgl.modules.weight.entity.vo.WeighInfoTodayStatisticVo;
|
||||
@ -29,4 +32,10 @@ public interface IWeighInfoService extends IService<WeighInfo> {
|
||||
List<WeighInfoGoodsNameStatisticVo> getWeighInfoGoodsNameStatistic(HashMap<String, Object> map);
|
||||
|
||||
List<WeighInfoForwardingUnitRankVo> getWeighInfoForwardingUnitRank(HashMap<String, Object> map);
|
||||
|
||||
List<SectorOneVo> countForwardingUnit(HashMap<String, Object> paramMap);
|
||||
|
||||
CountWeighInfoVO countWeighInfo(HashMap<String, Object> paramMap);
|
||||
|
||||
SectorVo countWeighInfoGoodsName(HashMap<String, Object> paramMap);
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.zhgd.jeecg.common.api.vo.Result;
|
||||
import com.zhgd.xmgl.base.entity.vo.TrendVo;
|
||||
import com.zhgd.xmgl.modules.weight.entity.WeighBookVehicleInfo;
|
||||
import com.zhgd.xmgl.modules.weight.entity.bo.WeighingTypeStatisticBo;
|
||||
import com.zhgd.xmgl.modules.weight.entity.vo.PullListVo;
|
||||
@ -15,6 +16,7 @@ import com.zhgd.xmgl.modules.weight.entity.vo.WeighingTypeStatisticVo;
|
||||
import com.zhgd.xmgl.modules.weight.enums.WeighingTypeEnum;
|
||||
import com.zhgd.xmgl.modules.weight.mapper.WeighBookVehicleInfoMapper;
|
||||
import com.zhgd.xmgl.modules.weight.service.IWeighBookVehicleInfoService;
|
||||
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;
|
||||
@ -118,4 +120,25 @@ public class WeighBookVehicleInfoServiceImpl extends ServiceImpl<WeighBookVehicl
|
||||
return pullListVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TrendVo> countWeighBookVehicleInfoTrend(HashMap<String, Object> paramMap) {
|
||||
List<TrendVo> list = baseMapper.countWeighBookVehicleInfoTrend(paramMap);
|
||||
Integer type = MapUtils.getInteger(paramMap, "type");
|
||||
String format = null;
|
||||
List<String> 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;
|
||||
}
|
||||
return TrendVo.fillTrendVos(list, dateTimeStrList, format);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -7,15 +7,18 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
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.modules.weight.entity.WeighInfo;
|
||||
import com.zhgd.xmgl.modules.weight.entity.WeighPic;
|
||||
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;
|
||||
import com.zhgd.xmgl.modules.weight.entity.vo.WeighInfoTodayStatisticVo;
|
||||
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;
|
||||
@ -38,6 +41,8 @@ public class WeighInfoServiceImpl extends ServiceImpl<WeighInfoMapper, WeighInfo
|
||||
private WeighInfoMapper weighInfoMapper;
|
||||
@Autowired
|
||||
private WeighPicMapper weighPicMapper;
|
||||
@Autowired
|
||||
private WeighBookVehicleInfoMapper weighBookVehicleInfoMapper;
|
||||
|
||||
@Override
|
||||
public Result<IPage<WeighInfo>> queryPageList(WeighInfo weighInfo, Integer pageNo, Integer pageSize, HttpServletRequest req) {
|
||||
@ -88,4 +93,35 @@ public class WeighInfoServiceImpl extends ServiceImpl<WeighInfoMapper, WeighInfo
|
||||
return weighInfoMapper.getWeighInfoForwardingUnitRank(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SectorOneVo> countForwardingUnit(HashMap<String, Object> paramMap) {
|
||||
return baseMapper.countForwardingUnit(paramMap);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CountWeighInfoVO countWeighInfo(HashMap<String, Object> paramMap) {
|
||||
String projectSn = MapUtils.getString(paramMap, "projectSn");
|
||||
CountWeighInfoVO countWeighInfoVO = baseMapper.countWeighInfo(paramMap);
|
||||
CountWeighInfoVO c1 = weighBookVehicleInfoMapper.countWeighInfo(paramMap);
|
||||
countWeighInfoVO.setMakeAnAppointmentToday(c1.getMakeAnAppointmentToday());
|
||||
countWeighInfoVO.setCumulativeReservations(c1.getCumulativeReservations());
|
||||
WeighInfo weighInfo = weighInfoMapper.selectOne(new LambdaQueryWrapper<WeighInfo>()
|
||||
.eq(WeighInfo::getProjectSn, projectSn).orderByDesc(WeighInfo::getId).last("limit 1"));
|
||||
if (weighInfo != null) {
|
||||
try {
|
||||
countWeighInfoVO.setNumberOfWeighThisTime(weighInfo.getGrossWeight().doubleValue());
|
||||
countWeighInfoVO.setNumberPlate(weighInfo.getLicensePlate());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return countWeighInfoVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SectorVo countWeighInfoGoodsName(HashMap<String, Object> paramMap) {
|
||||
List<SectorOneVo> list = baseMapper.countWeighInfoGoodsName(paramMap);
|
||||
return SectorVo.getSectorVo(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user