zhangxin пре 1 година
родитељ
комит
03c3bb3113
20 измењених фајлова са 346 додато и 90 уклоњено
  1. 21 23
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/ams/WcsTaskController.java
  2. 2 2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/wms/asn/WmsDocAsnHeaderController.java
  3. 32 1
      ruoyi-common/src/main/java/com/ruoyi/common/utils/TimeUtils.java
  4. 8 7
      ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java
  5. 55 0
      warewms-ams/src/main/java/com/ruoyi/ams/agv/car/domain/CarInfo.java
  6. 19 0
      warewms-ams/src/main/java/com/ruoyi/ams/agv/car/dto/CarInfoDTO.java
  7. 14 0
      warewms-ams/src/main/java/com/ruoyi/ams/agv/car/mapper/CarInfoMapper.java
  8. 11 0
      warewms-ams/src/main/java/com/ruoyi/ams/agv/car/service/ICarInfoService.java
  9. 14 0
      warewms-ams/src/main/java/com/ruoyi/ams/agv/car/service/impl/CarInfoServiceImpl.java
  10. 11 0
      warewms-ams/src/main/java/com/ruoyi/ams/agv/car/vo/CarInfoVO.java
  11. 3 0
      warewms-ams/src/main/java/com/ruoyi/ams/asn/dto/TotalInfoDTO.java
  12. 21 0
      warewms-ams/src/main/java/com/ruoyi/ams/asn/dto/WmsAllGranularityTotalDTO.java
  13. 2 0
      warewms-ams/src/main/java/com/ruoyi/ams/asn/dto/WmsDetailsTotalDTO.java
  14. 3 3
      warewms-ams/src/main/java/com/ruoyi/ams/asn/service/IWmsDocAsnDetailsService.java
  15. 39 29
      warewms-ams/src/main/java/com/ruoyi/ams/asn/service/impl/WmsDocAsnDetailsServiceImpl.java
  16. 26 0
      warewms-ams/src/main/java/com/ruoyi/ams/task/dto/LargeScreenWcsTaskDTO.java
  17. 9 3
      warewms-ams/src/main/java/com/ruoyi/ams/task/service/IWcsTaskService.java
  18. 21 10
      warewms-ams/src/main/java/com/ruoyi/ams/task/service/impl/WcsTaskServiceImpl.java
  19. 8 0
      warewms-ams/src/main/resources/mapper/ams/CarInfoMapper.xml
  20. 27 12
      warewms-base/src/main/java/com/ruoyi/base/constant/Constant.java

+ 21 - 23
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/ams/WcsTaskController.java

@@ -1,36 +1,26 @@
 package com.ruoyi.web.controller.warewms.ams;
 
-import java.util.Date;
-import java.util.List;
-import javax.servlet.http.HttpServletResponse;
-
+import com.ruoyi.ams.task.domain.WcsTask;
 import com.ruoyi.ams.task.domain.form.TaskDispositionForm;
 import com.ruoyi.ams.task.form.AddTaskForm;
+import com.ruoyi.ams.task.service.IWcsTaskService;
 import com.ruoyi.base.constant.Constant;
-import com.ruoyi.base.utils.IdSequenceUtils;
-import com.ruoyi.common.core.domain.model.LoginUser;
-import com.ruoyi.common.utils.StringUtils;
-import io.swagger.annotations.ApiModelProperty;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
 import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.domain.model.LoginUser;
+import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.enums.BusinessType;
-import com.ruoyi.ams.task.domain.WcsTask;
-import com.ruoyi.ams.task.service.IWcsTaskService;
+import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.poi.ExcelUtil;
-import com.ruoyi.common.core.page.TableDataInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.Date;
+import java.util.List;
 
 /**
  * AGV任务Controller
@@ -54,6 +44,14 @@ public class WcsTaskController extends BaseController {
         return getDataTable(list);
     }
 
+    /**
+     * 查询大屏AGV任务列表
+     */
+    @GetMapping("/selectLargeScreenWcsTaskList")
+    public TableDataInfo selectLargeScreenWcsTaskList() {
+        return getDataTable(wcsTaskService.selectLargeScreenWcsTaskList());
+    }
+
     /**
      * 导出AGV任务列表
      */

+ 2 - 2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/wms/asn/WmsDocAsnHeaderController.java

@@ -212,8 +212,8 @@ public class WmsDocAsnHeaderController extends BaseController {
 
     @GetMapping(value = "/queryAllGranularityTotal")
     @ApiOperation("可视化大屏根据字段名获取时间段内年/月/日总量")
-    public AjaxResult queryAllGranularityTotal(@RequestParam String field, @RequestParam String beginTime, @RequestParam String endTime) {
-        return AjaxResult.success(wmsDocAsnDetailsService.queryAllGranularityTotal(field, beginTime, endTime));
+    public AjaxResult queryAllGranularityTotal(@RequestParam String field, @RequestParam String currentTime) {
+        return AjaxResult.success(wmsDocAsnDetailsService.queryAllGranularityTotal(field, currentTime));
     }
     @PostMapping(value = "/queryFieldTotalList")
     @ApiOperation("可视化大屏根据字段field获取时间段根据时间粒度切割后产量 data不传即获取总量")

+ 32 - 1
ruoyi-common/src/main/java/com/ruoyi/common/utils/TimeUtils.java

@@ -150,7 +150,6 @@ public class TimeUtils {
             monthList.add(format(resetDate, DATE_TIME_PATTERN));
             resetDate = org.apache.commons.lang3.time.DateUtils.addMonths(resetDate, 1);
         }
-
         return monthList;
     }
 
@@ -437,6 +436,10 @@ public class TimeUtils {
         return getSplitedTimeMapByMonth(beginDate, endDate);
     }
 
+    public static void main(String[] args) {
+        System.out.println(getSplitedTimeMapByMonth("2023-08-07 22:28:59", "2023-09-07 23:59:58"));
+        System.out.println(getSplitedTimeMapByDay("2023-08-03 22:28:59", "2023-08-07 23:59:58"));
+    }
 
     /**
      * 按月分割时间,返回一个映射
@@ -889,6 +892,34 @@ public class TimeUtils {
         return format(dateTime.plusDays(days).toDate(), DATE_TIME_PATTERN);
     }
 
+    /**
+     * 根据传入时间获取时间
+     * @param currentTime
+     * @param granularity
+     * @return
+     */
+    public static SplitedTimeParam getSplitTimeByGranularity(String currentTime, Granularity granularity) {
+        SplitedTimeParam splitedTimeParam = new SplitedTimeParam();
+        Map<String, String> dateMap = new HashMap<>();
+
+        if (CompareUtil.compare(granularity, Granularity.DAY) == 0) {
+            splitedTimeParam.setBeginTime(getDayBeginTime(currentTime));
+            splitedTimeParam.setEndTime(getDayEndTime(currentTime));
+            return splitedTimeParam;
+        }
+        if (CompareUtil.compare(granularity, Granularity.MONTH) == 0) {
+            splitedTimeParam.setBeginTime(getMonthBeginTime(currentTime));
+            splitedTimeParam.setEndTime(getMonthEndTime(currentTime));
+            return splitedTimeParam;
+        }
+        if (CompareUtil.compare(granularity, Granularity.YEAR) == 0) {
+            splitedTimeParam.setBeginTime(getYearBeginTime(currentTime));
+            splitedTimeParam.setEndTime(getYearEndTime(currentTime));
+            return splitedTimeParam;
+        }
+        return splitedTimeParam;
+    }
+
     /**
      * 根据时间范围获取时间
      *

+ 8 - 7
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java

@@ -1,12 +1,5 @@
 package com.ruoyi.framework.web.service;
 
-import javax.annotation.Resource;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.authentication.AuthenticationManager;
-import org.springframework.security.authentication.BadCredentialsException;
-import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
-import org.springframework.security.core.Authentication;
-import org.springframework.stereotype.Component;
 import com.ruoyi.common.constant.Constants;
 import com.ruoyi.common.core.domain.entity.SysUser;
 import com.ruoyi.common.core.domain.model.LoginUser;
@@ -23,6 +16,14 @@ import com.ruoyi.framework.manager.AsyncManager;
 import com.ruoyi.framework.manager.factory.AsyncFactory;
 import com.ruoyi.system.service.ISysConfigService;
 import com.ruoyi.system.service.ISysUserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.authentication.AuthenticationManager;
+import org.springframework.security.authentication.BadCredentialsException;
+import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
+import org.springframework.security.core.Authentication;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.Resource;
 
 /**
  * 登录校验方法

+ 55 - 0
warewms-ams/src/main/java/com/ruoyi/ams/agv/car/domain/CarInfo.java

@@ -0,0 +1,55 @@
+package com.ruoyi.ams.agv.car.domain;
+
+import com.ruoyi.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 入库单明细对象 wms_doc_asn_details
+ * 
+ * @author ruoyi
+ * @date 2022-11-14
+ */
+public class CarInfo extends BaseEntity
+{
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "id")
+    private String id;
+
+    @ApiModelProperty(value = "车编号")
+    private String carNo;
+
+    @ApiModelProperty(value = "仓库编号")
+    private String warehouseId;
+
+    @ApiModelProperty(value = "状态")
+    private String state;
+
+    @ApiModelProperty(value = "是否启用")
+    private String activeFlag;
+
+    @ApiModelProperty(value = "电池")
+    private String battery;
+
+    @ApiModelProperty(value = "x轴")
+    private String x;
+
+    @ApiModelProperty(value = "y轴")
+    private String y;
+
+    @ApiModelProperty(value = "时间")
+    private String userdefine1;
+
+    @ApiModelProperty(value = "时间")
+    private String userdefine2;
+
+    @ApiModelProperty(value = "时间")
+    private String userdefine3;
+
+    @ApiModelProperty(value = "时间")
+    private String userdefine4;
+
+    @ApiModelProperty(value = "时间")
+    private String userdefine5;
+
+}

+ 19 - 0
warewms-ams/src/main/java/com/ruoyi/ams/agv/car/dto/CarInfoDTO.java

@@ -0,0 +1,19 @@
+package com.ruoyi.ams.agv.car.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+@Data
+public class CarInfoDTO implements Serializable {
+
+    private static final long serialVersionUID = 4857035237485972793L;
+
+    @ApiModelProperty(value = "时间")
+    private String time;
+
+    @ApiModelProperty(value = "数量")
+    private BigDecimal total;
+}

+ 14 - 0
warewms-ams/src/main/java/com/ruoyi/ams/agv/car/mapper/CarInfoMapper.java

@@ -0,0 +1,14 @@
+package com.ruoyi.ams.agv.car.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ruoyi.ams.agv.car.domain.CarInfo;
+
+/**
+ * 入库单明细Mapper接口
+ *
+ * @author ruoyi
+ * @date 2022-11-03
+ */
+public interface CarInfoMapper extends BaseMapper<CarInfo> {
+
+}

+ 11 - 0
warewms-ams/src/main/java/com/ruoyi/ams/agv/car/service/ICarInfoService.java

@@ -0,0 +1,11 @@
+package com.ruoyi.ams.agv.car.service;
+
+/**
+ * 入库单Service接口
+ *
+ * @author ruoyi
+ * @date 2022-10-12
+ */
+public interface ICarInfoService {
+
+}

+ 14 - 0
warewms-ams/src/main/java/com/ruoyi/ams/agv/car/service/impl/CarInfoServiceImpl.java

@@ -0,0 +1,14 @@
+package com.ruoyi.ams.agv.car.service.impl;
+
+import com.ruoyi.ams.agv.car.service.ICarInfoService;
+import org.springframework.stereotype.Service;
+
+/**
+ * 入库单Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2022-10-12
+ */
+@Service
+public class CarInfoServiceImpl implements ICarInfoService {
+}

+ 11 - 0
warewms-ams/src/main/java/com/ruoyi/ams/agv/car/vo/CarInfoVO.java

@@ -0,0 +1,11 @@
+package com.ruoyi.ams.agv.car.vo;
+
+import com.ruoyi.ams.agv.car.domain.CarInfo;
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class CarInfoVO extends CarInfo {
+
+}

+ 3 - 0
warewms-ams/src/main/java/com/ruoyi/ams/asn/dto/TotalInfoDTO.java

@@ -1,5 +1,6 @@
 package com.ruoyi.ams.asn.dto;
 
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -10,7 +11,9 @@ public class TotalInfoDTO implements Serializable {
 
     private static final long serialVersionUID = 4857035237485972793L;
 
+    @ApiModelProperty(value = "时间")
     private String time;
 
+    @ApiModelProperty(value = "数量")
     private BigDecimal total;
 }

+ 21 - 0
warewms-ams/src/main/java/com/ruoyi/ams/asn/dto/WmsAllGranularityTotalDTO.java

@@ -0,0 +1,21 @@
+package com.ruoyi.ams.asn.dto;
+
+import com.ruoyi.common.enums.Granularity;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+@Data
+public class WmsAllGranularityTotalDTO implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "时间粒度")
+    private Granularity granularity;
+
+    @ApiModelProperty(value = "名称")
+    private String name;
+
+    private List<TotalInfoDTO> totalInfoDTOList;
+}

+ 2 - 0
warewms-ams/src/main/java/com/ruoyi/ams/asn/dto/WmsDetailsTotalDTO.java

@@ -1,5 +1,6 @@
 package com.ruoyi.ams.asn.dto;
 
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -9,6 +10,7 @@ import java.util.List;
 public class WmsDetailsTotalDTO implements Serializable {
     private static final long serialVersionUID = 1853526301723047994L;
 
+    @ApiModelProperty(value = "名称")
     private String name;
 
     private List<TotalInfoDTO> totalInfoDTOList;

+ 3 - 3
warewms-ams/src/main/java/com/ruoyi/ams/asn/service/IWmsDocAsnDetailsService.java

@@ -1,6 +1,7 @@
 package com.ruoyi.ams.asn.service;
 
 import com.ruoyi.ams.asn.domain.WmsDocAsnDetails;
+import com.ruoyi.ams.asn.dto.WmsAllGranularityTotalDTO;
 import com.ruoyi.ams.asn.dto.WmsDetailsReqDTO;
 import com.ruoyi.ams.asn.dto.WmsDetailsTotalDTO;
 import com.ruoyi.common.enums.Granularity;
@@ -102,11 +103,10 @@ public interface IWmsDocAsnDetailsService {
     /**
      * 根据字段名获取时间段内年/月/日总量
      * @param field 字段名
-     * @param beginTime 起始时间
-     * @param endTime 结束时间
+     * @param currentTime 目标时间
      * @return
      */
-    Map<String, List<WmsDetailsTotalDTO>> queryAllGranularityTotal(String field, String beginTime, String endTime);
+    Map<String, List<WmsAllGranularityTotalDTO>> queryAllGranularityTotal(String field, String currentTime);
 
     /**
      * 根据字段field获取时间段根据时间粒度切割后产量 data不传即获取总量

+ 39 - 29
warewms-ams/src/main/java/com/ruoyi/ams/asn/service/impl/WmsDocAsnDetailsServiceImpl.java

@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.ruoyi.ams.asn.domain.WmsDocAsnDetails;
 import com.ruoyi.ams.asn.dto.TotalInfoDTO;
+import com.ruoyi.ams.asn.dto.WmsAllGranularityTotalDTO;
 import com.ruoyi.ams.asn.dto.WmsDetailsReqDTO;
 import com.ruoyi.ams.asn.dto.WmsDetailsTotalDTO;
 import com.ruoyi.ams.asn.mapper.WmsDocAsnDetailsMapper;
@@ -15,6 +16,7 @@ import com.ruoyi.common.constant.Constants;
 import com.ruoyi.common.enums.Granularity;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.exception.base.BaseException;
+import com.ruoyi.common.utils.ConvertUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.TimeUtils;
 import com.ruoyi.common.utils.params.SplitedTimeParam;
@@ -160,15 +162,16 @@ public class WmsDocAsnDetailsServiceImpl implements IWmsDocAsnDetailsService {
 
     /**
      * 根据status获取字段状态率
-     * @param field 字段名
-     * @param beginTime 起始时间
-     * @param endTime 结束时间
-     * @param status  默认总量 HG: 合格 BHG:不合格 DJ:待检
+     *
+     * @param field       字段名
+     * @param beginTime   起始时间
+     * @param endTime     结束时间
+     * @param status      默认总量 HG: 合格 BHG:不合格 DJ:待检
      * @param granularity 时间粒度
      * @return
      */
     @Override
-    public List<WmsDetailsTotalDTO> getPassRate(String field, String beginTime, String endTime, String status, Granularity granularity){
+    public List<WmsDetailsTotalDTO> getPassRate(String field, String beginTime, String endTime, String status, Granularity granularity) {
         List<WmsDetailsTotalDTO> result = new ArrayList<>();
         if (ObjectUtil.isNull(granularity)) {
             granularity = Granularity.DAY;
@@ -197,32 +200,35 @@ public class WmsDocAsnDetailsServiceImpl implements IWmsDocAsnDetailsService {
     }
 
     /**
-     * 根据字段名获取时间段内年/月/日总量
-     * @param field 字段名
-     * @param beginTime 起始时间
-     * @param endTime 结束时间
+     * 根据字段名获取时间段内传入时间当年/月/日总量
+     *
+     * @param field     字段名
+     * @param currentTime 目标时间
      * @return
      */
     @Override
-    public Map<String, List<WmsDetailsTotalDTO>> queryAllGranularityTotal(String field, String beginTime, String endTime){
-        List<WmsDetailsTotalDTO> result = new ArrayList<>();
+    public Map<String, List<WmsAllGranularityTotalDTO>> queryAllGranularityTotal(String field, String currentTime) {
+        List<WmsAllGranularityTotalDTO> result = new ArrayList<>();
         for (Granularity granularity : Granularity.values()) {
             if (granularity.equals(Granularity.HOUR)) continue;
-            List<WmsDetailsTotalDTO> wmsDetailsTotalDTOByDayList = queryFieldTotalList(field, beginTime, endTime, granularity);
-            result.addAll(wmsDetailsTotalDTOByDayList);
+            SplitedTimeParam splitTimeByGranularity = TimeUtils.getSplitTimeByGranularity(currentTime, granularity);
+            List<WmsDetailsTotalDTO> wmsDetailsTotalDTOByDayList = queryFieldTotalList(field, splitTimeByGranularity.getBeginTime(), splitTimeByGranularity.getEndTime(), granularity);
+            List<WmsAllGranularityTotalDTO> wmsAllGranularityTotalDTOList = ConvertUtils.sourceToTarget(wmsDetailsTotalDTOByDayList, WmsAllGranularityTotalDTO.class);
+            wmsAllGranularityTotalDTOList.forEach(item -> item.setGranularity(granularity));
+            result.addAll(wmsAllGranularityTotalDTOList);
         }
-        Map<String, List<WmsDetailsTotalDTO>> wmsDetailsTotalDTOMap = result.stream().collect(Collectors.groupingBy(WmsDetailsTotalDTO::getName));
+        Map<String, List<WmsAllGranularityTotalDTO>> wmsDetailsTotalDTOMap = result.stream().collect(Collectors.groupingBy(WmsAllGranularityTotalDTO::getName));
         return wmsDetailsTotalDTOMap;
     }
 
     /**
      * 根据字段field获取时间段按天切割后产量 data不传即获取总量
      *
-     * @param data        字段具体值
-     * @param field       字段名称
-     * @param beginTime   起始时间
-     * @param endTime     结束时间
-     * @param status      默认总量 HG: 合格 BHG:不合格 DJ:待检
+     * @param data      字段具体值
+     * @param field     字段名称
+     * @param beginTime 起始时间
+     * @param endTime   结束时间
+     * @param status    默认总量 HG: 合格 BHG:不合格 DJ:待检
      * @return
      */
     public List<WmsDetailsTotalDTO> queryFieldTotalList(String data, String field, String beginTime, String endTime, String status) {
@@ -231,6 +237,7 @@ public class WmsDocAsnDetailsServiceImpl implements IWmsDocAsnDetailsService {
 
     /**
      * 根据字段field获取时间段根据时间粒度切割后产量 data不传即获取总量
+     *
      * @param wmsDetailsReqDTO
      * @return
      */
@@ -261,6 +268,9 @@ public class WmsDocAsnDetailsServiceImpl implements IWmsDocAsnDetailsService {
      */
     public List<WmsDetailsTotalDTO> queryFieldTotalList(String data, String field, String beginTime, String endTime, String status, Granularity granularity) {
         List<WmsDetailsTotalDTO> result = new ArrayList<>();
+        if (ObjectUtil.isNull(granularity)) {
+            granularity = Granularity.DAY;
+        }
         Map<String, SplitedTimeParam> splitTimeMap = TimeUtils.getSplitedTimeGroupByTime(beginTime, endTime, granularity);
         if (StringUtils.isNotBlank(data)) {
             List<WmsDocAsnDetails> wmsDocAsnDetailsList = queryWmsDocAsnDetailsList(data, field, beginTime, endTime, status);
@@ -283,12 +293,11 @@ public class WmsDocAsnDetailsServiceImpl implements IWmsDocAsnDetailsService {
     }
 
     /**
-     *
-     * @param data                  字段具体值
-     * @param wmsDocAsnDetailsList  根据某一字段分类的入库单集合
-     * @param beginTime             起始时间
-     * @param endTime               结束时间
-     * @param granularity           时间粒度
+     * @param data                 字段具体值
+     * @param wmsDocAsnDetailsList 根据某一字段分类的入库单集合
+     * @param beginTime            起始时间
+     * @param endTime              结束时间
+     * @param granularity          时间粒度
      * @return
      */
     private WmsDetailsTotalDTO buildWmsDetailsTotalDTOList(String data, List<WmsDocAsnDetails> wmsDocAsnDetailsList, String beginTime, String endTime, Granularity granularity) {
@@ -300,9 +309,9 @@ public class WmsDocAsnDetailsServiceImpl implements IWmsDocAsnDetailsService {
     /**
      * 构建传入时间段根据时间粒度切割某一字段分类后的产量
      *
-     * @param data                  字段具体值
-     * @param wmsDocAsnDetailsList  根据某一字段分类的入库单集合
-     * @param splitTimeMap          根据时间粒度对时间段切割集合
+     * @param data                 字段具体值
+     * @param wmsDocAsnDetailsList 根据某一字段分类的入库单集合
+     * @param splitTimeMap         根据时间粒度对时间段切割集合
      * @return
      */
     private WmsDetailsTotalDTO buildWmsDetailsTotalDTOList(String data, List<WmsDocAsnDetails> wmsDocAsnDetailsList, Map<String, SplitedTimeParam> splitTimeMap) {
@@ -315,7 +324,8 @@ public class WmsDocAsnDetailsServiceImpl implements IWmsDocAsnDetailsService {
             List<WmsDocAsnDetails> wmsDocAsnDetailsBetweenTimeList = wmsDocAsnDetailsList.stream().filter(item -> TimeUtils.dateToTimestamp(item.getLotatt03(), TimeUtils.DATE_TIME_PATTERN) >= TimeUtils.dateToTimestamp(splitedTimeParam.getBeginTime(), TimeUtils.DATE_TIME_PATTERN)
                     && TimeUtils.dateToTimestamp(item.getLotatt03(), TimeUtils.DATE_TIME_PATTERN) <= TimeUtils.dateToTimestamp(splitedTimeParam.getEndTime(), TimeUtils.DATE_TIME_PATTERN)).collect(Collectors.toList());
             //总数
-            BigDecimal total = wmsDocAsnDetailsBetweenTimeList.stream().filter(item -> ObjectUtil.isNotEmpty(item.getExpectedQtyEach())).map(WmsDocAsnDetails::getExpectedQtyEach).reduce(BigDecimal.ZERO, BigDecimal::add);
+            BigDecimal total = wmsDocAsnDetailsBetweenTimeList.stream().filter(item -> ObjectUtil.isNotEmpty(item.getExpectedQtyEach()))
+                    .map(WmsDocAsnDetails::getExpectedQtyEach).reduce(BigDecimal.ZERO, BigDecimal::add);
             totalInfoDTO.setTotal(total);
             totalInfoDTO.setTime(splitTimeParamEntry.getKey());
             totalInfoDTOList.add(totalInfoDTO);

+ 26 - 0
warewms-ams/src/main/java/com/ruoyi/ams/task/dto/LargeScreenWcsTaskDTO.java

@@ -0,0 +1,26 @@
+package com.ruoyi.ams.task.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+public class LargeScreenWcsTaskDTO implements Serializable {
+    private static final long serialVersionUID = -900564514593492183L;
+
+    @ApiModelProperty(value = "起始点位")
+    private String locationFrom;
+
+    @ApiModelProperty(value = "终点点位")
+    private String locationTo;
+
+    @ApiModelProperty(value = "任务状态")
+    private Long state;
+
+    @ApiModelProperty(value = "任务状态备注")
+    private String stateRemark;
+
+    @ApiModelProperty(value = "AGV接收车号")
+    private String agvNo;
+}

+ 9 - 3
warewms-ams/src/main/java/com/ruoyi/ams/task/service/IWcsTaskService.java

@@ -1,12 +1,12 @@
 package com.ruoyi.ams.task.service;
 
-import java.util.List;
-
-import com.ruoyi.ams.agv.ndc.entity.CallbackResult;
 import com.ruoyi.ams.task.domain.WcsTask;
+import com.ruoyi.ams.task.dto.LargeScreenWcsTaskDTO;
 import com.ruoyi.ams.task.dto.WcsTaskLocationDTO;
 import com.ruoyi.common.core.domain.AjaxResult;
 
+import java.util.List;
+
 /**
  * AGV任务Service接口
  *
@@ -30,6 +30,12 @@ public interface IWcsTaskService {
      */
     List<WcsTask> selectWcsTaskList(WcsTask wcsTask);
 
+    /**
+     * 获取大屏任务列表
+     * @return
+     */
+    List<LargeScreenWcsTaskDTO> selectLargeScreenWcsTaskList();
+
     /**
      * 查询待下发的任务
      *

+ 21 - 10
warewms-ams/src/main/java/com/ruoyi/ams/task/service/impl/WcsTaskServiceImpl.java

@@ -1,38 +1,37 @@
 package com.ruoyi.ams.task.service.impl;
 
-import java.lang.reflect.Method;
-import java.util.Date;
-import java.util.List;
-
 import com.ruoyi.ams.agv.ndc.domain.AmsTask;
-import com.ruoyi.ams.agv.ndc.entity.CallbackResult;
 import com.ruoyi.ams.agv.ndc.service.IAmsTaskService;
 import com.ruoyi.ams.box.service.IWmsBoxInfoService;
 import com.ruoyi.ams.config.domain.FlowConfigEvent;
 import com.ruoyi.ams.config.service.IFlowConfigEventService;
-import com.ruoyi.ams.inv.domain.InvLotAtt;
 import com.ruoyi.ams.inv.domain.InvLotLocId;
 import com.ruoyi.ams.inv.mapper.InvLotLocIdMapper;
 import com.ruoyi.ams.inv.service.IInvLotAttService;
 import com.ruoyi.ams.inv.service.IInvLotLocIdService;
+import com.ruoyi.ams.task.domain.WcsTask;
+import com.ruoyi.ams.task.dto.LargeScreenWcsTaskDTO;
 import com.ruoyi.ams.task.dto.WcsTaskLocationDTO;
+import com.ruoyi.ams.task.mapper.WcsTaskMapper;
+import com.ruoyi.ams.task.service.IWcsTaskService;
 import com.ruoyi.base.constant.Constant;
 import com.ruoyi.base.domain.BaseLocationInfo;
 import com.ruoyi.base.service.IBaseLocationInfoService;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.redis.RedisCache;
+import com.ruoyi.common.utils.ConvertUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.spring.SpringUtils;
 import com.ruoyi.common.utils.uuid.SnowflakeIdWorker;
-import com.ruoyi.hard.modbus.tcp.AutoDoorClient;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.ruoyi.ams.task.mapper.WcsTaskMapper;
-import com.ruoyi.ams.task.domain.WcsTask;
-import com.ruoyi.ams.task.service.IWcsTaskService;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.lang.reflect.Method;
+import java.util.Date;
+import java.util.List;
+
 /**
  * AGV任务Service业务层处理
  *
@@ -109,6 +108,18 @@ public class WcsTaskServiceImpl implements IWcsTaskService {
         return wcsTaskMapper.selectWcsTaskListVO(wcsTask);
     }
 
+    /**
+     * 获取大屏任务列表
+     * @return
+     */
+    @Override
+    public List<LargeScreenWcsTaskDTO> selectLargeScreenWcsTaskList() {
+        List<WcsTask> wcsTaskList = wcsTaskMapper.selectWcsTaskListVO(new WcsTask());
+        List<LargeScreenWcsTaskDTO> largeScreenWcsTaskDTO = ConvertUtils.sourceToTarget(wcsTaskList, LargeScreenWcsTaskDTO.class);
+        largeScreenWcsTaskDTO.forEach(item -> item.setStateRemark(Constant.TASK_STS.getRemark(Integer.valueOf(item.getState().toString()))));
+        return largeScreenWcsTaskDTO;
+    }
+
     @Override
     public List<WcsTask> selectWcsUnallocated(Long warehouseId) {
         return wcsTaskMapper.selectWcsUnallocated(warehouseId);

+ 8 - 0
warewms-ams/src/main/resources/mapper/ams/CarInfoMapper.xml

@@ -0,0 +1,8 @@
+<?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.ruoyi.ams.agv.car.mapper.CarInfoMapper">
+
+
+</mapper>

+ 27 - 12
warewms-base/src/main/java/com/ruoyi/base/constant/Constant.java

@@ -1,5 +1,9 @@
 package com.ruoyi.base.constant;
 
+import cn.hutool.core.comparator.CompareUtil;
+
+import java.util.Arrays;
+
 /**
  * Created by IntelliJ IDEA.
  * User: andy.qu
@@ -459,57 +463,68 @@ public class Constant {
         /**
          * 下发AMS
          */
-        TASK0(0),
+        TASK0(0, "下发AMS"),
         /**
          * 开始
          */
-        TASK1(1),
+        TASK1(1, "开始"),
         /**
          * 完成
          */
-        TASK2(2),
+        TASK2(2, "完成"),
         /**
          * 开始取货
          */
-        TASK3(3),
+        TASK3(3, "开始取货"),
         /**
          * 取货完成
          */
-        TASK4(4),
+        TASK4(4, "取货完成"),
         /**
          * 开始卸货
          */
-        TASK5(5),
+        TASK5(5, "开始卸货"),
         /**
          * 卸货完成
          */
-        TASK6(6),
+        TASK6(6, "卸货完成"),
         /**
          * 取消
          */
-        TASK7(7),
+        TASK7(7, "取消"),
         /**
          * 空叉取消
          */
-        TASK8(8),
+        TASK8(8, "空叉取消"),
         /**
          * 队列等待
          */
-        TASK9(9),
+        TASK9(9, "队列等待"),
         /**
          * 已下发
          */
-        TASK10(10);
+        TASK10(10, "已下发");
 
 
         private Integer value;
 
+        private String remark;
+
         public Integer getValue() {
             return value;
         }
 
-        TASK_STS(Integer value) {
+        public String getRemark() {
+            return remark;
+        }
+
+        public static String getRemark(Integer value){
+            return Arrays.stream(TASK_STS.values()).filter(item -> CompareUtil.compare(item.value, value) == 0).map(TASK_STS::getRemark).findFirst().orElseGet(() -> null);
+        }
+
+        TASK_STS(Integer value, String remark) {
             this.value = value;
+            this.remark = remark;
         }
     }