diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/purchasereceiptRecord/PurchaseshortageDetailController.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/purchasereceiptRecord/PurchaseshortageDetailController.java new file mode 100644 index 00000000..4b9467d7 --- /dev/null +++ b/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> getPurchaseshortageDetailPage(@Valid PurchaseshortageDetailPageReqVO pageVO) { + PageResult pageResult = purchaseshortageDetailService.getPurchaseshortageDetailPage(pageVO); + PageResult 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> getPurchaseshortageDetailSenior(@Valid @RequestBody CustomConditions conditions) { + PageResult pageResult = purchaseshortageDetailService.getPurchaseshortageDetailSenior(conditions); + PageResult 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); + } + +} diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/purchasereceiptRecord/vo/PurchaseshortageDetailBaseVO.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/purchasereceiptRecord/vo/PurchaseshortageDetailBaseVO.java index c613f773..648a3e77 100644 --- a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/purchasereceiptRecord/vo/PurchaseshortageDetailBaseVO.java +++ b/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; + } diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/purchasereceiptRecord/PurchaseshortageDetailMapper.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/purchasereceiptRecord/PurchaseshortageDetailMapper.java index 20fd31ae..991b8901 100644 --- a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/purchasereceiptRecord/PurchaseshortageDetailMapper.java +++ b/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 selectList(PurchaseshortageDetailExportReqVO reqVO) { - return selectList(new LambdaQueryWrapperX() - .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 selectSenior(CustomConditions conditions) { + return selectPage(conditions, QueryWrapperUtils.structure(conditions)); } + default List selectList(Long masterId) { + return selectList(new LambdaQueryWrapperX() + .eq(PurchaseshortageDetailDO::getMasterId, masterId)); + } } diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/purchasereceiptRecord/PurchaseshortageDetailService.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/purchasereceiptRecord/PurchaseshortageDetailService.java index e0d9e311..51569042 100644 --- a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/purchasereceiptRecord/PurchaseshortageDetailService.java +++ b/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 getPurchaseshortageDetailList(Collection ids); - - /** - * 获得采购收货记录子分页 + * 获得采购收货缺货子分页 * * @param pageReqVO 分页查询 * @return 采购收货记录子分页 @@ -48,11 +23,18 @@ public interface PurchaseshortageDetailService { PageResult getPurchaseshortageDetailPage(PurchaseshortageDetailPageReqVO pageReqVO); /** - * 获得采购收货记录子列表, 用于 Excel 导出 + * 获得用高级搜索采购收货缺货子分页列表 * - * @param exportReqVO 查询条件 - * @return 采购收货记录子列表 + * @param conditions 分页、排序和自定义条件 + * @return 分页列表 + */ + PageResult getPurchaseshortageDetailSenior(CustomConditions conditions); + + /** + * 根据主表id查询 + * @param masterId + * @return */ - List getPurchaseshortageDetailList(PurchaseshortageDetailExportReqVO exportReqVO); + List selectList(Long masterId); } diff --git a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/purchasereceiptRecord/PurchaseshortageDetailServiceImpl.java b/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/purchasereceiptRecord/PurchaseshortageDetailServiceImpl.java index 87fa6590..5c76cdf3 100644 --- a/win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/purchasereceiptRecord/PurchaseshortageDetailServiceImpl.java +++ b/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 getPurchaseshortageDetailList(Collection ids) { - return purchaseshortageDetailMapper.selectBatchIds(ids); + public PageResult getPurchaseshortageDetailPage(PurchaseshortageDetailPageReqVO pageReqVO) { + return purchaseshortageDetailMapper.selectPage(pageReqVO); } @Override - public PageResult getPurchaseshortageDetailPage(PurchaseshortageDetailPageReqVO pageReqVO) { - return purchaseshortageDetailMapper.selectPage(pageReqVO); + public PageResult getPurchaseshortageDetailSenior(CustomConditions conditions) { + return purchaseshortageDetailMapper.selectSenior(conditions); } @Override - public List getPurchaseshortageDetailList(PurchaseshortageDetailExportReqVO exportReqVO) { - return purchaseshortageDetailMapper.selectList(exportReqVO); + public List selectList(Long masterId) { + return purchaseshortageDetailMapper.selectList(masterId); } }