package com.engine.htxc.contract.web;

import com.alibaba.fastjson.JSON;
import com.engine.common.util.ParamUtil;
import com.engine.common.util.ServiceUtil;
import com.engine.htxc.contract.dto.ContractProcessDTO;
import com.engine.htxc.contract.dto.ProcessInfoDTO;
import com.engine.htxc.contract.service.ContractListService;
import com.engine.htxc.contract.service.impl.ContractListServiceImpl;
import com.engine.htxc.contract.service.impl.ContractServiceImpl;
import com.google.common.collect.Maps;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import weaver.conn.RecordSet;
import weaver.general.Util;
import weaver.hrm.HrmUserVarify;
import weaver.hrm.User;
import weaver.interfaces.htsc.GlobatTools.JAVATools;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import java.util.Map;

/**
 * @Title: ecology-9
 * @Company: 泛微软件
 * @author: K1810036
 * @version: 1.0
 * @CreateDate: 2022/8/26
 * @Description:  合同列表action
 * @ModifyLog:
 **/
public class ContractListAction {
    private static final Logger logger= LoggerFactory.getLogger(ContractListAction.class);
    private ContractListService contractListService = ServiceUtil.getService(ContractListServiceImpl.class);

    @POST
    @Path("/deleteListData")
    @Produces({MediaType.TEXT_PLAIN})
    public String deleteListData(@Context HttpServletRequest request, @Context HttpServletResponse response) {
        Map<String,Object> apiData = Maps.newHashMap();
        try {
            Map<String, Object> paramMap = ParamUtil.request2Map(request);
            return JSON.toJSONString(contractListService.deleteData(paramMap));
        }catch (Exception e){
            logger.error("删除异常",e);
        }
        return JAVATools.Apiretrun("-1", "删除数据失败");
    }
}
