Package com.founder.fix.fixflow.core.impl.db

Examples of com.founder.fix.fixflow.core.impl.db.SqlCommand


    try {
      String groupIdField = getGroupInfo().getGroupIdField();
      String groupNameField = getGroupInfo().getGroupNameField();
      String supGroupIdField = getGroupInfo().getSupGroupIdField();
      String sqlText = getGroupInfo().getSqlText();
      SqlCommand sqlCommand = getSqlCommand();
      // 部门编号,父级编号,部门名称
      // 获取这个部门的所有子部门
      List<Map<String, Object>> listMap = sqlCommand.queryForList("SELECT USERTABLE.* FROM (" + sqlText + ") USERTABLE");
      for (Map<String, Object> map : listMap) {
        // 部门编号
        String groupDbId = StringUtil.getString(StringUtil.getString(map.get(groupIdField)));
        // 部门名称
        String groupDbName = StringUtil.getString(StringUtil.getString(map.get(groupNameField)));
View Full Code Here


    Object cacheData = cache.getCacheData(getId() + "_findUserChildMembersIncludeByGroupId_" + groupId);
    if (cacheData != null) {
      return (List<UserTo>) cacheData;
    } else {
      try {
        SqlCommand sqlCommand = getSqlCommand();
        List<GroupTo> groupTos = getGroupChild(groupId, true);
        List<Object> objectParamWhere = new ArrayList<Object>();
        String sqlInString = "";
        for (GroupTo groupTo : groupTos) {
          if (sqlInString.equals("")) {
            sqlInString = "?";
            objectParamWhere.add(groupTo.getGroupId());
          } else {
            sqlInString = sqlInString + ",?";
            objectParamWhere.add(groupTo.getGroupId());
          }
        }
        UserInfo userInfo = getGroupInfo().getUserInfo();
        String userIdField = userInfo.getUserIdField();
        String userNameField = userInfo.getUserNameField();
        String groupIdField = userInfo.getGroupIdField();
        String sqlText = userInfo.getSqlText();
        // 这里可能会出现重复记录人名的问题
        List<Map<String, Object>> dataObj = sqlCommand.queryForList("select USERTABLE.* FROM (" + sqlText + ") USERTABLE WHERE USERTABLE."
            + groupIdField + " in (" + sqlInString + ")", objectParamWhere);
        List<UserTo> userTos = new ArrayList<UserTo>();
        for (Map<String, Object> map : dataObj) {
          UserTo userTo = new UserTo(StringUtil.getString(map.get(userIdField)), StringUtil.getString(map.get(userNameField)), map);
          userTos.add(userTo);
View Full Code Here

    Object cacheData = cache.getCacheData(getId() + "_findUserByGroupId_" + groupId);
    if (cacheData != null) {
      return (List<UserTo>) cacheData;
    } else {
      try {
        SqlCommand sqlCommand = getSqlCommand();
        List<Object> objectParamWhere = new ArrayList<Object>();
        objectParamWhere.add(groupId);
        UserInfo userInfo = getGroupInfo().getUserInfo();
        String userIdField = userInfo.getUserIdField();
        String userNameField = userInfo.getUserNameField();
        String groupIdField = userInfo.getGroupIdField();
        String sqlText = userInfo.getSqlText();
        List<Map<String, Object>> dataObj = sqlCommand.queryForList("SELECT USERTABLE.* FROM (" + sqlText + ") USERTABLE where USERTABLE."
            + groupIdField + "=?", objectParamWhere);
        List<UserTo> userTos = new ArrayList<UserTo>();
        for (Map<String, Object> map : dataObj) {
          UserTo userTo = new UserTo(StringUtil.getString(map.get(userIdField)), StringUtil.getString(map.get(userNameField)), map);
          userTos.add(userTo);
View Full Code Here

      try {
        String groupIdField = getGroupInfo().getGroupIdField();
        String groupNameField = getGroupInfo().getGroupNameField();
        String supGroupIdField = getGroupInfo().getSupGroupIdField();
        String sqlText = getGroupInfo().getSqlText();
        SqlCommand sqlCommand = getSqlCommand();
        List<Object> objectParamWhere = new ArrayList<Object>();
        objectParamWhere.add(groupId);
        List<Map<String, Object>> dataObj = sqlCommand.queryForList(" SELECT USERTABLENEW.* FROM (" + sqlText
            + ") USERTABLENEW WHERE USERTABLENEW." + groupIdField + " IN (SELECT USERTABLE." + supGroupIdField + " FROM (" + sqlText
            + ") USERTABLE where USERTABLE." + groupIdField + "=?)", objectParamWhere);
        if (dataObj.size() == 0) {
          return null;
        }
View Full Code Here

  public void execute(ExecutionContext executionContext) throws Exception {
   

    if(sqlText!=null){
      SqlCommand sqlCommand=new SqlCommand(Context.getDbConnection());
      sqlCommand.execute(sqlText.toString());
    }
    else {
      throw new FixFlowException("执行数据库语句不正确!");
    }
   
View Full Code Here

      }
    }
   
    stringBuffer.append("'");
   
    SqlCommand sqlCommand=new SqlCommand(Context.getDbConnection());
    List<Map<String, Object>> productMapList= sqlCommand.queryForList(stringBuffer.toString());
   
    List<String> quehuoproductlist = new ArrayList<String>();
   
    //查看库存是否足够
    for(Map<String, Object> detailmap : detailMapList) {
      for (Map<String, Object> productmap : productMapList) {
        String detailid = detailmap.get("PRODUCT_ID").toString();
        String proid = productmap.get("PRODUCT_ID").toString();
        int shuliang = Integer.parseInt(detailmap.get("AMOUNT").toString());
        int kucun = Integer.parseInt(productmap.get("AMOUNT").toString());
        if(detailid.equals(proid) && kucun<shuliang) {
          enough = false;
          quehuoproductlist.add(proid);
        }
      }
    }
   
    if(type.equals("zizeng") && enough==false) {
      StringBuffer stringBuffer1 = new StringBuffer();
      stringBuffer1.append("update product_info set amount = amount + 10 where product_id = '");
      for(int i=0; i<quehuoproductlist.size(); i++)
      {
        if(i==0) {
          stringBuffer1.append(quehuoproductlist.get(i));
        }else {
          stringBuffer1.append("' or product_id = '"+quehuoproductlist.get(i));
        }
      }
     
      stringBuffer1.append("'");
     
      SqlCommand sqlCommand1=new SqlCommand(Context.getDbConnection());
      sqlCommand1.execute(stringBuffer1.toString());
    }
   
    if(je < Float.parseFloat(customedu) && detailzq >= Integer.parseInt(zhangqi) && enough == false) {
      flag1 = true;
    }
View Full Code Here

  public <T> T executeBusinessRules(String ruleId, Object parameter,T classReturn, Map<String, Object> configMap) {
   
    ProcessEngineConfigurationImpl processEngineConfiguration=Context.getProcessEngineConfiguration();
    groovyShell.setVariable("sysRulesConfig", Context.getProcessEngineConfiguration());
    groovyShell.setVariable("parameter", parameter);
    groovyShell.setVariable("sqlCommand", new SqlCommand(Context.getDbConnection()));
    if(configMap!=null){
     
      for (String mapKey : configMap.keySet()) {
        groovyShell.setVariable(mapKey, configMap.get(mapKey));
      }
View Full Code Here

  @Override
  public Object executeBusinessRules(String ruleId, Object parameter, Map<String, Object> configMap) {
    ProcessEngineConfigurationImpl processEngineConfiguration=Context.getProcessEngineConfiguration();
    groovyShell.setVariable("sysRulesConfig", Context.getProcessEngineConfiguration());
    groovyShell.setVariable("parameter", parameter);
    groovyShell.setVariable("sqlCommand", new SqlCommand(Context.getDbConnection()));
    if(configMap!=null){
     
      for (String mapKey : configMap.keySet()) {
        groovyShell.setVariable(mapKey, configMap.get(mapKey));
      }
View Full Code Here

public class UpdateProcessStatus implements ConnectorHandler {

  private java.lang.String statusValue;

  public void execute(ExecutionContext executionContext) throws Exception {
    SqlCommand sqlCommand=new SqlCommand(Context.getDbConnection());
    String Fix_BizName=StringUtil.getString(Context.getAbstractScriptLanguageMgmt().execute("${Fix_BizName}", executionContext));
    String Fix_BizKeyFile=StringUtil.getString(Context.getAbstractScriptLanguageMgmt().execute("${Fix_BizKeyFile}", executionContext));
    if(Fix_BizName==null||Fix_BizName.equals("")){
      throw new FixFlowException("数据变量${Fix_BizName}为空");
    }
    if(Fix_BizKeyFile==null||Fix_BizKeyFile.equals("")){
      throw new FixFlowException("数据变量${Fix_BizKeyFile}为空");
    }
    String sqlText="UPDATE "+Fix_BizName+" SET  FIX_PROCESSSTATE='"+statusValue+"' WHERE "+Fix_BizKeyFile+"='"+executionContext.getBizKey()+"'";
    sqlCommand.execute(sqlText);
  }
View Full Code Here

import com.founder.fix.fixflow.core.impl.util.StringUtil;

public class UpdateProcessInstanceId implements ConnectorHandler {

  public void execute(ExecutionContext executionContext) throws Exception {
    SqlCommand sqlCommand=new SqlCommand(Context.getDbConnection());
    String Fix_BizName=StringUtil.getString(Context.getAbstractScriptLanguageMgmt().execute("${Fix_BizName}", executionContext));
    String Fix_BizKeyFile=StringUtil.getString(Context.getAbstractScriptLanguageMgmt().execute("${Fix_BizKeyFile}", executionContext));
    if(Fix_BizName==null||Fix_BizName.equals("")){
      throw new FixFlowException("数据变量${Fix_BizName}为空");
    }
    if(Fix_BizKeyFile==null||Fix_BizKeyFile.equals("")){
      throw new FixFlowException("数据变量${Fix_BizKeyFile}为空");
    }
    String processInstId=executionContext.getProcessInstance().getId();
    String sqlText="UPDATE "+Fix_BizName+" SET  FIX_PROCESSINSTANCE_ID='"+processInstId+"' WHERE "+Fix_BizKeyFile+"='"+executionContext.getBizKey()+"'";
    sqlCommand.execute(sqlText);
  }
View Full Code Here

TOP

Related Classes of com.founder.fix.fixflow.core.impl.db.SqlCommand

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.