Commit dcecc23b authored by chew's avatar chew

追溯码查询商品来源

parent bc694f54
...@@ -6,10 +6,7 @@ import com.ekingwin.tms_app.module.cargo.outbound.dto.*; ...@@ -6,10 +6,7 @@ import com.ekingwin.tms_app.module.cargo.outbound.dto.*;
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.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.*;
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.vo.CustomerVo; import com.ekingwin.tms_app.module.cargo.vo.CustomerVo;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
...@@ -170,5 +167,14 @@ public class OutboundController { ...@@ -170,5 +167,14 @@ public class OutboundController {
return Result.success(outboundOrderService.queryCustomer(list)); return Result.success(outboundOrderService.queryCustomer(list));
} }
@PostMapping("/tracecode/detail")
public Result<TracecodeDetailVo> getTracecodeDetail(@RequestBody @Valid TracecodeInfoReq req) {
String type=outboundOrderService.getIdType(req.getTraceCode());
if (StringUtils.isNotEmpty(type)&&"TRACE".equals(type)){
return Result.success(outboundOrderService.getTracecodeDetail(req.getTraceCode()));
}else {
return Result.error("追溯码不存在");
}
}
} }
\ No newline at end of file
...@@ -2,9 +2,12 @@ package com.ekingwin.tms_app.module.cargo.outbound.dao; ...@@ -2,9 +2,12 @@ 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.entity.OutboundTracecode; import com.ekingwin.tms_app.module.cargo.outbound.entity.OutboundTracecode;
import com.ekingwin.tms_app.module.cargo.outbound.vo.TracecodeDetailVo;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
public interface OutboundTracecodeMapper extends BaseMapper<OutboundTracecode> { public interface OutboundTracecodeMapper extends BaseMapper<OutboundTracecode> {
OutboundTracecode selectByTraceCode(@Param("traceCode") String traceCode); OutboundTracecode selectByTraceCode(@Param("traceCode") String traceCode);
TracecodeDetailVo selectTracecodeDetail(@Param("traceCode") String traceCode);
} }
...@@ -4,10 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -4,10 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ekingwin.tms_app.module.cargo.outbound.dto.*; import com.ekingwin.tms_app.module.cargo.outbound.dto.*;
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.*;
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.vo.CustomerVo; import com.ekingwin.tms_app.module.cargo.vo.CustomerVo;
import java.util.List; import java.util.List;
...@@ -29,4 +26,5 @@ public interface OutboundOrderService { ...@@ -29,4 +26,5 @@ public interface OutboundOrderService {
public void scanTracecode(TracecodeScanReq req, String operatorId); public void scanTracecode(TracecodeScanReq req, String operatorId);
public IPage<OrderWithPendingVo> getOrderWithPending(OrderQueryReq req); public IPage<OrderWithPendingVo> getOrderWithPending(OrderQueryReq req);
public List<CustomerVo> queryCustomer(List<String> req); public List<CustomerVo> queryCustomer(List<String> req);
public TracecodeDetailVo getTracecodeDetail(String traceCode);
} }
...@@ -6,10 +6,7 @@ import com.ekingwin.tms_app.module.cargo.outbound.dto.*; ...@@ -6,10 +6,7 @@ import com.ekingwin.tms_app.module.cargo.outbound.dto.*;
import com.ekingwin.tms_app.module.cargo.outbound.entity.*; import com.ekingwin.tms_app.module.cargo.outbound.entity.*;
import com.ekingwin.tms_app.module.cargo.outbound.dao.*; 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.*;
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.vo.CustomerVo; import com.ekingwin.tms_app.module.cargo.vo.CustomerVo;
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;
...@@ -161,5 +158,12 @@ public class OutboundOrderServiceImpl implements OutboundOrderService { ...@@ -161,5 +158,12 @@ public class OutboundOrderServiceImpl implements OutboundOrderService {
return customerVos; return customerVos;
} }
@Override
public TracecodeDetailVo getTracecodeDetail(String traceCode) {
TracecodeDetailVo vo = tracecodeMapper.selectTracecodeDetail(traceCode);
if (vo == null) {
throw new RuntimeException("追溯码不存在");
}
return vo;
}
} }
package com.ekingwin.tms_app.module.cargo.outbound.vo;
import lombok.Data;
@Data
public class TracecodeDetailVo {
private String traceCode;
private String itemCode;
private String itemName;
private String batchNo;
private String lotNo;
private String serialNo;
private String mfgDate; // 生产日期(格式化)
private String expDate; // 效期(格式化)
private String expireFlag; // 正常/已过期
private String supplier;
private String origin;
private String orderNo;
private String traceId; // 箱号(对应字段 Traceid)
private String customerName;
private String scanStatus; // PENDING/SCANNED
private String scannedBy;
private String scannedTime; // 扫描时间(格式化)
}
\ No newline at end of file
...@@ -51,5 +51,34 @@ ...@@ -51,5 +51,34 @@
FROM T_DOC_outbound_tracecode FROM T_DOC_outbound_tracecode
WHERE trace_code = #{traceCode} WHERE trace_code = #{traceCode}
</select> </select>
<select id="selectTracecodeDetail"
resultType="com.ekingwin.tms_app.module.cargo.outbound.vo.TracecodeDetailVo">
SELECT
t.trace_code AS traceCode,
t.item_code AS itemCode,
t.item_name AS itemName,
t.batch_no AS batchNo,
t.lot_no AS lotNo,
t.serial_no AS serialNo,
TO_CHAR(t.manufacture_date, 'YYYY-MM-DD') AS mfgDate,
TO_CHAR(t.expire_date, 'YYYY-MM-DD') AS expDate,
<![CDATA[
CASE
WHEN t.expire_date < SYSDATE THEN '【已过期】'
ELSE '正常'
END
]]> AS expireFlag,
t.supplier,
t.origin,
t.order_no AS orderNo,
t.traceid AS traceId,
h.customer_name AS customerName,
t.status AS scanStatus,
t.scanned_by AS scannedBy,
TO_CHAR(t.scanned_time, 'YYYY-MM-DD HH24:MI:SS') AS scannedTime
FROM T_DOC_outbound_tracecode t
LEFT JOIN T_DOC_outbound_scan_HEADER h
ON t.organizationid = h.organizationid AND t.order_no = h.order_no
WHERE t.trace_code = #{traceCode}
</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