如何通过点击询价订单号,显示关联订的数据

如何通过点击询价订单号,显示关联订的数据_第1张图片

如上图,上图就是询价单号,通过点击询价单号之后显示单号所对应的信息(如下)

在这里插入图片描述

通过代码进行呈现,具体体现代码为,通过订单编号查询到,订单编号所对应的信息

Controller

@ApiOperation(value = "询价单号关联的订单号")
    @RequestMapping(name = "询价单号关联的订单号", value = {"/*****"}, method = RequestMethod.PUT)
    public Result queryOrderNos(@RequestBody Map input) throws Exception {
  
    <这个仅仅只是获取到当前系统的登录用户>
        LoginedUser currentUser = AuthorityUtils.getCurrentUser();
  
    <用于日志进行打印>
        logger.info("currentUser : " + currentUser);
        
    
        String inquiryCode = (String) input.get("inquiryCode");
        Result result = new Result(); 
        if (inquiryCode.equals("")) {
            result.setCode("99999");
            result.setMsg("询价单号不能为空!");
            return result;
        }
        result = wlInquiryService.queryOrderNos(inquiryCode);
        return result;
    }

Service

public Result queryOrderNos(String inquiryCode) {
        Result result = new Result();
        try {
            List  orderNos = wlOrderDao.queryOrderNos(inquiryCode);
            result.setCode("00000");
            result.setMsg("查询到订单号");
            result.setData(orderNos);
        } catch (Exception e) {
            logger.error("查询失败", e.getCause());
            return Result.failure("查询失败,原因:" + e.getMessage(), "Query failed, reason:" + e.getMessage());
        }
        return result;
    }

Dao

 @Query(value = "select wl_order_no from wl_orders where inquiry_code = :inquiryCode and delete_flag = 0", nativeQuery = true)
    List queryOrderNos(@Param("inquiryCode") String inquiryCode);

上面可能会需要看的数据 方便看 Debug更清晰
如何通过点击询价订单号,显示关联订的数据_第2张图片

可能你们还想知道为啥子input传入的数据为code 以及单号呢

下面这个是vue前端代码

            //打开询价单号查看界面
            handleNoView(index,row){
                console.log("inquiryCode="+row.inquiryCode+",transType="+row.transType);
                this.inquiryObj.inquiryCode=row.inquiryCode;
                this.inquiryObj.transType=row.transType;
                let url = "api/wlInquiry/queryOrderNos";
                let method = "put";
                let self=this;
                http.postOrPut(url, method,this.inquiryObj).then(response => {
                    if(response.code='00000'){
                            let list=[];
                        for(let i=0;i

你可能感兴趣的:(上海地段,java后端处理,查询关联信息)