Browse Source

收货缺货记录接口。

master
刘忱 2 years ago
parent
commit
e2ff4bd427
  1. 64
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/purchasereceiptRecord/PurchaseshortageDetailController.java
  2. 7
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/purchasereceiptRecord/vo/PurchaseshortageDetailBaseVO.java
  3. 58
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/purchasereceiptRecord/PurchaseshortageDetailMapper.java
  4. 46
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/purchasereceiptRecord/PurchaseshortageDetailService.java
  5. 31
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/purchasereceiptRecord/PurchaseshortageDetailServiceImpl.java

64
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/purchasereceiptRecord/PurchaseshortageDetailController.java

@ -0,0 +1,64 @@
package com.win.module.wms.controller.purchasereceiptRecord;
import com.win.framework.common.pojo.CommonResult;
import com.win.framework.common.pojo.CustomConditions;
import com.win.framework.common.pojo.PageResult;
import com.win.module.system.api.user.AdminUserApi;
import com.win.module.system.api.user.dto.AdminUserRespDTO;
import com.win.module.wms.controller.purchasereceiptRecord.vo.PurchaseshortageDetailPageReqVO;
import com.win.module.wms.controller.purchasereceiptRecord.vo.PurchaseshortageDetailRespVO;
import com.win.module.wms.convert.purchasereceiptRecord.PurchaseshortageDetailConvert;
import com.win.module.wms.dal.dataobject.purchasereceiptRecord.PurchaseshortageDetailDO;
import com.win.module.wms.service.purchasereceiptRecord.PurchaseshortageDetailService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.validation.Valid;
import static com.win.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 采购收货缺货子")
@RestController
@RequestMapping("/wms/purchaseshortage-detail")
@Validated
public class PurchaseshortageDetailController {
@Resource
private PurchaseshortageDetailService purchaseshortageDetailService;
@Resource
private AdminUserApi userApi;
@GetMapping("/page")
@Operation(summary = "获得采购收货记录子分页")
@PreAuthorize("@ss.hasPermission('wms:purchaseshortage-detail:query')")
public CommonResult<PageResult<PurchaseshortageDetailRespVO>> getPurchaseshortageDetailPage(@Valid PurchaseshortageDetailPageReqVO pageVO) {
PageResult<PurchaseshortageDetailDO> pageResult = purchaseshortageDetailService.getPurchaseshortageDetailPage(pageVO);
PageResult<PurchaseshortageDetailRespVO> result = PurchaseshortageDetailConvert.INSTANCE.convertPage(pageResult);
for(PurchaseshortageDetailRespVO vo : result.getList()) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
}
return success(result);
}
@PostMapping("/senior")
@Operation(summary = "高级搜索获得采购收货记录子信息分页")
@PreAuthorize("@ss.hasPermission('wms:purchaseshortage-detail:query')")
public CommonResult<PageResult<PurchaseshortageDetailRespVO>> getPurchaseshortageDetailSenior(@Valid @RequestBody CustomConditions conditions) {
PageResult<PurchaseshortageDetailDO> pageResult = purchaseshortageDetailService.getPurchaseshortageDetailSenior(conditions);
PageResult<PurchaseshortageDetailRespVO> result = PurchaseshortageDetailConvert.INSTANCE.convertPage(pageResult);
for(PurchaseshortageDetailRespVO vo : result.getList()) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
}
return success(result);
}
}

7
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/purchasereceiptRecord/vo/PurchaseshortageDetailBaseVO.java

@ -168,4 +168,11 @@ public class PurchaseshortageDetailBaseVO {
@Schema(description = "到批次")
private String toBatch;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime createTime;
@Schema(description = "创建者Id")
private String creator;
}

58
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/purchasereceiptRecord/PurchaseshortageDetailMapper.java

@ -1,9 +1,10 @@
package com.win.module.wms.dal.mysql.purchasereceiptRecord;
import com.win.framework.common.pojo.CustomConditions;
import com.win.framework.common.pojo.PageResult;
import com.win.framework.mybatis.core.mapper.BaseMapperX;
import com.win.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.win.module.wms.controller.purchasereceiptRecord.vo.PurchaseshortageDetailExportReqVO;
import com.win.framework.mybatis.core.util.QueryWrapperUtils;
import com.win.module.wms.controller.purchasereceiptRecord.vo.PurchaseshortageDetailPageReqVO;
import com.win.module.wms.dal.dataobject.purchasereceiptRecord.PurchaseshortageDetailDO;
import org.apache.ibatis.annotations.Mapper;
@ -69,55 +70,12 @@ public interface PurchaseshortageDetailMapper extends BaseMapperX<Purchaseshorta
.orderByDesc(PurchaseshortageDetailDO::getId));
}
default List<PurchaseshortageDetailDO> selectList(PurchaseshortageDetailExportReqVO reqVO) {
return selectList(new LambdaQueryWrapperX<PurchaseshortageDetailDO>()
.eqIfPresent(PurchaseshortageDetailDO::getFromPackingNumber, reqVO.getFromPackingNumber())
.eqIfPresent(PurchaseshortageDetailDO::getToPackingNumber, reqVO.getToPackingNumber())
.eqIfPresent(PurchaseshortageDetailDO::getFromContainerNumber, reqVO.getFromContainerNumber())
.eqIfPresent(PurchaseshortageDetailDO::getToContainerNumber, reqVO.getToContainerNumber())
.eqIfPresent(PurchaseshortageDetailDO::getFromBatch, reqVO.getFromBatch())
.eqIfPresent(PurchaseshortageDetailDO::getAltBatch, reqVO.getAltBatch())
.betweenIfPresent(PurchaseshortageDetailDO::getArriveDate, reqVO.getArriveDate())
.betweenIfPresent(PurchaseshortageDetailDO::getProduceDate, reqVO.getProduceDate())
.betweenIfPresent(PurchaseshortageDetailDO::getExpireDate, reqVO.getExpireDate())
.eqIfPresent(PurchaseshortageDetailDO::getInventoryStatus, reqVO.getInventoryStatus())
.eqIfPresent(PurchaseshortageDetailDO::getFromLocationCode, reqVO.getFromLocationCode())
.eqIfPresent(PurchaseshortageDetailDO::getToLocationCode, reqVO.getToLocationCode())
.eqIfPresent(PurchaseshortageDetailDO::getFromLocationGroupCode, reqVO.getFromLocationGroupCode())
.eqIfPresent(PurchaseshortageDetailDO::getToLocationGroupCode, reqVO.getToLocationGroupCode())
.eqIfPresent(PurchaseshortageDetailDO::getFromAreaCode, reqVO.getFromAreaCode())
.eqIfPresent(PurchaseshortageDetailDO::getToAreaCode, reqVO.getToAreaCode())
.eqIfPresent(PurchaseshortageDetailDO::getPoNumber, reqVO.getPoNumber())
.eqIfPresent(PurchaseshortageDetailDO::getPoLine, reqVO.getPoLine())
.eqIfPresent(PurchaseshortageDetailDO::getStdPackQty, reqVO.getStdPackQty())
.eqIfPresent(PurchaseshortageDetailDO::getStdPackUnit, reqVO.getStdPackUnit())
.eqIfPresent(PurchaseshortageDetailDO::getQty, reqVO.getQty())
.eqIfPresent(PurchaseshortageDetailDO::getUom, reqVO.getUom())
.eqIfPresent(PurchaseshortageDetailDO::getSupplierQty, reqVO.getSupplierQty())
.eqIfPresent(PurchaseshortageDetailDO::getSupplierUom, reqVO.getSupplierUom())
.eqIfPresent(PurchaseshortageDetailDO::getConvertRate, reqVO.getConvertRate())
.eqIfPresent(PurchaseshortageDetailDO::getVisualInspectResult, reqVO.getVisualInspectResult())
.eqIfPresent(PurchaseshortageDetailDO::getVisualInspectPhotos, reqVO.getVisualInspectPhotos())
.eqIfPresent(PurchaseshortageDetailDO::getFailedReason, reqVO.getFailedReason())
.eqIfPresent(PurchaseshortageDetailDO::getSinglePrice, reqVO.getSinglePrice())
.eqIfPresent(PurchaseshortageDetailDO::getAmount, reqVO.getAmount())
.eqIfPresent(PurchaseshortageDetailDO::getJobDetailId, reqVO.getJobDetailId())
.eqIfPresent(PurchaseshortageDetailDO::getItemCode, reqVO.getItemCode())
.likeIfPresent(PurchaseshortageDetailDO::getItemName, reqVO.getItemName())
.eqIfPresent(PurchaseshortageDetailDO::getItemDesc1, reqVO.getItemDesc1())
.eqIfPresent(PurchaseshortageDetailDO::getItemDesc2, reqVO.getItemDesc2())
.eqIfPresent(PurchaseshortageDetailDO::getMasterId, reqVO.getMasterId())
.eqIfPresent(PurchaseshortageDetailDO::getNumber, reqVO.getNumber())
.eqIfPresent(PurchaseshortageDetailDO::getRemark, reqVO.getRemark())
.betweenIfPresent(PurchaseshortageDetailDO::getCreateTime, reqVO.getCreateTime())
.eqIfPresent(PurchaseshortageDetailDO::getSiteId, reqVO.getSiteId())
.eqIfPresent(PurchaseshortageDetailDO::getProjectCode, reqVO.getProjectCode())
.eqIfPresent(PurchaseshortageDetailDO::getCode, reqVO.getCode())
.eqIfPresent(PurchaseshortageDetailDO::getInterfaceType, reqVO.getInterfaceType())
.eqIfPresent(PurchaseshortageDetailDO::getFromOwnerCode, reqVO.getFromOwnerCode())
.eqIfPresent(PurchaseshortageDetailDO::getToOwnerCode, reqVO.getToOwnerCode())
.eqIfPresent(PurchaseshortageDetailDO::getToBatch, reqVO.getToBatch())
.orderByDesc(PurchaseshortageDetailDO::getId));
default PageResult<PurchaseshortageDetailDO> selectSenior(CustomConditions conditions) {
return selectPage(conditions, QueryWrapperUtils.structure(conditions));
}
default List<PurchaseshortageDetailDO> selectList(Long masterId) {
return selectList(new LambdaQueryWrapperX<PurchaseshortageDetailDO>()
.eq(PurchaseshortageDetailDO::getMasterId, masterId));
}
}

46
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/purchasereceiptRecord/PurchaseshortageDetailService.java

@ -1,11 +1,10 @@
package com.win.module.wms.service.purchasereceiptRecord;
import com.win.framework.common.pojo.CustomConditions;
import com.win.framework.common.pojo.PageResult;
import com.win.module.wms.controller.purchasereceiptRecord.vo.*;
import com.win.module.wms.controller.purchasereceiptRecord.vo.PurchaseshortageDetailPageReqVO;
import com.win.module.wms.dal.dataobject.purchasereceiptRecord.PurchaseshortageDetailDO;
import javax.validation.Valid;
import java.util.Collection;
import java.util.List;
/**
@ -16,31 +15,7 @@ import java.util.List;
public interface PurchaseshortageDetailService {
/**
* 创建采购收货记录子
*
* @param createReqVO 创建信息
* @return 编号
*/
Long createPurchaseshortageDetail(@Valid PurchaseshortageDetailCreateReqVO createReqVO);
/**
* 获得采购收货记录子
*
* @param id 编号
* @return 采购收货记录子
*/
PurchaseshortageDetailDO getPurchaseshortageDetail(Long id);
/**
* 获得采购收货记录子列表
*
* @param ids 编号
* @return 采购收货记录子列表
*/
List<PurchaseshortageDetailDO> getPurchaseshortageDetailList(Collection<Long> ids);
/**
* 获得采购收货记录子分页
* 获得采购收货缺货子分页
*
* @param pageReqVO 分页查询
* @return 采购收货记录子分页
@ -48,11 +23,18 @@ public interface PurchaseshortageDetailService {
PageResult<PurchaseshortageDetailDO> getPurchaseshortageDetailPage(PurchaseshortageDetailPageReqVO pageReqVO);
/**
* 获得采购收货记录子列表, 用于 Excel 导出
* 获得用高级搜索采购收货缺货子分页列表
*
* @param exportReqVO 查询条件
* @return 采购收货记录子列表
* @param conditions 分页排序和自定义条件
* @return 分页列表
*/
PageResult<PurchaseshortageDetailDO> getPurchaseshortageDetailSenior(CustomConditions conditions);
/**
* 根据主表id查询
* @param masterId
* @return
*/
List<PurchaseshortageDetailDO> getPurchaseshortageDetailList(PurchaseshortageDetailExportReqVO exportReqVO);
List<PurchaseshortageDetailDO> selectList(Long masterId);
}

31
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/purchasereceiptRecord/PurchaseshortageDetailServiceImpl.java

@ -1,17 +1,14 @@
package com.win.module.wms.service.purchasereceiptRecord;
import com.win.framework.common.pojo.CustomConditions;
import com.win.framework.common.pojo.PageResult;
import com.win.module.wms.controller.purchasereceiptRecord.vo.PurchaseshortageDetailCreateReqVO;
import com.win.module.wms.controller.purchasereceiptRecord.vo.PurchaseshortageDetailExportReqVO;
import com.win.module.wms.controller.purchasereceiptRecord.vo.PurchaseshortageDetailPageReqVO;
import com.win.module.wms.convert.purchasereceiptRecord.PurchaseshortageDetailConvert;
import com.win.module.wms.dal.dataobject.purchasereceiptRecord.PurchaseshortageDetailDO;
import com.win.module.wms.dal.mysql.purchasereceiptRecord.PurchaseshortageDetailMapper;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource;
import java.util.Collection;
import java.util.List;
/**
@ -27,32 +24,18 @@ public class PurchaseshortageDetailServiceImpl implements PurchaseshortageDetail
private PurchaseshortageDetailMapper purchaseshortageDetailMapper;
@Override
public Long createPurchaseshortageDetail(PurchaseshortageDetailCreateReqVO createReqVO) {
// 插入
PurchaseshortageDetailDO purchaseshortageDetail = PurchaseshortageDetailConvert.INSTANCE.convert(createReqVO);
purchaseshortageDetailMapper.insert(purchaseshortageDetail);
// 返回
return purchaseshortageDetail.getId();
}
@Override
public PurchaseshortageDetailDO getPurchaseshortageDetail(Long id) {
return purchaseshortageDetailMapper.selectById(id);
}
@Override
public List<PurchaseshortageDetailDO> getPurchaseshortageDetailList(Collection<Long> ids) {
return purchaseshortageDetailMapper.selectBatchIds(ids);
public PageResult<PurchaseshortageDetailDO> getPurchaseshortageDetailPage(PurchaseshortageDetailPageReqVO pageReqVO) {
return purchaseshortageDetailMapper.selectPage(pageReqVO);
}
@Override
public PageResult<PurchaseshortageDetailDO> getPurchaseshortageDetailPage(PurchaseshortageDetailPageReqVO pageReqVO) {
return purchaseshortageDetailMapper.selectPage(pageReqVO);
public PageResult<PurchaseshortageDetailDO> getPurchaseshortageDetailSenior(CustomConditions conditions) {
return purchaseshortageDetailMapper.selectSenior(conditions);
}
@Override
public List<PurchaseshortageDetailDO> getPurchaseshortageDetailList(PurchaseshortageDetailExportReqVO exportReqVO) {
return purchaseshortageDetailMapper.selectList(exportReqVO);
public List<PurchaseshortageDetailDO> selectList(Long masterId) {
return purchaseshortageDetailMapper.selectList(masterId);
}
}

Loading…
Cancel
Save