出库历史列表

20230922-ljl-fixBug
laolin 1 year ago
parent d26c94de3a
commit c64970ad5f

@ -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;
}
}

@ -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<OpOrderOutstorageHistory> getByIdList(List<Long> idList);
Pager<OpOrderOutstorageHistory> searchOutstorageLogList(SearchOutstorageLogListRequestDTO condition);
}

@ -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<OpOrderOutstorageHistory> searchOutstorageLogList(SearchOutstorageLogListRequestDTO condition) {
List<OpOrderOutstorageHistory> 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<OpOrderOutstorageHistory> pager = new Pager<>();
pager.setTotal(count);
pager.setData(list);
pager.setPage(condition.getPage());
pager.setPageSize(condition.getPageSize());
return pager;
}
}

@ -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<SearchOutstorageLogListRequestDTO, Ret> {
@Autowired
private OpOrderOutstorageHistoryService opOrderOutstorageHistoryService;
@Override
public BaseResponse<Ret> handle(BaseRequest<SearchOutstorageLogListRequestDTO> 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<OpOrderOutstorageHistory> productToDsItemPager = opOrderOutstorageHistoryService.searchOutstorageLogList(condition);
// ----结果返回----
return R.ok(Ret.success(productToDsItemPager.toMap()));
}
}

@ -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<Long> getLastHistoryId(@Param("shopIds") List<String> shopIds, @Param("orderIdList") List<String> orderIds);
List<OpOrderOutstorageHistory> getByIdList(@Param("idList")List<Long> idList);
List<OpOrderOutstorageHistory> getByIdList(@Param("idList") List<Long> idList);
List<OpOrderOutstorageHistory> 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);
}

@ -190,4 +190,64 @@
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP}
where op_order_outstorage_history_id = #{opOrderOutstorageHistoryId,jdbcType=BIGINT}
</update>
<select id="searchOutstorageLogList" resultMap="BaseResultMap">
select a.*,c.logistics_name,d.shop_name
from op_order_outstorage_history a
inner join op_order_ds b on b.order_id = a.order_id
left join op_logistics c on c.logistics_id = a.logistics_id
left join shop d on d.shop_id = a.shop_id
where a.shop_id = #{shopId,jdbcType=BIGINT}
<if test="outstorageTimeStart != null">
AND a.gmt_create <![CDATA[ >= ]]> #{outstorageTimeStart}
</if>
<if test="outstorageTimeEnd != null">
AND a.gmt_create <![CDATA[ <= ]]> #{outstorageTimeEnd}
</if>
<if test="orderIds != null">
AND a.order_id in (#{orderIds})
</if>
<if test="outstorageStatus != null">
AND a.status = #{outstorageStatus}
</if>
<if test="logisticsId != null">
AND a.logistics_id = #{logisticsId}
</if>
<if test="waybillCodes != null">
AND a.waybill in (#{waybillCodes})
</if>
<if test="source != null">
AND a.source in (#{source})
</if>
order by a.op_order_outstorage_history_id desc
limit #{page},#{pageSize}
</select>
<select id="searchOutstorageLogCount" resultType="java.lang.Integer">
select count(a.op_order_outstorage_history_id)
from op_order_outstorage_history a
inner join op_order_ds b on b.order_id = a.order_id
left join op_logistics c on c.logistics_id = a.logistics_id
left join shop d on d.shop_id = a.shop_id
where a.shop_id = #{shopId,jdbcType=BIGINT}
<if test="outstorageTimeStart != null">
AND a.gmt_create <![CDATA[ >= ]]> #{outstorageTimeStart}
</if>
<if test="outstorageTimeEnd != null">
AND a.gmt_create <![CDATA[ <= ]]> #{outstorageTimeEnd}
</if>
<if test="orderIds != null">
AND a.order_id in (#{orderIds})
</if>
<if test="outstorageStatus != null">
AND a.status = #{outstorageStatus}
</if>
<if test="logisticsId != null">
AND a.logistics_id = #{logisticsId}
</if>
<if test="waybillCodes != null">
AND a.waybill in (#{waybillCodes})
</if>
<if test="source != null">
AND a.source in (#{source})
</if>
</select>
</mapper>

Loading…
Cancel
Save