Commit c569fa72 authored by chew's avatar chew

查询剩余工作

parent b266b6df
...@@ -8,6 +8,7 @@ import com.ekingwin.tms_app.module.cargo.outbound.entity.OutboundTracecode; ...@@ -8,6 +8,7 @@ import com.ekingwin.tms_app.module.cargo.outbound.entity.OutboundTracecode;
import com.ekingwin.tms_app.module.cargo.outbound.service.OutboundOrderService; import com.ekingwin.tms_app.module.cargo.outbound.service.OutboundOrderService;
import com.ekingwin.tms_app.module.cargo.outbound.vo.BoxInfoVo; import com.ekingwin.tms_app.module.cargo.outbound.vo.BoxInfoVo;
import com.ekingwin.tms_app.module.cargo.outbound.vo.CustomerProductSummaryVo; import com.ekingwin.tms_app.module.cargo.outbound.vo.CustomerProductSummaryVo;
import com.ekingwin.tms_app.module.cargo.outbound.vo.OrderWithPendingVo;
import com.ekingwin.tms_app.module.cargo.outbound.vo.OutboundOrderVo; import com.ekingwin.tms_app.module.cargo.outbound.vo.OutboundOrderVo;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -135,4 +136,11 @@ public class OutboundController { ...@@ -135,4 +136,11 @@ public class OutboundController {
outboundOrderService.scanTracecode(req, userId); outboundOrderService.scanTracecode(req, userId);
return Result.success(null); return Result.success(null);
} }
@PostMapping("/orders/pending")
public Result<IPage<OrderWithPendingVo>> listOrdersWithPending(
@RequestBody @Valid OrderQueryReq req,
@RequestAttribute("userId") String userId) {
return Result.success(outboundOrderService.getOrderWithPending(req));
}
} }
\ No newline at end of file
...@@ -3,6 +3,7 @@ package com.ekingwin.tms_app.module.cargo.outbound.dao; ...@@ -3,6 +3,7 @@ package com.ekingwin.tms_app.module.cargo.outbound.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ekingwin.tms_app.module.cargo.outbound.vo.CustomerProductSummaryVo; import com.ekingwin.tms_app.module.cargo.outbound.vo.CustomerProductSummaryVo;
import com.ekingwin.tms_app.module.cargo.outbound.entity.OutboundOrderHeader; import com.ekingwin.tms_app.module.cargo.outbound.entity.OutboundOrderHeader;
import com.ekingwin.tms_app.module.cargo.outbound.vo.OrderWithPendingVo;
import com.ekingwin.tms_app.module.cargo.outbound.vo.OutboundOrderVo; import com.ekingwin.tms_app.module.cargo.outbound.vo.OutboundOrderVo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.Date; import java.util.Date;
...@@ -30,4 +31,12 @@ public interface OutboundOrderHeaderMapper extends BaseMapper<OutboundOrderHeade ...@@ -30,4 +31,12 @@ public interface OutboundOrderHeaderMapper extends BaseMapper<OutboundOrderHeade
@Param("endTime") Date endTime @Param("endTime") Date endTime
); );
List<OrderWithPendingVo> selectOrderWithPending(
@Param("customerName") String customerName,
@Param("orderNo") String orderNo,
@Param("status") String status,
@Param("startTime") Date startTime,
@Param("endTime") Date endTime
);
} }
\ No newline at end of file
package com.ekingwin.tms_app.module.cargo.outbound.dto;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
public class OrderQueryReq {
private String customerName;
private String orderNo;
private String status;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date startTime;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endTime;
private Integer pageNum = 1;
private Integer pageSize = 10;
}
\ No newline at end of file
package com.ekingwin.tms_app.module.cargo.outbound.service; package com.ekingwin.tms_app.module.cargo.outbound.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ekingwin.tms_app.module.cargo.outbound.dto.CustomerProductQueryReq; import com.ekingwin.tms_app.module.cargo.outbound.dto.*;
import com.ekingwin.tms_app.module.cargo.outbound.dto.OutboundOrderQueryReq;
import com.ekingwin.tms_app.module.cargo.outbound.dto.TallyCommitReq;
import com.ekingwin.tms_app.module.cargo.outbound.dto.TracecodeScanReq;
import com.ekingwin.tms_app.module.cargo.outbound.entity.OutboundOrderDetail; import com.ekingwin.tms_app.module.cargo.outbound.entity.OutboundOrderDetail;
import com.ekingwin.tms_app.module.cargo.outbound.entity.OutboundTracecode; import com.ekingwin.tms_app.module.cargo.outbound.entity.OutboundTracecode;
import com.ekingwin.tms_app.module.cargo.outbound.vo.BoxInfoVo; import com.ekingwin.tms_app.module.cargo.outbound.vo.BoxInfoVo;
import com.ekingwin.tms_app.module.cargo.outbound.vo.CustomerProductSummaryVo; import com.ekingwin.tms_app.module.cargo.outbound.vo.CustomerProductSummaryVo;
import com.ekingwin.tms_app.module.cargo.outbound.vo.OrderWithPendingVo;
import com.ekingwin.tms_app.module.cargo.outbound.vo.OutboundOrderVo; import com.ekingwin.tms_app.module.cargo.outbound.vo.OutboundOrderVo;
import java.util.List; import java.util.List;
...@@ -28,4 +26,5 @@ public interface OutboundOrderService { ...@@ -28,4 +26,5 @@ public interface OutboundOrderService {
public void commitTally(TallyCommitReq req, String operatorId); public void commitTally(TallyCommitReq req, String operatorId);
public void scanTracecode(TracecodeScanReq req, String operatorId); public void scanTracecode(TracecodeScanReq req, String operatorId);
public IPage<OrderWithPendingVo> getOrderWithPending(OrderQueryReq req);
} }
...@@ -8,6 +8,7 @@ import com.ekingwin.tms_app.module.cargo.outbound.dao.*; ...@@ -8,6 +8,7 @@ import com.ekingwin.tms_app.module.cargo.outbound.dao.*;
import com.ekingwin.tms_app.module.cargo.outbound.service.OutboundOrderService; import com.ekingwin.tms_app.module.cargo.outbound.service.OutboundOrderService;
import com.ekingwin.tms_app.module.cargo.outbound.vo.BoxInfoVo; import com.ekingwin.tms_app.module.cargo.outbound.vo.BoxInfoVo;
import com.ekingwin.tms_app.module.cargo.outbound.vo.CustomerProductSummaryVo; import com.ekingwin.tms_app.module.cargo.outbound.vo.CustomerProductSummaryVo;
import com.ekingwin.tms_app.module.cargo.outbound.vo.OrderWithPendingVo;
import com.ekingwin.tms_app.module.cargo.outbound.vo.OutboundOrderVo; import com.ekingwin.tms_app.module.cargo.outbound.vo.OutboundOrderVo;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -140,4 +141,16 @@ public class OutboundOrderServiceImpl implements OutboundOrderService { ...@@ -140,4 +141,16 @@ public class OutboundOrderServiceImpl implements OutboundOrderService {
trace.setScannedTime(new Date()); trace.setScannedTime(new Date());
tracecodeMapper.updateById(trace); tracecodeMapper.updateById(trace);
} }
public IPage<OrderWithPendingVo> getOrderWithPending(OrderQueryReq req) {
Page<OrderWithPendingVo> page = new Page<>(req.getPageNum(), req.getPageSize());
page.setRecords(orderHeaderMapper.selectOrderWithPending(
req.getCustomerName(),
req.getOrderNo(),
req.getStatus(),
req.getStartTime(),
req.getEndTime()
));
return page;
}
} }
package com.ekingwin.tms_app.module.cargo.outbound.vo;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class OrderWithPendingVo {
private String orderNo;
private String customerName;
private String customerCode;
private Integer totalLines;
private Integer tallyLines;
private Integer remainLines; // 剩余行数
private BigDecimal progressPct; // 进度百分比
private String status;
private String statusCn; // 中文状态
private String pendingItems; // 未理货明细(如 "商品A(5); 商品B(3)")
private String pendingBoxes; // 未理货箱号(逗号分隔)
private Integer pendingTraces; // 未理货追溯码数量
}
\ No newline at end of file
...@@ -103,4 +103,51 @@ ...@@ -103,4 +103,51 @@
q.TOTAL_QTY q.TOTAL_QTY
ORDER BY d.item_name ORDER BY d.item_name
</select> </select>
<select id="selectOrderWithPending"
resultType="com.ekingwin.tms_app.module.cargo.outbound.vo.OrderWithPendingVo">
SELECT
h.order_no AS orderNo,
h.customer_name AS customerName,
h.customer_code AS customerCode,
h.total_lines AS totalLines,
h.tally_lines AS tallyLines,
(h.total_lines - h.tally_lines) AS remainLines,
ROUND(h.tally_lines / NULLIF(h.total_lines, 0) * 100, 1) AS progressPct,
h.status,
DECODE(h.status, 'PENDING','待理货','TALLYING','理货中','DONE','已完成', h.status) AS statusCn,
-- 未理货明细
(SELECT LISTAGG(ol.item_name || '(' || (ol.order_qty - ol.tally_qty) || ')', '; ')
WITHIN GROUP (ORDER BY ol.line_no)
FROM T_DOC_outbound_scan_DETAIL ol
WHERE ol.order_no = h.order_no AND ol.status != 'DONE') AS pendingItems,
-- 未理货箱号
(SELECT LISTAGG(b.box_no, ',') WITHIN GROUP (ORDER BY b.box_no)
FROM T_DOC_outbound_box b
WHERE b.order_no = h.order_no AND b.status != 'DONE') AS pendingBoxes,
-- 未理货追溯码数
(SELECT COUNT(*)
FROM T_DOC_outbound_tracecode t
WHERE t.order_no = h.order_no AND t.status = 'PENDING') AS pendingTraces
FROM T_DOC_outbound_scan_HEADER h
WHERE 1=1
<if test="customerName != null and customerName != ''">
AND h.customer_name LIKE '%' || #{customerName} || '%'
</if>
<if test="orderNo != null and orderNo != ''">
AND h.order_no = #{orderNo}
</if>
<if test="status != null and status != ''">
AND h.status = #{status}
</if>
<if test="startTime != null">
AND h.create_time >= #{startTime, jdbcType=TIMESTAMP}
</if>
<if test="endTime != null">
AND h.create_time <![CDATA[ <= ]]> #{endTime, jdbcType=TIMESTAMP}
</if>
<!-- 如果默认不查已完成,可加 -->
<!-- AND h.status != 'DONE' -->
ORDER BY h.status, h.create_time DESC
</select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment