Просмотр исходного кода

按日期导出入库出库明细8.28

李卫 1 год назад
Родитель
Сommit
7aa3260909

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

@@ -7,12 +7,11 @@ import java.util.Map;
 import javax.servlet.http.HttpServletResponse;
 
 import com.ruoyi.ams.asn.domain.WmsDocAsnDetails;
-import com.ruoyi.ams.asn.form.DelDocAsnDetailsForm;
+import com.ruoyi.ams.asn.domain.WmsDocAsnExportTime;
 import com.ruoyi.ams.asn.service.IWmsDocAsnDetailsService;
 import com.ruoyi.ams.xuankuang.domain.form.TicketTaskCancellation;
 import com.ruoyi.ams.xuankuang.domain.vo.WcsResponseVo;
 import com.ruoyi.ams.xuankuang.service.WmsToWcsApiService;
-import com.ruoyi.base.domain.BaseIdsequence;
 import com.ruoyi.base.service.IBaseIdsequenceService;
 import com.ruoyi.common.core.domain.model.LoginUser;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -69,6 +68,18 @@ public class WmsDocAsnHeaderController extends BaseController {
         util.exportExcel(response, list, "入库单数据");
     }
 
+    /**
+    * 按时间导出入库单头和出库单头明细列表
+    */
+    @PreAuthorize("@ss.hasPermi('docAsn:docAsn:export')")
+    @Log(title = "入库单明细", businessType = BusinessType.EXPORT)
+    @PostMapping("/exportTime")
+    public void exportTime(HttpServletResponse response, WmsDocAsnHeader wmsDocAsnHeader) {
+        List<WmsDocAsnExportTime> list = wmsDocAsnHeaderService.selectWmsDocAsnHeaderExportTime(wmsDocAsnHeader);
+        ExcelUtil<WmsDocAsnExportTime> util = new ExcelUtil<WmsDocAsnExportTime>(WmsDocAsnExportTime.class);
+        util.exportExcel(response, list, "入库单数据");
+    }
+
     /**
      * 获取入库单详细信息
      */

+ 15 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/wms/order/WmsDocOrderHeaderController.java

@@ -2,6 +2,7 @@ package com.ruoyi.web.controller.warewms.wms.order;
 
 import com.ruoyi.ams.inv.domain.vo.InvLotLocIdLotattVO;
 import com.ruoyi.ams.order.domain.WmsDocOrderDetails;
+import com.ruoyi.ams.order.domain.WmsDocOrderExportTime;
 import com.ruoyi.ams.order.domain.WmsDocOrderHeader;
 import com.ruoyi.ams.order.form.AllocationForm;
 import com.ruoyi.ams.order.form.CancelOrderForm;
@@ -69,6 +70,19 @@ public class WmsDocOrderHeaderController extends BaseController {
         util.exportExcel(response, list, "出库单头数据");
     }
 
+    /**
+     * 按时间导出出库明细列表
+     */
+
+    @PreAuthorize("@ss.hasPermi('docOrder:docOrder:export')")
+    @Log(title = "出库明细", businessType = BusinessType.EXPORT)
+    @PostMapping("/exportTime")
+    public void exportTime(HttpServletResponse response, WmsDocOrderHeader wmsDocOrderHeader) {
+        List<WmsDocOrderExportTime> list = wmsDocOrderHeaderService.selectWmsDocOrderHeaderExportTime(wmsDocOrderHeader);
+        ExcelUtil<WmsDocOrderExportTime> util = new ExcelUtil<WmsDocOrderExportTime>(WmsDocOrderExportTime.class);
+        util.exportExcel(response, list, "出库单头数据");
+    }
+
     /**
      * 获取出库单头详细信息
      */
@@ -155,7 +169,7 @@ public class WmsDocOrderHeaderController extends BaseController {
     @PostMapping("/addDocOrderHeader")
     public AjaxResult addDocOrderHeader(@RequestBody WmsDocOrderHeader wmsDocOrderHeader) {
         LoginUser loginUser = getLoginUser();
-            if(Sets.newHashSet(Constant.ASN_TYP.DZ.getValue(), Constant.ASN_TYP.YK.getValue()).add(wmsDocOrderHeader.getOrderType())
+        if(!Sets.newHashSet(Constant.ASN_TYP.DZ.getValue(), Constant.ASN_TYP.YK.getValue()).add(wmsDocOrderHeader.getOrderType())
                 && StringUtils.isBlank(wmsDocOrderHeader.getSoReference3())){
             return AjaxResult.error("袋装出库请指定破袋机编号");
         }

+ 27 - 3
ruoyi-ui/src/views/wms/docAsn/index.vue

@@ -98,13 +98,24 @@
         >删除</el-button>
       </el-col>
       <el-col :span="1.5">
+        <el-date-picker
+          v-model="dateRangevlist"
+          size="small"
+          @change="onchange"
+          style="width: 240px"
+          value-format="yyyy-MM-dd"
+          type="daterange"
+          range-separator="-"
+          start-placeholder="开始日期"
+          end-placeholder="结束日期"
+        ></el-date-picker>
         <el-button
           type="warning"
           plain
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-hasPermi="['docAsn:docAsn:export']"
+          v-hasPermi="['docAsn:docAsn:exportTime']"
         >导出</el-button>
       </el-col>
       <el-col :span="1.5">
@@ -233,7 +244,15 @@ export default {
       open: false,
       //明细编辑
       addOrUpdateVisible: false,
+      dateRangevlist:[],
       dateRange: [],
+      //按时间导出
+      obj:{
+        params:{
+          beginTime:'',
+          endTime:''
+        }
+      },
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -271,6 +290,10 @@ export default {
         this.loading = false;
       });
     },
+    onchange(e) {
+      this.obj.params['beginTime']  = e[0];
+      this.obj.params['endTime']  = e[1];
+    },
     // 取消按钮
     cancel() {
       this.open = false;
@@ -332,6 +355,7 @@ export default {
       this.resetForm("queryForm");
       this.handleQuery();
     },
+
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.asnNo)
@@ -471,8 +495,8 @@ export default {
     },
     /** 导出按钮操作 */
     handleExport() {
-      this.download('docAsn/docAsn/export', {
-        ...this.queryParams
+      this.download('docAsn/docAsn/exportTime', {
+        ...this.obj
       }, `docAsn_${new Date().getTime()}.xlsx`)
     },
     handleClose(row) {

+ 28 - 4
ruoyi-ui/src/views/wms/docOrder/index.vue

@@ -121,16 +121,28 @@
           v-hasPermi="['docOrder:docOrder:remove']"
         >删除</el-button>
       </el-col>
+      -->
       <el-col :span="1.5">
+      <el-date-picker
+        v-model="dateRangevlist"
+        size="small"
+        @change="onchange"
+        style="width: 240px"
+        value-format="yyyy-MM-dd"
+        type="daterange"
+        range-separator="-"
+        start-placeholder="开始日期"
+        end-placeholder="结束日期"
+      ></el-date-picker>
         <el-button
           type="warning"
           plain
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-hasPermi="['docOrder:docOrder:export']"
+          v-hasPermi="['docOrder:docOrder:exportTime']"
         >导出</el-button>
-      </el-col>-->
+      </el-col>
       <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
     </el-row>
 
@@ -259,6 +271,14 @@ export default {
       // 是否显示弹出层
       open: false,
       dateRange: [],
+      dateRangevlist:[],
+      //按时间导出
+      obj:{
+        params:{
+          beginTime:'',
+          endTime:''
+        }
+      },
       // 查询参数
       queryParams: {
         orderNo:null,
@@ -297,6 +317,10 @@ export default {
         this.loading = false;
       });
     },
+    onchange(e) {
+      this.obj.params['beginTime']  = e[0];
+      this.obj.params['endTime']  = e[1];
+    },
     // 取消按钮
     cancel() {
       this.open = false;
@@ -434,8 +458,8 @@ export default {
     },
     /** 导出按钮操作 */
     handleExport() {
-      this.download('docOrder/docOrder/export', {
-        ...this.queryParams
+      this.download('docOrder/docOrder/exportTime', {
+        ...this.obj
       }, `docOrder_${new Date().getTime()}.xlsx`)
     },
     doAllocation(row) {

+ 40 - 39
warewms-ams/src/main/java/com/ruoyi/ams/asn/domain/WmsDocAsnDetails.java

@@ -31,6 +31,7 @@ public class WmsDocAsnDetails extends BaseEntity
     private Long asnLineNo;
 
     /** 入库单号 */
+    @Excel(name = "入库单号")
     private String asnNo;
 
     /** 产品 */
@@ -58,159 +59,159 @@ public class WmsDocAsnDetails extends BaseEntity
     private String lineStatus;
 
     /** 冻结原因 */
-    @Excel(name = "冻结原因")
+    //@Excel(name = "冻结原因")
     private String holdRejectreason;
 
     /** 备注 */
-    @Excel(name = "备注")
+    //@Excel(name = "备注")
     private String notes;
 
     /** 包装 */
-    @Excel(name = "包装")
+    //@Excel(name = "包装")
     private String packId;
 
     /** 指定库区 */
-    @Excel(name = "指定库区")
+    //@Excel(name = "指定库区")
     private String locationZone;
 
     /** 批号 */
-    @Excel(name = "批号")
+    //@Excel(name = "批号")
     private String lotatt01;
 
     /** 版本号 */
-    @Excel(name = "版本号")
+    //@Excel(name = "版本号")
     private String lotatt02;
 
     /** 生产日期 */
-    @Excel(name = "生产日期")
+    //@Excel(name = "生产日期")
     private String lotatt03;
 
     /** 有效期 */
-    @Excel(name = "有效期")
+    //@Excel(name = "有效期")
     private String lotatt04;
 
     /** 入库单号 */
-    @Excel(name = "入库单号")
+    //@Excel(name = "入库单号")
     private String lotatt05;
 
     /** poNo */
-    @Excel(name = "poNo")
+    //@Excel(name = "poNo")
     private String lotatt06;
 
     /** 质量状态 */
-    @Excel(name = "质量状态")
+    //@Excel(name = "质量状态")
     private String lotatt07;
 
     /** 供应商 */
-    @Excel(name = "供应商")
+    //@Excel(name = "供应商")
     private String lotatt08;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String lotatt09;
 
     /** 检验日期 */
-    @Excel(name = "检验日期")
+    //@Excel(name = "检验日期")
     private String lotatt10;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String lotatt11;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String lotatt12;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String lotatt13;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String lotatt14;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String lotatt15;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String lotatt16;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String lotatt17;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String lotatt18;
 
     /** 指定库位 */
-    @Excel(name = "指定库位")
+    //@Excel(name = "指定库位")
     private Long locationId;
 
     /** sap_doucment_id */
-    @Excel(name = "sap_doucment_id")
+    //@Excel(name = "sap_doucment_id")
     private String documentId;
 
     /** 归还人 */
-    @Excel(name = "归还人")
+    //@Excel(name = "归还人")
     private String dEdi01;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String dEdi02;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String dEdi03;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String dEdi04;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String dEdi05;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String dEdi06;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String dEdi07;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String dEdi08;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String dEdi09;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String dEdi10;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String dEdi11;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String dEdi12;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String dEdi13;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String dEdi14;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String dEdi15;
 
     public void setAsnLineNo(Long asnLineNo) 

+ 43 - 0
warewms-ams/src/main/java/com/ruoyi/ams/asn/domain/WmsDocAsnExportTime.java

@@ -0,0 +1,43 @@
+package com.ruoyi.ams.asn.domain;
+
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+import lombok.Data;
+import java.math.BigDecimal;
+
+/*
+* 入库按时间导出excel
+* */
+@Data
+public class WmsDocAsnExportTime extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /*
+    * 日期
+    * */
+    @Excel(name = "日期")
+    private String createTime2;
+
+    /** 产品 */
+    @Excel(name = "产品")
+    private String sku;
+
+    /** 收货件数 */
+    @Excel(name = "入库件数")
+    private BigDecimal receivedQty;
+
+    /** 越库件数 */
+    @Excel(name = "越库件数")
+    private BigDecimal crossing;
+
+    /** 入库类型 */
+    private String asnType;
+
+
+    public WmsDocAsnExportTime(String createTime2,String sku, BigDecimal receivedQty,BigDecimal crossing) {
+        this.createTime2 = createTime2;
+        this.sku = sku;
+        this.receivedQty = receivedQty;
+        this.crossing = crossing;
+    }
+}

+ 9 - 1
warewms-ams/src/main/java/com/ruoyi/ams/asn/service/IWmsDocAsnHeaderService.java

@@ -3,6 +3,7 @@ package com.ruoyi.ams.asn.service;
 import java.util.List;
 
 import com.ruoyi.ams.asn.domain.WmsDocAsnDetails;
+import com.ruoyi.ams.asn.domain.WmsDocAsnExportTime;
 import com.ruoyi.ams.asn.domain.WmsDocAsnHeader;
 import com.ruoyi.ams.asn.form.PaForm;
 import com.ruoyi.ams.asn.form.StockForm;
@@ -35,6 +36,14 @@ public interface IWmsDocAsnHeaderService {
      */
     List<WmsDocAsnHeader> selectWmsDocAsnHeaderList(WmsDocAsnHeader wmsDocAsnHeader);
 
+    /**
+     * 按时间导出入库单头和明细列表
+     *
+     * @param wmsDocAsnHeader 入库单
+     * @return 入库单集合
+     */
+    List<WmsDocAsnExportTime> selectWmsDocAsnHeaderExportTime(WmsDocAsnHeader wmsDocAsnHeader);
+
     /**
      * 查询入库单
      *
@@ -136,7 +145,6 @@ public interface IWmsDocAsnHeaderService {
      * 检查关闭表头
      *
      * @param asnNo
-     * @param asnLineNo
      * @return
      */
     int closeHeader(String asnNo);

+ 43 - 0
warewms-ams/src/main/java/com/ruoyi/ams/asn/service/impl/WmsDocAsnHeaderServiceImpl.java

@@ -2,6 +2,7 @@ package com.ruoyi.ams.asn.service.impl;
 
 import cn.hutool.core.date.DateUtil;
 import com.ruoyi.ams.asn.domain.WmsDocAsnDetails;
+import com.ruoyi.ams.asn.domain.WmsDocAsnExportTime;
 import com.ruoyi.ams.asn.domain.WmsDocAsnHeader;
 import com.ruoyi.ams.asn.form.PaForm;
 import com.ruoyi.ams.asn.form.StockForm;
@@ -27,7 +28,9 @@ import com.ruoyi.ams.order.domain.WmsDocOrderHeader;
 import com.ruoyi.ams.order.dto.WmsDocOrderDTO;
 import com.ruoyi.ams.order.mapper.WmsDocOrderDetailsMapper;
 import com.ruoyi.ams.order.service.IActAllocationDetailsService;
+import com.ruoyi.ams.order.service.IWmsDocOrderDetailsService;
 import com.ruoyi.ams.order.service.IWmsDocOrderHeaderService;
+import com.ruoyi.ams.task.domain.WcsTask;
 import com.ruoyi.ams.task.service.IWcsTaskService;
 import com.ruoyi.base.constant.Constant;
 import com.ruoyi.base.domain.BaseLocationInfo;
@@ -50,7 +53,9 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * 入库单Service业务层处理
@@ -119,6 +124,44 @@ public class WmsDocAsnHeaderServiceImpl implements IWmsDocAsnHeaderService {
         return wmsDocAsnHeaderMapper.selectWmsDocAsnHeaderList(wmsDocAsnHeader);
     }
 
+    /*
+     * 按时间导出入库单头和明细列表
+     * */
+    @Override
+    public List<WmsDocAsnExportTime> selectWmsDocAsnHeaderExportTime(WmsDocAsnHeader wmsDocAsnHeader) {
+        List<WmsDocAsnHeader> wmsDocAsnHeaders = wmsDocAsnHeaderMapper.selectWmsDocAsnHeaderList(wmsDocAsnHeader);
+        WmsDocAsnDetails wmsDocAsnDetail = new WmsDocAsnDetails();
+        wmsDocAsnDetail.setParams(wmsDocAsnHeader.getParams());
+        List<WmsDocAsnDetails> wmsDocAsnDetails = wmsDocAsnDetailsMapper.selectWmsDocAsnDetailsList(wmsDocAsnDetail);
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+
+        List<WmsDocAsnExportTime> result = wmsDocAsnHeaders.stream()
+                .flatMap(map1 -> wmsDocAsnDetails.stream()
+                        .filter(map2 -> map2.getAsnNo().equals(map1.getAsnNo()))
+                        .filter(map2 -> "DZ".equals(map1.getAsnType()) || "YK".equals(map1.getAsnType()))
+                        .map(map2 -> {
+                            String formattedDate = sdf.format(map2.getCreateTime());
+                            BigDecimal receivedQty = map2.getReceivedQty() != null && !"0E-8".equals(map2.getReceivedQty().toString()) ? map2.getReceivedQty() : new BigDecimal("0");
+                            if ("DZ".equals(map1.getAsnType())) {
+                                return new WmsDocAsnExportTime(
+                                        formattedDate,
+                                        map2.getSku(),
+                                        receivedQty,
+                                        BigDecimal.ZERO);
+                            } else {
+                                return new WmsDocAsnExportTime(
+                                        formattedDate,
+                                        map2.getSku(),
+                                        BigDecimal.ZERO,
+                                        receivedQty);
+                            }
+                        })
+                )
+                .collect(Collectors.toList());
+
+        return result;
+    }
+
     /**
      * 查询入库单
      *

+ 62 - 61
warewms-ams/src/main/java/com/ruoyi/ams/order/domain/WmsDocOrderDetails.java

@@ -30,13 +30,14 @@ public class WmsDocOrderDetails extends BaseEntity
     }
 
     /** 出库单号 */
+    @Excel(name = "出库单号")
     private String orderNo;
 
     /** 明细行号 */
     private BigDecimal orderLineNo;
 
     /** 货主代码 */
-    @Excel(name = "货主代码")
+    //@Excel(name = "货主代码")
     private String customerId;
 
     /** 产品代码 */
@@ -56,11 +57,11 @@ public class WmsDocOrderDetails extends BaseEntity
     private BigDecimal qtyOrderedEach;
 
     /** 软分配件数 */
-    @Excel(name = "软分配件数")
+    //@Excel(name = "软分配件数")
     private BigDecimal qtySoftAllocated;
 
     /** 软分配数量 */
-    @Excel(name = "软分配数量")
+    //@Excel(name = "软分配数量")
     private BigDecimal qtySoftallocatedEach;
 
     /** 分配件数 */
@@ -76,15 +77,15 @@ public class WmsDocOrderDetails extends BaseEntity
     private BigDecimal qtyPicked;
 
     /** 拣货数量 */
-    @Excel(name = "拣货数量")
+    //@Excel(name = "拣货数量")
     private BigDecimal qtyPickedEach;
 
     /** 复核件数 */
-    @Excel(name = "复核件数")
+    //@Excel(name = "复核件数")
     private BigDecimal qtyPacked;
 
     /** 复核数量 */
-    @Excel(name = "复核数量")
+    //@Excel(name = "复核数量")
     private BigDecimal qtyPackedEach;
 
     /** 发运件数 */
@@ -92,223 +93,223 @@ public class WmsDocOrderDetails extends BaseEntity
     private BigDecimal qtyShipped;
 
     /** 发运数量 */
-    @Excel(name = "发运数量")
+    //@Excel(name = "发运数量")
     private BigDecimal qtyShippedEach;
 
     /** 单位 */
-    @Excel(name = "单位")
+    //@Excel(name = "单位")
     private String uom;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String lotatt01;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String lotatt02;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String lotatt03;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String lotatt04;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String lotatt05;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String lotatt06;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String lotatt07;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String lotatt08;
 
     /** 领用人 */
-    @Excel(name = "领用人")
+    //@Excel(name = "领用人")
     private String lotatt09;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String lotatt10;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String lotatt11;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String lotatt12;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String lotatt13;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String lotatt14;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String lotatt15;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String lotatt16;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String lotatt17;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String lotatt18;
 
     /** 包装规格 */
-    @Excel(name = "包装规格")
+    //@Excel(name = "包装规格")
     private String packId;
 
     /** 指定出库库存的库区(未启用) */
-    @Excel(name = "指定出库库存的库区", readConverterExp = "未=启用")
+    //@Excel(name = "指定出库库存的库区", readConverterExp = "未=启用")
     private String pickZone;
 
     /** 指定库位 */
-    @Excel(name = "指定库位")
+    //@Excel(name = "指定库位")
     private String location;
 
     /** 批次号 */
-    @Excel(name = "批次号")
+    //@Excel(name = "批次号")
     private String lotnum;
 
     /** 净重 */
-    @Excel(name = "净重")
+    //@Excel(name = "净重")
     private BigDecimal netWeight;
 
     /** 毛重 */
-    @Excel(name = "毛重")
+    //@Excel(name = "毛重")
     private BigDecimal grossWeight;
 
     /** 体积 */
-    @Excel(name = "体积")
+    //@Excel(name = "体积")
     private BigDecimal cubic;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String dEdi01;
 
     /** 目标库位 */
-    @Excel(name = "目标库位")
+    //@Excel(name = "目标库位")
     private String dEdi02;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String dEdi03;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String dEdi04;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String dEdi05;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String dEdi06;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String dEdi07;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String dEdi08;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private BigDecimal dEdi09;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private BigDecimal dEdi10;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String dEdi11;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String dEdi12;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String dEdi13;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String dEdi14;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String dEdi15;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String dEdi16;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String dEdi17;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String dEdi18;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String dEdi19;
 
     /**  */
-    @Excel(name = "")
+    //@Excel(name = "")
     private String dEdi20;
 
     /** 跟踪号(未启用) */
-    @Excel(name = "跟踪号", readConverterExp = "未=启用")
+    //@Excel(name = "跟踪号", readConverterExp = "未=启用")
     private String traceId;
 
     /** 软分配规则(未启用) */
-    @Excel(name = "软分配规则", readConverterExp = "未=启用")
+    //@Excel(name = "软分配规则", readConverterExp = "未=启用")
     private String softAllocationRule;
 
     /** 分配规则(未启用) */
-    @Excel(name = "分配规则", readConverterExp = "未=启用")
+    //@Excel(name = "分配规则", readConverterExp = "未=启用")
     private String allocationRule;
 
     /** 预留字段1 */
-    @Excel(name = "预留字段1")
+    //@Excel(name = "预留字段1")
     private String userdefine1;
 
     /** 预留字段2 */
-    @Excel(name = "预留字段2")
+    //@Excel(name = "预留字段2")
     private String userdefine2;
 
     /** 预留字段3 */
-    @Excel(name = "预留字段3")
+    //@Excel(name = "预留字段3")
     private String userdefine3;
 
     /** 预留字段4 */
-    @Excel(name = "预留字段4")
+    //@Excel(name = "预留字段4")
     private String userdefine4;
 
     /** 预留字段5 */
-    @Excel(name = "预留字段5")
+    //@Excel(name = "预留字段5")
     private String userdefine5;
 
     public void setOrderNo(String orderNo) 

+ 44 - 0
warewms-ams/src/main/java/com/ruoyi/ams/order/domain/WmsDocOrderExportTime.java

@@ -0,0 +1,44 @@
+package com.ruoyi.ams.order.domain;
+
+import com.ruoyi.common.annotation.Excel;
+import com.ruoyi.common.core.domain.BaseEntity;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/*
+ * 出库按时间导出excel
+ * */
+@Data
+public class WmsDocOrderExportTime extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /*
+     * 日期
+     * */
+    @Excel(name = "日期")
+    private String createTime2;
+    /** 产品 */
+    @Excel(name = "产品")
+    private String sku;
+
+    /** 出库件数 */
+    @Excel(name = "出库件数")
+    private BigDecimal qtyAllocated;
+
+    /** 越库件数 */
+    @Excel(name = "越库件数")
+    private BigDecimal crossing;
+
+    /** 入库类型 */
+    private String asnType;
+
+
+    public WmsDocOrderExportTime(String createTime2,String sku, BigDecimal qtyAllocated,BigDecimal crossing) {
+        this.createTime2 = createTime2;
+        this.sku = sku;
+        this.qtyAllocated = qtyAllocated;
+        this.crossing = crossing;
+    }
+
+}

+ 7 - 0
warewms-ams/src/main/java/com/ruoyi/ams/order/service/IWmsDocOrderHeaderService.java

@@ -3,6 +3,7 @@ package com.ruoyi.ams.order.service;
 import java.util.List;
 
 import com.ruoyi.ams.order.domain.WmsDocOrderDetails;
+import com.ruoyi.ams.order.domain.WmsDocOrderExportTime;
 import com.ruoyi.ams.order.domain.WmsDocOrderHeader;
 import com.ruoyi.ams.order.form.*;
 import com.ruoyi.ams.order.vo.CheckOutVO;
@@ -33,6 +34,12 @@ public interface IWmsDocOrderHeaderService {
      */
     List<WmsDocOrderHeader> selectWmsDocOrderHeaderList(WmsDocOrderHeader wmsDocOrderHeader);
 
+    /**
+     * 按时间导出出库单头和明细列表
+     *
+     */
+    List<WmsDocOrderExportTime> selectWmsDocOrderHeaderExportTime(WmsDocOrderHeader wmsDocOrderHeader);
+
     /**
      * 查询出库单头
      *

+ 18 - 1
warewms-ams/src/main/java/com/ruoyi/ams/order/service/impl/WmsDocOrderDetailsServiceImpl.java

@@ -4,6 +4,7 @@ import java.math.BigDecimal;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
+import java.util.stream.Collectors;
 
 import com.ruoyi.ams.asn.domain.WmsDocAsnDetails;
 import com.ruoyi.base.constant.Constant;
@@ -45,9 +46,25 @@ public class WmsDocOrderDetailsServiceImpl implements IWmsDocOrderDetailsService
      */
     @Override
     public List<WmsDocOrderDetails> selectWmsDocOrderDetailsList(WmsDocOrderDetails wmsDocOrderDetails) {
-        return wmsDocOrderDetailsMapper.selectWmsDocOrderDetailsList(wmsDocOrderDetails);
+        List<WmsDocOrderDetails> list = wmsDocOrderDetailsMapper.selectWmsDocOrderDetailsList(wmsDocOrderDetails);
+        list = list.stream()
+                .peek(item -> {
+                    if (item.getQtyAllocated() != null && "0E-8".equals(item.getQtyAllocated().toString())) {
+                        item.setQtyAllocated(new BigDecimal("0"));
+                    }
+                    if (item.getQtyPicked() != null && "0E-8".equals(item.getQtyPicked().toString())) {
+                        item.setQtyPicked(new BigDecimal("0"));
+                    }
+                    if (item.getQtyShipped() != null && "0E-8".equals(item.getQtyShipped().toString())) {
+                        item.setQtyShipped(new BigDecimal("0"));
+                    }
+                })
+                .collect(Collectors.toList());
+
+        return list;
     }
 
+
     /**
      * 查询出库单
      *

+ 44 - 1
warewms-ams/src/main/java/com/ruoyi/ams/order/service/impl/WmsDocOrderHeaderServiceImpl.java

@@ -20,7 +20,7 @@ import com.ruoyi.ams.inv.service.IActTransactionLogService;
 import com.ruoyi.ams.inv.service.IInvLotLocIdService;
 import com.ruoyi.ams.order.domain.ActAllocationDetails;
 import com.ruoyi.ams.order.domain.WmsDocOrderDetails;
-import com.ruoyi.ams.order.domain.WmsDocOrderHeader;
+import com.ruoyi.ams.order.domain.WmsDocOrderExportTime;
 import com.ruoyi.ams.order.form.*;
 import com.ruoyi.ams.order.mapper.WmsDocOrderDetailsMapper;
 import com.ruoyi.ams.order.mapper.WmsDocOrderHeaderMapper;
@@ -47,10 +47,15 @@ import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.uuid.SnowflakeIdWorker;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import com.ruoyi.ams.order.mapper.WmsDocOrderHeaderMapper;
+import com.ruoyi.ams.order.domain.WmsDocOrderHeader;
+import com.ruoyi.ams.order.service.IWmsDocOrderHeaderService;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
 import java.util.*;
+import java.util.stream.Collectors;
 
 /**
  * 出库单头Service业务层处理
@@ -115,6 +120,44 @@ public class WmsDocOrderHeaderServiceImpl implements IWmsDocOrderHeaderService {
         return wmsDocOrderHeaderMapper.selectWmsDocOrderHeaderList(wmsDocOrderHeader);
     }
 
+    /**
+     * 按时间导出出库单头和明细列表
+     */
+    @Override
+    public List<WmsDocOrderExportTime> selectWmsDocOrderHeaderExportTime(WmsDocOrderHeader wmsDocOrderHeader) {
+        List<WmsDocOrderHeader> wmsDocOrderHeaders = wmsDocOrderHeaderMapper.selectWmsDocOrderHeaderList(wmsDocOrderHeader);
+        WmsDocOrderDetails wmsDocOrderDetail = new WmsDocOrderDetails();
+        wmsDocOrderDetail.setParams(wmsDocOrderHeader.getParams());
+        List<WmsDocOrderDetails> wmsDocOrderDetails = wmsDocOrderDetailsMapper.selectWmsDocOrderDetailsList(wmsDocOrderDetail);
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+
+        List<WmsDocOrderExportTime> result = wmsDocOrderHeaders.stream()
+                .flatMap(map1 -> wmsDocOrderDetails.stream()
+                        .filter(map2 -> map2.getOrderNo().equals(map1.getOrderNo()))
+                        .filter(map2 -> "DZ".equals(map1.getOrderType()) || "YK".equals(map1.getOrderType()))
+                        .map(map2 -> {
+                            String formattedDate = sdf.format(map2.getCreateTime());
+                            BigDecimal qtyAllocated = map2.getQtyAllocated() != null && !"0E-8".equals(map2.getQtyAllocated().toString()) ? map2.getQtyAllocated() : new BigDecimal("0");
+                            if ("DZ".equals(map1.getOrderType())) {
+                                return new WmsDocOrderExportTime(
+                                        formattedDate,
+                                        map2.getSku(),
+                                        qtyAllocated,
+                                        BigDecimal.ZERO);
+                            }
+                                return new WmsDocOrderExportTime(
+                                        formattedDate,
+                                        map2.getSku(),
+                                        BigDecimal.ZERO,
+                                        qtyAllocated);
+
+                        })
+                )
+                .collect(Collectors.toList());
+
+        return result;
+    }
+
     @Override
     public List<WmsDocOrderDetails> initOrderDetails(String orderNo) {
         List<WmsDocOrderDetails> details = wmsDocOrderDetailsMapper.selectWmsDocOrderDetailsByOrderNo(orderNo);

+ 6 - 0
warewms-ams/src/main/resources/mapper/ams/WmsDocAsnDetailsMapper.xml

@@ -116,6 +116,12 @@
             <if test="dEdi13 != null  and dEdi13 != ''"> and d_edi_13 = #{dEdi13}</if>
             <if test="dEdi14 != null  and dEdi14 != ''"> and d_edi_14 = #{dEdi14}</if>
             <if test="dEdi15 != null  and dEdi15 != ''"> and d_edi_15 = #{dEdi15}</if>
+            <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
+                AND date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
+            </if>
+            <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
+                AND date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
+            </if>
         </where>
     </select>
 

+ 12 - 1
warewms-ams/src/main/resources/mapper/docOrder/WmsDocOrderDetailsMapper.xml

@@ -98,7 +98,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectWmsDocOrderDetailsList" parameterType="WmsDocOrderDetails" resultMap="WmsDocOrderDetailsResult">
         <include refid="selectWmsDocOrderDetailsVo"/>
-        where order_no = #{orderNo}
+        <where>
+            <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
+            AND date_format(create_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
+            </if>
+            <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
+                AND date_format(create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
+            </if>
+            <if test="orderNo != null and orderNo != ''">
+                AND order_no = #{orderNo}
+             </if>
+        </where>
+        <!-- where order_no = #{orderNo} -->
     </select>
 
     <select id="selectWmsDocOrderDetailsByOrderNo" parameterType="String" resultMap="WmsDocOrderDetailsResult">