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 GetOutSignSetting extends AbstractCommonCommand<Map<String, Object>> {

	public GetOutSignSetting(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(Prop.getInstance().getPropValue("hrm_outsign_setting", "remark"));
            String photo = Util.null2String(Prop.getInstance().getPropValue("hrm_outsign_setting", "photo"));
			String nearly = Util.null2String(Prop.getInstance().getPropValue("hrm_outsign_setting", "nearly"), "1");
			String poitypes = Util.null2String(Prop.getInstance().getPropValue("hrm_outsign_setting", "poitypes"), "170000");
			String showCompanyName = Util.null2String(Prop.getInstance().getPropValue("hrm_outsign_setting", "showCompanyName"));
			if("".equals(poitypes))
				poitypes = "170000";
			if("".equals(nearly))
				nearly = "1";
			if("".equals(showCompanyName))
				showCompanyName = "0";

            retmap.put("status", "1");
            retmap.put("remark",  remark);
            retmap.put("photo",  photo);
			retmap.put("nearly",  nearly);
			retmap.put("showCompanyName",  showCompanyName);
			retmap.put("poitypes",  poitypes);
        }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;
	}
}
