Browse Source

1.修复仓库盘点任务明细导出

dist.1.3.0
zhenghaoyu 8 months ago
parent
commit
94fe27dbd3
  1. 13
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/TaskQuestController.java
  2. 105
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/excel/QuestContrastPackageExcelVO.java
  3. 3
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.java
  4. 40
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml
  5. 4
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java
  6. 7
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

13
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/TaskQuestController.java

@ -25,6 +25,7 @@ import com.logpm.warehouse.dto.TaskQuestDTO;
import com.logpm.warehouse.dto.TaskSearchDTO;
import com.logpm.warehouse.entity.TaskQuestEntity;
import com.logpm.warehouse.excel.QuestContrastExcel;
import com.logpm.warehouse.excel.QuestContrastPackageExcelVO;
import com.logpm.warehouse.excel.TaskQueryDataExcel;
import com.logpm.warehouse.excel.TaskQuestExcel;
import com.logpm.warehouse.service.ITaskQuestService;
@ -210,6 +211,18 @@ public class TaskQuestController extends BladeController {
}
@GetMapping("/export-allDataWithPackage")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "导出全部数据明细维度", notes = "传入questDetailDTO")
public void exportAllDataWithPackage(QuestDetailDTO questDetailDTO, HttpServletResponse response){
String questNum = questDetailDTO.getQuestNum();
List<QuestContrastPackageExcelVO> list = taskQuestService.exportAllDataWithPackage(questDetailDTO);
ExcelUtil.export(response, "盘点任务【"+questNum+"】数据" + DateUtil.time(), "盘点明细数据表", list, QuestContrastPackageExcelVO.class);
}
/**
* 导出数据
*/

105
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/excel/QuestContrastPackageExcelVO.java

@ -0,0 +1,105 @@
package com.logpm.warehouse.excel;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
@Data
public class QuestContrastPackageExcelVO implements Serializable {
@ColumnWidth(20)
@ExcelProperty(value = "订单号")
private String orderCode;
@ColumnWidth(20)
@ExcelProperty(value = "运单号")
private String waybillNumber;
@ColumnWidth(20)
@ExcelProperty(value = "盘点方式")
private String questType;
@ColumnWidth(20)
@ExcelProperty(value = "盘点对象")
private String questTarget;
@ColumnWidth(20)
@ExcelProperty(value = "盘点状态")
private String questStatus;
@ColumnWidth(20)
@ExcelProperty(value = "包件码")
private String orderPackageCode;
@ColumnWidth(20)
@ExcelProperty(value = "品类名称")
private String categoryName;
@ColumnWidth(20)
@ExcelProperty(value = "在库数量")
private Integer stockNum;
@ColumnWidth(20)
@ExcelProperty(value = "物料编码")
private String materialCode;
@ColumnWidth(20)
@ExcelProperty(value = "物料名称")
private String materialName;
@ColumnWidth(20)
@ExcelProperty(value = "一级品类")
private String firsts;
@ColumnWidth(20)
@ExcelProperty(value = "二级品类")
private String seconds;
@ColumnWidth(20)
@ExcelProperty(value = "三级品类")
private String thirdProduct;
@ColumnWidth(20)
@ExcelProperty(value = "商场名称")
private String marketName;
@ColumnWidth(20)
@ExcelProperty(value = "批次号")
private String incomingBatch;
@ColumnWidth(20)
@ExcelProperty(value = "发站仓名称")
private String sendWarehouseName;
@ColumnWidth(20)
@ExcelProperty(value = "品牌")
private String brandName;
@ColumnWidth(20)
@ExcelProperty(value = "原有托盘")
private String trayName;
@ColumnWidth(20)
@ExcelProperty(value = "原有库位")
private String positionCode;
@ColumnWidth(20)
@ExcelProperty(value = "新托盘")
private String newTrayName;
@ColumnWidth(20)
@ExcelProperty(value = "新库位")
private String groundingPositionCode;
@ColumnWidth(20)
@ExcelProperty(value = "盘点时间")
private Date inventoryTime;
@ColumnWidth(20)
@ExcelProperty(value = "盘点人")
private String inventoryUser;
}

3
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.java

@ -23,6 +23,7 @@ import com.logpm.warehouse.entity.QuestDetailChildEntity;
import com.logpm.warehouse.entity.QuestDetailEntity;
import com.logpm.warehouse.entity.TaskQuestEntity;
import com.logpm.warehouse.entity.WarehouseTrayEntity;
import com.logpm.warehouse.excel.QuestContrastPackageExcelVO;
import com.logpm.warehouse.excel.TaskQueryDataExcel;
import com.logpm.warehouse.vo.*;
import com.logpm.warehouse.excel.TaskQuestExcel;
@ -198,4 +199,6 @@ public interface TaskQuestMapper extends BaseMapper<TaskQuestEntity> {
List<QuestDetailEntity> findIsChangeData(@Param("questNum") String questNum);
Integer findStockNum(@Param("questDetailId") Long questDetailId, @Param("tableName") String tableName);
List<QuestContrastPackageExcelVO> exportAllDataWithPackage(@Param("param") QuestDetailDTO questDetailDTO);
}

40
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml

@ -707,4 +707,44 @@
</select>
<select id="exportAllDataWithPackage" resultType="com.logpm.warehouse.excel.QuestContrastPackageExcelVO">
select order_code orderCode,
waybill_number waybillNumber,
order_package_code orderPackageCode,
material_code materialCode,
material_name materialName,
firsts firsts,
`second` seconds,
third_product thirdProduct,
case when quest_type = 1 then '随机'
when quest_type = 2 then '库位'
when quest_type = 3 then '订单'
when quest_type = 4 then '托盘'
else '未知'
end questType,
case when quest_target = 1 then '订制品'
when quest_target = 2 then '零担'
when quest_target = 3 then '库存品'
else '未知'
end questTarget,
case when quest_status = 1 then '已盘点'
when quest_status = 3 then '已排除'
else '未盘点'
end questStatus,
category_name categoryName,
brand_name brandName,
market_name marketName,
stock_num stockNum,
incoming_batch incomingBatch,
send_warehouse_name sendWarehouseName,
tray_name trayName,
position_code positionCode,
new_tray_name newTrayName,
grounding_position_code groundingPositionCode,
inventory_time inventoryTime,
inventory_user inventoryUser
from ${param.questNum}
where is_deleted = 0
</select>
</mapper>

4
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java

@ -26,6 +26,7 @@ import com.logpm.warehouse.entity.QuestDetailChildEntity;
import com.logpm.warehouse.entity.QuestDetailEntity;
import com.logpm.warehouse.entity.TaskQuestEntity;
import com.logpm.warehouse.excel.QuestContrastExcel;
import com.logpm.warehouse.excel.QuestContrastPackageExcelVO;
import com.logpm.warehouse.excel.TaskQueryDataExcel;
import com.logpm.warehouse.excel.TaskQuestExcel;
import com.logpm.warehouse.vo.*;
@ -305,4 +306,7 @@ public interface ITaskQuestService extends BaseService<TaskQuestEntity> {
List<QuestDetailEntity> findIsChangeData(String questNum);
Integer findStockNum(Long questDetailId, String tableName);
List<QuestContrastPackageExcelVO> exportAllDataWithPackage(QuestDetailDTO questDetailDTO);
}

7
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

@ -39,6 +39,7 @@ import com.logpm.warehouse.dto.TaskQuestDTO;
import com.logpm.warehouse.dto.TaskSearchDTO;
import com.logpm.warehouse.entity.*;
import com.logpm.warehouse.excel.QuestContrastExcel;
import com.logpm.warehouse.excel.QuestContrastPackageExcelVO;
import com.logpm.warehouse.excel.TaskQueryDataExcel;
import com.logpm.warehouse.excel.TaskQuestExcel;
import com.logpm.warehouse.mapper.TaskQuestMapper;
@ -49,7 +50,6 @@ import com.logpm.warehouse.vo.*;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.jetbrains.annotations.Nullable;
import org.mapstruct.factory.Mappers;
import org.springblade.common.cache.CacheNames;
import org.springblade.common.constant.RedisKeyConstant;
import org.springblade.common.constant.common.IsOrNoConstant;
@ -3492,6 +3492,11 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
return baseMapper.findStockNum(questDetailId, tableName);
}
@Override
public List<QuestContrastPackageExcelVO> exportAllDataWithPackage(QuestDetailDTO questDetailDTO) {
return baseMapper.exportAllDataWithPackage(questDetailDTO);
}
private String getQuestNum(String warehouseCode) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
// return "PDRW_" + warehouseCode + "_" + simpleDateFormat.format(new Date()) + String.format("%03d", new Random().nextInt(900) + 100);

Loading…
Cancel
Save