Browse Source

器具解绑导出记录修改

master
赵雪冰 2 years ago
parent
commit
4145ca00ac
  1. 15
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/ContainerUnbindRecordMainController.java
  2. 79
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordMainExcelVO.java
  3. 3
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/containerUnbind/ContainerUnbindRecordMainService.java
  4. 39
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/containerUnbind/ContainerUnbindRecordMainServiceImpl.java

15
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/ContainerUnbindRecordMainController.java

@ -2,11 +2,14 @@ package com.win.module.wms.controller.containerUnbind;
import com.win.framework.common.pojo.CommonResult;
import com.win.framework.common.pojo.PageResult;
import com.win.framework.dict.core.util.DictFrameworkUtils;
import com.win.framework.excel.core.util.ExcelUtils;
import com.win.framework.operatelog.core.annotations.OperateLog;
import com.win.module.wms.controller.containerBind.vo.ContainerBindRecordMainExcelVO;
import com.win.module.wms.controller.containerUnbind.vo.*;
import com.win.module.wms.convert.containerUnbind.ContainerUnbindRecordMainConvert;
import com.win.module.wms.dal.dataobject.containerUnbind.ContainerUnbindRecordMainDO;
import com.win.module.wms.enums.DictTypeConstants;
import com.win.module.wms.service.containerUnbind.ContainerUnbindRecordMainService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
@ -93,10 +96,16 @@ public class ContainerUnbindRecordMainController {
@OperateLog(type = EXPORT)
public void exportContainerUnbindRecordMainExcel(@Valid ContainerUnbindRecordMainExportReqVO exportReqVO,
HttpServletResponse response) throws IOException {
List<ContainerUnbindRecordMainDO> list = containerUnbindRecordMainService.getContainerUnbindRecordMainList(exportReqVO);
Map<Integer, String[]> mapDropDown = new HashMap<>();
String[] componentContainerContentType = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.CONTAINER_CONTENT_TYPE);
mapDropDown.put(3, componentContainerContentType);
String[] componentInventoryStatus = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.INVENTORY_STATUS);
mapDropDown.put(7, componentInventoryStatus);
String[] componentUom = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.UOM);
mapDropDown.put(8, componentUom);
List<ContainerUnbindRecordMainExcelVO> list = containerUnbindRecordMainService.getContainerUnbindRecordMainList(exportReqVO);
// 导出 Excel
List<ContainerUnbindRecordMainExcelVO> datas = ContainerUnbindRecordMainConvert.INSTANCE.convertList02(list);
ExcelUtils.write(response, "器具解绑记录主.xls", "数据", ContainerUnbindRecordMainExcelVO.class, datas);
ExcelUtils.write(response, "器具解绑记录主.xls", "数据", ContainerUnbindRecordMainExcelVO.class, list,mapDropDown);
}
@GetMapping("/get-import-template")

79
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/containerUnbind/vo/ContainerUnbindRecordMainExcelVO.java

@ -1,8 +1,12 @@
package com.win.module.wms.controller.containerUnbind.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.win.framework.excel.core.annotations.DictFormat;
import com.win.framework.excel.core.convert.DictConvert;
import com.win.module.wms.enums.DictTypeConstants;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
/**
@ -13,8 +17,6 @@ import java.time.LocalDateTime;
@Data
public class ContainerUnbindRecordMainExcelVO {
@ExcelProperty("id")
private Long id;
@ExcelProperty("单据号")
private String number;
@ -22,70 +24,37 @@ public class ContainerUnbindRecordMainExcelVO {
@ExcelProperty("器具号")
private String containerNumber;
@ExcelProperty("仓库代码")
@ExcelProperty("仓库代码")
private String fromWarehouseCode;
@ExcelProperty("到仓库代码")
private String toWarehouseCode;
@ExcelProperty(value = "内容物类型",converter = DictConvert.class)
@DictFormat(DictTypeConstants.CONTAINER_CONTENT_TYPE)
private String containerContentType;
@ExcelProperty("出库事务类型")
private String outTransactionType;
@ExcelProperty("内容物号")
private String contentNumber;
@ExcelProperty("入库事务类型")
private String inTransactionType;
@ExcelProperty("物料代码")
private String itemCode;
@ExcelProperty("执行时间")
private LocalDateTime executeTime;
@ExcelProperty("批次")
private String batch;
@ExcelProperty("生效日期")
private LocalDateTime activeDate;
@ExcelProperty(value = "库存状态",converter = DictConvert.class)
@DictFormat(DictTypeConstants.INVENTORY_STATUS)
private String inventoryStatus;
@ExcelProperty("是否可用")
private String available;
@ExcelProperty(value = "计量单位",converter = DictConvert.class)
@DictFormat(DictTypeConstants.UOM)
private String uom;
@ExcelProperty("申请时间")
private LocalDateTime requestTime;
@ExcelProperty("截止时间")
private LocalDateTime dueTime;
@ExcelProperty("部门")
private String departmentCode;
@ExcelProperty("用户组")
private String userGroupCode;
@ExcelProperty("接口类型")
private String interfaceType;
@ExcelProperty("业务类型")
private String businessType;
@ExcelProperty("备注")
private String remark;
@ExcelProperty("数量")
private BigDecimal qty;
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@ExcelProperty("扩展属性")
private String extraProperties;
@ExcelProperty("地点ID")
private String siteId;
@ExcelProperty("代码")
private String code;
@ExcelProperty("从库位类型范围")
private String fromLocationTypes;
@ExcelProperty("到库位类型范围")
private String toLocationTypes;
@ExcelProperty("从库区代码范围")
private String fromAreaCodes;
@ExcelProperty("到库区代码范围")
private String toAreaCodes;
@ExcelProperty("备注")
private String remark;
}

3
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/containerUnbind/ContainerUnbindRecordMainService.java

@ -1,6 +1,7 @@
package com.win.module.wms.service.containerUnbind;
import com.win.framework.common.pojo.PageResult;
import com.win.module.wms.controller.containerBind.vo.ContainerBindRecordMainExcelVO;
import com.win.module.wms.controller.containerUnbind.vo.*;
import com.win.module.wms.dal.dataobject.containerUnbind.ContainerUnbindRecordMainDO;
@ -67,7 +68,7 @@ public interface ContainerUnbindRecordMainService {
* @param exportReqVO 查询条件
* @return 器具解绑记录主列表
*/
List<ContainerUnbindRecordMainDO> getContainerUnbindRecordMainList(ContainerUnbindRecordMainExportReqVO exportReqVO);
List<ContainerUnbindRecordMainExcelVO> getContainerUnbindRecordMainList(ContainerUnbindRecordMainExportReqVO exportReqVO);
/**
* 导入器具解绑记录主主信息

39
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/containerUnbind/ContainerUnbindRecordMainServiceImpl.java

@ -2,10 +2,21 @@ package com.win.module.wms.service.containerUnbind;
import cn.hutool.core.collection.CollUtil;
import com.win.framework.common.pojo.PageResult;
import com.win.module.wms.controller.containerBind.vo.ContainerBindRecordDetailExportReqVO;
import com.win.module.wms.controller.containerBind.vo.ContainerBindRecordMainExcelVO;
import com.win.module.wms.controller.containerUnbind.vo.*;
import com.win.module.wms.controller.containerinit.vo.ContainerInitRecordDetailExportReqVO;
import com.win.module.wms.controller.containerinit.vo.ContainerInitRecordMainExcelVO;
import com.win.module.wms.convert.containerUnbind.ContainerUnbindRecordMainConvert;
import com.win.module.wms.dal.dataobject.containerBind.ContainerBindRecordDetailDO;
import com.win.module.wms.dal.dataobject.containerBind.ContainerBindRecordMainDO;
import com.win.module.wms.dal.dataobject.containerUnbind.ContainerUnbindRecordDetailDO;
import com.win.module.wms.dal.dataobject.containerUnbind.ContainerUnbindRecordMainDO;
import com.win.module.wms.dal.dataobject.containerinit.ContainerInitRecordDetailDO;
import com.win.module.wms.dal.dataobject.containerinit.ContainerInitRecordMainDO;
import com.win.module.wms.dal.mysql.containerUnbind.ContainerUnbindRecordDetailMapper;
import com.win.module.wms.dal.mysql.containerUnbind.ContainerUnbindRecordMainMapper;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
@ -13,6 +24,8 @@ import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import static com.win.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.win.module.wms.enums.ErrorCodeConstants.CONTAINER_UNBIND_RECORD_MAIN_IMPORT_LIST_IS_EMPTY;
@ -29,6 +42,8 @@ public class ContainerUnbindRecordMainServiceImpl implements ContainerUnbindReco
@Resource
private ContainerUnbindRecordMainMapper containerUnbindRecordMainMapper;
@Resource
private ContainerUnbindRecordDetailMapper containerUnbindRecordDetailMapper;
@Override
public Long createContainerUnbindRecordMain(ContainerUnbindRecordMainCreateReqVO createReqVO) {
@ -78,8 +93,28 @@ public class ContainerUnbindRecordMainServiceImpl implements ContainerUnbindReco
}
@Override
public List<ContainerUnbindRecordMainDO> getContainerUnbindRecordMainList(ContainerUnbindRecordMainExportReqVO exportReqVO) {
return containerUnbindRecordMainMapper.selectList(exportReqVO);
public List<ContainerUnbindRecordMainExcelVO> getContainerUnbindRecordMainList(ContainerUnbindRecordMainExportReqVO exportReqVO) {
List<ContainerUnbindRecordMainExcelVO> excelVOList = new ArrayList<>();
List<ContainerUnbindRecordMainDO> mainDOList = containerUnbindRecordMainMapper.selectList(exportReqVO);
if(mainDOList != null && mainDOList.size() > 0){
ContainerUnbindRecordDetailExportReqVO reqVO = new ContainerUnbindRecordDetailExportReqVO();
BeanUtils.copyProperties(exportReqVO,reqVO);
List<ContainerUnbindRecordDetailDO> detailDOList = containerUnbindRecordDetailMapper.selectList(reqVO);
Map<Long,List<ContainerUnbindRecordDetailDO>> groupMasterIdMap = detailDOList.stream().collect(Collectors.groupingBy(ContainerUnbindRecordDetailDO::getMasterId));
for(ContainerUnbindRecordMainDO mainDO:mainDOList){
Long id = mainDO.getId();
List<ContainerUnbindRecordDetailDO> detailChildList = groupMasterIdMap.get(id);
if(detailChildList != null && detailChildList.size() > 0){
for(ContainerUnbindRecordDetailDO detailDO:detailChildList){
ContainerUnbindRecordMainExcelVO containerUnbindRecordMainExcelVO = new ContainerUnbindRecordMainExcelVO();
BeanUtils.copyProperties(mainDO,containerUnbindRecordMainExcelVO);
BeanUtils.copyProperties(detailDO,containerUnbindRecordMainExcelVO);
excelVOList.add(containerUnbindRecordMainExcelVO);
}
}
}
}
return excelVOList;
}
@Override

Loading…
Cancel
Save