|
@ -1,10 +1,11 @@ |
|
|
package com.win.module.wms.service.container; |
|
|
package com.win.module.wms.service.container; |
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
import com.win.framework.common.pojo.CustomConditions; |
|
|
import com.win.framework.common.pojo.CustomConditions; |
|
|
import com.win.module.wms.controller.container.vo.ContainerMainCreateReqVO; |
|
|
import com.win.module.wms.controller.container.vo.*; |
|
|
import com.win.module.wms.controller.container.vo.ContainerMainExportReqVO; |
|
|
import com.win.module.wms.convert.container.ContainerDetailConvert; |
|
|
import com.win.module.wms.controller.container.vo.ContainerMainPageReqVO; |
|
|
import com.win.module.wms.dal.dataobject.container.ContainerDetailDO; |
|
|
import com.win.module.wms.controller.container.vo.ContainerMainUpdateReqVO; |
|
|
import com.win.module.wms.dal.mysql.container.ContainerDetailMapper; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
import javax.annotation.Resource; |
|
|
import javax.annotation.Resource; |
|
|
import org.springframework.validation.annotation.Validated; |
|
|
import org.springframework.validation.annotation.Validated; |
|
@ -32,6 +33,9 @@ public class ContainerMainServiceImpl implements ContainerMainService { |
|
|
@Resource |
|
|
@Resource |
|
|
private ContainerMainMapper containerMainMapper; |
|
|
private ContainerMainMapper containerMainMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
|
private ContainerDetailMapper containerDetailMapper; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public String createContainerMain(ContainerMainCreateReqVO createReqVO) { |
|
|
public String createContainerMain(ContainerMainCreateReqVO createReqVO) { |
|
|
// 插入
|
|
|
// 插入
|
|
@ -87,4 +91,26 @@ public class ContainerMainServiceImpl implements ContainerMainService { |
|
|
return containerMainMapper.selectList(exportReqVO); |
|
|
return containerMainMapper.selectList(exportReqVO); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public ContainerMainRespVO getContainerByNumber(String number) { |
|
|
|
|
|
// 查询主表
|
|
|
|
|
|
LambdaQueryWrapper<ContainerMainDO> lambdaQueryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
lambdaQueryWrapper.eq(ContainerMainDO::getNumber,number); |
|
|
|
|
|
ContainerMainDO containerMainDO = containerMainMapper.selectOne(lambdaQueryWrapper); |
|
|
|
|
|
ContainerMainRespVO containerMainRespVO = ContainerMainConvert.INSTANCE.convert(containerMainDO); |
|
|
|
|
|
// 查询子表
|
|
|
|
|
|
LambdaQueryWrapper<ContainerDetailDO> lambdaQueryWrapperDetail = new LambdaQueryWrapper<>(); |
|
|
|
|
|
lambdaQueryWrapperDetail.eq(ContainerDetailDO::getContentNumber,number); |
|
|
|
|
|
List<ContainerDetailDO> list = containerDetailMapper.selectList(lambdaQueryWrapperDetail); |
|
|
|
|
|
|
|
|
|
|
|
List<ContainerDetailRespVO> subList = new ArrayList<>(); |
|
|
|
|
|
for(ContainerDetailDO containerDetailDO:list){ |
|
|
|
|
|
ContainerDetailRespVO containerDetailRespVO = ContainerDetailConvert.INSTANCE.convert(containerDetailDO); |
|
|
|
|
|
subList.add(containerDetailRespVO); |
|
|
|
|
|
} |
|
|
|
|
|
// 主子绑定
|
|
|
|
|
|
containerMainRespVO.setSubList(subList); |
|
|
|
|
|
return containerMainRespVO; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|