package weaver.formmode.recruit.modeexpand.interview;

import weaver.conn.RecordSet;
import weaver.formmode.customjavacode.AbstractModeExpandJavaCodeNew;
import weaver.general.Util;
import weaver.hrm.User;
import weaver.soa.workflow.request.RequestInfo;

import java.util.HashMap;
import java.util.Map;

/**
 * @author:dxfeng
 * @createTime: 2024/10/14
 * @version: 1.0
 */
public class DeleteInterviewExpand extends AbstractModeExpandJavaCodeNew {
    @Override
    public Map<String, String> doModeExpand(Map<String, Object> params) {
        Map<String, String> result = new HashMap<>();
        RecordSet rs = new RecordSet();
        try {
            //数据id
            int billId;
            //模块id
            int modeId;
            RequestInfo requestInfo = (RequestInfo) params.get("RequestInfo");
            User user = (User) params.get("user");
            if (requestInfo != null) {
                billId = Util.getIntValue(requestInfo.getRequestid());
                modeId = Util.getIntValue(requestInfo.getWorkflowid());
                if (billId > 0 && modeId > 0) {
                    rs.executeUpdate("delete from uf_jcl_mspjfk where msid = ? ", billId);
                }
            }
        } catch (Exception e) {
            rs.writeLog(e);
            result.put("errmsg", e.getMessage());
            result.put("flag", "false");
        }

        return result;
    }
}
