Browse Source

超领查询和导出

fgd 1 year ago
parent
commit
19e5dbc82b

+ 29 - 0
sd-business/src/main/java/com/sd/business/controller/production/ProductionExceedReceiveController.java

@@ -1,13 +1,18 @@
 package com.sd.business.controller.production;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.ruoyi.common.core.domain.BaseSelectDto;
 import com.sd.business.entity.order.dto.SkuSpecPackageBomDto;
 import com.sd.business.entity.order.vo.OrderSkuVo;
 import com.sd.business.entity.production.dto.ProductionExceedReceiveDto;
+import com.sd.business.entity.production.dto.ProductionExceedReceiveSkuSelectDto;
 import com.sd.business.entity.production.vo.OutBomVo;
+import com.sd.business.entity.production.vo.ProductionExceedReceiveSkuVo;
 import com.sd.business.service.order.OrderSkuService;
 import com.sd.business.service.production.ProductionExceedReceiveService;
+import com.sd.business.service.production.ProductionExceedReceiveSkuService;
 import com.sd.business.service.sku.SkuSpecService;
+import com.sd.framework.util.excel.util.ExcelUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -15,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.servlet.http.HttpServletResponse;
 import java.util.List;
 
 /**
@@ -33,6 +39,29 @@ public class ProductionExceedReceiveController {
     @Autowired
     private ProductionExceedReceiveService productionExceedReceiveService;
 
+    @Autowired
+    private ProductionExceedReceiveSkuService productionExceedReceiveSkuService;
+
+    /**
+     * 生产超领明细分页
+     */
+    @PostMapping("/page")
+    public Page<ProductionExceedReceiveSkuVo> page(@RequestBody ProductionExceedReceiveSkuSelectDto dto) {
+        return productionExceedReceiveSkuService.getPage(dto);
+    }
+
+    /**
+     * 生产超领明细导出
+     * @return
+     */
+    @PostMapping("/exceedReceiveExportExcel")
+    public void exceedReceiveExportExcel(HttpServletResponse response, @RequestBody ProductionExceedReceiveSkuSelectDto dto) {
+        dto.setSearchAll(true);
+        Page<ProductionExceedReceiveSkuVo> page = productionExceedReceiveSkuService.getPage(dto);
+        List<ProductionExceedReceiveSkuVo> list = page.getRecords();
+        ExcelUtil.export(response,"生产超领明细数据", "明细数据", list, ProductionExceedReceiveSkuVo.class);
+    }
+
     /**
      * 生产超领
      */

+ 1 - 1
sd-business/src/main/java/com/sd/business/entity/production/dto/ProductionExceedReceiveSkuSelectDto.java

@@ -12,7 +12,7 @@ import lombok.Setter;
  */
 @Getter
 @Setter
-public class ProductionExceedReceiveSkuSelectDto  extends BaseSelectDto {
+public class ProductionExceedReceiveSkuSelectDto extends BaseSelectDto {
 
     /**
      * 超领类型

+ 2 - 0
sd-business/src/main/java/com/sd/business/entity/production/po/ProductionExceedReceiveSku.java

@@ -1,5 +1,6 @@
 package com.sd.business.entity.production.po;
 
+import com.alibaba.excel.annotation.ExcelProperty;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.ruoyi.common.core.domain.BasePo;
 import lombok.Getter;
@@ -51,6 +52,7 @@ public class ProductionExceedReceiveSku extends BasePo {
     /**
      * 数量
      */
+    @ExcelProperty(value = "超领数量", index = 6)
     @NotNull(message = "数量不能为空")
     private BigDecimal quantity;
 

+ 34 - 6
sd-business/src/main/java/com/sd/business/entity/production/vo/ProductionExceedReceiveSkuVo.java

@@ -1,5 +1,8 @@
 package com.sd.business.entity.production.vo;
 
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
 import com.sd.business.entity.production.po.ProductionExceedReceiveSku;
 import lombok.Getter;
 import lombok.Setter;
@@ -12,30 +15,55 @@ import lombok.Setter;
  */
 @Getter
 @Setter
+@ExcelIgnoreUnannotated
 public class ProductionExceedReceiveSkuVo extends ProductionExceedReceiveSku {
 
     /**
+     * 订单号
+     */
+    @ColumnWidth(20)
+    @ExcelProperty(value = "订单号", index = 0)
+    private String orderCode;
+
+    /**
+     * 万里牛订单号
+     */
+    @ColumnWidth(20)
+    @ExcelProperty(value = "万里牛订单号", index = 1)
+    private String orderWlnCode;
+
+    /**
      * sku规格品号
      */
+    @ColumnWidth(20)
+    @ExcelProperty(value = "sku规格品号", index = 2)
     private String skuSpecCode;
 
     /**
      * sku规格品名
      */
+    @ColumnWidth(20)
+    @ExcelProperty(value = "sku规格品名", index = 3)
     private String skuSpecName;
 
     /**
-     * 订单号
+     * 超领类型值 1制作损坏 2裸垫质量不良 3生产错误 4丢件 5补发
      */
-    private String orderCode;
+    @ColumnWidth(15)
+    @ExcelProperty(value = "超领类型", index = 4)
+    private String typeValue;
 
     /**
-     * 万里牛订单号
+     * 仓库名称
      */
-    private String orderWlnCode;
+    @ColumnWidth(15)
+    @ExcelProperty(value = "入仓名称", index = 5)
+    private String warehouseName;
 
     /**
-     * 仓库名称
+     * 超领时间
      */
-    private String warehouseName;
+    @ColumnWidth(20)
+    @ExcelProperty(value = "超领时间", index = 7)
+    private String exceedReceiveTime;
 }

+ 2 - 0
sd-business/src/main/java/com/sd/business/service/production/impl/ProductionExceedReceiveSkuServiceImpl.java

@@ -34,6 +34,8 @@ public class ProductionExceedReceiveSkuServiceImpl extends ServiceImpl<Productio
         wrapper.like("oi", OrderInfo::getWlnCode, dto.getOrderWlnCode());
         wrapper.like("ss", SkuSpec::getCode, dto.getSkuSpecCode());
         wrapper.like("ss", SkuSpec::getName, dto.getSkuSpecName());
+        wrapper.ge("per", OrderInfo::getShippingTime, dto.getBeginTime());
+        wrapper.le("per", OrderInfo::getShippingTime, dto.getEndTime());
         Page<ProductionExceedReceiveSkuVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
         return page;
     }

+ 11 - 0
sd-business/src/main/resources/mapper/production/ProductionExceedReceiveSkuMapper.xml

@@ -17,7 +17,17 @@
             pers.update_user,
             pers.update_time,
             per.type,
+            case
+                per.type
+                when 1 then '制作损坏'
+                when 2 then '裸垫质量不良'
+                when 3 then '生产错误'
+                when 4 then '丢件'
+                when 5 then '补单'
+                else ''
+            end  typeValue,
             per.responsible,
+            per.create_time exceedReceiveTime,
             oi.code     orderCode,
             oi.wln_code orderWlnCode,
             ss.code     skuSpecCode,
@@ -28,5 +38,6 @@
             inner join order_info oi on pers.order_id = oi.id
             inner join sku_spec ss on pers.sku_spec_id = ss.id
             inner join warehouse w on pers.warehouse_id = w.id
+            ${ew.customSqlSegment}
     </select>
 </mapper>