diff --git a/README.md b/README.md index d990441f..0b8fa3fe 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,8 @@ curl --location --request POST 'localhost:8080/base/cloud/spi' \ --data-raw '{ "appId":"7264840234423027259", "authId":"4463798", -"method":"searchDSProductCatTree", -"data":"{}" +"method":"getMoveHistoryProductList", +"data":"{\"status\":\"processing\",\"pageSize\":20,\"pageNo\":1}" }' diff --git a/ms-biz/src/main/java/com/ms/api/service/MoveCollectTaskDetailService.java b/ms-biz/src/main/java/com/ms/api/service/MoveCollectTaskDetailService.java index d383c18b..033ba6b8 100644 --- a/ms-biz/src/main/java/com/ms/api/service/MoveCollectTaskDetailService.java +++ b/ms-biz/src/main/java/com/ms/api/service/MoveCollectTaskDetailService.java @@ -1,7 +1,9 @@ package com.ms.api.service; +import com.ms.api.common.Pager; import com.ms.api.common.Ret; import com.ms.api.common.StrObjMap; +import com.ms.api.dto.move.GetMoveHistoryProductListRequestDTO; import com.ms.dal.entity.MoveCollectTaskDetail; /** @@ -24,4 +26,6 @@ public interface MoveCollectTaskDetailService { MoveCollectTaskDetail getMoveCollectTaskDetail(long shopId, long moveCollectTaskDetailId) ; Ret updateMoveCollectTaskDetail(StrObjMap updateData, long shopId, Long moveCollectTaskDetailId); + + Pager getMoveCollectTaskList(GetMoveHistoryProductListRequestDTO condition); } diff --git a/ms-biz/src/main/java/com/ms/api/service/MoveCollectTaskService.java b/ms-biz/src/main/java/com/ms/api/service/MoveCollectTaskService.java index 51567cd8..4fd97e08 100644 --- a/ms-biz/src/main/java/com/ms/api/service/MoveCollectTaskService.java +++ b/ms-biz/src/main/java/com/ms/api/service/MoveCollectTaskService.java @@ -24,6 +24,4 @@ public interface MoveCollectTaskService { int updateByPrimaryKey(MoveCollectTask record); MoveCollectTask getMoveCollectTask(long moveCollectTaskId, long shopId); - - Pager getMoveCollectTaskList(GetMoveHistoryProductListRequestDTO condition); } diff --git a/ms-biz/src/main/java/com/ms/api/service/impl/MoveCollectTaskDetailServiceImpl.java b/ms-biz/src/main/java/com/ms/api/service/impl/MoveCollectTaskDetailServiceImpl.java index 8a4b3f13..06c3d724 100644 --- a/ms-biz/src/main/java/com/ms/api/service/impl/MoveCollectTaskDetailServiceImpl.java +++ b/ms-biz/src/main/java/com/ms/api/service/impl/MoveCollectTaskDetailServiceImpl.java @@ -1,7 +1,9 @@ package com.ms.api.service.impl; +import com.ms.api.common.Pager; import com.ms.api.common.Ret; import com.ms.api.common.StrObjMap; +import com.ms.api.dto.move.GetMoveHistoryProductListRequestDTO; import com.ms.api.tool.CommonTool; import com.ms.dal.entity.MoveCollectTaskDetail; import com.ms.api.service.MoveCollectTaskDetailService; @@ -9,11 +11,14 @@ import com.ms.dal.mapper.MoveCollectTaskDetailMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + /** * */ @Service + public class MoveCollectTaskDetailServiceImpl implements MoveCollectTaskDetailService{ @Autowired @@ -64,6 +69,18 @@ public class MoveCollectTaskDetailServiceImpl implements MoveCollectTaskDetailSe return null; } + @Override + public Pager getMoveCollectTaskList(GetMoveHistoryProductListRequestDTO condition) { + List list = moveCollectTaskDetailMapper.getMoveCollectTaskList(condition.getShopId(), condition.getStatus(), condition.getPageStart(), condition.getPageSize()); + Integer count = moveCollectTaskDetailMapper.getMoveCollectTaskCount(condition.getShopId(), condition.getStatus()); + 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/service/impl/MoveCollectTaskServiceImpl.java b/ms-biz/src/main/java/com/ms/api/service/impl/MoveCollectTaskServiceImpl.java index 2b64c257..cb2a3824 100644 --- a/ms-biz/src/main/java/com/ms/api/service/impl/MoveCollectTaskServiceImpl.java +++ b/ms-biz/src/main/java/com/ms/api/service/impl/MoveCollectTaskServiceImpl.java @@ -61,18 +61,6 @@ public class MoveCollectTaskServiceImpl implements MoveCollectTaskService{ //return $this->db->query("select * from move_collect_task_detail where shop_id = %i and move_collect_task_detail_id in %li", $shopId, $detailIds); return null; } - - @Override - public Pager getMoveCollectTaskList(GetMoveHistoryProductListRequestDTO condition) { - List list = moveCollectTaskMapper.getMoveCollectTaskList(condition.getShopId(), condition.getStatus(), condition.getPageStart(), condition.getPageSize()); - Integer count = moveCollectTaskMapper.getMoveCollectTaskCount(condition.getShopId(), condition.getStatus()); - 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/move/GetMoveHistoryProductListService.java b/ms-biz/src/main/java/com/ms/api/spi/move/GetMoveHistoryProductListService.java index a03a717d..fd89e7ee 100644 --- a/ms-biz/src/main/java/com/ms/api/spi/move/GetMoveHistoryProductListService.java +++ b/ms-biz/src/main/java/com/ms/api/spi/move/GetMoveHistoryProductListService.java @@ -11,13 +11,18 @@ import com.ms.api.common.SPIBaseService; import com.ms.api.dto.move.GetMoveHistoryProductListRequestDTO; import com.ms.api.dto.move.SearchMoveProductItemRequestDTO; import com.ms.api.service.MicroMoveProductItemService; +import com.ms.api.service.MoveCollectTaskDetailService; import com.ms.api.service.MoveCollectTaskService; import com.ms.api.tool.DsJsonRequestTemplate; import com.ms.dal.entity.MicroMoveProductItem; import com.ms.dal.entity.MoveCollectTask; +import com.ms.dal.entity.MoveCollectTaskDetail; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; +import java.util.HashMap; +import java.util.Map; + /** * 铺货日志、搬家历史、复制历史 * 复制历史的搜索接口,根据状态,返回不同状态下的复制历史 @@ -26,7 +31,7 @@ import org.springframework.beans.factory.annotation.Autowired; @Slf4j public class GetMoveHistoryProductListService extends SPIBaseService implements ExtensionServiceHandler { @Autowired - private MoveCollectTaskService moveCollectTaskService; + private MoveCollectTaskDetailService moveCollectTaskDetailService; @Override public BaseResponse handle(BaseRequest req) { initHandle(req); @@ -40,9 +45,14 @@ public class GetMoveHistoryProductListService extends SPIBaseService implements condition.setPage(fields.getPage()); condition.setPageSize(fields.getPageSize()); condition.setShopId(shopId); - Pager moveCollectTaskPager = moveCollectTaskService.getMoveCollectTaskList(condition); + Pager moveCollectTaskPager = moveCollectTaskDetailService.getMoveCollectTaskList(condition); + Map result = new HashMap<>(); + result.put("taskDetailList", moveCollectTaskPager.getData()); + result.put("taskTotal", moveCollectTaskPager.getTotal()); + result.put("page", moveCollectTaskPager.getPage()); + result.put("pageSize", moveCollectTaskPager.getPageSize()); // ----结果返回---- - return R.ok(Ret.success(moveCollectTaskPager.toMap())); + return R.ok(Ret.success(result)); } } diff --git a/ms-dal/src/main/java/com/ms/dal/mapper/MoveCollectTaskDetailMapper.java b/ms-dal/src/main/java/com/ms/dal/mapper/MoveCollectTaskDetailMapper.java index 235c244c..60aaa925 100644 --- a/ms-dal/src/main/java/com/ms/dal/mapper/MoveCollectTaskDetailMapper.java +++ b/ms-dal/src/main/java/com/ms/dal/mapper/MoveCollectTaskDetailMapper.java @@ -3,6 +3,8 @@ package com.ms.dal.mapper; import com.ms.dal.entity.MoveCollectTaskDetail; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * @Entity com.ms.dal.entity.MoveCollectTaskDetail */ @@ -21,4 +23,7 @@ public interface MoveCollectTaskDetailMapper { int updateByPrimaryKey(MoveCollectTaskDetail record); + List getMoveCollectTaskList(Long shopId, String status, Integer page, Integer pageSize); + + Integer getMoveCollectTaskCount(Long shopId, String status); } diff --git a/ms-dal/src/main/java/com/ms/dal/mapper/MoveCollectTaskMapper.java b/ms-dal/src/main/java/com/ms/dal/mapper/MoveCollectTaskMapper.java index 91a1eef2..f54a4baf 100644 --- a/ms-dal/src/main/java/com/ms/dal/mapper/MoveCollectTaskMapper.java +++ b/ms-dal/src/main/java/com/ms/dal/mapper/MoveCollectTaskMapper.java @@ -22,8 +22,4 @@ public interface MoveCollectTaskMapper { int updateByPrimaryKeySelective(MoveCollectTask record); int updateByPrimaryKey(MoveCollectTask record); - - List getMoveCollectTaskList(Long shopId, String status, Integer page, Integer pageSize); - - Integer getMoveCollectTaskCount(Long shopId, String status); } diff --git a/ms-dal/src/main/resources/mapper/MoveCollectTaskDetailMapper.xml b/ms-dal/src/main/resources/mapper/MoveCollectTaskDetailMapper.xml index 6c32a4bf..360ab6f9 100644 --- a/ms-dal/src/main/resources/mapper/MoveCollectTaskDetailMapper.xml +++ b/ms-dal/src/main/resources/mapper/MoveCollectTaskDetailMapper.xml @@ -223,4 +223,23 @@ gmt_modified = #{gmtModified,jdbcType=TIMESTAMP} where move_collect_task_detail_id = #{moveCollectTaskDetailId,jdbcType=BIGINT} + + diff --git a/ms-dal/src/main/resources/mapper/MoveCollectTaskMapper.xml b/ms-dal/src/main/resources/mapper/MoveCollectTaskMapper.xml index b6cc9247..140bbcfb 100644 --- a/ms-dal/src/main/resources/mapper/MoveCollectTaskMapper.xml +++ b/ms-dal/src/main/resources/mapper/MoveCollectTaskMapper.xml @@ -127,24 +127,4 @@ gmt_modified = #{gmtModified,jdbcType=TIMESTAMP} where move_collect_task_id = #{moveCollectTaskId,jdbcType=INTEGER} - - -