diff --git a/ms-api/src/main/java/com/ms/api/dto/order/SearchOutstorageLogListRequestDTO.java b/ms-api/src/main/java/com/ms/api/dto/order/SearchOutstorageLogListRequestDTO.java new file mode 100644 index 00000000..b27bc94c --- /dev/null +++ b/ms-api/src/main/java/com/ms/api/dto/order/SearchOutstorageLogListRequestDTO.java @@ -0,0 +1,53 @@ +package com.ms.api.dto.order; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.ms.api.common.PageOption; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.springframework.util.StringUtils; + +/* + * 获取出库历史列表 请求参数 + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class SearchOutstorageLogListRequestDTO extends PageOption { + + private Long shopId; + /* + * 订单起始时间 + */ + private String outstorageTimeStart; + + /* + * 订单结束时间 + */ + private String outstorageTimeEnd; + /* + * 订单号 + */ + private String orderIds; + /* + * 运单号 + */ + private String waybillCodes; + /* + * 物流id + */ + private String logisticsId; + + /** + * 状态 + */ + private String outstorageStatus; + /** + * 来源 + */ + private String source; + + @JsonIgnore + public boolean checkParams() { + return true; + } + +} diff --git a/ms-biz/src/main/java/com/ms/api/service/OpOrderOutstorageHistoryService.java b/ms-biz/src/main/java/com/ms/api/service/OpOrderOutstorageHistoryService.java index 018f64eb..e3049e38 100644 --- a/ms-biz/src/main/java/com/ms/api/service/OpOrderOutstorageHistoryService.java +++ b/ms-biz/src/main/java/com/ms/api/service/OpOrderOutstorageHistoryService.java @@ -1,8 +1,14 @@ package com.ms.api.service; import java.util.List; +import java.util.Map; +import com.ms.api.common.Pager; +import com.ms.api.dto.move.SearchMoveProductItemRequestDTO; +import com.ms.api.dto.order.SearchOutstorageLogListRequestDTO; +import com.ms.dal.entity.MicroMoveProductItem; import com.ms.dal.entity.OpOrderOutstorageHistory; +import com.ms.dal.entity.PurchaseOrder; /** * @@ -25,4 +31,6 @@ public interface OpOrderOutstorageHistoryService { List getByIdList(List idList); + Pager searchOutstorageLogList(SearchOutstorageLogListRequestDTO condition); + } diff --git a/ms-biz/src/main/java/com/ms/api/service/impl/OpOrderOutstorageHistoryServiceImpl.java b/ms-biz/src/main/java/com/ms/api/service/impl/OpOrderOutstorageHistoryServiceImpl.java index 2477b552..dc1639b9 100644 --- a/ms-biz/src/main/java/com/ms/api/service/impl/OpOrderOutstorageHistoryServiceImpl.java +++ b/ms-biz/src/main/java/com/ms/api/service/impl/OpOrderOutstorageHistoryServiceImpl.java @@ -2,8 +2,12 @@ package com.ms.api.service.impl; import java.util.ArrayList; import java.util.List; +import java.util.Map; import cn.hutool.core.util.ObjectUtil; +import com.ms.api.common.Pager; +import com.ms.api.dto.order.SearchOutstorageLogListRequestDTO; +import com.ms.dal.entity.MicroMoveProductItem; import com.ms.dal.entity.OpOrderOutstorageHistory; import com.ms.api.service.OpOrderOutstorageHistoryService; import com.ms.dal.mapper.OpOrderOutstorageHistoryMapper; @@ -66,6 +70,25 @@ public class OpOrderOutstorageHistoryServiceImpl implements OpOrderOutstorageHis return opOrderOutstorageHistoryMapper.getByIdList(idList); } + + + @Override + public Pager searchOutstorageLogList(SearchOutstorageLogListRequestDTO condition) { + List list = opOrderOutstorageHistoryMapper.searchOutstorageLogList(condition.getShopId(), + condition.getOutstorageTimeStart(),condition.getOutstorageTimeEnd(),condition.getOrderIds(),condition.getOutstorageStatus(),condition.getLogisticsId(),condition.getWaybillCodes(), + condition.getSource(), + condition.getPageStart(), condition.getPageSize()); + Integer count = opOrderOutstorageHistoryMapper.searchOutstorageLogCount(condition.getShopId(), + condition.getOutstorageTimeStart(),condition.getOutstorageTimeEnd(),condition.getOrderIds(),condition.getOutstorageStatus(),condition.getLogisticsId(),condition.getWaybillCodes(), + condition.getSource()); + Pager pager = new Pager<>(); + pager.setTotal(count); + pager.setData(list); + pager.setPage(condition.getPage()); + pager.setPageSize(condition.getPageSize()); + return pager; + } + } diff --git a/ms-biz/src/main/java/com/ms/api/spi/order/SearchOutstorageLogListService.java b/ms-biz/src/main/java/com/ms/api/spi/order/SearchOutstorageLogListService.java new file mode 100644 index 00000000..c40c7d34 --- /dev/null +++ b/ms-biz/src/main/java/com/ms/api/spi/order/SearchOutstorageLogListService.java @@ -0,0 +1,47 @@ +package com.ms.api.spi.order; + +import com.jinritemai.cloud.base.api.BaseRequest; +import com.jinritemai.cloud.base.api.BaseResponse; +import com.jinritemai.cloud.base.api.ExtensionService; +import com.jinritemai.cloud.base.api.ExtensionServiceHandler; +import com.ms.api.common.Pager; +import com.ms.api.common.R; +import com.ms.api.common.Ret; +import com.ms.api.common.SPIBaseService; +import com.ms.api.dto.order.SearchOutstorageLogListRequestDTO; +import com.ms.api.service.OpOrderOutstorageHistoryService; +import com.ms.dal.entity.OpOrderOutstorageHistory; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; + +@ExtensionService("searchOutstorageLogList") +@Slf4j +public class SearchOutstorageLogListService extends SPIBaseService implements ExtensionServiceHandler { + + @Autowired + private OpOrderOutstorageHistoryService opOrderOutstorageHistoryService; + + + @Override + public BaseResponse handle(BaseRequest req) { + initHandle(req); + SearchOutstorageLogListRequestDTO dto = req.getData(); + SearchOutstorageLogListRequestDTO condition=new SearchOutstorageLogListRequestDTO(); + + condition.setShopId(shopId); + condition.setPage(dto.getPage()); + condition.setPageSize(dto.getPageSize()); + condition.setLogisticsId(dto.getLogisticsId()); + condition.setOutstorageStatus(dto.getOutstorageStatus()); + condition.setOrderIds(dto.getOrderIds()); + condition.setOutstorageTimeEnd(dto.getOutstorageTimeEnd()); + condition.setOutstorageTimeStart(dto.getOutstorageTimeStart()); + condition.setSource(dto.getSource()); + condition.setWaybillCodes(dto.getWaybillCodes()); + + Pager productToDsItemPager = opOrderOutstorageHistoryService.searchOutstorageLogList(condition); + + // ----结果返回---- + return R.ok(Ret.success(productToDsItemPager.toMap())); + } +} diff --git a/ms-dal/src/main/java/com/ms/dal/mapper/OpOrderOutstorageHistoryMapper.java b/ms-dal/src/main/java/com/ms/dal/mapper/OpOrderOutstorageHistoryMapper.java index 2059f272..f6193cb6 100644 --- a/ms-dal/src/main/java/com/ms/dal/mapper/OpOrderOutstorageHistoryMapper.java +++ b/ms-dal/src/main/java/com/ms/dal/mapper/OpOrderOutstorageHistoryMapper.java @@ -1,6 +1,7 @@ package com.ms.dal.mapper; import java.util.List; +import java.util.Map; import com.ms.dal.entity.OpOrderOutstorageHistory; import org.apache.ibatis.annotations.Mapper; @@ -26,5 +27,11 @@ public interface OpOrderOutstorageHistoryMapper { List getLastHistoryId(@Param("shopIds") List shopIds, @Param("orderIdList") List orderIds); - List getByIdList(@Param("idList")List idList); + List getByIdList(@Param("idList") List idList); + + List searchOutstorageLogList(Long shopId, String outstorageTimeStart, String outstorageTimeEnd, + String orderIds, String outstorageStatus, String logisticsId, String waybillCodes, String source, Integer page, Integer pageSize); + + Integer searchOutstorageLogCount(Long shopId, String outstorageTimeStart, String outstorageTimeEnd, + String orderIds, String outstorageStatus, String logisticsId, String waybillCodes, String source); } diff --git a/ms-dal/src/main/resources/mapper/OpOrderOutstorageHistoryMapper.xml b/ms-dal/src/main/resources/mapper/OpOrderOutstorageHistoryMapper.xml index 08d8817b..e3160fe7 100644 --- a/ms-dal/src/main/resources/mapper/OpOrderOutstorageHistoryMapper.xml +++ b/ms-dal/src/main/resources/mapper/OpOrderOutstorageHistoryMapper.xml @@ -190,4 +190,64 @@ gmt_modified = #{gmtModified,jdbcType=TIMESTAMP} where op_order_outstorage_history_id = #{opOrderOutstorageHistoryId,jdbcType=BIGINT} + +