package com.huigou.topsun.sap.nonProducePick.controller;

import com.huigou.topsun.sap.nonProducePick.application.NonProducePickItemApplication;
import com.huigou.topsun.sap.nonProducePick.domain.query.NonProducePickQueryRequest;
import com.huigou.uasp.annotation.ControllerMapping;
import com.huigou.uasp.client.CommonController;
import com.huigou.util.SDO;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @Auther: xin.lu
 * @Date: 2024/03/13/10:46
 * @Description:
 */
@Controller
@ControllerMapping("/nonProducePickItem")
public class NonProducePickItemController extends CommonController {
    @Resource
    private NonProducePickItemApplication nonProducePickItemApplication;

    public String queryNonProducePickItems(){
        SDO sdo = this.getSDO();
        NonProducePickQueryRequest queryRequest = sdo.toQueryRequest(NonProducePickQueryRequest.class);
        Map<String, Object> map = nonProducePickItemApplication.queryNonProducePickItems(queryRequest);
        return toResult(map);
    }

    public String deleteNonProducePickItem(){
        SDO sdo = this.getSDO();
        List<String> ids = sdo.getIds();
        nonProducePickItemApplication.deleteByIds(ids);
        return success();
    }
}
