package com.engine.kq.cmd.upgrade;

import com.engine.common.biz.AbstractCommonCommand;
import com.engine.common.entity.BizLogContext;
import com.engine.core.interceptor.CommandContext;
import com.engine.kq.biz.KQOneStopUp;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import weaver.conn.RecordSet;
import weaver.hrm.User;
import weaver.systeminfo.SystemEnv;

/**
 * 外部集成考勤设置升级
 * @author pzy
 *
 */
public class DoUpgrade9Cmd extends AbstractCommonCommand<Map<String, Object>>{

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

	@Override
	public BizLogContext getLogContext() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Map<String, Object> execute(CommandContext commandContext) {
		Map<String,Object> retmap = new HashMap<String,Object>();
    RecordSet rs = new RecordSet();
    RecordSet rs1 = new RecordSet();
		try {
		  KQOneStopUp kqOneStopUp = new KQOneStopUp();
//		  kqOneStopUp.upAttSet();

		  List<Object> signSetList = new ArrayList<>();

      String getSignSetSql = "select* from HrmScheduleSignSet ";
      rs.executeQuery(getSignSetSql);
      while (rs.next()){
        Map<String,Object> signSetMap = new HashMap<>();
        signSetMap.put("datasourceid",rs.getString("datasourceid"));
        signSetMap.put("tablename",rs.getString("tablename"));
        signSetList.add(signSetMap);
      }
			retmap.put("status", "1");
      retmap.put("data", signSetList);
		} catch (Exception e) {
			writeLog(e);
      retmap.put("status", "-1");
      retmap.put("message",  SystemEnv.getHtmlLabelName(382661,user.getLanguage()));
		}
		return retmap;
	}

}
