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.CommonResult;
import com.win.framework.common.pojo.PageResult; 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.excel.core.util.ExcelUtils;
import com.win.framework.operatelog.core.annotations.OperateLog; 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.controller.containerUnbind.vo.*;
import com.win.module.wms.convert.containerUnbind.ContainerUnbindRecordMainConvert; import com.win.module.wms.convert.containerUnbind.ContainerUnbindRecordMainConvert;
import com.win.module.wms.dal.dataobject.containerUnbind.ContainerUnbindRecordMainDO; 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 com.win.module.wms.service.containerUnbind.ContainerUnbindRecordMainService;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.Parameter;
@ -93,10 +96,16 @@ public class ContainerUnbindRecordMainController {
@OperateLog(type = EXPORT) @OperateLog(type = EXPORT)
public void exportContainerUnbindRecordMainExcel(@Valid ContainerUnbindRecordMainExportReqVO exportReqVO, public void exportContainerUnbindRecordMainExcel(@Valid ContainerUnbindRecordMainExportReqVO exportReqVO,
HttpServletResponse response) throws IOException { 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 // 导出 Excel
List<ContainerUnbindRecordMainExcelVO> datas = ContainerUnbindRecordMainConvert.INSTANCE.convertList02(list); ExcelUtils.write(response, "器具解绑记录主.xls", "数据", ContainerUnbindRecordMainExcelVO.class, list,mapDropDown);
ExcelUtils.write(response, "器具解绑记录主.xls", "数据", ContainerUnbindRecordMainExcelVO.class, datas);
} }
@GetMapping("/get-import-template") @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; package com.win.module.wms.controller.containerUnbind.vo;
import com.alibaba.excel.annotation.ExcelProperty; 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 lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
/** /**
@ -13,8 +17,6 @@ import java.time.LocalDateTime;
@Data @Data
public class ContainerUnbindRecordMainExcelVO { public class ContainerUnbindRecordMainExcelVO {
@ExcelProperty("id")
private Long id;
@ExcelProperty("单据号") @ExcelProperty("单据号")
private String number; private String number;
@ -22,70 +24,37 @@ public class ContainerUnbindRecordMainExcelVO {
@ExcelProperty("器具号") @ExcelProperty("器具号")
private String containerNumber; private String containerNumber;
@ExcelProperty("仓库代码") @ExcelProperty("仓库代码")
private String fromWarehouseCode; private String fromWarehouseCode;
@ExcelProperty("到仓库代码") @ExcelProperty(value = "内容物类型",converter = DictConvert.class)
private String toWarehouseCode; @DictFormat(DictTypeConstants.CONTAINER_CONTENT_TYPE)
private String containerContentType;
@ExcelProperty("出库事务类型") @ExcelProperty("内容物号")
private String outTransactionType; private String contentNumber;
@ExcelProperty("入库事务类型") @ExcelProperty("物料代码")
private String inTransactionType; private String itemCode;
@ExcelProperty("执行时间") @ExcelProperty("批次")
private LocalDateTime executeTime; private String batch;
@ExcelProperty("生效日期") @ExcelProperty(value = "库存状态",converter = DictConvert.class)
private LocalDateTime activeDate; @DictFormat(DictTypeConstants.INVENTORY_STATUS)
private String inventoryStatus;
@ExcelProperty("是否可用") @ExcelProperty(value = "计量单位",converter = DictConvert.class)
private String available; @DictFormat(DictTypeConstants.UOM)
private String uom;
@ExcelProperty("申请时间") @ExcelProperty("数量")
private LocalDateTime requestTime; private BigDecimal qty;
@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("创建时间") @ExcelProperty("创建时间")
private LocalDateTime createTime; private LocalDateTime createTime;
@ExcelProperty("扩展属性") @ExcelProperty("备注")
private String extraProperties; private String remark;
@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;
} }

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; package com.win.module.wms.service.containerUnbind;
import com.win.framework.common.pojo.PageResult; 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.controller.containerUnbind.vo.*;
import com.win.module.wms.dal.dataobject.containerUnbind.ContainerUnbindRecordMainDO; import com.win.module.wms.dal.dataobject.containerUnbind.ContainerUnbindRecordMainDO;
@ -67,7 +68,7 @@ public interface ContainerUnbindRecordMainService {
* @param exportReqVO 查询条件 * @param exportReqVO 查询条件
* @return 器具解绑记录主列表 * @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 cn.hutool.core.collection.CollUtil;
import com.win.framework.common.pojo.PageResult; 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.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.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.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 com.win.module.wms.dal.mysql.containerUnbind.ContainerUnbindRecordMainMapper;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
@ -13,6 +24,8 @@ import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.List; 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.framework.common.exception.util.ServiceExceptionUtil.exception;
import static com.win.module.wms.enums.ErrorCodeConstants.CONTAINER_UNBIND_RECORD_MAIN_IMPORT_LIST_IS_EMPTY; 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 @Resource
private ContainerUnbindRecordMainMapper containerUnbindRecordMainMapper; private ContainerUnbindRecordMainMapper containerUnbindRecordMainMapper;
@Resource
private ContainerUnbindRecordDetailMapper containerUnbindRecordDetailMapper;
@Override @Override
public Long createContainerUnbindRecordMain(ContainerUnbindRecordMainCreateReqVO createReqVO) { public Long createContainerUnbindRecordMain(ContainerUnbindRecordMainCreateReqVO createReqVO) {
@ -78,8 +93,28 @@ public class ContainerUnbindRecordMainServiceImpl implements ContainerUnbindReco
} }
@Override @Override
public List<ContainerUnbindRecordMainDO> getContainerUnbindRecordMainList(ContainerUnbindRecordMainExportReqVO exportReqVO) { public List<ContainerUnbindRecordMainExcelVO> getContainerUnbindRecordMainList(ContainerUnbindRecordMainExportReqVO exportReqVO) {
return containerUnbindRecordMainMapper.selectList(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 @Override

Loading…
Cancel
Save