package com.engine.kq.cmd.attendanceButton;

import com.engine.common.biz.AbstractCommonCommand;
import com.engine.common.entity.BizLogContext;
import com.engine.core.interceptor.CommandContext;
import com.engine.kq.biz.KQGroupComInfo;
import com.engine.kq.biz.KQGroupMemberComInfo;
import com.engine.kq.entity.KQGroupEntity;
import com.engine.portal.biz.constants.ModuleConstants;
import com.engine.portal.biz.nonstandardfunction.SysModuleInfoBiz;
import weaver.common.DateUtil;
import weaver.conn.RecordSet;
import weaver.file.Prop;
import weaver.general.BaseBean;
import weaver.general.Util;
import weaver.hrm.User;
import weaver.hrm.resource.ResourceComInfo;
import weaver.systeminfo.SystemEnv;

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

/**
 * 获取考勤组的基本信息的
 */
public class SaveOutSignSettingCmd extends AbstractCommonCommand<Map<String, Object>> {

	public SaveOutSignSettingCmd(Map<String, Object> params, User user) {
		this.user = user;
		this.params = params;
	}

    @Override
    public Map<String, Object> execute(CommandContext commandContext) {
        Map<String, Object> retmap = new HashMap<String, Object>();
        try{
            String remark = Util.null2String(params.get("remark"));
            String photo = Util.null2String(params.get("photo"));
            String nearly = Util.null2String(params.get("nearly"));

            Prop.setPropValueForAdd("hrm_outsign_setting", "remark", remark);
            Prop.setPropValueForAdd("hrm_outsign_setting", "photo", photo);
            Prop.setPropValueForAdd("hrm_outsign_setting", "nearly", nearly);

            retmap.put("status", "1");
        }catch (Exception ex){
            retmap.put("status", "-1");
            retmap.put("message",  SystemEnv.getHtmlLabelName(382661,user.getLanguage()));

            ex.printStackTrace();
            writeLog(ex);
        }
        return retmap;
    }

    @Override
    public BizLogContext getLogContext() {
        return null;
    }
}
