Commit 7b7a9e97 authored by chew's avatar chew

通过条码查询客户信息

parent c569fa72
......@@ -10,12 +10,14 @@ 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.OrderWithPendingVo;
import com.ekingwin.tms_app.module.cargo.outbound.vo.OutboundOrderVo;
import com.ekingwin.tms_app.module.cargo.vo.CustomerVo;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
......@@ -143,4 +145,30 @@ public class OutboundController {
@RequestAttribute("userId") String userId) {
return Result.success(outboundOrderService.getOrderWithPending(req));
}
@PostMapping("/queryCode/queryCustomer")
public Result<List<CustomerVo>> queryCustomer(
@RequestBody @Valid InfoQueryReq req,
@RequestAttribute("userId") String userId) {
log.info("-----------用码查询:"+req.toString());
List<String> list =new ArrayList<>();
String type=outboundOrderService.getIdType(req.getCode());
if (StringUtils.isNotEmpty(type)&&"BOX".equals(type)) {
List<BoxInfoVo> data = outboundOrderService.getBoxInfo(req.getCode());
if (data != null&&data.size()>0){
for (BoxInfoVo boxInfoVo:data){
list.add(boxInfoVo.getOrderNo());
}
}
}else if (StringUtils.isNotEmpty(type)&&"TRACE".equals(type)){
OutboundTracecode outboundTracecode = outboundOrderService.getTracecodeInfo(req.getCode());
if (outboundTracecode != null){
list.add(outboundTracecode.getOrderNo());
}
}
return Result.success(outboundOrderService.queryCustomer(list));
}
}
\ No newline at end of file
......@@ -5,6 +5,7 @@ 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.vo.OrderWithPendingVo;
import com.ekingwin.tms_app.module.cargo.outbound.vo.OutboundOrderVo;
import com.ekingwin.tms_app.module.cargo.vo.CustomerVo;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
......@@ -39,4 +40,6 @@ public interface OutboundOrderHeaderMapper extends BaseMapper<OutboundOrderHeade
@Param("endTime") Date endTime
);
List<CustomerVo> queryCustomer(@Param("orderids") List<String> orderids);
}
\ No newline at end of file
......@@ -8,6 +8,7 @@ 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.OrderWithPendingVo;
import com.ekingwin.tms_app.module.cargo.outbound.vo.OutboundOrderVo;
import com.ekingwin.tms_app.module.cargo.vo.CustomerVo;
import java.util.List;
......@@ -27,4 +28,5 @@ public interface OutboundOrderService {
public void scanTracecode(TracecodeScanReq req, String operatorId);
public IPage<OrderWithPendingVo> getOrderWithPending(OrderQueryReq req);
public List<CustomerVo> queryCustomer(List<String> req);
}
......@@ -10,6 +10,7 @@ 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.OrderWithPendingVo;
import com.ekingwin.tms_app.module.cargo.outbound.vo.OutboundOrderVo;
import com.ekingwin.tms_app.module.cargo.vo.CustomerVo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -153,4 +154,12 @@ public class OutboundOrderServiceImpl implements OutboundOrderService {
));
return page;
}
@Override
public List<CustomerVo> queryCustomer(List<String> req) {
List<CustomerVo> customerVos = orderHeaderMapper.queryCustomer(req);
return customerVos;
}
}
......@@ -150,4 +150,18 @@
<!-- AND h.status != 'DONE' -->
ORDER BY h.status, h.create_time DESC
</select>
<select id="queryCustomer" resultType="com.ekingwin.tms_app.module.cargo.vo.CustomerVo">
SELECT
h.customer_id AS customerId,
h.customer_name AS customerName,
h.address_no AS addressNo,
h.address AS customerAddr,
h.branch_id AS branchId,
h.branch_name AS branchName
FROM T_DOC_outbound_scan_HEADER h
WHERE h.order_no IN
<foreach item="orderid" collection="orderids" open="(" separator="," close=")">
#{orderid}
</foreach>
</select>
</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