| | |
| | | package cn.ksource.web.facade.cfg; |
| | | |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | import cn.ksource.beans.CMDB_CI_CATEGORY; |
| | | import cn.ksource.beans.WORKFLOW_BASE; |
| | | import cn.ksource.beans.FlowRecord; |
| | | import cn.ksource.core.dao.BaseDao; |
| | | import cn.ksource.core.dao.SqlParameter; |
| | | import cn.ksource.core.page.PageInfo; |
| | | import cn.ksource.core.util.*; |
| | | import cn.ksource.core.web.WebUtil; |
| | | import cn.ksource.web.Constants; |
| | | import cn.ksource.web.facade.cfgcate.CfgcateFacade; |
| | | import cn.ksource.web.facade.customermanage.CustomerManageFacade; |
| | | import cn.ksource.web.service.cmdb.SequenceService; |
| | | import cn.ksource.web.service.flow.FlowRecordService; |
| | | import org.apache.poi.hssf.usermodel.HSSFCell; |
| | | import org.apache.poi.hssf.usermodel.HSSFRow; |
| | | import org.apache.poi.hssf.usermodel.HSSFSheet; |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | | import org.apache.poi.poifs.filesystem.OfficeXmlFileException; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.lowagie.tools.concat_pdf; |
| | | import com.sun.swing.internal.plaf.basic.resources.basic_sv; |
| | | |
| | | import cn.ksource.beans.FlowRecord; |
| | | import cn.ksource.core.dao.BaseDao; |
| | | import cn.ksource.core.dao.SqlParameter; |
| | | import cn.ksource.core.page.PageInfo; |
| | | import cn.ksource.core.web.WebUtil; |
| | | import cn.ksource.web.Constants; |
| | | import cn.ksource.web.facade.cfgcate.CfgcateFacade; |
| | | import cn.ksource.web.service.flow.FlowRecordService; |
| | | import org.springframework.web.multipart.commons.CommonsMultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | |
| | | @Service |
| | | @SuppressWarnings("rawtypes") |
| | |
| | | if (StringUtil.isNotBlank(ConvertUtil.obj2StrBlank(params.get("categoryId")))) { |
| | | sql.append(" and a.LV3_ID=:categoryId "); |
| | | } |
| | | |
| | | |
| | | //客户 |
| | | if (StringUtil.isNotBlank(ConvertUtil.obj2StrBlank(params.get("customerId")))) { |
| | | sql.append(" and a.CUS_ID=:customerId "); |
| | |
| | | params.put("subId", Arrays.asList(str.split(","))); |
| | | sql.append(" AND a.SUB_CUS_ID in( :subId) "); |
| | | } |
| | | |
| | | |
| | | } |
| | | if (StringUtil.isNotBlank(ConvertUtil.obj2StrBlank(params.get("templateKey")))) { |
| | | sql.append(" and exists ( "); |
| | |
| | | private Map getCfgDailyItemSupport(Map<String, String> params) { |
| | | Map<String, Object> support = new HashMap<String, Object>(); |
| | | StringBuilder sql = new StringBuilder(); |
| | | sql.append(" select a.* from ci_daily_patrol_item a ,cmdb_ci_base b,ci_daily_patrol_customer_item c,ci_daily_ci_item_re d "); |
| | | sql.append(" select a.ID,a.ITEM_NAME,a.NORMAL_VALUE,a.ORDER_NUM,a.STATE,a.BUSINESS_ID,a.BUSINESS_NAME,a.ITEM_TYPE,a.CUSTOMER_ID,a.P_ID from ci_daily_patrol_item a ,cmdb_ci_base b,ci_daily_patrol_customer_item c,ci_daily_ci_item_re d "); |
| | | sql.append(" where (b.lv2_id = a.business_id or b.lv3_id = a.business_id) and b.id= :id and d.ci_id = :id and c.item_id = a.id and c.id =d.cus_item_id and c.using_state = 1 and a.state = 1 "); |
| | | sql.append(" group by a.id "); |
| | | sql.append(" group by a.ID,a.ITEM_NAME,a.NORMAL_VALUE,a.ORDER_NUM,a.STATE,a.BUSINESS_ID,a.BUSINESS_NAME,a.ITEM_TYPE,a.CUSTOMER_ID,a.P_ID "); |
| | | support.put("sql", sql.toString()); |
| | | support.put("param", params); |
| | | return support; |
| | |
| | | StringBuilder sql = new StringBuilder(); |
| | | sql.append(" select a.* from ci_remind_item a,cmdb_ci_base b,ci_remind_customer_item c,ci_remind_cilist d "); |
| | | sql.append(" where (b.lv2_id = a.business_id or b.lv3_id = a.business_id) and b.id= :id and d.ci_id = :id and c.item_id = a.id and c.id =d.project_item_id and c.using_state = 1 and a.state = 1 "); |
| | | sql.append(" group by a.id "); |
| | | sql.append(" group by a.ID,a.ITEM_NAME,a.CYCLE,a.PRIORITY_LEVEL_ID,a.PRIORITY_LEVEL_NAME,a.ITEM_NOTE,a.ORDER_NUM,a.STATE,a.BUSINESS_ID,a.BUSINESS_NAME,a.ITEM_TYPE,a.CUSTOMER_ID,a.P_ID "); |
| | | support.put("sql", sql.toString()); |
| | | support.put("param", params); |
| | | return support; |
| | |
| | | private Map getCfgHealthItemSupport(Map<String, String> params) { |
| | | Map<String, Object> support = new HashMap<String, Object>(); |
| | | StringBuilder sql = new StringBuilder(); |
| | | sql.append(" select a.* from ci_health_item a,cmdb_ci_base b,ci_health_customer_item c,ci_health_customize_detail d "); |
| | | sql.append(" select a.ID,a.ITEM_NAME,a.PRIORITY_LEVEL_ID,a.PRIORITY_LEVEL_NAME,a.ITEM_NOTE,a.EXPECT_VALUE,a.ORDER_NUM,a.STATE,a.BUSINESS_ID,a.BUSINESS_NAME,a.ITEM_TYPE,a.CUSTOMER_ID,a.P_ID from ci_health_item a,cmdb_ci_base b,ci_health_customer_item c,ci_health_customize_detail d "); |
| | | sql.append(" where (b.lv2_id = a.business_id or b.lv3_id = a.business_id) and b.id= :id and d.ci_id = :id and c.item_id = a.id and c.id =d.customer_item_id and c.using_state = 1 and a.state = 1 "); |
| | | sql.append(" group by a.id "); |
| | | sql.append(" group by a.ID,a.ITEM_NAME,a.PRIORITY_LEVEL_ID,a.PRIORITY_LEVEL_NAME,a.ITEM_NOTE,a.EXPECT_VALUE,a.ORDER_NUM,a.STATE,a.BUSINESS_ID,a.BUSINESS_NAME,a.ITEM_TYPE,a.CUSTOMER_ID,a.P_ID "); |
| | | support.put("sql", sql.toString()); |
| | | support.put("param", params); |
| | | return support; |