package com.ruoyi.system.service.impl;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.system.common.ReturnResult;
import com.ruoyi.system.constant.ApiConstant;
import com.ruoyi.system.service.IItemListQueryService;
import com.ruoyi.system.yyinterface.VoucherUtils;
import org.springframework.stereotype.Service;

/**
 * @author xyx
 * @date 2024/4/22
 */
@Service
public class ItemListQueryServiceImpl implements IItemListQueryService {

    @Override
    public JSONArray getItemList(String sskId) {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("pageIndex",1L);
        jsonObject.put("pageSize",1000L);

        jsonObject.put("code",sskId);
        ReturnResult accSubject = VoucherUtils.callVoucherQuery( jsonObject , ApiConstant.YFXM_URL);
        JSONObject data = (JSONObject) accSubject.getData().get(0);
        return data.getJSONArray("recordList");
    }
}
