| | |
| | | package com.doumee.api; |
| | | |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.service.business.third.model.ApiResponse; |
| | | import com.doumee.service.business.PlatformJobService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @PreventRepeat(interval = 2000) |
| | | @ApiOperation("月台今日作业未完成通知定时") |
| | | @GetMapping("/sendUnFinishNotice") |
| | | public ApiResponse sendUnFinishNotice() { |
| | | public synchronized ApiResponse sendUnFinishNotice() { |
| | | log.error("========月台今日作业未完成通知定时============开始"+System.currentTimeMillis()+""); |
| | | platformJobService.sendUnFinishNotice(); |
| | | log.error("========月台今日作业未完成通知定时============结束"+System.currentTimeMillis()+""); |
| | |
| | | @PostMapping("/exportExcel") |
| | | @RequiresPermissions("business:inoutrecord:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<InoutRecord> pageWrap, HttpServletResponse response) { |
| | | ExcelExporter.build(InoutRecord.class).export(inoutRecordService.findPage(pageWrap).getRecords(), "出入场人次车次每日统计表", response); |
| | | ExcelExporter.build(InoutRecord.class).export(inoutRecordService.findPage(pageWrap).getRecords(), "厂区进出记录", response); |
| | | } |
| | | |
| | | @ApiOperation("根据ID查询") |
| | |
| | | @PostMapping("/exportExcel") |
| | | @CloudRequiredPermission("business:inoutrecord:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<InoutRecord> pageWrap, HttpServletResponse response) { |
| | | ExcelExporter.build(InoutRecord.class).export(inoutRecordService.findPage(pageWrap).getRecords(), "出入场人次车次每日统计表", response); |
| | | ExcelExporter.build(InoutRecord.class).export(inoutRecordService.findPage(pageWrap).getRecords(), "出入场人次车次统计表_"+System.currentTimeMillis(), response); |
| | | } |
| | | |
| | | @ApiOperation("根据ID查询") |
| | |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | @ApiModelProperty(value = "主键", example = "1") |
| | | @ExcelColumn(name="主键") |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "创建人编码", example = "1") |
| | | @ExcelColumn(name="创建人编码") |
| | | private Integer creator; |
| | | |
| | | @ApiModelProperty(value = "创建时间") |
| | | @ExcelColumn(name="创建时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ExcelColumn(name="创建时间",index = 9,width = 18,dateFormat = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createDate; |
| | | |
| | | @ApiModelProperty(value = "更新人编码", example = "1") |
| | | @ExcelColumn(name="更新人编码") |
| | | private Integer editor; |
| | | |
| | | @ApiModelProperty(value = "更新时间") |
| | | @ExcelColumn(name="更新时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date editDate; |
| | | |
| | | @ApiModelProperty(value = "是否删除0否 1是", example = "1") |
| | | @ExcelColumn(name="是否删除0否 1是") |
| | | private Integer isdeleted; |
| | | |
| | | @ApiModelProperty(value = "备注") |
| | | @ExcelColumn(name="备注") |
| | | @ExcelColumn(name="备注",index = 10,width = 16) |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "对象类型 0车辆 1人员", example = "1") |
| | | @ExcelColumn(name="对象类型 0车辆 1人员") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "海康事件编码") |
| | | @ExcelColumn(name="海康事件编码") |
| | | private String hkEventId; |
| | | |
| | | @ApiModelProperty(value = "海康事件对象编码") |
| | | @ExcelColumn(name="海康事件对象编码") |
| | | private String hkId; |
| | | |
| | | @ApiModelProperty(value = "关联人员编码(关联member)", example = "1") |
| | | @ExcelColumn(name="关联人员编码(关联member)") |
| | | private Integer memberId; |
| | | |
| | | @ApiModelProperty(value = "关联人员编码(关联cars)", example = "1") |
| | | @ExcelColumn(name="关联人员编码(关联cars)") |
| | | private Integer carId; |
| | | |
| | | @ApiModelProperty(value = "关联分类编码(关联category)", example = "1") |
| | | @ExcelColumn(name="关联分类编码(关联category)") |
| | | private Integer categoryId; |
| | | |
| | | @ApiModelProperty(value = "关联分类名称") |
| | | @ExcelColumn(name="关联分类名称") |
| | | @ExcelColumn(name="车辆分类",index = 6,width = 16) |
| | | private String categoryName; |
| | | |
| | | @ApiModelProperty(value = "关联父级分类编码(关联category)", example = "1") |
| | | @ExcelColumn(name="关联父级分类编码(关联category)") |
| | | private Integer categoryParentId; |
| | | |
| | | @ApiModelProperty(value = "关联分类名称") |
| | | @ExcelColumn(name="关联分类名称") |
| | | private String categoryParentName; |
| | | |
| | | @ApiModelProperty(value = "业务类型 业务类型 0=访客车辆-访客车辆 ;" + |
| | |
| | | "2=wms市公司的预约入园车辆:货运车辆-市公司卸货车辆;" + |
| | | "3=wms、安泰的预约入园车辆:货运车辆-加工烟卸货车辆 ;" + |
| | | "4=wms安泰公务车:公务车-安泰物流公务用车;" + |
| | | "5=wms安泰自有车:货运车辆-安泰物流货运车辆' ", example = "1") |
| | | @ExcelColumn(name="车辆业务类型") |
| | | "5=wms安泰自有车:货运车辆-安泰物流货运车辆;" + |
| | | "6=未知车辆; ", example = "1") |
| | | @ExcelColumn(name="车辆业务类型",index = 5,width = 16,valueMapping = "0=访客车辆-访客车辆;1=货运车辆-外协运输车辆;2=货运车辆-市公司卸货车辆;3=货运车辆-加工烟卸货车辆;4=公务车-安泰物流公务用车;5=货运车辆-安泰物流货运车辆;6=未知车辆;") |
| | | private Integer carBizType; |
| | | |
| | | @ApiModelProperty(value = "用户类型 0劳务访客 1普通访客 2内部员工 3车辆信息 4相关方人员 5货运司机 ", example = "1") |
| | | @ExcelColumn(name="用户类型 0劳务访客 1普通访客 2内部员工 3车辆信息 4相关方人员 5货运司机 ") |
| | | @ExcelColumn(name="用户类型",index = 3,width = 16,valueMapping = "0=劳务访客;1=普通访客;2=内部员工;3=车辆信息;4=相关方人员;5=货运司机;") |
| | | private Integer memberType; |
| | | |
| | | @ApiModelProperty(value = "人员名称") |
| | | @ExcelColumn(name="人员名称") |
| | | @ExcelColumn(name="人员名称",index = 0,width = 16) |
| | | private String memberName; |
| | | @ApiModelProperty(value = "人员手机号") |
| | | @ExcelColumn(name="人员手机号") |
| | | @ExcelColumn(name="人员手机号",index = 1,width = 16) |
| | | private String memberPhone; |
| | | @ApiModelProperty(value = "组织名称") |
| | | @ExcelColumn(name="组织名称") |
| | | @ExcelColumn(name="组织名称",index = 2,width = 16) |
| | | private String companyName; |
| | | @ApiModelProperty(value = "关联组织编码") |
| | | @ExcelColumn(name="关联组织编码") |
| | | private Integer companyId; |
| | | |
| | | @ApiModelProperty(value = "车牌号") |
| | | @ExcelColumn(name="车牌号") |
| | | @ExcelColumn(name="车牌号",index = 4,width = 16) |
| | | private String carCode; |
| | | |
| | | @ApiModelProperty(value = "关联对象类型 0车辆 1人员 2访客申请记录 3访客报备申请记录 4月台作业记录", example = "1") |
| | | @ExcelColumn(name="关联对象类型 0车辆 1人员 2访客申请记录 3访客报备申请记录 4月台作业记录") |
| | | private Integer objType; |
| | | @ApiModelProperty(value = "统计日期(2024-10-12 00:00:00)") |
| | | @ExcelColumn(name="统计日期(2024-10-12 00:00:00)") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date timeInfo; |
| | | |
| | | @ApiModelProperty(value = "关联对象编码", example = "1") |
| | | @ExcelColumn(name="关联对象编码") |
| | | private Integer objId; |
| | | |
| | | @ApiModelProperty(value = "进出类型 0进 1出", example = "1") |
| | | @ExcelColumn(name="进出类型 0进 1出") |
| | | @ExcelColumn(name="进出类型",index = 7,width = 10,valueMapping = "0=进;1=出;") |
| | | private Integer inOrOut; |
| | | |
| | | @ApiModelProperty(value = "进出设备名称") |
| | | @ExcelColumn(name="进出设备名称") |
| | | @ExcelColumn(name="进出类型",index = 8,width = 10) |
| | | private String deviceName; |
| | | |
| | | @ApiModelProperty(value = "人脸照片") |
| | |
| | | @ApiModelProperty(value = "证件显示信息") |
| | | @TableField(exist = false) |
| | | private String memberCode; |
| | | |
| | | @ApiModelProperty(value = "创建时间 开始") |
| | | @TableField(exist = false) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date startDate; |
| | | |
| | | @ApiModelProperty(value = "创建时间 结束") |
| | | @TableField(exist = false) |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date endDate; |
| | | |
| | | } |
| | |
| | | import com.doumee.dao.business.dto.InParkDataDTO; |
| | | import com.doumee.dao.business.model.Category; |
| | | import com.doumee.dao.business.model.InoutRecord; |
| | | import com.doumee.dao.business.model.Member; |
| | | import com.doumee.dao.business.vo.GeneralDataVO; |
| | | import com.doumee.dao.business.vo.InParkUserDataVO; |
| | | import com.doumee.service.business.InoutRecordService; |
| | |
| | | @Override |
| | | public PageData<InoutRecord> findPage(PageWrap<InoutRecord> pageWrap) { |
| | | IPage<InoutRecord> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | QueryWrapper<InoutRecord> queryWrapper = new QueryWrapper<>(); |
| | | MPJLambdaWrapper<InoutRecord> queryWrapper = new MPJLambdaWrapper<>(); |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | if (pageWrap.getModel().getId() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getId, pageWrap.getModel().getId()); |
| | | } |
| | | if (pageWrap.getModel().getCreator() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getCreator, pageWrap.getModel().getCreator()); |
| | | } |
| | | if (pageWrap.getModel().getCreateDate() != null) { |
| | | queryWrapper.lambda().ge(InoutRecord::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getCreateDate())); |
| | | queryWrapper.lambda().le(InoutRecord::getCreateDate, Utils.Date.getEnd(pageWrap.getModel().getCreateDate())); |
| | | } |
| | | if (pageWrap.getModel().getEditor() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getEditor, pageWrap.getModel().getEditor()); |
| | | } |
| | | if (pageWrap.getModel().getEditDate() != null) { |
| | | queryWrapper.lambda().ge(InoutRecord::getEditDate, Utils.Date.getStart(pageWrap.getModel().getEditDate())); |
| | | queryWrapper.lambda().le(InoutRecord::getEditDate, Utils.Date.getEnd(pageWrap.getModel().getEditDate())); |
| | | } |
| | | if (pageWrap.getModel().getIsdeleted() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getIsdeleted, pageWrap.getModel().getIsdeleted()); |
| | | } |
| | | if (pageWrap.getModel().getRemark() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getRemark, pageWrap.getModel().getRemark()); |
| | | } |
| | | if (pageWrap.getModel().getType() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getType, pageWrap.getModel().getType()); |
| | | } |
| | | if (pageWrap.getModel().getHkEventId() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getHkEventId, pageWrap.getModel().getHkEventId()); |
| | | } |
| | | if (pageWrap.getModel().getHkId() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getHkId, pageWrap.getModel().getHkId()); |
| | | } |
| | | if (pageWrap.getModel().getMemberId() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getMemberId, pageWrap.getModel().getMemberId()); |
| | | } |
| | | if (pageWrap.getModel().getCarId() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getCarId, pageWrap.getModel().getCarId()); |
| | | } |
| | | if (pageWrap.getModel().getCategoryId() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getCategoryId, pageWrap.getModel().getCategoryId()); |
| | | } |
| | | if (pageWrap.getModel().getCategoryName() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getCategoryName, pageWrap.getModel().getCategoryName()); |
| | | } |
| | | if (pageWrap.getModel().getCarBizType() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getCarBizType, pageWrap.getModel().getCarBizType()); |
| | | } |
| | | if (pageWrap.getModel().getMemberType() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getMemberType, pageWrap.getModel().getMemberType()); |
| | | } |
| | | if (pageWrap.getModel().getMemberName() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getMemberName, pageWrap.getModel().getMemberName()); |
| | | } |
| | | if (pageWrap.getModel().getCarCode() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getCarCode, pageWrap.getModel().getCarCode()); |
| | | } |
| | | if (pageWrap.getModel().getObjType() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getObjType, pageWrap.getModel().getObjType()); |
| | | } |
| | | if (pageWrap.getModel().getObjId() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getObjId, pageWrap.getModel().getObjId()); |
| | | } |
| | | if (pageWrap.getModel().getInOrOut() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getInOrOut, pageWrap.getModel().getInOrOut()); |
| | | } |
| | | if (pageWrap.getModel().getDeviceName() != null) { |
| | | queryWrapper.lambda().eq(InoutRecord::getDeviceName, pageWrap.getModel().getDeviceName()); |
| | | } |
| | | InoutRecord model = pageWrap.getModel(); |
| | | queryWrapper.selectAll(InoutRecord.class) |
| | | .eq(InoutRecord::getIsdeleted,Constants.ZERO) |
| | | .eq(Objects.nonNull(model.getType()),InoutRecord::getType, model.getType()) |
| | | .eq(Objects.nonNull(model.getInOrOut()),InoutRecord::getInOrOut, model.getInOrOut()) |
| | | .eq(Objects.nonNull(model.getObjType()),InoutRecord::getObjType, model.getObjType()) |
| | | .eq(Objects.nonNull(model.getCarBizType()),InoutRecord::getCarBizType, model.getCarBizType()) |
| | | .eq(Objects.nonNull(model.getMemberType()),InoutRecord::getMemberType, model.getMemberType()) |
| | | .ge(Objects.nonNull(model.getStartDate()),InoutRecord::getCreateDate, Utils.Date.getStart(model.getStartDate())) |
| | | .le(Objects.nonNull(model.getEndDate()),InoutRecord::getCreateDate, Utils.Date.getEnd(model.getEndDate())) |
| | | .and(StringUtils.isNotBlank(model.getCategoryName()),i->i.like(InoutRecord::getCategoryName,model.getCategoryName()).or().like(InoutRecord::getCategoryParentName,model.getCategoryName())) |
| | | .and(StringUtils.isNotBlank(model.getMemberName()),i->i.like(InoutRecord::getMemberName,model.getMemberName()).or().like(InoutRecord::getMemberPhone,model.getMemberName())) |
| | | .and(StringUtils.isNotBlank(model.getCarCode()),i->i.like(InoutRecord::getCarCode,model.getCarCode()).or().like(InoutRecord::getRemark,model.getCarCode())) |
| | | .like(StringUtils.isNotBlank(model.getCompanyName()),InoutRecord::getCompanyName,model.getCompanyName()) |
| | | .like(StringUtils.isNotBlank(model.getDeviceName()),InoutRecord::getDeviceName,model.getDeviceName()) |
| | | .orderByDesc(InoutRecord::getId) |
| | | ; |
| | | for(PageWrap.SortData sortData: pageWrap.getSorts()) { |
| | | if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) { |
| | | queryWrapper.orderByDesc(sortData.getProperty()); |
| | |
| | | .eq(pageWrap.getModel().getYpos() != null, Platform::getYpos, pageWrap.getModel().getYpos()) |
| | | .eq(pageWrap.getModel().getWidth() != null, Platform::getWidth, pageWrap.getModel().getWidth()) |
| | | .eq(pageWrap.getModel().getHeight() != null, Platform::getHeight, pageWrap.getModel().getHeight()) |
| | | .eq(pageWrap.getModel().getAngle() != null, Platform::getAngle, pageWrap.getModel().getAngle()); |
| | | .eq(pageWrap.getModel().getAngle() != null, Platform::getAngle, pageWrap.getModel().getAngle()) |
| | | .orderByAsc(Platform::getSortnum) |
| | | ; |
| | | for(PageWrap.SortData sortData: pageWrap.getSorts()) { |
| | | if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) { |
| | | queryWrapper.orderByDesc(sortData.getProperty()); |
| | |
| | | Date lastYear = DateUtil.addYearToDate(year,-1);//去年 |
| | | List<PlatformJob> monthNum = platformJobMapper.selectJoinList(PlatformJob.class, |
| | | new MPJLambdaWrapper<PlatformJob>() |
| | | .selectAs(PlatformJob::getId,PlatformJob::getId) |
| | | .select(PlatformJob::getType,PlatformJob::getType) |
| | | .select(PlatformJob::getTotalNum,PlatformJob::getTotalNum) |
| | | .select(PlatformJob::getStatus,PlatformJob::getStatus) |
| | | .selectAs(PlatformJob::getId,PlatformJob::getId) |
| | | .selectAs(PlatformJob::getTotalNum,PlatformJob::getTotalNum) |
| | | .selectAs(PlatformJob::getDoneDate,PlatformJob::getDoneDate) |
| | | .select(PlatformJob::getStatus,PlatformJob::getStatus) |
| | | .select(PlatformJob::getType,PlatformJob::getType) |
| | | .eq(PlatformJob::getIsdeleted,Constants.ZERO) |
| | | .in(PlatformJob::getType,Constants.ONE,Constants.THREE) |
| | | .in(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE.getKey(), |
| | |
| | | } |
| | | if(CollectionUtils.isNotEmpty(jobList)){ |
| | | //获取任务数据 |
| | | List<String> jobDataList = list.stream().filter(i->Objects.nonNull(i.getDoneDate())).map(i->DateUtil.formatDate(i.getDoneDate(),"yyyy-MM-dd")).collect(Collectors.toList()); |
| | | for (String jobDate:jobDataList) { |
| | | //过滤当天的数据 |
| | | List<PlatformJob> platformJobList = list.stream(). |
| | | filter(i->jobDate.equals(DateUtil.formatDate(i.getDoneDate(),"yyyy-MM-dd"))).collect(Collectors.toList()); |
| | | if(CollectionUtils.isNotEmpty(platformJobList)){ |
| | | //获取今天的 |
| | | r = r.add(this.getDayTotalRata(getSumTotalByList(platformJobList,type,null),jobDate)); |
| | | List<String> jobDataList = jobList.stream().filter(i->Objects.nonNull(i.getDoneDate())) |
| | | .map(i->DateUtil.formatDate(i.getDoneDate(),"yyyy-MM-dd")).collect(Collectors.toList()); |
| | | if(CollectionUtils.isNotEmpty(jobDataList)){ |
| | | for (String jobDate:jobDataList) { |
| | | //过滤当天的数据 |
| | | List<PlatformJob> platformJobList = list.stream(). |
| | | filter(i->jobDate.equals(DateUtil.formatDate(i.getDoneDate(),"yyyy-MM-dd"))).collect(Collectors.toList()); |
| | | if(CollectionUtils.isNotEmpty(platformJobList)){ |
| | | //获取今天的 |
| | | r = r.add(this.getDayTotalRata(getSumTotalByList(platformJobList,type,null),jobDate)); |
| | | } |
| | | } |
| | | r = r.divide(new BigDecimal(Integer.toString(jobList.size())),2,BigDecimal.ROUND_HALF_UP); |
| | | } |
| | | } |
| | | return r; |
| | |
| | | //查询今日最早/最晚的作业数据 |
| | | List<PlatformLog> platformLogList = platformLogMapper.selectList(new QueryWrapper<PlatformLog>() |
| | | .lambda() |
| | | .apply(" ( to_days(param1) = '"+today+"' or to_days(param2) = '"+today+"' ) ") |
| | | .apply(" ( DATE_FORMAT( param1 ,'%Y-%m-%d' ) = '"+today+"' or DATE_FORMAT( param2 ,'%Y-%m-%d' ) = '"+today+"' ) ") |
| | | ); |
| | | if(totalAmount.compareTo(BigDecimal.ZERO)==0||CollectionUtils.isEmpty(platformLogList)){ |
| | | return BigDecimal.ZERO; |